From 11c2bb7cdfa401b9e3e2f65ec459e1b7a452ed76 Mon Sep 17 00:00:00 2001 From: yatinkarel Date: Fri, 17 Jul 2020 18:29:28 +0530 Subject: [PATCH] Allow CentOS8 jobs to run with custom dlrn hashes DLRN repo symlinks(ex. current-tripleo, current etc) keeps on changing with promotions, in order to reproduce/rerun jobs with older dlrn hashes CentOS8 release files were missing support, this patch adds it. Related-Bug: #1887637 Depends-On: https://review.opendev.org/#/c/747121/ Change-Id: Idffb7de57d5f2debb8213b11c5ce3e41c2ece4f3 --- config/release/tripleo-ci/CentOS-8/master.yml | 22 ++++++++++++++++--- .../promotion-testing-hash-master.yml | 22 ++++++++++++++++--- .../CentOS-8/promotion-testing-hash-train.yml | 22 ++++++++++++++++--- .../promotion-testing-hash-ussuri.yml | 22 ++++++++++++++++--- config/release/tripleo-ci/CentOS-8/train.yml | 22 ++++++++++++++++--- config/release/tripleo-ci/CentOS-8/ussuri.yml | 22 ++++++++++++++++--- 6 files changed, 114 insertions(+), 18 deletions(-) diff --git a/config/release/tripleo-ci/CentOS-8/master.yml b/config/release/tripleo-ci/CentOS-8/master.yml index ef613b37e..cf19e604c 100644 --- a/config/release/tripleo-ci/CentOS-8/master.yml +++ b/config/release/tripleo-ci/CentOS-8/master.yml @@ -59,18 +59,34 @@ repo_cmd_before: | export NODEPOOL_CENTOS_MIRROR={{ lookup('env','NODEPOOL_CENTOS_MIRROR')|default('http://mirror.centos.org/centos', true) }} export NODEPOOL_RDO_PROXY=https://trunk.rdoproject.org fi + {% if dlrn_hash_path_newest is defined and dlrn_hash_path_newest %} + export DLRN_PATH_TAG_NEWEST="current/{{ dlrn_hash_path_newest }}" + {% else %} + export DLRN_PATH_TAG_NEWEST="{{ dlrn_hash_tag_newest }}" + {% endif %} + {% if dlrn_hash_path is defined and dlrn_hash_path %} + export DLRN_PATH_TAG="{{ promote_source }}/{{ dlrn_hash_path }}" + {% else %} + export DLRN_PATH_TAG="{{ dlrn_hash_tag }}" + {% endif %} + rdo_dlrn=`curl --silent https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/${DLRN_PATH_TAG_NEWEST}/delorean.repo -S 2>>~/dlrn_repo_curl_errors.log | grep baseurl | grep "component/tripleo" | cut -d= -f2` + if [[ -z "$rdo_dlrn" ]]; then + echo "Failed to parse dlrn hash" + exit 1 + fi + export RDO_DLRN_REPO=${rdo_dlrn/https:\/\/trunk.rdoproject.org/$NODEPOOL_RDO_PROXY} repos: # RDO repos - type: file filename: delorean.repo - down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/{{ dlrn_hash_tag }}/delorean.repo" + down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/${DLRN_PATH_TAG}/delorean.repo" # name of delorean-tripleo-component-current? naming is hard - - type: file + - type: generic reponame: delorean-current filename: delorean-current.repo - down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/component/tripleo/current/delorean.repo" + baseurl: $RDO_DLRN_REPO priority: 10 includepkgs: - ansible-role-container-registry diff --git a/config/release/tripleo-ci/CentOS-8/promotion-testing-hash-master.yml b/config/release/tripleo-ci/CentOS-8/promotion-testing-hash-master.yml index d3beabfa1..9bb601d1a 100644 --- a/config/release/tripleo-ci/CentOS-8/promotion-testing-hash-master.yml +++ b/config/release/tripleo-ci/CentOS-8/promotion-testing-hash-master.yml @@ -49,20 +49,36 @@ repo_cmd_before: | export NODEPOOL_CENTOS_MIRROR={{ lookup('env','NODEPOOL_CENTOS_MIRROR')|default('http://mirror.centos.org/centos', true) }} export NODEPOOL_RDO_PROXY=https://trunk.rdoproject.org fi + {% if dlrn_hash_path_newest is defined and dlrn_hash_path_newest %} + export DLRN_PATH_TAG_NEWEST="current/{{ dlrn_hash_path_newest }}" + {% else %} + export DLRN_PATH_TAG_NEWEST="{{ dlrn_hash_tag_newest }}" + {% endif %} + {% if dlrn_hash_path is defined and dlrn_hash_path %} + export DLRN_PATH_TAG="{{ promote_source }}/{{ dlrn_hash_path }}" + {% else %} + export DLRN_PATH_TAG="{{ dlrn_hash_tag }}" + {% endif %} + rdo_dlrn=`curl --silent https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/${DLRN_PATH_TAG_NEWEST}/delorean.repo -S 2>>~/dlrn_repo_curl_errors.log | grep baseurl | grep "component/tripleo" | cut -d= -f2` + if [[ -z "$rdo_dlrn" ]]; then + echo "Failed to parse dlrn hash" + exit 1 + fi + export RDO_DLRN_REPO=${rdo_dlrn/https:\/\/trunk.rdoproject.org/$NODEPOOL_RDO_PROXY} repos: - type: file filename: delorean.repo - down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/{{ promote_source }}/delorean.repo" + down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/${DLRN_PATH_TAG}/delorean.repo" # ATM current is not used in promotion jobs, this is a bug. # However for consistency w/ what is merged. removing # See config/release/tripleo-ci/CentOS-7/promotion-testing-hash-master.yml#L48-L64 # "https://trunk.rdoproject.org/centos8-master/component/tripleo/current/delorean.repo" - - type: file + - type: generic reponame: delorean-current filename: delorean-current.repo - down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/component/tripleo/current/delorean.repo" + baseurl: $RDO_DLRN_REPO priority: 10 includepkgs: - ansible-role-container-registry diff --git a/config/release/tripleo-ci/CentOS-8/promotion-testing-hash-train.yml b/config/release/tripleo-ci/CentOS-8/promotion-testing-hash-train.yml index 26df56d7b..bc1bdb214 100644 --- a/config/release/tripleo-ci/CentOS-8/promotion-testing-hash-train.yml +++ b/config/release/tripleo-ci/CentOS-8/promotion-testing-hash-train.yml @@ -48,20 +48,36 @@ repo_cmd_before: | export NODEPOOL_CENTOS_MIRROR={{ lookup('env','NODEPOOL_CENTOS_MIRROR')|default('http://mirror.centos.org/centos', true) }} export NODEPOOL_RDO_PROXY=https://trunk.rdoproject.org fi + {% if dlrn_hash_path_newest is defined and dlrn_hash_path_newest %} + export DLRN_PATH_TAG_NEWEST="current/{{ dlrn_hash_path_newest }}" + {% else %} + export DLRN_PATH_TAG_NEWEST="{{ dlrn_hash_tag_newest }}" + {% endif %} + {% if dlrn_hash_path is defined and dlrn_hash_path %} + export DLRN_PATH_TAG="{{ promote_source }}/{{ dlrn_hash_path }}" + {% else %} + export DLRN_PATH_TAG="{{ dlrn_hash_tag }}" + {% endif %} + rdo_dlrn=`curl --silent https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/${DLRN_PATH_TAG_NEWEST}/delorean.repo -S 2>>~/dlrn_repo_curl_errors.log | grep baseurl | grep "component/tripleo" | cut -d= -f2` + if [[ -z "$rdo_dlrn" ]]; then + echo "Failed to parse dlrn hash" + exit 1 + fi + export RDO_DLRN_REPO=${rdo_dlrn/https:\/\/trunk.rdoproject.org/$NODEPOOL_RDO_PROXY} repos: - type: file filename: delorean.repo - down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/{{ promote_source }}/delorean.repo" + down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/${DLRN_PATH_TAG}/delorean.repo" # ATM current is not used in promotion jobs, this is a bug. # However for consistency w/ what is merged. removing # See config/release/tripleo-ci/CentOS-7/promotion-testing-hash-master.yml#L48-L64 # "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/component/tripleo/current/delorean.repo" - - type: file + - type: generic reponame: delorean-current filename: delorean-current.repo - down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/component/tripleo/current/delorean.repo" + baseurl: $RDO_DLRN_REPO priority: 10 includepkgs: - ansible-role-container-registry diff --git a/config/release/tripleo-ci/CentOS-8/promotion-testing-hash-ussuri.yml b/config/release/tripleo-ci/CentOS-8/promotion-testing-hash-ussuri.yml index b64866f70..4d29f84e9 100644 --- a/config/release/tripleo-ci/CentOS-8/promotion-testing-hash-ussuri.yml +++ b/config/release/tripleo-ci/CentOS-8/promotion-testing-hash-ussuri.yml @@ -49,20 +49,36 @@ repo_cmd_before: | export NODEPOOL_CENTOS_MIRROR={{ lookup('env','NODEPOOL_CENTOS_MIRROR')|default('http://mirror.centos.org/centos', true) }} export NODEPOOL_RDO_PROXY=https://trunk.rdoproject.org fi + {% if dlrn_hash_path_newest is defined and dlrn_hash_path_newest %} + export DLRN_PATH_TAG_NEWEST="current/{{ dlrn_hash_path_newest }}" + {% else %} + export DLRN_PATH_TAG_NEWEST="{{ dlrn_hash_tag_newest }}" + {% endif %} + {% if dlrn_hash_path is defined and dlrn_hash_path %} + export DLRN_PATH_TAG="{{ promote_source }}/{{ dlrn_hash_path }}" + {% else %} + export DLRN_PATH_TAG="{{ dlrn_hash_tag }}" + {% endif %} + rdo_dlrn=`curl --silent https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/${DLRN_PATH_TAG_NEWEST}/delorean.repo -S 2>>~/dlrn_repo_curl_errors.log | grep baseurl | grep "component/tripleo" | cut -d= -f2` + if [[ -z "$rdo_dlrn" ]]; then + echo "Failed to parse dlrn hash" + exit 1 + fi + export RDO_DLRN_REPO=${rdo_dlrn/https:\/\/trunk.rdoproject.org/$NODEPOOL_RDO_PROXY} repos: - type: file filename: delorean.repo - down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/{{ promote_source }}/delorean.repo" + down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/${DLRN_PATH_TAG}/delorean.repo" # ATM current is not used in promotion jobs, this is a bug. # However for consistency w/ what is merged. removing # See config/release/tripleo-ci/CentOS-7/promotion-testing-hash-master.yml#L48-L64 # "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/component/tripleo/current/delorean.repo" - - type: file + - type: generic reponame: delorean-current filename: delorean-current.repo - down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/component/tripleo/current/delorean.repo" + baseurl: $RDO_DLRN_REPO priority: 10 includepkgs: - ansible-role-container-registry diff --git a/config/release/tripleo-ci/CentOS-8/train.yml b/config/release/tripleo-ci/CentOS-8/train.yml index 310eca2dd..92088e204 100644 --- a/config/release/tripleo-ci/CentOS-8/train.yml +++ b/config/release/tripleo-ci/CentOS-8/train.yml @@ -43,17 +43,33 @@ repo_cmd_before: | export NODEPOOL_CENTOS_MIRROR={{ lookup('env','NODEPOOL_CENTOS_MIRROR')|default('http://mirror.centos.org/centos', true) }} export NODEPOOL_RDO_PROXY=https://trunk.rdoproject.org fi + {% if dlrn_hash_path_newest is defined and dlrn_hash_path_newest %} + export DLRN_PATH_TAG_NEWEST="current/{{ dlrn_hash_path_newest }}" + {% else %} + export DLRN_PATH_TAG_NEWEST="{{ dlrn_hash_tag_newest }}" + {% endif %} + {% if dlrn_hash_path is defined and dlrn_hash_path %} + export DLRN_PATH_TAG="{{ promote_source }}/{{ dlrn_hash_path }}" + {% else %} + export DLRN_PATH_TAG="{{ dlrn_hash_tag }}" + {% endif %} + rdo_dlrn=`curl --silent https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/${DLRN_PATH_TAG_NEWEST}/delorean.repo -S 2>>~/dlrn_repo_curl_errors.log | grep baseurl | grep "component/tripleo" | cut -d= -f2` + if [[ -z "$rdo_dlrn" ]]; then + echo "Failed to parse dlrn hash" + exit 1 + fi + export RDO_DLRN_REPO=${rdo_dlrn/https:\/\/trunk.rdoproject.org/$NODEPOOL_RDO_PROXY} repos: - type: file filename: delorean.repo - down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/{{ dlrn_hash_tag }}/delorean.repo" + down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/${DLRN_PATH_TAG}/delorean.repo" # name of delorean-tripleo-component-current? naming is hard - - type: file + - type: generic reponame: delorean-current filename: delorean-current.repo - down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/component/tripleo/current/delorean.repo" + baseurl: $RDO_DLRN_REPO priority: 10 includepkgs: - ansible-role-container-registry diff --git a/config/release/tripleo-ci/CentOS-8/ussuri.yml b/config/release/tripleo-ci/CentOS-8/ussuri.yml index e6b77ce1e..33d8ca1b8 100644 --- a/config/release/tripleo-ci/CentOS-8/ussuri.yml +++ b/config/release/tripleo-ci/CentOS-8/ussuri.yml @@ -59,18 +59,34 @@ repo_cmd_before: | export NODEPOOL_CENTOS_MIRROR={{ lookup('env','NODEPOOL_CENTOS_MIRROR')|default('http://mirror.centos.org/centos', true) }} export NODEPOOL_RDO_PROXY=https://trunk.rdoproject.org fi + {% if dlrn_hash_path_newest is defined and dlrn_hash_path_newest %} + export DLRN_PATH_TAG_NEWEST="current/{{ dlrn_hash_path_newest }}" + {% else %} + export DLRN_PATH_TAG_NEWEST="{{ dlrn_hash_tag_newest }}" + {% endif %} + {% if dlrn_hash_path is defined and dlrn_hash_path %} + export DLRN_PATH_TAG="{{ promote_source }}/{{ dlrn_hash_path }}" + {% else %} + export DLRN_PATH_TAG="{{ dlrn_hash_tag }}" + {% endif %} + rdo_dlrn=`curl --silent https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/${DLRN_PATH_TAG_NEWEST}/delorean.repo -S 2>>~/dlrn_repo_curl_errors.log | grep baseurl | grep "component/tripleo" | cut -d= -f2` + if [[ -z "$rdo_dlrn" ]]; then + echo "Failed to parse dlrn hash" + exit 1 + fi + export RDO_DLRN_REPO=${rdo_dlrn/https:\/\/trunk.rdoproject.org/$NODEPOOL_RDO_PROXY} repos: # RDO repos - type: file filename: delorean.repo - down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/{{ dlrn_hash_tag }}/delorean.repo" + down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/${DLRN_PATH_TAG}/delorean.repo" # name of delorean-tripleo-component-current? naming is hard - - type: file + - type: generic reponame: delorean-current filename: delorean-current.repo - down_url: "https://trunk.rdoproject.org/{{ distro_ver }}-{{ release }}/component/tripleo/current/delorean.repo" + baseurl: $RDO_DLRN_REPO priority: 10 includepkgs: - ansible-role-container-registry