From a6d5ace71a935b04086965c45508c3c5725efd5e Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Wed, 18 Dec 2024 17:57:26 +0000 Subject: [PATCH 01/52] Added CI to create PRs to bump repos on main --- .github/workflows/update-timestamps.yml | 28 ++++++ ansible/ci/library/latest_timestamps.py | 88 +++++++++++++++++++ ansible/ci/update_timestamps.yml | 28 ++++++ .../inventory/group_vars/all/defaults.yml | 15 ++++ requirements.txt | 1 + 5 files changed, 160 insertions(+) create mode 100644 .github/workflows/update-timestamps.yml create mode 100644 ansible/ci/library/latest_timestamps.py create mode 100644 ansible/ci/update_timestamps.yml diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml new file mode 100644 index 000000000..5f50703d0 --- /dev/null +++ b/.github/workflows/update-timestamps.yml @@ -0,0 +1,28 @@ +name: Check for new Release Train snapshots +on: + workflow_dispatch: + schedule: + - cron: '0 7 * * *' # Run at 7am on default branch + +jobs: + upstream_check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Setup environment + run: | + . venv/bin/activate + . environments/.stackhpc/activate + + - name: Check for updated Ark timestamps and replace in defaults.yml + run: ansible-playbook ansible/ci/update_timestamps.yml + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + add-paths: environments/common/inventory/group_vars/all/defaults.yml + commit-message: "[automated] bumped repo timestamps to latest" + branch: auto/bump-timestamps + title: "[Automation] Bumped repo timestamps to latest" + body: Automated changes by .github/workflows/update-timestamps.yml diff --git a/ansible/ci/library/latest_timestamps.py b/ansible/ci/library/latest_timestamps.py new file mode 100644 index 000000000..d7f45cd7a --- /dev/null +++ b/ansible/ci/library/latest_timestamps.py @@ -0,0 +1,88 @@ +#!/usr/bin/python + +# Copyright: (c) 2018, Terry Jones +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +DOCUMENTATION = r''' +--- +module: latest_timestamps + +short_description: Gets the latest set of snapshots from Pulp and overwrites + +version_added: "1.0.0" + +description: Gets the latest set of snapshots from given source URLs and returns dictionary in to replace 'appliances_repo_timestamps' with + +author: + - William Tripp +''' + +EXAMPLES = r''' +# Pass in a message +- name: Get latest timestamps + latest_timestamps: + current_timestamps_dict: "{{ appliances_repo_timestamps }}" + sources_dict: "{{ appliances_repo_timestamp_sources }}" + register: result + +''' + +RETURN = r''' +# These are examples of possible return values, and in general should use other names for return values. +latest_dict: + description: Dictionary with updated timestamps + type: dict + returned: always +changed_timestamps: + description: List of repos that've been updated + type: str[] + returned: always +''' + +from ansible.module_utils.basic import AnsibleModule +import requests +from bs4 import BeautifulSoup + +def run_module(): + module_args = dict( + current_timestamps_dict=dict(type='dict', required=True), + sources_dict=dict(type='dict', required=True) + ) + + result = dict( + changed=False, + original_message='', + message='' + ) + + module = AnsibleModule( + argument_spec=module_args, + supports_check_mode=True + ) + + latest_timestamps = {} + changed_timestamps = [] + for repo in module.params['sources_dict']: + latest_timestamps[repo] = module.params['sources_dict'][repo] + for version in module.params['sources_dict'][repo]: + html_txt = requests.get(url=module.params['sources_dict'][repo][version]).text + timestamp_link_list = BeautifulSoup(html_txt,features="html.parser").body.find('pre').find_all() + timestamp_link_list = map(lambda x: x.string,timestamp_link_list) # xml tags + latest_timestamps[repo][version] = list(timestamp_link_list)[-1][:-1] # last timestamp in list with trailing / removed + if module.params['sources_dict'][repo][version] != module.params['current_timestamps_dict'][repo][version]: + changed_timestamps.append(repo+' '+version) + + result['latest_dict'] = latest_timestamps + result['changed_timestamps'] = changed_timestamps + + module.exit_json(**result) + + +def main(): + run_module() + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/ansible/ci/update_timestamps.yml b/ansible/ci/update_timestamps.yml new file mode 100644 index 000000000..7834e2a33 --- /dev/null +++ b/ansible/ci/update_timestamps.yml @@ -0,0 +1,28 @@ +- hosts: localhost + tasks: + - name: Check sources are defined for all repos + ansible.builtin.assert: + that: appliances_repo_timestamps[item].keys() == appliances_repo_timestamp_sources[item].keys() + fail_msg: "'appliances_repo_timestamps.{{ item }}' is missing a source definition in 'appliances_repo_timestamp_sources'" + loop: "{{ appliances_repo_timestamps.keys() }}" + + - name: Get latest timestamps from sources + latest_timestamps: + sources_dict: "{{ appliances_repo_timestamp_sources }}" + current_timestamps_dict: "{{ appliances_repo_timestamps }}" + register: _result + + - name: Print updated timestamps + ansible.builtin.debug: + var: _result.changed_timestamps + + - name: Overwrite repo timestamps with latest + ansible.builtin.blockinfile: + path: "{{ playbook_dir }}/../../environments/common/inventory/group_vars/all/defaults.yml" + marker: "# {mark} Marker for ansible/ci/update_timestamps.yml (GH workflow managed)" + block: | + {{ yaml_template | to_nice_yaml(indent=2) }} + vars: + yaml_template: + appliances_repo_timestamps: "{{ _result.latest_dict }}" + when: (_result.changed_timestamps | count) > 0 diff --git a/environments/common/inventory/group_vars/all/defaults.yml b/environments/common/inventory/group_vars/all/defaults.yml index 1bac4590d..8a1b1e73f 100644 --- a/environments/common/inventory/group_vars/all/defaults.yml +++ b/environments/common/inventory/group_vars/all/defaults.yml @@ -82,6 +82,7 @@ appliances_local_users: "{{ appliances_local_users_default + appliances_local_us ########################################################################################### +# BEGIN Marker for ansible/ci/update_timestamps.yml (GH workflow managed) appliances_repo_timestamps: baseos: '9.4': 20240816T002610 @@ -93,3 +94,17 @@ appliances_repo_timestamps: '9.4': 20240816T002610 epel: '9': 20240902T080424 +# END Marker for ansible/ci/update_timestamps.yml (GH workflow managed) + +# For CI +appliances_repo_timestamp_sources: + baseos: + '9.4': https://ark.stackhpc.com/pulp/content/rocky/9.4/BaseOS/x86_64/os/ + appstream: + '9.4': https://ark.stackhpc.com/pulp/content/rocky/9.4/AppStream/x86_64/os/ + crb: + '9.4': https://ark.stackhpc.com/pulp/content/rocky/9.4/CRB/x86_64/os/ + extras: + '9.4': https://ark.stackhpc.com/pulp/content/rocky/9.4/extras/x86_64/os/ + epel: + '9': https://ark.stackhpc.com/pulp/content/epel/9/Everything/x86_64/ diff --git a/requirements.txt b/requirements.txt index 7d81f3285..3988b4451 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,3 +10,4 @@ selinux # this is a shim to avoid having to use --system-site-packages, you stil netaddr matplotlib pulp-cli==0.29.2 +beautifulsoup4==4.12.3 From 856541a408d21452041d9992cb68dfc5831793da Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 19 Dec 2024 15:50:42 +0000 Subject: [PATCH 02/52] reworked for new repo list structure --- ansible/ci/library/latest_timestamps.py | 35 +++++++++++++++---------- ansible/ci/update_timestamps.yml | 10 ++----- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/ansible/ci/library/latest_timestamps.py b/ansible/ci/library/latest_timestamps.py index d7f45cd7a..aae153d2e 100644 --- a/ansible/ci/library/latest_timestamps.py +++ b/ansible/ci/library/latest_timestamps.py @@ -23,8 +23,8 @@ # Pass in a message - name: Get latest timestamps latest_timestamps: - current_timestamps_dict: "{{ appliances_repo_timestamps }}" - sources_dict: "{{ appliances_repo_timestamp_sources }}" + repos_dict: "{{ appliances_repo_timestamp_sources }}" + content_url: "https://ark.stackhpc.com/pulp/content" register: result ''' @@ -44,11 +44,12 @@ from ansible.module_utils.basic import AnsibleModule import requests from bs4 import BeautifulSoup +from copy import deepcopy def run_module(): module_args = dict( - current_timestamps_dict=dict(type='dict', required=True), - sources_dict=dict(type='dict', required=True) + repos_dict=dict(type='dict', required=True), + content_url=dict(type='str', required=True) ) result = dict( @@ -62,17 +63,23 @@ def run_module(): supports_check_mode=True ) - latest_timestamps = {} + original_timestamps = dict(module.params['repos_dict']) + latest_timestamps = deepcopy(original_timestamps) changed_timestamps = [] - for repo in module.params['sources_dict']: - latest_timestamps[repo] = module.params['sources_dict'][repo] - for version in module.params['sources_dict'][repo]: - html_txt = requests.get(url=module.params['sources_dict'][repo][version]).text - timestamp_link_list = BeautifulSoup(html_txt,features="html.parser").body.find('pre').find_all() - timestamp_link_list = map(lambda x: x.string,timestamp_link_list) # xml tags - latest_timestamps[repo][version] = list(timestamp_link_list)[-1][:-1] # last timestamp in list with trailing / removed - if module.params['sources_dict'][repo][version] != module.params['current_timestamps_dict'][repo][version]: - changed_timestamps.append(repo+' '+version) + + for repo in original_timestamps: + for version in original_timestamps[repo]: + + html_txt = requests.get( + url= module.params['content_url'] + '/' + original_timestamps[repo][version]['path'] + ).text + timestamp_link_list = BeautifulSoup(html_txt,features="html.parser").body.find('pre').find_all() # getting raw list of timestamps from html + timestamp_link_list = map(lambda x: x.string,timestamp_link_list) # stripping xml tags + latest_timestamp = list(timestamp_link_list)[-1][:-1] # last timestamp in list with trailing / removed + + latest_timestamps[repo][version]['timestamp'] = latest_timestamp + if original_timestamps[repo][version]['timestamp'] != latest_timestamp: + changed_timestamps.append(repo+' '+version+': '+original_timestamps[repo][version]['timestamp']+' -> '+latest_timestamp) result['latest_dict'] = latest_timestamps result['changed_timestamps'] = changed_timestamps diff --git a/ansible/ci/update_timestamps.yml b/ansible/ci/update_timestamps.yml index 7834e2a33..b612531b3 100644 --- a/ansible/ci/update_timestamps.yml +++ b/ansible/ci/update_timestamps.yml @@ -1,15 +1,9 @@ - hosts: localhost tasks: - - name: Check sources are defined for all repos - ansible.builtin.assert: - that: appliances_repo_timestamps[item].keys() == appliances_repo_timestamp_sources[item].keys() - fail_msg: "'appliances_repo_timestamps.{{ item }}' is missing a source definition in 'appliances_repo_timestamp_sources'" - loop: "{{ appliances_repo_timestamps.keys() }}" - - name: Get latest timestamps from sources latest_timestamps: - sources_dict: "{{ appliances_repo_timestamp_sources }}" - current_timestamps_dict: "{{ appliances_repo_timestamps }}" + repos_dict: "{{ appliances_pulp_repos }}" + content_url: "https://ark.stackhpc.com/pulp/content" register: _result - name: Print updated timestamps From 056e98b1df737bbbc9cf037e315a9cca86d40f3a Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 20 Dec 2024 11:20:56 +0000 Subject: [PATCH 03/52] fatimage build now integrated into timestamp bump --- .github/workflows/fatimage.yml | 9 ++++ .github/workflows/update-timestamps.yml | 62 +++++++++++++++++++++---- 2 files changed, 63 insertions(+), 8 deletions(-) diff --git a/.github/workflows/fatimage.yml b/.github/workflows/fatimage.yml index 6649a3533..d4f20765e 100644 --- a/.github/workflows/fatimage.yml +++ b/.github/workflows/fatimage.yml @@ -10,6 +10,14 @@ on: - LEAFCLOUD - SMS - ARCUS + workflow_call: + inputs: + ci_cloud: + type: string + default: LEAFCLOUD + outputs: + openhpc-RL8-image: ${{ steps.manifest.outputs.openhpc-RL8-image }} + openhpc-RL9-image: ${{ steps.manifest.outputs.openhpc-RL9-image }} jobs: openstack: @@ -96,6 +104,7 @@ jobs: IMAGE_NAME=$(openstack image show -f value -c name $IMAGE_ID) echo "image-name=${IMAGE_NAME}" >> "$GITHUB_OUTPUT" echo "image-id=$IMAGE_ID" >> "$GITHUB_OUTPUT" + echo "${{ matrix.build.image_name }}-image=${IMAGE_NAME}" >> "$GITHUB_OUTPUT" echo $IMAGE_ID > image-id.txt echo $IMAGE_NAME > image-name.txt diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 5f50703d0..a43558140 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -15,14 +15,60 @@ jobs: . venv/bin/activate . environments/.stackhpc/activate + - name: Switch to automation branch + run: git checkout -b auto/bump-timestamps || git checkout auto/bump-timestamps + - name: Check for updated Ark timestamps and replace in defaults.yml run: ansible-playbook ansible/ci/update_timestamps.yml - - name: Create Pull Request - uses: peter-evans/create-pull-request@v7 - with: - add-paths: environments/common/inventory/group_vars/all/defaults.yml - commit-message: "[automated] bumped repo timestamps to latest" - branch: auto/bump-timestamps - title: "[Automation] Bumped repo timestamps to latest" - body: Automated changes by .github/workflows/update-timestamps.yml + - name: Check if timestamps were changed + id: timestamp_check + run: | + git diff --quiet + echo "timestamps_changed=$?" >> "$GITHUB_OUTPUT" + + # TODO: find way to stop CI running if pushing to existing PR + - name: Push new timestamps + if: "${{ steps.timestamp_check.outputs.timestamps_changed }} == 0" + run: | + git add environments/common/inventory/group_vars/all/defaults.yml + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' + git commit -m "Bumped repo timestamps" + git push + + build_fatimage: + if: "${{ steps.timestamp_check.outputs.timestamps_changed }} == 0" + needs: upstream_check + uses: stackhpc/ansible-slurm-appliance/.github/workflows/fatimage.yml + + ci_and_pr: + if: "${{ steps.timestamp_check.outputs.timestamps_changed }} == 0" + needs: build_fatimage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Bump CI with new images + run: | + git checkout auto/bump-timestamps + sed -i 's/"RL8".*$/"RL8": "${{ needs.build_fatimage.outputs.openhpc-RL8-image }}"/' environments/.stackhpc/terraform/cluster_image.auto.tfvars.json + sed -i 's/"RL9".*$/"RL9": "${{ needs.build_fatimage.outputs.openhpc-RL9-image }}"/' environments/.stackhpc/terraform/cluster_image.auto.tfvars.json + + - name: Push new images + run: | + git add environments/.stackhpc/terraform/cluster_image.auto.tfvars.json + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' + git commit -m "Bumped images" + git push + + - name: Check if PR exists + id: pr-check + run: | + gh pr list --json headRefName --jq '.[].headRefName' | grep auto/bump-timestamps + echo "pr_exists=$?" >> "$GITHUB_OUTPUT" + + - name: Create PR + if: ${{ steps.pr-check.outputs.pr_exists }} + run: gh pr create --title "[Auto] Bump repo timestamps to latest" --base main --head auto/bump-timestamps From 9eedb46fe6bd366e485c13fe2a6c14b719aa736d Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 20 Dec 2024 13:19:05 +0000 Subject: [PATCH 04/52] now points fatimage on local branch --- .github/workflows/update-timestamps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index a43558140..d6b729d02 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -40,7 +40,7 @@ jobs: build_fatimage: if: "${{ steps.timestamp_check.outputs.timestamps_changed }} == 0" needs: upstream_check - uses: stackhpc/ansible-slurm-appliance/.github/workflows/fatimage.yml + uses: ./.github/workflows/fatimage.yml ci_and_pr: if: "${{ steps.timestamp_check.outputs.timestamps_changed }} == 0" From 04555a0039f6e9b2247b178be5dad76f14fca2f1 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 20 Dec 2024 13:23:58 +0000 Subject: [PATCH 05/52] temporarily added pr trigger for testing --- .github/workflows/update-timestamps.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index d6b729d02..5904f593a 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -1,6 +1,7 @@ name: Check for new Release Train snapshots on: workflow_dispatch: + pull_request: schedule: - cron: '0 7 * * *' # Run at 7am on default branch From f1f486b85df2d21cba042d1450c8699cf8e523bc Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 20 Dec 2024 13:31:04 +0000 Subject: [PATCH 06/52] fixed outputs --- .github/workflows/update-timestamps.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 5904f593a..9337f590d 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -7,6 +7,8 @@ on: jobs: upstream_check: + outputs: + timestamps_changed: "{{ steps.timestamp_check.outputs.timestamps_changed }}" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -39,13 +41,15 @@ jobs: git push build_fatimage: - if: "${{ steps.timestamp_check.outputs.timestamps_changed }} == 0" + if: "${{ needs.upstream_check.outputs.timestamps_changed }} == 0" needs: upstream_check uses: ./.github/workflows/fatimage.yml ci_and_pr: - if: "${{ steps.timestamp_check.outputs.timestamps_changed }} == 0" - needs: build_fatimage + if: "${{ needs.upstream_check.outputs.timestamps_changed }} == 0" + needs: + - upstream_check + - build_fatimage runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 333ac6e26ea2ca6f4511377f89aeef444eb57fd5 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 20 Dec 2024 13:33:19 +0000 Subject: [PATCH 07/52] fixed fatimage outputs --- .github/workflows/fatimage.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fatimage.yml b/.github/workflows/fatimage.yml index d4f20765e..f339249ea 100644 --- a/.github/workflows/fatimage.yml +++ b/.github/workflows/fatimage.yml @@ -16,8 +16,12 @@ on: type: string default: LEAFCLOUD outputs: - openhpc-RL8-image: ${{ steps.manifest.outputs.openhpc-RL8-image }} - openhpc-RL9-image: ${{ steps.manifest.outputs.openhpc-RL9-image }} + openhpc-RL8-image: + description: "RL8 image" + value: "${{ jobs.openstack.outputs.openhpc-RL8-image }}" + openhpc-RL9-image: + description: "RL9 image" + value: "${{ jobs.openstack.outputs.openhpc-RL9-image }}" jobs: openstack: @@ -42,6 +46,9 @@ jobs: CI_CLOUD: ${{ github.event.inputs.ci_cloud }} ARK_PASSWORD: ${{ secrets.ARK_PASSWORD }} LEAFCLOUD_PULP_PASSWORD: ${{ secrets.LEAFCLOUD_PULP_PASSWORD }} + outputs: + openhpc-RL8-image: "${{ steps.manifest.outputs.openhpc-RL8-image }}" + openhpc-RL9-image: "${{ steps.manifest.outputs.openhpc-RL9-image }}" steps: - uses: actions/checkout@v2 From 90f8e7a1a78b42dfbdc615cf93fe564c1236f888 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 20 Dec 2024 13:46:14 +0000 Subject: [PATCH 08/52] fixed environment --- .github/workflows/update-timestamps.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 9337f590d..62b78d724 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -15,6 +15,7 @@ jobs: - name: Setup environment run: | + dev/setup-env.sh . venv/bin/activate . environments/.stackhpc/activate From bf14c8a0c3bd57939401f9cf7de89cdc3c31b23e Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 20 Dec 2024 13:56:27 +0000 Subject: [PATCH 09/52] testing on branch --- .github/workflows/update-timestamps.yml | 4 +++- ansible/ci/update_timestamps.yml | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 62b78d724..c48c08d69 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -1,7 +1,7 @@ name: Check for new Release Train snapshots on: workflow_dispatch: - pull_request: + pull_request: #temporary schedule: - cron: '0 7 * * *' # Run at 7am on default branch @@ -12,6 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: #temporary + ref: feat/auto-bump-timestamps #temporary - name: Setup environment run: | diff --git a/ansible/ci/update_timestamps.yml b/ansible/ci/update_timestamps.yml index b612531b3..16d0f0216 100644 --- a/ansible/ci/update_timestamps.yml +++ b/ansible/ci/update_timestamps.yml @@ -1,5 +1,8 @@ - hosts: localhost tasks: + - name: test + debug: + var: appliances_repo_timestamps - name: Get latest timestamps from sources latest_timestamps: repos_dict: "{{ appliances_pulp_repos }}" From 4771f5c82e4b8a3ec393d89aac7dea2f34101903 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 20 Dec 2024 14:18:17 +0000 Subject: [PATCH 10/52] moved to one step environment --- .github/workflows/update-timestamps.yml | 10 +++------- ansible/ci/update_timestamps.yml | 3 --- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index c48c08d69..b1d7a9bd6 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -15,17 +15,13 @@ jobs: with: #temporary ref: feat/auto-bump-timestamps #temporary - - name: Setup environment + - name: Check for updated Ark timestamps and replace in defaults.yml run: | dev/setup-env.sh . venv/bin/activate . environments/.stackhpc/activate - - - name: Switch to automation branch - run: git checkout -b auto/bump-timestamps || git checkout auto/bump-timestamps - - - name: Check for updated Ark timestamps and replace in defaults.yml - run: ansible-playbook ansible/ci/update_timestamps.yml + git checkout -b auto/bump-timestamps || git checkout auto/bump-timestamps + ansible-playbook ansible/ci/update_timestamps.yml - name: Check if timestamps were changed id: timestamp_check diff --git a/ansible/ci/update_timestamps.yml b/ansible/ci/update_timestamps.yml index 16d0f0216..b612531b3 100644 --- a/ansible/ci/update_timestamps.yml +++ b/ansible/ci/update_timestamps.yml @@ -1,8 +1,5 @@ - hosts: localhost tasks: - - name: test - debug: - var: appliances_repo_timestamps - name: Get latest timestamps from sources latest_timestamps: repos_dict: "{{ appliances_pulp_repos }}" From 664c9dbeb05075b12c60e5ef699e459acc35107e Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 20 Dec 2024 14:24:50 +0000 Subject: [PATCH 11/52] prevent exit on failure checks --- .github/workflows/update-timestamps.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index b1d7a9bd6..9aa63fd11 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -21,11 +21,12 @@ jobs: . venv/bin/activate . environments/.stackhpc/activate git checkout -b auto/bump-timestamps || git checkout auto/bump-timestamps - ansible-playbook ansible/ci/update_timestamps.yml + ansible-playbook ansible/ci/update_timestamps.yml -v - name: Check if timestamps were changed id: timestamp_check run: | + set +e git diff --quiet echo "timestamps_changed=$?" >> "$GITHUB_OUTPUT" @@ -70,6 +71,7 @@ jobs: - name: Check if PR exists id: pr-check run: | + set +e gh pr list --json headRefName --jq '.[].headRefName' | grep auto/bump-timestamps echo "pr_exists=$?" >> "$GITHUB_OUTPUT" From 94b5eeffc300335fb60af22b666f36aa77ac2a97 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 20 Dec 2024 14:28:18 +0000 Subject: [PATCH 12/52] auto sets upstream branch --- .github/workflows/update-timestamps.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 9aa63fd11..3b78edc9b 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -38,6 +38,7 @@ jobs: git config user.name 'github-actions[bot]' git config user.email 'github-actions[bot]@users.noreply.github.com' git commit -m "Bumped repo timestamps" + git config --global --add --bool push.autoSetupRemote true git push build_fatimage: From 5088fdfb156a298bdbce73f530b883f5ca63c1a5 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 20 Dec 2024 14:52:04 +0000 Subject: [PATCH 13/52] fixed outdated var and moved fatimage to bumped branch --- .github/workflows/fatimage.yml | 16 ++++++++++++++++ .github/workflows/update-timestamps.yml | 5 +++-- ansible/ci/update_timestamps.yml | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fatimage.yml b/.github/workflows/fatimage.yml index f339249ea..f8e9d8923 100644 --- a/.github/workflows/fatimage.yml +++ b/.github/workflows/fatimage.yml @@ -15,6 +15,9 @@ on: ci_cloud: type: string default: LEAFCLOUD + branch: + type: string + default: "${{ github.ref }}" outputs: openhpc-RL8-image: description: "RL8 image" @@ -51,7 +54,20 @@ jobs: openhpc-RL9-image: "${{ steps.manifest.outputs.openhpc-RL9-image }}" steps: + + - name: Get current context + id: get_branch + run: | + if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then + target_branch=${{ github.ref }} + else + target_branch=${{ github.event.inputs.branch }} + fi + echo "target_branch=$target_branch" >> "$GITHUB_OUTPUT" + - uses: actions/checkout@v2 + with: + ref: ${{ steps.get_branch.outputs.target_branch }} - name: Record settings for CI cloud run: | diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 3b78edc9b..0b90d003b 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -12,8 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - with: #temporary - ref: feat/auto-bump-timestamps #temporary - name: Check for updated Ark timestamps and replace in defaults.yml run: | @@ -45,6 +43,9 @@ jobs: if: "${{ needs.upstream_check.outputs.timestamps_changed }} == 0" needs: upstream_check uses: ./.github/workflows/fatimage.yml + with: + ci_cloud: LEAFCLOUD + branch: auto/bump-timestamps ci_and_pr: if: "${{ needs.upstream_check.outputs.timestamps_changed }} == 0" diff --git a/ansible/ci/update_timestamps.yml b/ansible/ci/update_timestamps.yml index b612531b3..c9ea78b1a 100644 --- a/ansible/ci/update_timestamps.yml +++ b/ansible/ci/update_timestamps.yml @@ -18,5 +18,5 @@ {{ yaml_template | to_nice_yaml(indent=2) }} vars: yaml_template: - appliances_repo_timestamps: "{{ _result.latest_dict }}" + appliances_pulp_repos: "{{ _result.latest_dict }}" when: (_result.changed_timestamps | count) > 0 From a59e6f753adace09c83f33ed65102ccbc29e030e Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 20 Dec 2024 15:17:27 +0000 Subject: [PATCH 14/52] fixed not picking up existing changes on automation branch --- .github/workflows/update-timestamps.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 0b90d003b..1227e3ca7 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -18,7 +18,8 @@ jobs: dev/setup-env.sh . venv/bin/activate . environments/.stackhpc/activate - git checkout -b auto/bump-timestamps || git checkout auto/bump-timestamps + git checkout auto/bump-timestamps || git checkout -b auto/bump-timestamps + git pull origin auto/bump-timestamps ansible-playbook ansible/ci/update_timestamps.yml -v - name: Check if timestamps were changed From e45bb31fb39495659ec4daed06bfc30b0f333897 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 20 Dec 2024 15:48:09 +0000 Subject: [PATCH 15/52] should now checkout branches correctly --- .github/workflows/fatimage.yml | 16 --------------- .github/workflows/update-timestamps.yml | 27 ++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.github/workflows/fatimage.yml b/.github/workflows/fatimage.yml index f8e9d8923..f339249ea 100644 --- a/.github/workflows/fatimage.yml +++ b/.github/workflows/fatimage.yml @@ -15,9 +15,6 @@ on: ci_cloud: type: string default: LEAFCLOUD - branch: - type: string - default: "${{ github.ref }}" outputs: openhpc-RL8-image: description: "RL8 image" @@ -54,20 +51,7 @@ jobs: openhpc-RL9-image: "${{ steps.manifest.outputs.openhpc-RL9-image }}" steps: - - - name: Get current context - id: get_branch - run: | - if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then - target_branch=${{ github.ref }} - else - target_branch=${{ github.event.inputs.branch }} - fi - echo "target_branch=$target_branch" >> "$GITHUB_OUTPUT" - - uses: actions/checkout@v2 - with: - ref: ${{ steps.get_branch.outputs.target_branch }} - name: Record settings for CI cloud run: | diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 1227e3ca7..8b22b2b97 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -13,13 +13,32 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Check automation branch exists + id: auto-branch-check + run: | + git fetch + branches=$(git branch -r) + set +e + echo $branches | grep auto/bump-timestamps + branch_exists="$?" + echo "branch_exists=$branch_exists" >> "$GITHUB_OUTPUT" + + - name: Create automation branch + if: steps.auto-branch-check.outputs.branch_exists == '1' + run: | + git checkout -b auto/bump-timestamps + git config --global --add --bool push.autoSetupRemote true + git push + + - uses: actions/checkout@v2 + with: + ref: auto/bump-timestamps + - name: Check for updated Ark timestamps and replace in defaults.yml run: | dev/setup-env.sh . venv/bin/activate . environments/.stackhpc/activate - git checkout auto/bump-timestamps || git checkout -b auto/bump-timestamps - git pull origin auto/bump-timestamps ansible-playbook ansible/ci/update_timestamps.yml -v - name: Check if timestamps were changed @@ -43,7 +62,7 @@ jobs: build_fatimage: if: "${{ needs.upstream_check.outputs.timestamps_changed }} == 0" needs: upstream_check - uses: ./.github/workflows/fatimage.yml + uses: stackhpc/ansible-slurm-appliance/.github/workflows/fatimage.yml@auto/bump-timestamps with: ci_cloud: LEAFCLOUD branch: auto/bump-timestamps @@ -56,6 +75,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + ref: auto/bump-timestamps - name: Bump CI with new images run: | From 58e0af8693d0d77266b5897949d5fddf5e4ee158 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 20 Dec 2024 16:50:56 +0000 Subject: [PATCH 16/52] fixes --- .github/workflows/update-timestamps.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 8b22b2b97..ca0280c83 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -50,7 +50,7 @@ jobs: # TODO: find way to stop CI running if pushing to existing PR - name: Push new timestamps - if: "${{ steps.timestamp_check.outputs.timestamps_changed }} == 0" + if: steps.timestamp_check.outputs.timestamps_changed == '1' run: | git add environments/common/inventory/group_vars/all/defaults.yml git config user.name 'github-actions[bot]' @@ -59,16 +59,16 @@ jobs: git config --global --add --bool push.autoSetupRemote true git push + # todo: don't skip if rerun build_fatimage: - if: "${{ needs.upstream_check.outputs.timestamps_changed }} == 0" + if: needs.upstream_check.outputs.timestamps_changed == '1' needs: upstream_check uses: stackhpc/ansible-slurm-appliance/.github/workflows/fatimage.yml@auto/bump-timestamps with: ci_cloud: LEAFCLOUD - branch: auto/bump-timestamps ci_and_pr: - if: "${{ needs.upstream_check.outputs.timestamps_changed }} == 0" + if: needs.upstream_check.outputs.timestamps_changed == '1' needs: - upstream_check - build_fatimage @@ -100,5 +100,5 @@ jobs: echo "pr_exists=$?" >> "$GITHUB_OUTPUT" - name: Create PR - if: ${{ steps.pr-check.outputs.pr_exists }} + if: steps.pr-check.outputs.pr_exists run: gh pr create --title "[Auto] Bump repo timestamps to latest" --base main --head auto/bump-timestamps From dd4ace08609e5eb2580cc7911d1b3bfc64609486 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 2 Jan 2025 08:56:19 +0000 Subject: [PATCH 17/52] fatimage now only created if head is timestamp commit --- .github/workflows/update-timestamps.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index ca0280c83..f11ac8267 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -8,7 +8,7 @@ on: jobs: upstream_check: outputs: - timestamps_changed: "{{ steps.timestamp_check.outputs.timestamps_changed }}" + new_fatimage: "{{ steps.fatimage_check.outputs.new_fatimage }}" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -56,19 +56,35 @@ jobs: git config user.name 'github-actions[bot]' git config user.email 'github-actions[bot]@users.noreply.github.com' git commit -m "Bumped repo timestamps" + git notes add -m "timestamp_bump_commit" git config --global --add --bool push.autoSetupRemote true git push + + - name: Check if new fatimage needed + id: fatimage_check + run: | + NEED_NEW_IMAGE=false + set +e + if $(git notes show) ; then + HEAD_NOTES=$(git notes show) + if [[ $HEAD_NOTES == "timestamp_bump_commit" ]] ; then + NEED_NEW_IMAGE=true + fi + fi + set -e + echo "new_fatimage=$NEED_NEW_IMAGE" >> "$GITHUB_OUTPUT" + # todo: don't skip if rerun build_fatimage: - if: needs.upstream_check.outputs.timestamps_changed == '1' + if: needs.upstream_check.outputs.new_fatimage == 'true' needs: upstream_check uses: stackhpc/ansible-slurm-appliance/.github/workflows/fatimage.yml@auto/bump-timestamps with: ci_cloud: LEAFCLOUD ci_and_pr: - if: needs.upstream_check.outputs.timestamps_changed == '1' + if: needs.upstream_check.outputs.new_fatimage == 'true' needs: - upstream_check - build_fatimage From a2b05ba4700208fe6391d6b1b3606fdb47955b3d Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 2 Jan 2025 09:02:20 +0000 Subject: [PATCH 18/52] ci rerun --- .github/workflows/update-timestamps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index f11ac8267..3de8895c6 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -1,7 +1,7 @@ name: Check for new Release Train snapshots on: workflow_dispatch: - pull_request: #temporary + pull_request: #temporary schedule: - cron: '0 7 * * *' # Run at 7am on default branch From 7242f6c7b9e6bb670e00284f78a0973a661bac3d Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 2 Jan 2025 09:12:18 +0000 Subject: [PATCH 19/52] fixed notes not being pushed --- .github/workflows/update-timestamps.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 3de8895c6..ec8b66dfe 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -59,6 +59,7 @@ jobs: git notes add -m "timestamp_bump_commit" git config --global --add --bool push.autoSetupRemote true git push + git push origin 'refs/notes/*' - name: Check if new fatimage needed id: fatimage_check From 1efd6787ea0e5ef0119ea26e3d3c414d7d9bd54c Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 2 Jan 2025 09:26:49 +0000 Subject: [PATCH 20/52] fixed notes --- .github/workflows/update-timestamps.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index ec8b66dfe..d1e675fc7 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -52,14 +52,15 @@ jobs: - name: Push new timestamps if: steps.timestamp_check.outputs.timestamps_changed == '1' run: | + git fetch origin refs/notes/*:refs/notes/* git add environments/common/inventory/group_vars/all/defaults.yml git config user.name 'github-actions[bot]' git config user.email 'github-actions[bot]@users.noreply.github.com' git commit -m "Bumped repo timestamps" - git notes add -m "timestamp_bump_commit" + git notes add --force -m "timestamp_bump_commit" git config --global --add --bool push.autoSetupRemote true git push - git push origin 'refs/notes/*' + git push origin refs/notes/* - name: Check if new fatimage needed id: fatimage_check From 533bb7cb1de27e35e4c22abd9ec42b2eaa70a578 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 2 Jan 2025 09:42:18 +0000 Subject: [PATCH 21/52] fixed fatimage check --- .github/workflows/update-timestamps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index d1e675fc7..b31c3db39 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -67,7 +67,7 @@ jobs: run: | NEED_NEW_IMAGE=false set +e - if $(git notes show) ; then + if git notes show ; then HEAD_NOTES=$(git notes show) if [[ $HEAD_NOTES == "timestamp_bump_commit" ]] ; then NEED_NEW_IMAGE=true From b2302eee8beb70d2c680be152bfe96d1f970242d Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 2 Jan 2025 10:03:44 +0000 Subject: [PATCH 22/52] debug logging --- .github/workflows/update-timestamps.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index b31c3db39..7af733347 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -65,6 +65,7 @@ jobs: - name: Check if new fatimage needed id: fatimage_check run: | + git fetch origin refs/notes/*:refs/notes/* NEED_NEW_IMAGE=false set +e if git notes show ; then @@ -74,8 +75,16 @@ jobs: fi fi set -e + echo $NEED_NEW_IMAGE echo "new_fatimage=$NEED_NEW_IMAGE" >> "$GITHUB_OUTPUT" + debug: + needs: + - upstream_check + runs-on: ubuntu-latest + steps: + - name: Debug + run: echo "${{ needs.upstream_check.outputs.new_fatimage }}" # todo: don't skip if rerun build_fatimage: From cacce1582182623b9c4dfd5d88470c7ab74cfca9 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 2 Jan 2025 10:07:12 +0000 Subject: [PATCH 23/52] testing with strings --- .github/workflows/update-timestamps.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 7af733347..f6f25e327 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -66,12 +66,12 @@ jobs: id: fatimage_check run: | git fetch origin refs/notes/*:refs/notes/* - NEED_NEW_IMAGE=false + NEED_NEW_IMAGE="false" set +e if git notes show ; then HEAD_NOTES=$(git notes show) if [[ $HEAD_NOTES == "timestamp_bump_commit" ]] ; then - NEED_NEW_IMAGE=true + NEED_NEW_IMAGE="true" fi fi set -e From 1a5d3a3b61242ef4927d7f0be79a989dc27066df Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 2 Jan 2025 10:30:03 +0000 Subject: [PATCH 24/52] ci test --- .github/workflows/update-timestamps.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index f6f25e327..d3bb72d06 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -84,7 +84,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Debug - run: echo "${{ needs.upstream_check.outputs.new_fatimage }}" + run: echo "$TST" + env: + TST: ${{ needs.upstream_check.outputs.new_fatimage }} # todo: don't skip if rerun build_fatimage: From 022f2a5270e8f911ec66fc032409abb356d2bcbb Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 2 Jan 2025 10:39:23 +0000 Subject: [PATCH 25/52] fixed outputs --- .github/workflows/update-timestamps.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index d3bb72d06..37ab2eba1 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -8,7 +8,7 @@ on: jobs: upstream_check: outputs: - new_fatimage: "{{ steps.fatimage_check.outputs.new_fatimage }}" + new_fatimage: "${{ steps.fatimage_check.outputs.new_fatimage }}" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -77,18 +77,7 @@ jobs: set -e echo $NEED_NEW_IMAGE echo "new_fatimage=$NEED_NEW_IMAGE" >> "$GITHUB_OUTPUT" - - debug: - needs: - - upstream_check - runs-on: ubuntu-latest - steps: - - name: Debug - run: echo "$TST" - env: - TST: ${{ needs.upstream_check.outputs.new_fatimage }} - # todo: don't skip if rerun build_fatimage: if: needs.upstream_check.outputs.new_fatimage == 'true' needs: upstream_check From 16fdb9cf8063599bb94a0a78ba7b547ba530b05d Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 2 Jan 2025 10:51:50 +0000 Subject: [PATCH 26/52] fixed inputs not being passed --- .github/workflows/fatimage.yml | 2 +- .github/workflows/update-timestamps.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fatimage.yml b/.github/workflows/fatimage.yml index f339249ea..e4bdc2259 100644 --- a/.github/workflows/fatimage.yml +++ b/.github/workflows/fatimage.yml @@ -43,7 +43,7 @@ jobs: env: ANSIBLE_FORCE_COLOR: True OS_CLOUD: openstack - CI_CLOUD: ${{ github.event.inputs.ci_cloud }} + CI_CLOUD: ${{ inputs.ci_cloud }} ARK_PASSWORD: ${{ secrets.ARK_PASSWORD }} LEAFCLOUD_PULP_PASSWORD: ${{ secrets.LEAFCLOUD_PULP_PASSWORD }} outputs: diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 37ab2eba1..0f453356f 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -81,9 +81,10 @@ jobs: build_fatimage: if: needs.upstream_check.outputs.new_fatimage == 'true' needs: upstream_check + secrets: inherit uses: stackhpc/ansible-slurm-appliance/.github/workflows/fatimage.yml@auto/bump-timestamps with: - ci_cloud: LEAFCLOUD + ci_cloud: 'LEAFCLOUD' ci_and_pr: if: needs.upstream_check.outputs.new_fatimage == 'true' From 762a241c44b7f202303900589fc0d155850c469c Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 2 Jan 2025 11:42:17 +0000 Subject: [PATCH 27/52] separate input for workflow_call --- .github/workflows/fatimage.yml | 4 ++-- .github/workflows/update-timestamps.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fatimage.yml b/.github/workflows/fatimage.yml index e4bdc2259..a586d39c3 100644 --- a/.github/workflows/fatimage.yml +++ b/.github/workflows/fatimage.yml @@ -12,7 +12,7 @@ on: - ARCUS workflow_call: inputs: - ci_cloud: + ci_cloud_override: type: string default: LEAFCLOUD outputs: @@ -43,7 +43,7 @@ jobs: env: ANSIBLE_FORCE_COLOR: True OS_CLOUD: openstack - CI_CLOUD: ${{ inputs.ci_cloud }} + CI_CLOUD: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ci_cloud || inputs.ci_cloud_override }} ARK_PASSWORD: ${{ secrets.ARK_PASSWORD }} LEAFCLOUD_PULP_PASSWORD: ${{ secrets.LEAFCLOUD_PULP_PASSWORD }} outputs: diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 0f453356f..7698ce56d 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -84,7 +84,7 @@ jobs: secrets: inherit uses: stackhpc/ansible-slurm-appliance/.github/workflows/fatimage.yml@auto/bump-timestamps with: - ci_cloud: 'LEAFCLOUD' + ci_cloud_override: 'LEAFCLOUD' ci_and_pr: if: needs.upstream_check.outputs.new_fatimage == 'true' From 4a1cfc06eaf46476f368f2472abcb9186ce44d59 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 2 Jan 2025 11:52:55 +0000 Subject: [PATCH 28/52] comment --- .github/workflows/fatimage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fatimage.yml b/.github/workflows/fatimage.yml index a586d39c3..fe55a4fec 100644 --- a/.github/workflows/fatimage.yml +++ b/.github/workflows/fatimage.yml @@ -43,7 +43,7 @@ jobs: env: ANSIBLE_FORCE_COLOR: True OS_CLOUD: openstack - CI_CLOUD: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ci_cloud || inputs.ci_cloud_override }} + CI_CLOUD: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ci_cloud || inputs.ci_cloud_override }} # workaround for not being able to define string and choice in separate events ARK_PASSWORD: ${{ secrets.ARK_PASSWORD }} LEAFCLOUD_PULP_PASSWORD: ${{ secrets.LEAFCLOUD_PULP_PASSWORD }} outputs: From 636cee386ee2ecf5f2ae563dfb59dc9ba6a0df77 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 2 Jan 2025 12:50:37 +0000 Subject: [PATCH 29/52] added gh token --- .github/workflows/update-timestamps.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 7698ce56d..97803060a 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -121,3 +121,5 @@ jobs: - name: Create PR if: steps.pr-check.outputs.pr_exists run: gh pr create --title "[Auto] Bump repo timestamps to latest" --base main --head auto/bump-timestamps + env: + GH_TOKEN: ${{ github.token }} From 3f76a7c4d56303835bbcb423f89e7244d4d1404e Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 2 Jan 2025 13:11:19 +0000 Subject: [PATCH 30/52] made more idempotent + terraform typo --- .github/workflows/update-timestamps.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 97803060a..fb3d422c8 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -86,21 +86,18 @@ jobs: with: ci_cloud_override: 'LEAFCLOUD' - ci_and_pr: + bump_timestamps: if: needs.upstream_check.outputs.new_fatimage == 'true' - needs: - - upstream_check - - build_fatimage + needs: build_fatimage runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: ref: auto/bump-timestamps - - name: Bump CI with new images run: | git checkout auto/bump-timestamps - sed -i 's/"RL8".*$/"RL8": "${{ needs.build_fatimage.outputs.openhpc-RL8-image }}"/' environments/.stackhpc/terraform/cluster_image.auto.tfvars.json + sed -i 's/"RL8".*$/"RL8": "${{ needs.build_fatimage.outputs.openhpc-RL8-image }},"/' environments/.stackhpc/terraform/cluster_image.auto.tfvars.json sed -i 's/"RL9".*$/"RL9": "${{ needs.build_fatimage.outputs.openhpc-RL9-image }}"/' environments/.stackhpc/terraform/cluster_image.auto.tfvars.json - name: Push new images @@ -111,6 +108,14 @@ jobs: git commit -m "Bumped images" git push + create_pr: + needs: bump_timestamps + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: auto/bump-timestamps + - name: Check if PR exists id: pr-check run: | From a709ee756e4083bc593160eae470c13f8ee49a52 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 2 Jan 2025 13:52:15 +0000 Subject: [PATCH 31/52] added body to PR --- .github/workflows/update-timestamps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index fb3d422c8..98e70e8c8 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -125,6 +125,6 @@ jobs: - name: Create PR if: steps.pr-check.outputs.pr_exists - run: gh pr create --title "[Auto] Bump repo timestamps to latest" --base main --head auto/bump-timestamps + run: gh pr create --title "[Auto] Bump repo timestamps to latest" --base main --head auto/bump-timestamps --body "Updated Release Train timestamps in defaults.yml with latest from Ark" env: GH_TOKEN: ${{ github.token }} From 7ba077ada418afac4f637bac483b96f9adea6f27 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 2 Jan 2025 13:58:41 +0000 Subject: [PATCH 32/52] fixed idempotency --- .github/workflows/update-timestamps.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 98e70e8c8..899d85ba4 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -110,6 +110,7 @@ jobs: create_pr: needs: bump_timestamps + if: always() && (needs.bump_timestamps.result == 'skipped' || needs.bump_timestamps.result == 'success') runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 365e54f1a2e448c3a4ae0a89bb3ebf109f3c0110 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 3 Jan 2025 09:44:36 +0000 Subject: [PATCH 33/52] fixed not failing if branch hasn't been created --- .github/workflows/fatimage.yml | 7 ++++++- .github/workflows/update-timestamps.yml | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fatimage.yml b/.github/workflows/fatimage.yml index fe55a4fec..d09291a25 100644 --- a/.github/workflows/fatimage.yml +++ b/.github/workflows/fatimage.yml @@ -15,6 +15,9 @@ on: ci_cloud_override: type: string default: LEAFCLOUD + target_branch: + type: string + default: ${{ github.ref }} outputs: openhpc-RL8-image: description: "RL8 image" @@ -51,7 +54,9 @@ jobs: openhpc-RL9-image: "${{ steps.manifest.outputs.openhpc-RL9-image }}" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + ref: ${{ github.event_name == 'workflow_dispatch' && github.ref || inputs.target_branch }} - name: Record settings for CI cloud run: | diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 899d85ba4..a11f026bd 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -82,9 +82,10 @@ jobs: if: needs.upstream_check.outputs.new_fatimage == 'true' needs: upstream_check secrets: inherit - uses: stackhpc/ansible-slurm-appliance/.github/workflows/fatimage.yml@auto/bump-timestamps + uses: ./.github/workflows/fatimage.yml with: ci_cloud_override: 'LEAFCLOUD' + target_branch: auto/bump-timestamps bump_timestamps: if: needs.upstream_check.outputs.new_fatimage == 'true' From 011640bd8a515483595e2a9fe5103797a26477b4 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 3 Jan 2025 14:24:23 +0000 Subject: [PATCH 34/52] typo --- .github/workflows/update-timestamps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index a11f026bd..3c7f45971 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -98,7 +98,7 @@ jobs: - name: Bump CI with new images run: | git checkout auto/bump-timestamps - sed -i 's/"RL8".*$/"RL8": "${{ needs.build_fatimage.outputs.openhpc-RL8-image }},"/' environments/.stackhpc/terraform/cluster_image.auto.tfvars.json + sed -i 's/"RL8".*$/"RL8": "${{ needs.build_fatimage.outputs.openhpc-RL8-image }}",/' environments/.stackhpc/terraform/cluster_image.auto.tfvars.json sed -i 's/"RL9".*$/"RL9": "${{ needs.build_fatimage.outputs.openhpc-RL9-image }}"/' environments/.stackhpc/terraform/cluster_image.auto.tfvars.json - name: Push new images From 71b2226e0f849323d5f6dcd56deacaac8bfe6209 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 3 Jan 2025 14:57:07 +0000 Subject: [PATCH 35/52] Automatically triggers CI and comments result --- .github/workflows/fatimage.yml | 2 +- .github/workflows/stackhpc.yml | 9 ++++++++- .github/workflows/update-timestamps.yml | 24 ++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fatimage.yml b/.github/workflows/fatimage.yml index f0065130e..f63e55701 100644 --- a/.github/workflows/fatimage.yml +++ b/.github/workflows/fatimage.yml @@ -56,7 +56,7 @@ jobs: steps: - uses: actions/checkout@v3 with: - ref: ${{ github.event_name == 'workflow_dispatch' && github.ref || inputs.target_branch }} + ref: ${{ github.event_name != 'workflow_call' && github.ref || inputs.target_branch }} - name: Record settings for CI cloud run: | diff --git a/.github/workflows/stackhpc.yml b/.github/workflows/stackhpc.yml index b08854adb..b32ef4a2d 100644 --- a/.github/workflows/stackhpc.yml +++ b/.github/workflows/stackhpc.yml @@ -2,6 +2,11 @@ name: Test deployment and reimage on OpenStack on: workflow_dispatch: + workflow_call: + inputs: + target_branch: + type: string + default: ${{ github.ref }} push: branches: - main @@ -44,7 +49,9 @@ jobs: CI_CLOUD: ${{ vars.CI_CLOUD }} # default from repo settings TF_VAR_os_version: ${{ matrix.os_version }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + ref: ${{ github.event_name != 'workflow_call' && github.ref || inputs.target_branch }} - name: Override CI_CLOUD if PR label is present if: ${{ github.event_name == 'pull_request' }} diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 3c7f45971..9d200a810 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -130,3 +130,27 @@ jobs: run: gh pr create --title "[Auto] Bump repo timestamps to latest" --base main --head auto/bump-timestamps --body "Updated Release Train timestamps in defaults.yml with latest from Ark" env: GH_TOKEN: ${{ github.token }} + + run_ci: + needs: bump_timestamps + uses: ./.github/workflows/stackhpc.yml + with: + target_branch: auto/bump-timestamps + + comment_result: + if: always() && (needs.run_ci.result == 'failure' || needs.run_ci.result == 'success') && (needs.create_pr.result == 'skipped' || needs.create_pr.result == 'success') + needs: + - run_ci + - create_pr + runs-on: ubuntu-latest + steps: + - name: Checkout branch + uses: actions/checkout@v3 + with: + ref: auto/bump-timestamps + + - name: Comment CI status + uses: thollander/actions-comment-pull-request@v1 + with: + message: 'CI ${{ needs.run_ci.result }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From efe42b61226055b6a4a170ae68a545988b279ad3 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 3 Jan 2025 16:42:21 +0000 Subject: [PATCH 36/52] fixed comment on wrong PR + CI secrets --- .github/workflows/update-timestamps.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 9d200a810..259bcbf69 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -134,6 +134,7 @@ jobs: run_ci: needs: bump_timestamps uses: ./.github/workflows/stackhpc.yml + secrets: inherit with: target_branch: auto/bump-timestamps @@ -146,11 +147,16 @@ jobs: steps: - name: Checkout branch uses: actions/checkout@v3 - with: - ref: auto/bump-timestamps + + - name: Get created PR number + id: number_check + run: | + PR_NUMBER=$(gh pr list --head auto/bump-timestamps --state open --json number --jq .[0].number) + echo "pr_number=$PR_NUMBER" >> "$GITHUB_OUTPUT" - name: Comment CI status uses: thollander/actions-comment-pull-request@v1 with: message: 'CI ${{ needs.run_ci.result }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + pr_number: steps.number_check.outputs.pr_number From 5e71afa56e289bae256fc201d3775bb0725b3f6e Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 3 Jan 2025 16:50:42 +0000 Subject: [PATCH 37/52] fixed PR idempotency --- .github/workflows/update-timestamps.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 259bcbf69..29724dc19 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -123,10 +123,11 @@ jobs: run: | set +e gh pr list --json headRefName --jq '.[].headRefName' | grep auto/bump-timestamps - echo "pr_exists=$?" >> "$GITHUB_OUTPUT" + PR_EXISTS=$? + echo "pr_exists=$PR_EXISTS" >> "$GITHUB_OUTPUT" - name: Create PR - if: steps.pr-check.outputs.pr_exists + if: steps.pr-check.outputs.pr_exists == '0' run: gh pr create --title "[Auto] Bump repo timestamps to latest" --base main --head auto/bump-timestamps --body "Updated Release Train timestamps in defaults.yml with latest from Ark" env: GH_TOKEN: ${{ github.token }} From 921b565a6dfe4cf8ec11a6fb1ab546ab969336a2 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Mon, 6 Jan 2025 08:22:36 +0000 Subject: [PATCH 38/52] CI now always runs on image bump --- .github/workflows/update-timestamps.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 29724dc19..c02cf3724 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -133,7 +133,10 @@ jobs: GH_TOKEN: ${{ github.token }} run_ci: - needs: bump_timestamps + needs: + - bump_timestamps + - upstream_check + if: always() && (needs.bump_timestamps.result == 'success' || needs.upstream_check.outputs.new_fatimage == 'false') # should always run only on image bump commits uses: ./.github/workflows/stackhpc.yml secrets: inherit with: From 726dba275f988cfb02568a6d022766d6b291e1da Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Mon, 6 Jan 2025 12:01:43 +0000 Subject: [PATCH 39/52] fixed fatimage and ci not running on target branch --- .github/actions/is_callee/action.yml | 21 +++++++++++++++++++++ .github/workflows/fatimage.yml | 7 ++++++- .github/workflows/stackhpc.yml | 7 ++++++- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .github/actions/is_callee/action.yml diff --git a/.github/actions/is_callee/action.yml b/.github/actions/is_callee/action.yml new file mode 100644 index 000000000..3c4c4eec3 --- /dev/null +++ b/.github/actions/is_callee/action.yml @@ -0,0 +1,21 @@ +name: Check if being used as reusable workflow +description: Determines if running as part of a reusable workflow by checking if the specified current workflow file is the same as the caller +inputs: + current_workflow_file: + required: true + description: The name of the workflow file this action is called from +outputs: + is_callee: + value: ${{ steps.workflows_match.outputs.is_callee }} + description: Returns 'true' (string) if called as a reusable workflow +runs: + using: "composite" + steps: + - id: workflows_match + run: | + if echo ${{ github.workflow_ref }} | grep ${{ inputs.current_workflow_file }}; then + echo "is_callee='false'" >> "$GITHUB_OUTPUT" + else + echo "is_callee='true'" >> "$GITHUB_OUTPUT" + fi + shell: bash diff --git a/.github/workflows/fatimage.yml b/.github/workflows/fatimage.yml index f63e55701..1b582aee1 100644 --- a/.github/workflows/fatimage.yml +++ b/.github/workflows/fatimage.yml @@ -54,9 +54,14 @@ jobs: openhpc-RL9-image: "${{ steps.manifest.outputs.openhpc-RL9-image }}" steps: + - uses: stackhpc/ansible-slurm-appliance/.github/actions/is_callee@feat/auto-bump-timestamps # todo: change to main once merges + id: callee_check + with: + current_workflow_file: fatimage.yml + - uses: actions/checkout@v3 with: - ref: ${{ github.event_name != 'workflow_call' && github.ref || inputs.target_branch }} + ref: ${{ steps.callee_check.outputs.is_callee && inputs.target_branch || github.ref }} - name: Record settings for CI cloud run: | diff --git a/.github/workflows/stackhpc.yml b/.github/workflows/stackhpc.yml index b32ef4a2d..6972c108a 100644 --- a/.github/workflows/stackhpc.yml +++ b/.github/workflows/stackhpc.yml @@ -49,9 +49,14 @@ jobs: CI_CLOUD: ${{ vars.CI_CLOUD }} # default from repo settings TF_VAR_os_version: ${{ matrix.os_version }} steps: + - uses: stackhpc/ansible-slurm-appliance/.github/actions/is_callee@feat/auto-bump-timestamps # todo: change to main once merges + id: callee_check + with: + current_workflow_file: stackhpc.yml + - uses: actions/checkout@v3 with: - ref: ${{ github.event_name != 'workflow_call' && github.ref || inputs.target_branch }} + ref: ${{ steps.callee_check.outputs.is_callee && inputs.target_branch || github.ref }} - name: Override CI_CLOUD if PR label is present if: ${{ github.event_name == 'pull_request' }} From 6782308cdafd2129f5dc65637e5e4c72c1a6a3ed Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Mon, 6 Jan 2025 15:56:07 +0000 Subject: [PATCH 40/52] Release train support for ceph repos --- ansible/roles/dnf_repos/defaults/main.yml | 3 +++ ansible/roles/pulp_site/defaults/main.yml | 2 ++ environments/common/inventory/group_vars/all/defaults.yml | 7 +++++++ .../common/inventory/group_vars/all/os-manila-mount.yml | 1 + requirements.yml | 2 +- 5 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 environments/common/inventory/group_vars/all/os-manila-mount.yml diff --git a/ansible/roles/dnf_repos/defaults/main.yml b/ansible/roles/dnf_repos/defaults/main.yml index 17114b49d..52a91c803 100644 --- a/ansible/roles/dnf_repos/defaults/main.yml +++ b/ansible/roles/dnf_repos/defaults/main.yml @@ -30,6 +30,9 @@ dnf_repos_repolist: - file: "{{ dnf_repos_version_filenames.extras }}" name: extras base_url: "{{ dnf_repos_pulp_content_url }}/{{ appliances_pulp_repos.extras[ansible_distribution_version] | appliances_repo_to_subpath }}" +- file: ceph + name: Ceph + base_url: "{{ dnf_repos_pulp_content_url }}/{{ appliances_pulp_repos.ceph[ansible_distribution_major_version] | appliances_repo_to_subpath }}" dnf_repos_epel_baseurl: "{{ dnf_repos_pulp_content_url }}/{{ appliances_pulp_repos.epel[ansible_distribution_major_version] | appliances_repo_to_subpath }}" dnf_repos_epel_description: "epel" diff --git a/ansible/roles/pulp_site/defaults/main.yml b/ansible/roles/pulp_site/defaults/main.yml index 081307b6a..a5b889b3c 100644 --- a/ansible/roles/pulp_site/defaults/main.yml +++ b/ansible/roles/pulp_site/defaults/main.yml @@ -22,6 +22,8 @@ pulp_site_rpm_info: subpath: "{{ appliances_pulp_repos.extras[pulp_site_target_distribution_version] | appliances_repo_to_subpath }}" - name: "epel-{{ pulp_site_target_distribution_version_major }}-{{ appliances_pulp_repos.epel[pulp_site_target_distribution_version_major].timestamp }}" subpath: "{{ appliances_pulp_repos.epel[pulp_site_target_distribution_version_major] | appliances_repo_to_subpath }}" +- name: "ceph-{{ pulp_site_target_distribution_version_major }}-{{ appliances_pulp_repos.ceph[pulp_site_target_distribution_version_major].timestamp }}" + subpath: "{{ appliances_pulp_repos.ceph[pulp_site_target_distribution_version_major] | appliances_repo_to_subpath }}" pulp_site_rpm_repo_defaults: remote_username: "{{ pulp_site_upstream_username }}" diff --git a/environments/common/inventory/group_vars/all/defaults.yml b/environments/common/inventory/group_vars/all/defaults.yml index f32d14c60..94b4367ff 100644 --- a/environments/common/inventory/group_vars/all/defaults.yml +++ b/environments/common/inventory/group_vars/all/defaults.yml @@ -151,3 +151,10 @@ appliances_pulp_repos: '8': timestamp: 20241216T235733 path: epel/8/Everything/x86_64 + ceph: + '8': + timestamp: 20231104T015751 + path: centos/8-stream/storage/x86_64/ceph-quincy + '9': + timestamp: 20241114T011240 + path: centos/9-stream/storage/x86_64/ceph-quincy diff --git a/environments/common/inventory/group_vars/all/os-manila-mount.yml b/environments/common/inventory/group_vars/all/os-manila-mount.yml new file mode 100644 index 000000000..9df62ea46 --- /dev/null +++ b/environments/common/inventory/group_vars/all/os-manila-mount.yml @@ -0,0 +1 @@ +os_manila_mount_ceph_rpm_repos: [] \ No newline at end of file diff --git a/requirements.yml b/requirements.yml index 7e71bb904..5eddb1acf 100644 --- a/requirements.yml +++ b/requirements.yml @@ -21,7 +21,7 @@ roles: version: v3.1.5 - src: https://github.com/stackhpc/ansible-role-os-manila-mount.git name: stackhpc.os-manila-mount - version: v24.11.0 # Support ceph quincy for RL9 + version: refactor/overridable-repos # TODO: change once merged collections: - name: containers.podman From 5f8346b3060e72047856bcb9b5e39c9afe7aa3d5 Mon Sep 17 00:00:00 2001 From: wtripp180901 <78219569+wtripp180901@users.noreply.github.com> Date: Tue, 7 Jan 2025 09:09:08 +0000 Subject: [PATCH 41/52] bump images --- .../.stackhpc/terraform/cluster_image.auto.tfvars.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/environments/.stackhpc/terraform/cluster_image.auto.tfvars.json b/environments/.stackhpc/terraform/cluster_image.auto.tfvars.json index f9e568c3f..00a53feb3 100644 --- a/environments/.stackhpc/terraform/cluster_image.auto.tfvars.json +++ b/environments/.stackhpc/terraform/cluster_image.auto.tfvars.json @@ -1,6 +1,6 @@ { "cluster_image": { - "RL8": "openhpc-RL8-250102-1138-77cfc703", - "RL9": "openhpc-RL9-250102-1139-77cfc703" + "RL8": "openhpc-RL8-250106-1559-6782308c", + "RL9": "openhpc-RL9-250106-1559-6782308c" } } From 08a2a993794ee3525b788d3d0aa8ac9b337ef408 Mon Sep 17 00:00:00 2001 From: wtripp180901 <78219569+wtripp180901@users.noreply.github.com> Date: Tue, 7 Jan 2025 10:10:38 +0000 Subject: [PATCH 42/52] Update requirements.yml --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 5eddb1acf..27f4e49cf 100644 --- a/requirements.yml +++ b/requirements.yml @@ -21,7 +21,7 @@ roles: version: v3.1.5 - src: https://github.com/stackhpc/ansible-role-os-manila-mount.git name: stackhpc.os-manila-mount - version: refactor/overridable-repos # TODO: change once merged + version: v25.1.0 collections: - name: containers.podman From 0edc12b5b193e20f9e677d50f421e729ec175b56 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Tue, 7 Jan 2025 15:08:56 +0000 Subject: [PATCH 43/52] bumped rocky 9 ceph repos to reef --- environments/common/inventory/group_vars/all/defaults.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/environments/common/inventory/group_vars/all/defaults.yml b/environments/common/inventory/group_vars/all/defaults.yml index 29f0372ce..e26bc3018 100644 --- a/environments/common/inventory/group_vars/all/defaults.yml +++ b/environments/common/inventory/group_vars/all/defaults.yml @@ -170,5 +170,5 @@ appliances_pulp_repos: timestamp: 20231104T015751 path: centos/8-stream/storage/x86_64/ceph-quincy '9': - timestamp: 20241114T011240 - path: centos/9-stream/storage/x86_64/ceph-quincy + timestamp: 20240923T233036 + path: centos/9-stream/storage/x86_64/ceph-reef From b03caaf358fd1e16cc600d4cd39725e00c753e3e Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Tue, 7 Jan 2025 15:32:01 +0000 Subject: [PATCH 44/52] updated rl9 ceph version number --- .../common/inventory/group_vars/all/os-manila-mount.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/environments/common/inventory/group_vars/all/os-manila-mount.yml b/environments/common/inventory/group_vars/all/os-manila-mount.yml index 9df62ea46..79a18028b 100644 --- a/environments/common/inventory/group_vars/all/os-manila-mount.yml +++ b/environments/common/inventory/group_vars/all/os-manila-mount.yml @@ -1 +1,5 @@ -os_manila_mount_ceph_rpm_repos: [] \ No newline at end of file +os_manila_mount_ceph_rpm_repos: [] +os_manila_mount_ceph_min_versions: + Rocky: + "8": '17.2.7' # quincy + "9": '18.2.4' # reef From 0c3ea765a30da8e10d4ac469feb4a54637948750 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Tue, 7 Jan 2025 15:55:40 +0000 Subject: [PATCH 45/52] pinned github runners to ubuntu-22.04 --- .github/workflows/trivyscan.yml | 2 +- .github/workflows/update-timestamps.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/trivyscan.yml b/.github/workflows/trivyscan.yml index 5b65baca1..d7302ab2b 100644 --- a/.github/workflows/trivyscan.yml +++ b/.github/workflows/trivyscan.yml @@ -12,7 +12,7 @@ jobs: concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.build }} # to branch/PR + build cancel-in-progress: true - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index c02cf3724..646c18181 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -9,7 +9,7 @@ jobs: upstream_check: outputs: new_fatimage: "${{ steps.fatimage_check.outputs.new_fatimage }}" - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 @@ -90,7 +90,7 @@ jobs: bump_timestamps: if: needs.upstream_check.outputs.new_fatimage == 'true' needs: build_fatimage - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 with: @@ -112,7 +112,7 @@ jobs: create_pr: needs: bump_timestamps if: always() && (needs.bump_timestamps.result == 'skipped' || needs.bump_timestamps.result == 'success') - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 with: @@ -147,7 +147,7 @@ jobs: needs: - run_ci - create_pr - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout branch uses: actions/checkout@v3 From 82719fc7dc75f56e414072c51137aa3334f10ba2 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Tue, 7 Jan 2025 16:53:07 +0000 Subject: [PATCH 46/52] fixed missing token in PR check --- .github/workflows/update-timestamps.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 646c18181..4dc79da8e 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -125,6 +125,8 @@ jobs: gh pr list --json headRefName --jq '.[].headRefName' | grep auto/bump-timestamps PR_EXISTS=$? echo "pr_exists=$PR_EXISTS" >> "$GITHUB_OUTPUT" + env: + GH_TOKEN: ${{ github.token }} - name: Create PR if: steps.pr-check.outputs.pr_exists == '0' From 3e6b2cf7d9fa8d86296c4e664463cdbc19b6198e Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Tue, 7 Jan 2025 16:57:50 +0000 Subject: [PATCH 47/52] fixed pr not being created --- .github/workflows/update-timestamps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 4dc79da8e..e744cd3dc 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -129,7 +129,7 @@ jobs: GH_TOKEN: ${{ github.token }} - name: Create PR - if: steps.pr-check.outputs.pr_exists == '0' + if: steps.pr-check.outputs.pr_exists == '1' run: gh pr create --title "[Auto] Bump repo timestamps to latest" --base main --head auto/bump-timestamps --body "Updated Release Train timestamps in defaults.yml with latest from Ark" env: GH_TOKEN: ${{ github.token }} From b8581baf8d831a03fb5f001fff58022c8ebcc390 Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Wed, 8 Jan 2025 08:56:41 +0000 Subject: [PATCH 48/52] missing token --- .github/workflows/update-timestamps.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index e744cd3dc..32cd61f56 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -159,6 +159,8 @@ jobs: run: | PR_NUMBER=$(gh pr list --head auto/bump-timestamps --state open --json number --jq .[0].number) echo "pr_number=$PR_NUMBER" >> "$GITHUB_OUTPUT" + env: + GH_TOKEN: ${{ github.token }} - name: Comment CI status uses: thollander/actions-comment-pull-request@v1 From 3bed0b8a44536d483ec4190357f8abd35ec7dae5 Mon Sep 17 00:00:00 2001 From: wtripp180901 <78219569+wtripp180901@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:19:35 +0000 Subject: [PATCH 49/52] templating fix --- .github/workflows/update-timestamps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 32cd61f56..5ae671e3b 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -167,4 +167,4 @@ jobs: with: message: 'CI ${{ needs.run_ci.result }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - pr_number: steps.number_check.outputs.pr_number + pr_number: ${{ steps.number_check.outputs.pr_number }} From b1d60de59ae919f0a9f5393e75292bf9697505c3 Mon Sep 17 00:00:00 2001 From: wtripp180901 <78219569+wtripp180901@users.noreply.github.com> Date: Wed, 8 Jan 2025 11:53:23 +0000 Subject: [PATCH 50/52] rename --- .github/workflows/update-timestamps.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 5ae671e3b..28f5ddda1 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -87,7 +87,7 @@ jobs: ci_cloud_override: 'LEAFCLOUD' target_branch: auto/bump-timestamps - bump_timestamps: + bump_images: if: needs.upstream_check.outputs.new_fatimage == 'true' needs: build_fatimage runs-on: ubuntu-22.04 @@ -110,8 +110,8 @@ jobs: git push create_pr: - needs: bump_timestamps - if: always() && (needs.bump_timestamps.result == 'skipped' || needs.bump_timestamps.result == 'success') + needs: bump_images + if: always() && (needs.bump_images.result == 'skipped' || needs.bump_images.result == 'success') runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 @@ -136,9 +136,9 @@ jobs: run_ci: needs: - - bump_timestamps + - bump_images - upstream_check - if: always() && (needs.bump_timestamps.result == 'success' || needs.upstream_check.outputs.new_fatimage == 'false') # should always run only on image bump commits + if: always() && (needs.bump_images.result == 'success' || needs.upstream_check.outputs.new_fatimage == 'false') # should always run only on image bump commits uses: ./.github/workflows/stackhpc.yml secrets: inherit with: From 433a9cac6806c6c9cf62e44bf9c9be7e8824009a Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Thu, 9 Jan 2025 09:27:23 +0000 Subject: [PATCH 51/52] comment update --- .github/workflows/fatimage.yml | 2 +- .github/workflows/update-timestamps.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fatimage.yml b/.github/workflows/fatimage.yml index 1b582aee1..e2e00f488 100644 --- a/.github/workflows/fatimage.yml +++ b/.github/workflows/fatimage.yml @@ -46,7 +46,7 @@ jobs: env: ANSIBLE_FORCE_COLOR: True OS_CLOUD: openstack - CI_CLOUD: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ci_cloud || inputs.ci_cloud_override }} # workaround for not being able to define string and choice in separate events + CI_CLOUD: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ci_cloud || inputs.ci_cloud_override }} ARK_PASSWORD: ${{ secrets.ARK_PASSWORD }} LEAFCLOUD_PULP_PASSWORD: ${{ secrets.LEAFCLOUD_PULP_PASSWORD }} outputs: diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 28f5ddda1..33120efaa 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -1,6 +1,6 @@ name: Check for new Release Train snapshots on: - workflow_dispatch: + workflow_dispatch: # temporary, doesn't support workflow_dispatch due to issues with CI_CLOUD in fatimage pull_request: #temporary schedule: - cron: '0 7 * * *' # Run at 7am on default branch From 9ff34cb34cb38d333b0e8ce49ebc70e68a1f022d Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Mon, 13 Jan 2025 09:23:42 +0000 Subject: [PATCH 52/52] removed redundant checks and made is_callee checking clearer --- .github/actions/is_callee/action.yml | 4 ++-- .github/workflows/fatimage.yml | 4 ++-- .github/workflows/stackhpc.yml | 2 +- .github/workflows/update-timestamps.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/is_callee/action.yml b/.github/actions/is_callee/action.yml index 3c4c4eec3..b425f3df6 100644 --- a/.github/actions/is_callee/action.yml +++ b/.github/actions/is_callee/action.yml @@ -14,8 +14,8 @@ runs: - id: workflows_match run: | if echo ${{ github.workflow_ref }} | grep ${{ inputs.current_workflow_file }}; then - echo "is_callee='false'" >> "$GITHUB_OUTPUT" + echo "is_callee=false" >> "$GITHUB_OUTPUT" else - echo "is_callee='true'" >> "$GITHUB_OUTPUT" + echo "is_callee=true" >> "$GITHUB_OUTPUT" fi shell: bash diff --git a/.github/workflows/fatimage.yml b/.github/workflows/fatimage.yml index e2e00f488..c4c06c5b9 100644 --- a/.github/workflows/fatimage.yml +++ b/.github/workflows/fatimage.yml @@ -46,7 +46,7 @@ jobs: env: ANSIBLE_FORCE_COLOR: True OS_CLOUD: openstack - CI_CLOUD: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ci_cloud || inputs.ci_cloud_override }} + CI_CLOUD: ${{ github.event.inputs.ci_cloud || inputs.ci_cloud_override }} ARK_PASSWORD: ${{ secrets.ARK_PASSWORD }} LEAFCLOUD_PULP_PASSWORD: ${{ secrets.LEAFCLOUD_PULP_PASSWORD }} outputs: @@ -61,7 +61,7 @@ jobs: - uses: actions/checkout@v3 with: - ref: ${{ steps.callee_check.outputs.is_callee && inputs.target_branch || github.ref }} + ref: ${{ steps.callee_check.outputs.is_callee == 'true' && inputs.target_branch || github.ref }} - name: Record settings for CI cloud run: | diff --git a/.github/workflows/stackhpc.yml b/.github/workflows/stackhpc.yml index 6972c108a..2c8e0417c 100644 --- a/.github/workflows/stackhpc.yml +++ b/.github/workflows/stackhpc.yml @@ -56,7 +56,7 @@ jobs: - uses: actions/checkout@v3 with: - ref: ${{ steps.callee_check.outputs.is_callee && inputs.target_branch || github.ref }} + ref: ${{ steps.callee_check.outputs.is_callee == 'true' && inputs.target_branch || github.ref }} - name: Override CI_CLOUD if PR label is present if: ${{ github.event_name == 'pull_request' }} diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 33120efaa..763d21355 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -1,6 +1,6 @@ name: Check for new Release Train snapshots on: - workflow_dispatch: # temporary, doesn't support workflow_dispatch due to issues with CI_CLOUD in fatimage + workflow_dispatch: # temporary pull_request: #temporary schedule: - cron: '0 7 * * *' # Run at 7am on default branch