From f57c1aec6cafd0f2b4d6c04c787745b9f2729604 Mon Sep 17 00:00:00 2001 From: Hongbin LU Date: Mon, 30 Apr 2018 15:17:27 +0000 Subject: [PATCH] Add Zun scenario job for ubuntu Introduce a job 'kolla-ansible-ubuntu-source-zun' to test kolla with Zun enabled. To reduce CI resource, this job will be triggered only if there are changes on the Zun's ansible roles. Change-Id: I0ba207e1d3761da2d6992c5834d4f59e7e1d6628 --- ansible/roles/zun/templates/zun.conf.j2 | 1 + tests/templates/globals-default.j2 | 6 ++++++ tests/templates/inventory.j2 | 3 +++ tools/setup_gate.sh | 13 +++++++++++++ zuul.d/jobs.yaml | 10 ++++++++++ zuul.d/project.yaml | 2 ++ 6 files changed, 35 insertions(+) diff --git a/ansible/roles/zun/templates/zun.conf.j2 b/ansible/roles/zun/templates/zun.conf.j2 index 3613df0365..709dddc7a9 100644 --- a/ansible/roles/zun/templates/zun.conf.j2 +++ b/ansible/roles/zun/templates/zun.conf.j2 @@ -113,3 +113,4 @@ base_url = ws://{{ kolla_external_fqdn }}:{{ zun_wsproxy_port }} [docker] docker_remote_api_version = 1.24 +api_url = tcp://{{ api_interface_address }}:2375 diff --git a/tests/templates/globals-default.j2 b/tests/templates/globals-default.j2 index 95a7f27c83..8acf689656 100644 --- a/tests/templates/globals-default.j2 +++ b/tests/templates/globals-default.j2 @@ -44,4 +44,10 @@ ceph_pool_pg_num: 8 ceph_pool_pgp_num: 8 {% endif %} +{% if scenario == "zun" %} +enable_zun: "yes" +enable_kuryr: "yes" +docker_custom_option: " -H unix:///var/run/docker.sock -H tcp://{{ api_interface_address }}:2375" +{% endif %} + keystone_token_provider: "fernet" diff --git a/tests/templates/inventory.j2 b/tests/templates/inventory.j2 index 035e7402b6..b92f3570c3 100644 --- a/tests/templates/inventory.j2 +++ b/tests/templates/inventory.j2 @@ -601,6 +601,9 @@ placement [zun-api:children] zun +[zun-wsproxy:children] +zun + [zun-compute:children] compute diff --git a/tools/setup_gate.sh b/tools/setup_gate.sh index 299dd400b3..fc7a60af6e 100755 --- a/tools/setup_gate.sh +++ b/tools/setup_gate.sh @@ -44,6 +44,10 @@ EOF GATE_IMAGES+=",ceph,cinder" fi + if [[ $ACTION == "zun" ]]; then + GATE_IMAGES+=",zun,kuryr" + fi + cat <=2.4" "docker>=2.0.0" "python-openstackclient" "ara" "cmd2<0.9.0" + if [[ $ACTION == "zun" ]]; then + sudo -H pip install -U "python-zunclient" + fi detect_distro sudo mkdir /etc/ansible @@ -135,6 +142,12 @@ function sanity_check { openstack volume create --size 2 test_volume openstack server add volume kolla_boot_test test_volume --device /dev/vdb fi + if echo $ACTION | grep -q "zun"; then + openstack --debug appcontainer service list + openstack --debug appcontainer host list + # TODO(hongbin): Run a Zun container and assert the container becomes + # Running + fi } function test_openstack { diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 9b3d1ffdf8..9b7956059d 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -88,3 +88,13 @@ voting: false vars: base_distro: centos + +- job: + name: kolla-ansible-ubuntu-source-zun + parent: kolla-ansible-base + nodeset: kolla-ansible-xenial + voting: false + vars: + base_distro: ubuntu + install_type: source + scenario: zun diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 2d65193f02..bc8f261402 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -18,6 +18,8 @@ - kolla-ansible-oraclelinux-source-ceph - kolla-ansible-bifrost-centos-source: files: ^ansible\/roles\/bifrost\/.* + - kolla-ansible-ubuntu-source-zun: + files: ^ansible\/roles\/zun\/.* - openstack-tox-lower-constraints gate: jobs: