This guide outlines how to build and run SDC locally on linux. This can also be achieved on a linux virtual machine.
Java 11 and Apache Maven (min. version 3.6.0)
This guide will assume you have cloned the SDC repository to ~/workspace/ONAP/sdc
$ cd ~/workspace/ONAP/sdc
$ mvn clean install -P docker
Note: in first run you cannot skip tests. All dependencies must be created and installed in the local maven repository.
Note: to speed up build process, add "skip-test" parameters (-DskipTests=true -DskipUICleanup=true -Djacoco.skip=true -DskipPMD -Dmaven.test.skip=true -Dcheckstyle.skip)
Run 'docker images' to verify the existence of recently built onap/sdc-* images
$ sudo mkdir /data && sudo chmod 777 /data
$ mkdir /data/environments
$ cp <sdc-project-folder>/sdc-os-chef/environments/Template.json /data/environments/AUTO.json
$ IP=`ip route get 8.8.8.8 | awk '/src/{ print $7 }'`
$ echo ${IP}
192.168.1.13 # this will probably be different for you
$ sed -i "s/yyy/${IP}/g" /data/environments/AUTO.json
$ sed -i 's/xxx/AUTO/g' /data/environments/AUTO.json
Remember to update AUTO.json file with your current IP! Most of us have dynamic IP! It could be changed after computer restart. See instruction above. |
First cd into the main SDC repository
$ cd ~/workspace/ONAP/sdc
Build the SDC docker images
$ mvn clean install -P docker
If you have built the image previously, you can use the fast-build profile
$ mvn clean install -P docker, fast-build
Run SDC container
$ mvn install -P start-sdc
You can now open the SDC UI locally
$ firefox http://localhost:8285/login
For more info view sdc/README.md
Note: From here on this guide may be slightly outdated as the SDC git repository may have diverged from the instructions below.
create files in this /opt/config/ folder as follows:
$ echo AUTO > /opt/config/env_name.txt $ echo nexus3.onap.org:10001 > /opt/config/nexus_docker_repo.txt $ echo docker > /opt/config/nexus_username.txt $ echo docker > /opt/config/nexus_password.txt |
provide execution permissions to the scripts
chmod 777 /data/scripts/* |
as root user, launch the following script to test the setup is working (it will pull dockers from the LF repo and start them)
/data/scripts/docker_run.sh -r 1.1-STAGING-latest |
on script completion, you will see a successful health check. Depending on you VM performance, some containers may take times to be ready and up : sdc-cs takes about 2/3 mn, sdc-BE takes about 7/8 mn.
SDC API are available : http://yourIP:8080 for "internal API"
in order to access SDC you will need to enable SDC Simulator
In order to set up the Webseal-Simulator in your local environment, you can use the following guide: SDC Simulator
In order to check our code from our local environment, we'll compile our code locally and upload our local images to the vagrant
This is how to do so:
Add DOCKER_HOST to environment variables with the value: tcp://<ip of the vm where >:<port>
After the build is finished you'll need to run the sdc-os-chef project with profile docker in order to build docker from your local code and upload them to your local vagrant.
Run the following command in order to do so: (Need to check the docker repository credentials)
mvn clean install -pl sdc-os-chef -P docker |
In order to deploy your local images without pulling the latest images from the nexus you'll need to run the docker_run script with the local flag like so:
/data/scripts/docker_run.sh -l |