This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
joid:ci_integration [2015/12/17 17:21] David Blaisonneau |
joid:ci_integration [2016/01/26 14:21] (current) David Blaisonneau [Jenkins defaults] |
||
---|---|---|---|
Line 2: | Line 2: | ||
==== Prerequisites ==== | ==== Prerequisites ==== | ||
+ | |||
+ | === Jenkins install === | ||
+ | |||
+ | Please follow HOW TO here: https://wiki.opnfv.org/wiki/jenkins#how_to_connect_servers_from_labs_to_opnfv_jenkins | ||
=== Jump host preparation === | === Jump host preparation === | ||
Line 8: | Line 12: | ||
The following things must be set on the jumphost before starting any deploy: | The following things must be set on the jumphost before starting any deploy: | ||
- | * One extra repo (repository ppa:juju/stable) | ||
* applications must be installed | * applications must be installed | ||
- | * ''libvirt-bin'' | ||
* ''git'' | * ''git'' | ||
- | * ''iptables-persistent'' | ||
* ''bridge-utils'' | * ''bridge-utils'' | ||
* ''vlan'' | * ''vlan'' | ||
Line 20: | Line 21: | ||
* ''brStorage'' | * ''brStorage'' | ||
- | ===Pod parameters=== | + | All those pre-requisits can be managed by Master MAAS. |
- | The pod admin must also set a few parameters | + | Now you can launch jenkins |
+ | ===== Jenkins parameters ===== | ||
+ | |||
+ | Jenkins fixes those parameters: | ||
+ | |||
+ | ====Jenkins defaults==== | ||
<code> | <code> | ||
- | mkdir ~/joid_config | + | # Slave name on Jenkins |
- | cat << EOF > ~/joid_config/config.sh | + | export SLAVE_NAME=orange-fr-pod2 |
+ | export NODE_NAME=$SLAVE_NAME | ||
- | ### Set Pod name | + | # Git URL to use on this Jenkins Slave |
- | export POD_DC=orange | + | export GIT_BASE=https://gerrit.opnfv.org/gerrit/$PROJECT |
- | export POD_NUM=pod2 | + | |
- | # This must be the same name as the one configured in joid deployment files | + | |
- | export POD_NAME=\$POD_DC\$POD_NUM | + | |
- | ### Reinstall MAAS at each jenkins deploy | + | # Project Name |
- | export MAAS_REINSTALL=yes | + | export PROJECT=joid |
- | ### Set passwords | + | # Place of jenkins workspace |
- | export MAAS_USER=ubuntu | + | export WORKSPACE=$HOME/workspace/joid-deploy-<scenario>/ |
- | export MAAS_PASSWORD=ubuntu | + | # in case of local script testing |
- | export OS_ADMIN_PASSWORD=openstack | + | export WORKSPACE=$HOME/joid/ |
- | ### Set CEPH parameters | + | </code> |
- | # disks to use by ceph (comma separated list) | + | |
- | export CEPH_DISKS=/dev/sdb,/dev/sdc | + | |
- | # format or not disk before using ceph (must be done the first time) | + | ====Projects default==== |
+ | |||
+ | The file containing installer defaults is **releng/jjb/opnfv/installer-params.yml** | ||
+ | <code> | ||
+ | # IP of the installer (Not used for Joid) | ||
+ | export INSTALLER_IP=192.168.Y.Y | ||
+ | |||
+ | # Installer used for deploying OPNFV on this POD | ||
+ | export INSTALLER_TYPE=joid | ||
+ | |||
+ | # Scenario to deploy and test | ||
+ | # Based on scenario naming we can get joid options | ||
+ | # naming convention: | ||
+ | # os-<controller>-<nfvfeature>-<mode>[-<extrastuff>] | ||
+ | # With parameters: | ||
+ | # controller=(nosdn|odl_l3|odl_l2|onos|ocl) | ||
+ | # No odl_l3 today | ||
+ | # nfvfeature=(kvm|ovs|dpdk|nofeature) | ||
+ | # '_' list separated. | ||
+ | # mode=(ha|noha) | ||
+ | # extrastuff=(none) | ||
+ | # Optional field - Not used today | ||
+ | export DEPLOY_SCENARIO=none | ||
+ | |||
+ | # OpenStack release (kilo|liberty) | ||
+ | export OS_RELEASE=liberty | ||
+ | |||
+ | # External network to create (name;type;first ip;last ip; gateway;network) | ||
+ | export EXTERNAL_NETWORK="ext-net;flat;192.168.0.2;192.168.0.253;192.168.0.1;192.168.0.0/24" | ||
+ | |||
+ | # Disks to use by ceph by default (space separated list) | ||
+ | export CEPH_DISKS=/srv | ||
+ | |||
+ | # Disks to use by ceph by controllers (empty if same as CEPH_DISKS) | ||
+ | export CEPH_DISKS_CONTROLLERS="" | ||
+ | |||
+ | # Local lab config and Openstack openrc location | ||
+ | export LAB_CONFIG=$HOME/joid_config | ||
+ | |||
+ | # Format or not disk before using ceph [true/false] (must be done the first time) | ||
export CEPH_REFORMAT=false | export CEPH_REFORMAT=false | ||
- | EOF | + | # Reinstall MAAS and Bootstrap before deploy [true/false] |
+ | export MAAS_REINSTALL=false | ||
</code> | </code> | ||
+ | ==== Pod defaults==== | ||
+ | The file containing pod default is **releng/jjb/opnfv/slave-params.yml** | ||
- | No you can launch jenkins | + | <code> |
+ | # Version of the installer to deploy | ||
+ | export INSTALLER_VERSION=latest | ||
+ | </code> | ||
- | ==== Details of jenkins job === | + | Those parameters shall be present in the pod default. |
+ | <code> | ||
+ | # Disks to use by ceph by default (space separated list) | ||
+ | export CEPH_DISKS=/srv | ||
- | project to clone: http://gerrit.opnfv.org/gerrit/joid.git | + | # Disks to use by ceph by controllers (empty if same as CEPH_DISKS) |
+ | export CEPH_DISKS_CONTROLLERS=/srv | ||
+ | </code> | ||
+ | ===== Cleanup steps ===== | ||
- | ===== Jenkins parameters ===== | + | The cleanup is done at each deploy in the script |
- | Now install parameters are hard coded in the install script, this will be set by jenkins soon: | + | ===== HOW TO ===== |
- | JOID_MODE=ha | + | ==== Run CI deploy script without jenkins ==== |
- | JOID_RELEASE=liberty | + | |
- | JOID_SDN_CONTROLLER=odl | + | |
+ | * Copy all jenkins parameters (see list 'Jenkins parameters' section) in a file (~/deploy_params.sh) and set them according to your platform (**don't forget to set DEPLOY_SCENARIO value !**) | ||
+ | * Load this file | ||
+ | <code>source ~/deploy_params.sh</code> | ||
+ | * Get the script | ||
+ | <code>wget https://git.opnfv.org/cgit/releng/plain/jjb/joid/joid-deploy.sh | ||
+ | chmod +x joid-deploy.sh</code> | ||
+ | * Run the script | ||
+ | <code>./joid-deploy.sh</code> | ||
- | ===== Cleanup steps ===== | + | ==== Add my pod deployed by jenkins ==== |
+ | |||
+ | - Edit Releng **jjb/joid/joid-ci-jobs.yml** | ||
+ | - to add your node to pod list in the project section | ||
+ | - to add your trigger macro at the end of the file | ||
+ | - Add your pod description in **jjb/opnfv/slave-params.yml** | ||
+ | - Setup (or not) your local config file, as described in "Set specific pod parameters". | ||
+ | - If your $POD_NAME is not formated like this: <POD_DATA_CENTER>-<POD_ID> as set in joid/ci/maas/<POD_DATA_CENTER>/<POD_ID> subfolders, please modify section "Set Joid pod config name" in **releng/jjb/joid/joid-deploy.sh** | ||
+ | - Ask jenkins to deploy :) | ||
+ | |||
+ | ==== Set specific pod parameters ==== | ||
+ | |||
+ | The pod admin can set a few parameters | ||
+ | |||
+ | <code> | ||
+ | sudo -s jenkins | ||
+ | mkdir ~/joid_config | ||
+ | cat << EOF > ~/joid_config/config.sh | ||
+ | ### Set passwords | ||
+ | export MAAS_USER=ubuntu | ||
+ | export MAAS_PASSWORD=ubuntu | ||
+ | export OS_ADMIN_PASSWORD=openstack | ||
+ | EOF | ||
+ | </code> | ||
+ | |||
+ | ==== Deploy or not MAAS at each time ==== | ||
- | The cleanup is done at each depploy in the script | + | Testing MAAS deploy is not the core of CI tests, so to gain time, MAAS reinstall can be disabled by setting local parameter MAAS_REINSTALL=false. Juju will be cleaned and all nodes managed will return in ready mode. |