From fca8d78211c89190e59d709f3ad4a370f7c1ac60 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Sat, 17 Feb 2018 16:27:57 +0100 Subject: [PATCH] Use host_vars for wheel builds No need to use magic names since we now have host_vars, instead set wheel_python explicitly. Remove TODO comment. Change-Id: I5051a32d843b106b013b94d57fd24b63896b741a --- playbooks/wheel/post-base.yaml | 4 ---- roles/build-wheels/tasks/main.yaml | 4 ---- zuul.d/jobs.yaml | 25 +++++++++++++------------ 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/playbooks/wheel/post-base.yaml b/playbooks/wheel/post-base.yaml index d6306839f9..36dd3c0993 100644 --- a/playbooks/wheel/post-base.yaml +++ b/playbooks/wheel/post-base.yaml @@ -1,9 +1,5 @@ - hosts: all tasks: - - name: Select python version of build - set_fact: - wheel_python: "python{{ inventory_hostname[-1] }}" - - name: Ensure build logs directory exists file: path: "{{ zuul.executor.log_root }}/{{ wheel_python }}" diff --git a/roles/build-wheels/tasks/main.yaml b/roles/build-wheels/tasks/main.yaml index cee826fad4..95043aaf39 100644 --- a/roles/build-wheels/tasks/main.yaml +++ b/roles/build-wheels/tasks/main.yaml @@ -1,7 +1,3 @@ -- name: Select python version to build - set_fact: - wheel_python: "python{{ inventory_hostname[-1] }}" - - name: Ensure wheel dir exists file: group: zuul diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 721a165f93..9b1ae6674b 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -958,13 +958,12 @@ description: | Build CentOS 7 wheels for OpenStaci CI mirrors. nodeset: - # NOTE: The python2 and python3 suffix are important, they select the - # version of python to build in each job. (we pull the last character of - # the inventory_hostname) - # TODO(mordred): Replace the suffix with host_vars once we have them. nodes: - name: wheel-mirror-centos-7-python2 label: centos-7 + host_vars: + wheel-mirror-ubuntu-centos-7-python2: + wheel_python: python2 - job: name: publish-wheel-mirror-centos-7 @@ -983,15 +982,16 @@ description: | Build Ubuntu Trusty wheels for OpenStaci CI mirrors. nodeset: - # NOTE: The python2 and python3 suffix are important, they select the - # version of python to build in each job. (we pull the last character of - # the inventory_hostname) - # TODO(mordred): Replace the suffix with host_vars once we have them. nodes: - name: wheel-mirror-ubuntu-trusty-python2 label: ubuntu-trusty - name: wheel-mirror-ubuntu-trusty-python3 label: ubuntu-trusty + host_vars: + wheel-mirror-ubuntu-trusty-python2: + wheel_python: python2 + wheel-mirror-ubuntu-trusty-python3: + wheel_python: python3 - job: name: publish-wheel-mirror-ubuntu-trusty @@ -1010,15 +1010,16 @@ description: | Build Ubuntu Xenial wheels for OpenStaci CI mirrors. nodeset: - # NOTE: The python2 and python3 suffix are important, they select the - # version of python to build in each job. (we pull the last character of - # the inventory_hostname) - # TODO(mordred): Replace the suffix with host_vars once we have them. nodes: - name: wheel-mirror-ubuntu-xenial-python2 label: ubuntu-xenial - name: wheel-mirror-ubuntu-xenial-python3 label: ubuntu-xenial + host_vars: + wheel-mirror-ubuntu-xenial-python2: + wheel_python: python2 + wheel-mirror-ubuntu-xenial-python3: + wheel_python: python3 - job: name: publish-wheel-mirror-ubuntu-xenial