Skip to content
Snippets Groups Projects
Commit b8420859 authored by Mike Marchetti's avatar Mike Marchetti
Browse files

Update stage_3 to use multi-stack install


Add support for multi-stack installation

Cleanup use of sudo for copying files. Apply docker specific
configuration inside user directory.

Utilize multiple juju controllers utilizing the stack name.

Create stack with no exposed host ports via '-nohostports' for creating
multiple instances of osm (useful in CI)

Add osmclient container for stack: This allows user to run osmclient
inside a container, that matches the release of osm, that has internal
access to all services.

Added options:
    --nolxd for CI osm installation
    --nojuju for CI osm installation
    --nodockerbuild
    --nohostports
    --nohostclient
    -s <stack name>

Change-Id: I4a2c1b09854e61ebb52d83f9f1ecebed8a17674d
Signed-off-by: default avatarMike Marchetti <mmarchetti@sandvine.com>
parent 182bd734
No related branches found
No related tags found
No related merge requests found
FROM ubuntu:16.04
LABEL authors="Michael Marchetti"
RUN apt-get update && apt-get -y install curl software-properties-common
ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
ARG RELEASE=ReleaseFOUR-daily
ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
ARG REPOSITORY=testing
RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} devops osmclient" && apt update
RUN apt-get update && apt-get -y install python \
libcurl4-gnutls-dev libgnutls-dev osm-devops python-osmclient iputils-ping python-pip
RUN pip install python-magic pytest
ENV OSM_SOL005=True
ENV OSM_HOSTNAME=nbi:9999
ENV OSM_RO_HOSTNAME=ro:9090
......@@ -6,7 +6,8 @@ volumes:
osm_packages:
networks:
netOSM:
external: true
external:
name: ${OSM_NETWORK:-netOSM}
#driver: overlay
#driver_opts:
# com.docker.network.driver.mtu: "1446"
......@@ -20,7 +21,7 @@ services:
kafka:
image: wurstmeister/kafka
ports:
- "9092:9092"
- "9092"
networks:
- netOSM
environment:
......@@ -49,7 +50,7 @@ services:
OSMNBI_DATABASE_HOST: mongo
OSMNBI_MESSAGE_HOST: kafka
ports:
- "9999:9999"
- "${OSM_NBI_PORTS:-9999:9999}"
#depends_on:
# - kafka
# - mongo
......@@ -90,7 +91,7 @@ services:
#depends_on:
# - ro-db
ports:
- "9090:9090"
- "${OSM_RO_PORTS:-9090:9090}"
mon:
image: osm/mon
networks:
......@@ -105,7 +106,7 @@ services:
#depends_on:
# - kafka
ports:
- "8662:8662"
- "8662"
pm:
image: osm/pm
networks:
......@@ -124,5 +125,4 @@ services:
#depends_on:
# - nbi
ports:
- "80:80"
- "${OSM_UI_PORTS:-80:80}"
......@@ -37,4 +37,4 @@ services:
networks:
elk:
external:
name: netOSM
name: ${OSM_NETWORK:-netOSM}
version: '3'
networks:
netOSM:
external: true
external:
name: ${OSM_NETWORK:-netOSM}
services:
kafka-exporter:
image: osm/kafka-exporter
......@@ -32,4 +33,3 @@ services:
- netOSM
depends_on:
- prometheus
This diff is collapsed.
......@@ -40,6 +40,14 @@ properties([
])
])
def uninstall_osm(stackName) {
sh """
export OSM_USE_LOCAL_DEVOPS=true
export PATH=$PATH:/snap/bin
installers/full_install_osm.sh -y -s ${stackName} --test --nolxd --nodocker --nojuju --nohostports --nohostclient --uninstall
"""
}
node("${params.NODE}") {
sh 'env'
......@@ -179,8 +187,8 @@ node("${params.NODE}") {
}
sh """
export OSM_USE_LOCAL_DEVOPS=true
jenkins/host/start_build system --build-container ${container_name} \
export PATH=$PATH:/snap/bin
installers/full_install_osm.sh -y -s ${container_name} --test --nolxd --nodocker --nojuju --nohostports --nohostclient \
${commit_id} \
${repo_distro} \
${repo_base_url} \
......@@ -234,17 +242,18 @@ node("${params.NODE}") {
}
finally {
sh "docker stop ${http_server_name}"
sh "docker rm ${http_server_name}"
if ( params.DO_INSTALL ) {
if (error) {
if ( !params.SAVE_CONTAINER_ON_FAIL ) {
sh "lxc delete ${container_name} --force"
uninstall_osm container_name
}
throw error
}
else {
if ( !params.SAVE_CONTAINER_ON_PASS ) {
sh "lxc delete ${container_name} --force"
uninstall_osm container_name
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment