User Tools

Site Tools


howto-hyperv-ci

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
howto-hyperv-ci [2015/08/10 14:26]
gsamfira
howto-hyperv-ci [2015/09/25 16:03] (current)
ibalutoiu
Line 137: Line 137:
  
  
-Using that file we will now deploy our charms. Take note, charms will be configured to use the information you provide.+Using that file we will now deploy our charms. Take note, charms will be configured to use the information you provide
 + 
 +  juju-deployer -L -S -c filename.yaml
  
 At the end you should have something like this: At the end you should have something like this:
Line 182: Line 184:
   git clone https://github.com/cloudbase/common-ci.git   git clone https://github.com/cloudbase/common-ci.git
   cd common-ci && git checkout redmondridge   cd common-ci && git checkout redmondridge
 +  
 +  mkdir -p ~/charms/trusty && cd ~/charms/trusty
 +  git clone https://github.com/cloudbase/devstack-charm.git devstack
 +  
 +  mkdir -p ~/charms/win2012r2 && cd ~/charms/win2012r2
 +  git clone git@bitbucket.org:cloudbase/active-directory-charm.git active-directory
 +  cd active-directory
 +  ./download-juju-powershell-modules.sh
 +  
 +  mkdir -p ~/charms/win2012hvr2 && cd ~/charms/win2012hvr2
 +  git clone https://github.com/cloudbase/hyperv-charm.git hyper-v-ci
 +  
   exit   exit
   sudo ln -s /var/lib/jenkins/scripts/common-ci/deployer/deployer.py /usr/bin/ci-deployer   sudo ln -s /var/lib/jenkins/scripts/common-ci/deployer/deployer.py /usr/bin/ci-deployer
   exit   exit
 +
 +We need to copy over the juju environment to the jenkins server so that it can deploy juju charms:
 +
 +<code bash>
 +ADDRESS=$(juju run --unit jenkins/0 "unit-get public-address")
 +scp -i ~/.juju/ssh/juju_id_rsa -r /home/ubuntu/.juju ubuntu@$ADDRESS:~/
 +juju ssh jenkins/0 "sudo cp -a /home/ubuntu/.juju /var/lib/jenkins/.juju"
 +juju ssh jenkins/0 "sudo chown jenkins:jenkins -R /var/lib/jenkins/.juju"
 +juju ssh jenkins/0 "sudo chmod 700 -R /var/lib/jenkins/.juju"
 +</code>
  
 ==== Configure Jenkins ==== ==== Configure Jenkins ====
Line 276: Line 300:
 set -x set -x
 set +e set +e
 +
 +BUNDLE_LOCATION=$(mktemp)
 +UUID=$ZUUL_UUID
 +
 +cat << EOF > $BUNDLE_LOCATION
 +nova:
 +  overrides:
 +    data-port: "space delimited mac address list"
 +    external-port: "space delimited mac address list"
 +    zuul-branch: $ZUUL_BRANCH
 +    zuul-change: "$ZUUL_CHANGE"
 +    zuul-project: $ZUUL_PROJECT
 +    zuul-ref: $ZUUL_REF
 +    zuul-url: $ZUUL_URL
 +  relations:
 +  - - devstack-$UUID
 +    - hyper-v-ci-$UUID
 +  - - hyper-v-ci-$UUID
 +    - active-directory
 +  services:
 +    active-directory:
 +      branch: https://github.com/cloudbase/active-directory.git
 +      charm: local:win2012r2/active-directory
 +      num_units: 1
 +      options:
 +        domain-name: cloudbase.local
 +        password: Passw0rd
 +    devstack-$UUID:
 +      branch: https://github.com/cloudbase/devstack-charm.git
 +      charm: local:trusty/devstack
 +      num_units: 1
 +      options:
 +        disabled-services: horizon n-novnc n-net n-cpu ceilometer-acompute
 +        enable-plugin: networking-hyperv|https://github.com/stackforge/networking-hyperv.git
 +        enabled-services: rabbit mysql key n-api n-crt n-obj n-cond n-sch n-cauth
 +          neutron q-svc q-agt q-dhcp q-l3 q-meta q-lbaas q-fwaas q-metering q-vpn
 +          g-api g-reg cinder c-api c-vol c-sch c-bak s-proxy s-object s-container
 +          s-account heat h-api h-api-cfn h-api-cw h-eng tempest
 +        extra-packages: build-essential libpython-all-dev python-all python-dev python3-all
 +          python3.4-dev g++ g++-4.8 pkg-config libvirt-dev
 +        extra-python-packages: networking-hyperv
 +        heat-image-url: http://10.255.251.252/Fedora.vhdx
 +        test-image-url: http://10.255.251.252/cirros.vhdx
 +        vlan-range: 2500:2550
 +    hyper-v-ci-$UUID:
 +      branch: https://github.com/cloudbase/hyperv-charm
 +      charm: local:win2012hvr2/hyper-v-ci
 +      num_units: 2
 +      options:
 +        download-mirror: http://64.119.130.115/bin
 +        extra-python-packages: setuptools SQLAlchemy==0.9.8 wmi oslo.i18n==1.7.0 pbr==1.2.0
 +        git-user-email: hyper-v_ci@microsoft.com
 +        git-user-name: Hyper-V CI
 +        pypi-mirror: "space delimited pypi mirrors list"
 +EOF
 +
  
 export JUJU_REPOSITORY=$HOME/charms export JUJU_REPOSITORY=$HOME/charms
