...
How to Commit Code
coming soon
How to Deploy a minimal ONAP sdnc environment
This tutorial is based on ONAP-integration project[1] which utilizes Vagrant[2], a deployment tool to build an ONAP environment.
Info | ||
---|---|---|
| ||
"Integration framework, automated tools, code and scripts, best practice guidance related to cross-project Continuous System Integration Testing (CSIT), and delivery of ONAP." |
Prerequisites
Tool | version | Introduction | Download Link |
---|---|---|---|
Vagrant | 1.9.5 | https://www.vagrantup.com/ | https://releases.hashicorp.com/vagrant/?_ga=2.74767696.373821479.1506869076-1225456615.1499750393 |
Virtualbox | 5.1.20 | https://www.virtualbox.org/ | https://www.virtualbox.org/wiki/Download_Old_Builds_5_1 |
Git | 2.14.3 | https://git-scm.com/ | https://git-scm.com/downloads |
(1) After installation, make sure that your system is restarted in order to let configuration be activated.
(2) Instead of using Git bash, Cygwin could be also used and make sure "dos2unix" package is installed which will be used during setup
Basic setup
Windows 10
Download the exe and install.
Ubuntu 16.04
install virtualbox
Add the following line to your /etc/apt/sources.list:
deb http://download.virtualbox.org/virtualbox/debian xenial contrib
Run the command below
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install virtualbox-5.2
install vagrant
wget https://releases.hashicorp.com/vagrant/1.9.5/vagrant_1.9.5_x86_64.deb
sudo dpkg -i vagrant_1.9.5_x86_64.deb
install git
sudo apt-get install git
install dos2unix
sudo apt install dos2unix
Download The Project
git clone https://git.onap.org/integration'
- Hint: More information could be found under integration\bootstrap\vagrant-onap\README.md
Windows: Open Gitbash As Administrator
Convert Line Ending
cd integration/bootstrap/vagrant-onap/lib
find . -type f -print0 | xargs -0 dos2unix
Hint: This issue might be fixed later
Configure Deployment Mode
- There is an settings.yaml.development under integration\bootstrap\vagrant-onap\etc used for different deployment scenarios.
- The goal of this tutorial is to have a running SDNC environment, so in the configuration, it turns off clone and build project.
- Only file name called settings.yaml will be picked-up by the deployment script.
- There is an issue in the sample file that "build_images" should be replaced by "build_image", otherwise, this configuration won't work.
cp settings.yaml.development settings.yaml
vim settings.yaml
The example shows below
Code Block | ||
---|---|---|
| ||
build_image: "False"
clone_repo: "False"
compile_repo: "False"
enable_oparent: "False"
skip_get_images: "False"
skip_install: "False" |
- Hint: Under integration\bootstrap\vagrant-onap\doc\source\features\configure_execution.rst, it talks about the functionality of these attributes.
- Hint: Under integration\bootstrap\vagrant-onap\doc\source\features\example_usage.rst, it talks about the use cases of using this tool.
Modify Vagrantfile
vim integration/bootstrap/vagrant-onap/Vagrantfile
- In configuration = {...}, find docker_version and update the corresponding value to '1.2-STAGING-latest'
For example,
Code Block | ||
---|---|---|
| ||
...
configuration = {
...
'docker_version' => '1.2-STAGING-latest',
...
}
... |
Modify SDNC Deployment Script
vim integration/bootstrap/vagrant-onap/lib/sdnc
Find function get_sdnc_images{...} in the file and modify
Mainly use pull_onap_image to replace pull_openecomp_image
Pull onap/ccsdk-dgbuilder-image instead of openecomp one
For example,
Code Block | ||
---|---|---|
| ||
...
# get_sdnc_images() - Build or retrieve necessary images
function get_sdnc_images {
if [[ "$build_image" == "True" ]]; then
_build_sdnc_images
else
# pull_openecomp_image sdnc-image openecomp/sdnc-image:latest
# pull_openecomp_image admportal-sdnc-image openecomp/admportal-sdnc-image:latest
# pull_openecomp_image dgbuilder-sdnc-image openecomp/dgbuilder-sdnc-image:latest
pull_onap_image sdnc-image onap/sdnc-image:latest
pull_onap_image admportal-sdnc-image onap/admportal-sdnc-image:latest
pull_docker_image nexus3.onap.org:10001/onap/ccsdk-dgbuilder-image:latest onap/ccsdk-dgbuilder-image:latest
fi
pull_docker_image mysql/mysql-server:5.6
}
...
|
Start Deployment
cd integration/bootstrap/vagrant-onap
./tools/run.sh sdnc
Configure Port Forward
This could be replaced by adding scripts in Vagrantfile.
Open RestConf Page
http://127.0.0.1:8282/apidoc/explorer/index.html
Credentials: admin/Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
Basic usage of vagrant and docker
// check running vm instances
vagrant global-status
// ssh to the vm
vagrant ssh ${vm-id}
// check docker images
docker images
// check running docker instances
docker ps -a
// ssh to the docker instance
docker exec it ${docker-instance} bash
Reference:
[1] ONAP integration: https://git.onap.org/integration/
[2] Vagrant: https://www.vagrantup.com/
[3] ONAP SDC setup: Using Vagrant-Onap for local deployment of SDC project - WIP!!!
[4] Virtualbox Download link: https://www.virtualbox.org/wiki/Linux_Downloads
How to Deploy New Code (based on standard ONAP lab setup)
...