SDN-R on docker-compose
This is an example of how to run an ONAP sdnc-image with a minimal setup with SDN-R configuration with docker-compose. With this deployment you are able run the ODLUX gui within the SDNC which is then reachable on http://localhost:8080/odlux/index.html.
Prerequisites
vm (4 vCPU/ 4 gig RAM/ 40Gig HDD)
ubuntu (e.g. Ubuntu server 20.04.2 LTS)
docker
docker-compose (v2 recommended)
Deployment
So we have only 2 files in our directory. The docker-compose.yml itself and the .env file for storing all parameters we may like to change.
docker-compose.yml (minimal):
services:
sdnc-web:
image: ${SDNC_WEB_IMAGE}
container_name: sdnc-web
ports:
- 8080:8080
environment:
- SDNRHOST=sdnr
depends_on:
sdnr:
condition: service_healthy
healthcheck:
test: "curl --silent --fail http://localhost:8080/ready > /dev/null || exit 1"
interval: 10s
timeout: 10s
retries: 45
sdnr:
image: ${SDNC_IMAGE}
container_name: sdnr
ports:
- 8181:8181
environment:
- A1_ADAPTER_NORTHBOUND=false
- CCSDK_REPLICAS=0
- DOMAIN=""
- ENABLE_OAUTH=false
- ENABLE_ODL_CLUSTER=false
- ODL_ADMIN_PASSWORD=${ADMIN_PASSWORD}
- SDNC_REPLICAS=0
- SDNRDBURL=http://sdnrdb:9200
- SDNRDM=false
- SDNRINIT=true
- SDNRONLY=true
- SDNRWT=true
- SDNR_NETCONF_CALLHOME_ENABLED=true
- JAVA_OPTS=-Xms256m -Xmx4g
healthcheck:
test: [ "CMD", "wget", "-nv", "-t1", "--spider", "http://localhost:8181/ready" ]
interval: 10s
timeout: 10s
retries: 45
depends_on:
- sdnrdb
sdnrdb:
image: ${SDNRDB_IMAGE}
container_name: sdnrdb
environment:
- discovery.type=single-node
.env file:
SDNC_IMAGE=nexus3.onap.org:10001/onap/sdnc-image:2.6.1
SDNC_WEB_IMAGE=nexus3.onap.org:10001/onap/sdnc-web-image:2.6.1
ADMIN_PASSWORD=admin
SDNRDB_IMAGE=docker.elastic.co/elasticsearch/elasticsearch-oss:7.9.3
The sdnc image version (here latest) you can choose from this list here: https://nexus3.onap.org:10001/v2/onap/sdnc-image/tags/list.
version | ONAP release name | odl-base |
---|---|---|
2.8.X | Oslo | potassium-sr2 |
2.7.X | New Delhi (no sdnc release) | - |
2.6.X | Montreal | argon-sr2 |
2.5.X | London | chlorine |
2.4.X | Kohn | sulfur |
2.3.X | Jakarta | phosphorus |
2.2.X | Istanbul | silicon-SR1 |
2.1.X | Honolulu | aluminium-SR1/3 |
2.0.X | Guilin | sodium-SR3/4 |
1.8.X | Frankfurt | |
1.7.X | El Alto |
So after you started this deployment with
$ docker-compose up -d /docker compose up -d (depends on your docker compose version)
you should be able to access the ODLUX gui via you webbrowser on http://localhost:8080/odlux/index.html. Login credentials are username "admin" and password the one you have in your .env file, so by default also "admin".
Troubleshooting
Problem: docker container is crashing
check the status of the container
If the status is "up ..." then you may have to wait a little bit more.
If the status is exited, check the stdout logs of the container
Problem: ODLUX is not coming up/ 401 Unauthorized response:
Step 1: check ready service
both should return response code 200
If this does not return a 200 something is wrong on the sdnc or sdnc-web side so you have to follow step 2. If it returns 200 and odlux is still not reachable also go to step 2.
Step2: check odl console
if this is not accessable go to step 3:
if this is accessable do:
the output should be something like this:
if there is one package on Failure state pls go to step 3. If not go on with
If this list has some services still on GracePeriod, pls wait some more time and try it again (Can take up to two minutes). If this list is empty it looks like no sdnr feature was started. Then you have to check the features config file.
there you should see something like this:
If there are no sdnr features inside of this list, please check your environment variables inside of the container. If these are also okay, then you have to check the startODL.sh script for the install_sdnr_wt() function call, because this is then not called. If only odlux features are missing you may have set the SDNRDM env var to true. This is possible, but needs an extended setup which is not part of this guide.
Step 3: Search the log for failure inside of the container
Here you may find a resolve error or something similar. If this happens with a non release image (X.X.X-STAGING-xxx) pls try to use a release (X.X.X) first.