-ci-deployer deploy --zuul-uuid $ZUUL_UUID --zuul-branch $ZUUL_BRANCH --zuul-ref $ZUUL_REF --zuul-url $ZUUL_URL --zuul-change $ZUUL_CHANGE --zuul-project $ZUUL_PROJECT --nr-devstack-units 1 --nr-hyperv-units 2 --data-ports "90:e2:ba:67:57:ec 90:e2:ba:67:5b:10 90:e2:ba:67:5b:68 90:e2:ba:67:58:3c 90:e2:ba:67:57:04 90:e2:ba:68:7d:14 90:e2:ba:67:5f:78 90:e2:ba:67:27:84 90:e2:ba:67:27:8c 90:e2:ba:67:27:88 90:e2:ba:67:5b:6c 90:e2:ba:67:53:20 90:e2:ba:67:5c:10 90:e2:ba:68:7c:b8" --external-ports "90:e2:ba:67:57:ed 90:e2:ba:67:5b:11 90:e2:ba:67:5b:69 90:e2:ba:67:58:3d 90:e2:ba:67:57:05 90:e2:ba:68:7d:15 90:e2:ba:67:5f:79 90:e2:ba:67:27:85 90:e2:ba:67:27:8d 90:e2:ba:67:27:89 90:e2:ba:67:5b:6d 90:e2:ba:67:53:21 90:e2:ba:67:5c:11 90:e2:ba:68:7c:b9" --vlan-range "2500:2550" --hyper-v-extra-python-packages "setuptools SQLAlchemy==0.9.8 wmi oslo.i18n==1.7.0 pbr==1.2.0" --devstack-extra-packages "build-essential libpython-all-dev python-all python-dev python3-all python3.4-dev g++ g++-4.8 pkg-config libvirt-dev" --devstack-extra-python-packages "networking-hyperv" --devstack-enabled-services "rabbit mysql key n-api n-crt n-obj n-cond n-sch n-cauth neutron q-svc q-agt q-dhcp q-l3 q-meta q-lbaas q-fwaas q-metering q-vpn g-api g-reg cinder c-api c-vol c-sch c-bak s-proxy s-object s-container s-account heat h-api h-api-cfn h-api-cw h-eng tempest" --devstack-disabled-services "horizon n-novnc n-net n-cpu ceilometer-acompute" --devstack-enabled-plugins "networking-hyperv|https://github.com/stackforge/networking-hyperv.git" --ad-domain-name cloudbase.local --ad-admin-password Passw0rd --nr-ad-units 1+ci-deployer deploy --template $BUNDLE_LOCATION --search-string $UUID
 build_exit_code=$? build_exit_code=$?
  
Line 300: Line 380:
  
 #destroy charms, services and used nodes. #destroy charms, services and used nodes.
-ci-deployer teardown --zuul-uuid $ZUUL_UUID+ci-deployer teardown --search-string $ZUUL_UUID
 cleanup_exit_code=$? cleanup_exit_code=$?
  
Line 335: Line 415:
   * the VLAN range needs to be computed before the job starts   * the VLAN range needs to be computed before the job starts
   * the MAC address list needs to be known beforehand.   * the MAC address list needs to be known beforehand.
 +  * the extra python packages should be used only during CI quirkiness (requirements include a bad version of PBR for example). 
  
 In this PoC, we have a static list of MAC addresses and VLAN ranges, but this should be queried from a single source of truth (say an API that hosts resources such as VLAN ranges and MAC addresses). In this PoC, we have a static list of MAC addresses and VLAN ranges, but this should be queried from a single source of truth (say an API that hosts resources such as VLAN ranges and MAC addresses).
 +
 +
 +===== Configuring up Zuul =====
 +
 +As mentioned before, this is a manual step that will change once we integrate the jenkins and zuul charms. For now lets make sure layout.yaml is correctly configured. Edit **/etc/zuul/layout.yaml** and set the following content:
 +
 +<code yaml>
 +includes:
 +  - python-file: openstack_functions.py
 +
 +pipelines:
 +  - name: check
 +    description: Newly uploaded patchsets enter this pipeline to be validated. Voting is neutral, only comments with results are sent.
 +    failure-message: Build failed. For rechecking only on the Hyper-V CI, add a review comment with check hyper-v
 +    manager: IndependentPipelineManager
 +    precedence: low
 +    trigger:
 +      gerrit:
 +        - event: patchset-created
 +        - event: change-restored
 +        - event: comment-added
 +          comment_filter: (?i)^(Patch Set [0-9]+:)?( [\w\\+-]*)*(\n\n)?\s*(recheck|reverify|check hyper-v)
 +    dequeue-on-new-patchset: true
 +
 +jobs:
 +  - name: ^.*$
 +    parameter-function: set_log_url
 +  - name: nova-hyperv-tempest
 +    voting: false
 +  - name: neutron-hyperv-tempest
 +    voting: false
 +  - name: check-noop
 +    voting: false
 +
 +projects:
 +  - name: openstack/nova
 +    check:
 +      - nova-hyperv-tempest
 +</code>
 +
 +Save the file and restart zuul:
 +
 +<code bash>
 +restart zuul-merger
 +restart zuul-server
 +</code>
 +
 +You should be all done (If I have not forgotten anything). Make sure you check zuul logs for patch update status. This will be the likely place to look if you get no jobs in jenkins at all.
howto-hyperv-ci.1439206019.txt.gz · Last modified: 2015/08/10 14:27 (external edit)