Table of Contents
Prerequisites
VM requirments:
- VM spec needs to be 8 cores and 8G of ram, ubuntu 14.04 (do not use ubuntu 16.04)
docker engine needs to be installed on the VM to run the containers
Initial Setup
- in order for the dockers to start correctly on the VM the following folders need to be created on the VM.
- you need the /opt folder:
- in it create /opt/config/
- place the following files in this /opt/config/ folder:
- you need a /data folder
- in it create /data/environments/ (Note: Do not forget to configure your (BE/FE/Kibana/Elastic search) machine IP address in the below file.If they are all planned to run in the same
machine, configure the same IP address) copy the file from here: https://git.onap.org/sdc/tree/sdc-os-chef/environments/Template.json - rename it to AUTO.json
- change all the yyy to ip of the vm you are running on.
- this is an example of an env file
- this file may change from time to time so keep it updated with the changes done.
- For plugins configuration copy the file from https://git.onap.org/sdc/tree/sdc-os-chef/environments/plugins-configuration.yaml and update the plugins urls
- Below is the example of plugins-configuration.yaml
- in it create /data/environments/ (Note: Do not forget to configure your (BE/FE/Kibana/Elastic search) machine IP address in the below file.If they are all planned to run in the same
- now create a /data/scripts/ folder
- in folder /data/scripts/ place the following scripts from the sdc repo sdc repo
- docker_run.sh
- docker_login.sh
- docker_health.sh
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
Setting up the Webseal-Simulator
In order to set up the Webseal-Simulator in your local environment, you can use the following guide: SDC Simulator
Configure Docker Engine
- in order to allow building dockers from dev machine to the VM you will need to enable tcp communication to the docker engine.
use this link to enable tcp communication to the docker https://docs.docker.com/engine/reference/commandline/dockerd/ - once enabled you can execute netstat -nap to check the docker d is listening to 2375.
Deploying local dockers to the VM
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>
- Run mvn clean install and build the whole project.
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
- After this process is done go to your vagrant and run docker images to check that your local images are on the machine
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