diff options
Diffstat (limited to 'jjb/joid')
-rw-r--r-- | jjb/joid/joid-ci-jobs.yml | 276 | ||||
-rw-r--r-- | jjb/joid/joid-deploy.sh | 65 | ||||
-rw-r--r-- | jjb/joid/joid-project-jobs.yml | 61 | ||||
-rw-r--r-- | jjb/joid/joid.yml | 117 |
4 files changed, 386 insertions, 133 deletions
diff --git a/jjb/joid/joid-ci-jobs.yml b/jjb/joid/joid-ci-jobs.yml new file mode 100644 index 000000000..80e21f50e --- /dev/null +++ b/jjb/joid/joid-ci-jobs.yml @@ -0,0 +1,276 @@ +######################## +# Job configuration for joid +######################## +- project: + + name: 'joid' + + project: '{name}' + + installer: '{name}' + +#-------------------------------- +# BRANCH ANCHORS +#-------------------------------- + master: &master + stream: master + branch: '{stream}' + gs-pathname: '' + brahmaputra: &brahmaputra + stream: brahmaputra + branch: 'stable/{stream}' + gs-pathname: '/{stream}' +#-------------------------------- +# POD, INSTALLER, AND BRANCH MAPPING +#-------------------------------- +# brahmaputra +#-------------------------------- + pod: + - intel-pod5: + <<: *brahmaputra +#-------------------------------- +# master +#-------------------------------- + - intel-pod6: + <<: *master + - orange-pod2: + <<: *master +#-------------------------------- +# please check the triggers before enabling any of the controllers!!! + sdn-controller: + - 'odl': + disabled: false +# commented out below controllers to get Arno scenario settled first +# - 'nosdn': +# disabled: true +# - 'onos': +# disabled: true +# - 'opencontrail': +# disabled: true + + jobs: + - 'joid-{sdn-controller}-{pod}-daily-{stream}' + - 'joid-deploy-{pod}-daily-{stream}' + +######################## +# job templates +######################## +- job-template: + name: 'joid-{sdn-controller}-{pod}-daily-{stream}' + + project-type: multijob + + disabled: '{obj:disabled}' + + concurrent: false + + wrappers: + - build-name: + name: '$BUILD_NUMBER - SDN: $SDN_CONTROLLER Scenario: $DEPLOY_SCENARIO' + + triggers: + - 'joid-{pod}-{sdn-controller}-trigger' + + parameters: + - project-parameter: + project: '{project}' + - '{pod}-defaults' + - '{installer}-defaults' + - string: + name: SDN_CONTROLLER + default: '{sdn-controller}' + - string: + name: DEPLOY_SCENARIO + default: 'none' + + scm: + - git-scm: + credentials-id: '{ssh-credentials}' + refspec: '' + branch: '{branch}' + + builders: + - '{installer}-multijob-{pod}-builder': + pod: '{pod}' + stream: '{stream}' + +- job-template: + name: 'joid-deploy-{pod}-daily-{stream}' + + disabled: false + + concurrent: false + + wrappers: + - build-name: + name: '$BUILD_NUMBER - SDN: $SDN_CONTROLLER Scenario: $DEPLOY_SCENARIO' + - timeout: + timeout: 180 + fail: true + + parameters: + - project-parameter: + project: '{project}' + - '{pod}-defaults' + - '{installer}-defaults' + + scm: + - git-scm: + credentials-id: '{ssh-credentials}' + refspec: '' + branch: '{branch}' + + builders: + - '{pod}-builder' + +######################## +# multijob builder macros +######################## +# intel-pod5 is CI POD so full CI will run on it +# deploy, functest, yardstick +- builder: + name: joid-multijob-intel-pod5-builder + builders: + - multijob: + name: deploy + condition: SUCCESSFUL + projects: + - name: 'joid-deploy-{pod}-daily-{stream}' + current-parameters: true + git-revision: true + kill-phase-on: FAILURE + - multijob: + name: functest + condition: COMPLETED + projects: + - name: 'functest-joid-{pod}-daily-{stream}' + current-parameters: true + kill-phase-on: NEVER + - multijob: + name: yardstick + condition: COMPLETED + projects: + - name: 'yardstick-joid-{pod}-daily-{stream}' + current-parameters: true + kill-phase-on: NEVER +# intel-pod6 is CI POD so full CI will run on it +# deploy, functest, yardstick +- builder: + name: joid-multijob-intel-pod6-builder + builders: + - multijob: + name: deploy + condition: SUCCESSFUL + projects: + - name: 'joid-deploy-{pod}-daily-{stream}' + current-parameters: true + git-revision: true + kill-phase-on: FAILURE + - multijob: + name: functest + condition: COMPLETED + projects: + - name: 'functest-joid-{pod}-daily-{stream}' + current-parameters: true + kill-phase-on: NEVER + - multijob: + name: yardstick + condition: COMPLETED + projects: + - name: 'yardstick-joid-{pod}-daily-{stream}' + current-parameters: true + kill-phase-on: NEVER +# yardstick placeholder +# - multijob: +# name: yardstick +# condition: COMPLETED +# projects: +# - name: 'yardstick-joid-{pod}-daily-{stream}' +# current-parameters: true +# kill-phase-on: NEVER + +# orange-pod2 is NOT a CI POD so only the selected jobs will run +# deploy and functest currently +- builder: + name: joid-multijob-orange-pod2-builder + builders: + - multijob: + name: deploy + condition: SUCCESSFUL + projects: + - name: 'joid-deploy-{pod}-daily-{stream}' + current-parameters: true + git-revision: true + kill-phase-on: FAILURE + - multijob: + name: functest + condition: COMPLETED + projects: + - name: 'functest-joid-{pod}-daily-{stream}' + current-parameters: true + kill-phase-on: NEVER +######################## +# builder macros +######################## +- builder: + name: intel-pod5-builder + builders: + - shell: | + #!/bin/bash + echo "Running $INSTALLER_TYPE with controller $SDN_CONTROLLER" + echo + echo "Executing clean.sh" + cd $WORKSPACE/ci + ./clean.sh + echo + echo "Executing 02-maasdeploy.sh intelpod5" + ./02-maasdeploy.sh intelpod5 + echo + echo "Executing deploy.sh -o liberty -s $SDN_CONTROLLER -t ha -l intelpod5" + ./deploy.sh -o liberty -s $SDN_CONTROLLER -t ha -l intelpod5 + +- builder: + name: intel-pod6-builder + builders: + - shell: | + #!/bin/bash + echo "Running $INSTALLER_TYPE with controller $SDN_CONTROLLER" + echo + echo "Executing clean.sh" + cd $WORKSPACE/ci + ./clean.sh + echo + echo "Executing 02-maasdeploy.sh intelpod6" + ./02-maasdeploy.sh intelpod6 + echo + echo "Executing deploy.sh -o liberty -s $SDN_CONTROLLER -t ha -l intelpod6" + ./deploy.sh -o liberty -s $SDN_CONTROLLER -t ha -l intelpod6 + +- builder: + name: orange-pod2-builder + builders: + - shell: | + #!/bin/bash + echo "Running $INSTALLER_TYPE with controller $SDN_CONTROLLER" + echo "Please note that this is WIP generic builder" + echo + echo "Executing clean.sh" + cd $WORKSPACE/ci + ./clean.sh + - shell: + !include-raw ./joid-deploy.sh +######################## +# trigger macros +######################## +- trigger: + name: 'joid-intel-pod5-odl-trigger' + triggers: + - timed: '0 2 * * *' +- trigger: + name: 'joid-intel-pod6-odl-trigger' + triggers: + - timed: '0 2 * * *' +- trigger: + name: 'joid-orange-pod2-odl-trigger' + triggers: + - timed: '' diff --git a/jjb/joid/joid-deploy.sh b/jjb/joid/joid-deploy.sh index d9ce86eb4..c7e5ba8fd 100644 --- a/jjb/joid/joid-deploy.sh +++ b/jjb/joid/joid-deploy.sh @@ -2,12 +2,8 @@ set +e set -o nounset -####### Temporary - to be done with jenkins params ##### -JOID_MODE=ha -JOID_RELEASE=liberty -JOID_LOCAL_CONFIG_FOLDER=~/joid_config -JOID_SDN_CONTROLLER=odl -################# +JOID_LOCAL_CONFIG_FOLDER=$HOME/joid_config +JOID_ADMIN_OPENRC=$JOID_LOCAL_CONFIG_FOLDER/admin-openrc ## ## Load local config or defaults @@ -18,6 +14,7 @@ if [ -e "$JOID_LOCAL_CONFIG_FOLDER/config.sh" ]; then source $JOID_LOCAL_CONFIG_FOLDER/config.sh else echo "------ No local config, load default ------" + # link NODE_NAME to joid node config names case $NODE_NAME in orange-fr-pod2) POD=orange-pod2 ;; @@ -33,7 +30,6 @@ else export OS_ADMIN_PASSWORD=openstack export CEPH_DISKS=/srv export CEPH_REFORMAT=no - export JOID_ADMIN_OPENRC=$WORKSPACE/admin_openrc.sh fi ## @@ -47,8 +43,8 @@ if [ -e "$JOID_LOCAL_CONFIG_FOLDER/environments.yaml" ] && [ "$MAAS_REINSTALL" = else MAASCONFIG=$WORKSPACE/ci/maas/$POD_DC/$POD_NUM/deployment.yaml echo "------ Set MAAS password ------" - sed -i -- 's/user: ubuntu/user: $MAAS_USER/' $MAASCONFIG - sed -i -- 's/password: ubuntu/password: $MAAS_PASSWORD/' $MAASCONFIG + sed -i -- "s/user: ubuntu/user: $MAAS_USER/" $MAASCONFIG + sed -i -- "s/password: ubuntu/password: $MAAS_PASSWORD/" $MAASCONFIG echo "------ Redeploy MAAS ------" ./02-maasdeploy.sh $POD_NAME fi @@ -58,10 +54,10 @@ fi ## # Get juju deployer file -if [ "$JOID_MODE" == 'nonha' ]; then - SRCBUNDLE=$WORKSPACE/ci/$JOID_SDN_CONTROLLER/juju-deployer/ovs-$JOID_SDN_CONTROLLER.yaml +if [ "$HA_MODE" == 'nonha' ]; then + SRCBUNDLE=$WORKSPACE/ci/$SDN_CONTROLLER/juju-deployer/ovs-$SDN_CONTROLLER.yaml else - SRCBUNDLE=$WORKSPACE/ci/$JOID_SDN_CONTROLLER/juju-deployer/ovs-$JOID_SDN_CONTROLLER-$JOID_MODE.yaml + SRCBUNDLE=$WORKSPACE/ci/$SDN_CONTROLLER/juju-deployer/ovs-$SDN_CONTROLLER-$HA_MODE.yaml fi # Modify files @@ -78,17 +74,24 @@ sed -i -r -- "s/^(\s+osd-reformat: )'no'/\1'$CEPH_REFORMAT'/" $SRCBUNDLE ## echo "------ Deploy with juju ------" -echo "Execute: ./deploy.sh -t $JOID_MODE -o $JOID_RELEASE -s $JOID_SDN_CONTROLLER -l $POD_NAME" +echo "Execute: ./deploy.sh -t $HA_MODE -o $OS_RELEASE -s $SDN_CONTROLLER -l $POD_NAME" -./deploy.sh -t $JOID_MODE -o $JOID_RELEASE -s $JOID_SDN_CONTROLLER -l $POD_NAME +./deploy.sh -t $HA_MODE -o $OS_RELEASE -s $SDN_CONTROLLER -l $POD_NAME ## ## Set Admin RC ## -echo "------ Create OpenRC file ------" -KEYSTONE=$(cat bundle.yaml |shyaml get-value openstack-phase2.services.keystone.options.vip) +echo "------ Create OpenRC file [$JOID_ADMIN_OPENRC] ------" +KEYSTONE=$(cat bundles.yaml |shyaml get-value openstack-phase2.services.keystone.options.vip) +# create the folder if needed +JOID_ADMIN_OPENRC_FOLDER=$(echo $JOID_ADMIN_OPENRC | perl -pe "s|^(.*/).*?$|\1|") +if [ ! -d "$JOID_ADMIN_OPENRC_FOLDER" ]; then + mkdir -p $JOID_ADMIN_OPENRC_FOLDER +fi + +# export the openrc file cat << EOF > $JOID_ADMIN_OPENRC export OS_USERNAME=admin export OS_PASSWORD=$OS_ADMIN_PASSWORD @@ -97,7 +100,37 @@ export OS_AUTH_URL=http://$KEYSTONE:5000/v2.0 export OS_REGION_NAME=Canonical EOF +## +## Backup local juju env +## + if [ -d "$JOID_LOCAL_CONFIG_FOLDER" ]; then echo "------ Backup Juju environment ------" cp environments.yaml $JOID_LOCAL_CONFIG_FOLDER/ fi + +## +## Basic test to return a realistic result to jenkins +## +source $JOID_ADMIN_OPENRC +curl -i -sw '%{http_code}' -H "Content-Type: application/json" -d " +{ \"auth\": { + \"identity\": { + \"methods\": [\"password\"], + \"password\": { + \"user\": { + \"name\": \"$OS_TENANT_NAME\", + \"domain\": { \"id\": \"default\" }, + \"password\": \"$OS_PASSWORD\" + } + } + } + } +}" http://$KEYSTONE:5000/v3/auth/tokens |grep "HTTP/1.1 20" 2>&1 >/dev/null; echo $?; +RES=$? +if [ $RES == 0 ]; then + echo "Deploy SUCCESS" +else + echo "Deploy FAILED" +fi +exit $RES diff --git a/jjb/joid/joid-project-jobs.yml b/jjb/joid/joid-project-jobs.yml new file mode 100644 index 000000000..b314da1fa --- /dev/null +++ b/jjb/joid/joid-project-jobs.yml @@ -0,0 +1,61 @@ +################################################### +# All the jobs except verify have been removed! +# They will only be enabled on request by projects! +################################################### +- project: + name: joid-project-jobs + + project: 'joid' + + jobs: + - 'joid-verify-{stream}' + + stream: + - master: + branch: '{stream}' + gs-pathname: '' + - brahmaputra: + branch: 'stable/{stream}' + gs-pathname: '/{stream}' + +- job-template: + name: 'joid-verify-{stream}' + + parameters: + - project-parameter: + project: '{project}' + - gerrit-parameter: + branch: '{branch}' + - 'opnfv-build-defaults' + + scm: + - gerrit-trigger-scm: + credentials-id: '{ssh-credentials}' + refspec: '$GERRIT_REFSPEC' + choosing-strategy: 'gerrit' + + triggers: + - gerrit: + trigger-on: + - patchset-created-event: + exclude-drafts: 'false' + exclude-trivial-rebase: 'false' + exclude-no-code-change: 'false' + - draft-published-event + - comment-added-contains-event: + comment-contains-value: 'recheck' + - comment-added-contains-event: + comment-contains-value: 'reverify' + projects: + - project-compare-type: 'ANT' + project-pattern: '{project}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + forbidden-file-paths: + - compare-type: ANT + pattern: 'docs/**|.gitignore' + + builders: + - shell: | + echo "Nothing to verify!" diff --git a/jjb/joid/joid.yml b/jjb/joid/joid.yml deleted file mode 100644 index 28b019fcd..000000000 --- a/jjb/joid/joid.yml +++ /dev/null @@ -1,117 +0,0 @@ -######################## -# Job configuration for joid -######################## -- project: - - name: 'joid' - - installer: 'joid' - - controller: 'odl' - - pod: - - 'intel-pod5' - - 'orange-pod2' - - stream: - - master: - branch: 'master' - gs-pathname: '' - - jobs: - - 'joid-{controller}-{pod}-daily-{stream}' - - 'joid-deploy-{pod}-daily-{stream}' - -######################## -# job templates -######################## -- job-template: - name: 'joid-{controller}-{pod}-daily-{stream}' - - disabled: false - - concurrent: false - - parameters: - - project-parameter: - project: '{installer}' - - 'intel-us-build-1-defaults' - - '{installer}-defaults': - controller: '{controller}' - - scm: - - git-scm: - credentials-id: '{ssh-credentials}' - refspec: '' - branch: '{branch}' - - builders: - - trigger-builds: - - project: 'joid-deploy-{pod}-daily-{stream}' - git-revision: true - block: true - predefined-parameters: - CONTROLLER={controller} - -- job-template: - name: 'joid-deploy-{pod}-daily-{stream}' - - disabled: false - - concurrent: false - - wrappers: - - build-name: - name: '$BUILD_NUMBER: {installer} $CONTROLLER' - - parameters: - - project-parameter: - project: '{installer}' - - '{pod}-defaults' - - '{installer}-defaults': - controller: '{controller}' - - scm: - - git-scm: - credentials-id: '{ssh-credentials}' - refspec: '' - branch: '{branch}' - - builders: - - '{pod}-builder' - -######################## -# builder macros -######################## -- builder: - name: intel-pod5-builder - builders: - - shell: | - #!/bin/bash - echo "Running $INSTALLER_TYPE with controller $CONTROLLER" - echo "Please note that this is a quick try to see how joid deployment works" - echo - echo "Executing clean.sh" - cd $WORKSPACE/ci - ./clean.sh - - shell: | - cd $WORKSPACE/ci - echo "Executing 02-maasdeploy.sh intelpod5" - ./02-maasdeploy.sh intelpod5 - - shell: | - cd $WORKSPACE/ci - echo "Executing deploy.sh -o liberty -s $CONTROLLER -t ha -l intelpod5" - ./deploy.sh -o liberty -s $CONTROLLER -t ha -l intelpod5 -- builder: - name: orange-pod2-builder - builders: - - shell: | - #!/bin/bash - echo "Running $INSTALLER_TYPE with controller $CONTROLLER" - echo "Please note that this is WIP generic builder" - echo - echo "Executing clean.sh" - cd $WORKSPACE/ci - ./clean.sh - - shell: - !include-raw ./joid-deploy.sh |