--- /dev/null
+#
+# Copyright 2018 Telefonica
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+DESCRIPTORS_TOPDIR ?= ../..
+include $(DESCRIPTORS_TOPDIR)/mk/pkg.mk
+
+all: $(BUILD_DIR)/$(PKG_NAME)
--- /dev/null
+nsd:nsd-catalog:
+ nsd:
+ - id: ansiblecharm_nsd
+ name: ansiblecharm_nsd
+ short-name: ansiblecharm_nsd
+ description: Generated by OSM package generator
+ vendor: OSM
+ logo: osm.png
+ version: '1.0'
+ constituent-vnfd:
+ # The member-vnf-index needs to be unique, starting from 1
+ # vnfd-id-ref is the id of the VNFD
+ # Multiple constituent VNFDs can be specified
+ - member-vnf-index: 1
+ vnfd-id-ref: ansiblecharm_vnfd
+ vld:
+ # Networks for the VNFs
+ - id: mgmtnet
+ name: mgmtnet
+ short-name: mgmtnet
+ type: ELAN
+ mgmt-network: 'true'
+ vnfd-connection-point-ref:
+ - member-vnf-index-ref: 1
+ vnfd-id-ref: ansiblecharm_vnfd
+ vnfd-connection-point-ref: vnf-cp0
--- /dev/null
+#
+# Copyright 2018 Telefonica
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+DESCRIPTORS_TOPDIR ?= ../..
+
+VNFD_CHARM = ansible-charm
+include $(DESCRIPTORS_TOPDIR)/mk/pkg.mk
+
+all: $(BUILD_DIR)/$(PKG_NAME)
--- /dev/null
+vnfd:vnfd-catalog:
+ vnfd:
+ - id: ansiblecharm_vnfd
+ name: ansiblecharm_vnfd
+ short-name: ansiblecharm_vnfd
+ description: Generated by OSM package generator
+ vendor: OSM
+ logo: osm.png
+ version: '1.0'
+ connection-point:
+ - name: vnf-cp0
+ type: VPORT
+ mgmt-interface:
+ cp: vnf-cp0
+ vdu:
+ - id: ansiblecharm_vnfd-VM
+ name: ansiblecharm_vnfd-VM
+ description: ansiblecharm_vnfd-VM
+ count: 1
+ vm-flavor:
+ vcpu-count: 1
+ memory-mb: 1024
+ storage-gb: 10
+ image: 'ubuntu1604'
+ interface:
+ - name: vdu-eth0
+ type: EXTERNAL
+ virtual-interface:
+ type: VIRTIO
+ external-connection-point-ref: vnf-cp0
+ cloud-init-file: cloud-config.txt
+ vnf-configuration:
+ juju:
+ charm: ansible-charm
+ initial-config-primitive:
+ - seq: 1
+ name: config
+ parameter:
+ - name: ssh-hostname
+ value: <rw_mgmt_ip>
+ - name: ssh-username
+ value: ubuntu
+ - name: ssh-password
+ value: osm4u
+ - seq: 2
+ name: ansible-playbook
+ parameter:
+ - name: filename
+ value: '/home/ubuntu/first-touch'
+ config-primitive:
+ - name: ansible-playbook
+ parameter:
+ - name: filename
+ data-type: STRING
+ value: '/home/ubuntu/first-touch'
--- /dev/null
+#cloud-config\r
+password: osm4u\r
+chpasswd: { expire: False }\r
+ssh_pwauth: True\r
+\r
+write_files:\r
+- content: |\r
+ # My new helloworld file\r
+\r
+ owner: root:root\r
+ permissions: '0644'\r
+ path: /root/helloworld.txt\r
rm -rf /var/lib/apt/lists/* && \
chmod +x start.sh
-ENV DB_HOST keystone-db # DB Hostname
-ENV DB_PORT 3306 # DB Port
-ENV ROOT_DB_USER root # DB Root User
-ENV ROOT_DB_PASSWORD admin # DB Root Password
-ENV KEYSTONE_DB_PASSWORD admin # Keystone user password
-ENV ADMIN_PASSWORD admin # Admin password
-ENV NBI_PASSWORD nbi # NBI password
+# database
+ENV DB_HOST keystone-db
+ENV DB_PORT 3306
+ENV ROOT_DB_USER root
+ENV ROOT_DB_PASSWORD admin
+# keystone
+ENV KEYSTONE_DB_PASSWORD admin
+ENV ADMIN_PASSWORD admin
+ENV NBI_PASSWORD nbi
ENTRYPOINT ./start.sh
&& pip3 install pip==9.0.3 \
&& pip3 install -U aiokafka pyang lxml six enum34 \
&& pip3 install websockets==4.0.1 \
- && pip3 install requests
-
-RUN pip3 install PyNaCl
-
-RUN git clone https://osm.etsi.org/gerrit/osm/N2VC.git \
- && cd N2VC \
- && git checkout BUILD_v4.0.1_1 \
- && cd modules/libjuju && python3 setup.py develop && cd ../.. \
- && pip3 install -U -r requirements.txt
+ && pip3 install requests \
+ && pip3 install PyNaCl
ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
ARG RELEASE=ReleaseFOUR-daily
sg docker -c "docker pull prom/prometheus:${PROMETHEUS_TAG}" || FATAL "cannot get prometheus docker image"
fi
+ if [ -z "$TO_REBUILD" ] || echo $TO_REBUILD | grep -q KEYSTONE-DB ; then
+ sg docker -c "docker pull mariadb:${KEYSTONEDB_TAG}" || FATAL "cannot get keystone-db docker image"
+ fi
+
if [ -n "$PULL_IMAGES" ]; then
sg docker -c "docker pull ${DOCKER_USER}/mon:${OSM_DOCKER_TAG}" || FATAL "cannot pull MON docker image"
- sg docker -c "docker pull ${DOCKER_USER}/pol:${OSM_DOCKER_TAG}" || FATAL "cannot pull POL docker image"
elif [ -z "$TO_REBUILD" ] || echo $TO_REBUILD | grep -q MON ; then
git -C ${LWTEMPDIR} clone https://osm.etsi.org/gerrit/osm/MON
git -C ${LWTEMPDIR}/MON checkout ${COMMIT_ID}
sg docker -c "docker build ${LWTEMPDIR}/MON -f ${LWTEMPDIR}/MON/docker/Dockerfile -t osm/mon --no-cache" || FATAL "cannot build MON docker image"
- sg docker -c "docker build ${LWTEMPDIR}/MON/policy_module -f ${LWTEMPDIR}/MON/policy_module/Dockerfile -t osm/pm --no-cache" || FATAL "cannot build PM docker image"
+ fi
+
+ if [ -n "$PULL_IMAGES" ]; then
+ sg docker -c "docker pull ${DOCKER_USER}/pol:${OSM_DOCKER_TAG}" || FATAL "cannot pull POL docker image"
+ elif [ -z "$TO_REBUILD" ] || echo $TO_REBUILD | grep -q MON ; then
+ git -C ${LWTEMPDIR} clone https://osm.etsi.org/gerrit/osm/POL
+ git -C ${LWTEMPDIR}/POL checkout ${COMMIT_ID}
+ sg docker -c "docker build ${LWTEMPDIR}/POL -f ${LWTEMPDIR}/POL/docker/Dockerfile -t osm/pol --no-cache" || FATAL "cannot build PM docker image"
fi
if [ -n "$PULL_IMAGES" ]; then
sg docker -c "docker pull ${DOCKER_USER}/nbi:${OSM_DOCKER_TAG}" || FATAL "cannot pull NBI docker image"
+ sg docker -c "docker pull ${DOCKER_USER}/keystone:${OSM_DOCKER_TAG}" || FATAL "cannot pull KEYSTONE docker image"
elif [ -z "$TO_REBUILD" ] || echo $TO_REBUILD | grep -q NBI ; then
git -C ${LWTEMPDIR} clone https://osm.etsi.org/gerrit/osm/NBI
git -C ${LWTEMPDIR}/NBI checkout ${COMMIT_ID}
sg docker -c "docker build ${LWTEMPDIR}/NBI -f ${LWTEMPDIR}/NBI/Dockerfile.local -t osm/nbi --no-cache" || FATAL "cannot build NBI docker image"
+ sg docker -c "docker build ${LWTEMPDIR}/NBI/keystone -f ${LWTEMPDIR}/NBI/keystone/Dockerfile -t osm/keystone --no-cache" || FATAL "cannot build KEYSTONE docker image"
fi
if [ -n "$PULL_IMAGES" ]; then
echo "export DOCKER_USER=${DOCKER_USER}" | $WORKDIR_SUDO tee --append $OSM_DOCKER_WORK_DIR/osm_ports.sh
echo "export KAFKA_TAG=${KAFKA_TAG}" | $WORKDIR_SUDO tee --append $OSM_DOCKER_WORK_DIR/osm_ports.sh
echo "export PROMETHEUS_TAG=${PROMETHEUS_TAG}" | $WORKDIR_SUDO tee --append $OSM_DOCKER_WORK_DIR/osm_ports.sh
+ echo "export KEYSTONEDB_TAG=${KEYSTONEDB_TAG}" | $WORKDIR_SUDO tee --append $OSM_DOCKER_WORK_DIR/osm_ports.sh
}
function deploy_perfmon() {
- echo "Pulling docker images for PM (Grafana and Prometheus)"
- sg docker -c "docker pull prom/prometheus" || FATAL "cannot get prometheus docker image"
+ echo "Pulling docker images for PM (Grafana)"
sg docker -c "docker pull grafana/grafana" || FATAL "cannot get grafana docker image"
echo "Finished pulling PM docker images"
- echo "Generating osm/kafka-exporter docker image"
- sg docker -c "docker build ${OSM_DEVOPS}/installers/docker/osm_metrics/kafka-exporter -f ${OSM_DEVOPS}/installers/docker/osm_metrics/kafka-exporter/Dockerfile -t osm/kafka-exporter --no-cache" || FATAL "cannot build kafka-exporter docker image"
- echo "Finished generation of osm/kafka-exporter docker image"
$WORKDIR_SUDO mkdir -p $OSM_DOCKER_WORK_DIR/osm_metrics
$WORKDIR_SUDO cp -b ${OSM_DEVOPS}/installers/docker/osm_metrics/*.yml $OSM_DOCKER_WORK_DIR/osm_metrics
$WORKDIR_SUDO cp -b ${OSM_DEVOPS}/installers/docker/osm_metrics/*.json $OSM_DOCKER_WORK_DIR/osm_metrics
remove_stack osm_metrics
- echo "Deploying PM stack (Kafka exporter + Prometheus + Grafana)"
+ echo "Deploying PM stack (Grafana)"
sg docker -c "OSM_NETWORK=net${OSM_STACK_NAME} docker stack deploy -c $OSM_DOCKER_WORK_DIR/osm_metrics/docker-compose.yml osm_metrics"
echo "Finished deployment of PM stack"
return 0
DOCKER_USER=osm
KAFKA_TAG=2.11-1.0.2
PROMETHEUS_TAG=v2.4.3
+KEYSTONEDB_TAG=10
while getopts ":hy-:b:r:k:u:R:l:p:D:o:m:H:S:s:w:t:" o; do
case "${o}" in