Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AKS and EKS action to properly run on schedule #1125

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 12 additions & 18 deletions .github/workflows/deploy-to-aks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,45 +16,39 @@ on:
- cron: "17 0 * * 2"
jobs:
preprocess-input:
if: ${{ github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-22.04
outputs:
processed_bundle_versions: ${{ steps.process_bundle_versions.outputs.bundle_versions }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Process bundle versions
id: process_bundle_versions
run: python scripts/gh-actions/parse_versions.py "${{ inputs.bundle_version }}"

generate-bundle-versions-on-schedule:
if: ${{ github.event_name == 'schedule' }}
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install CLI tools
run: |
sudo snap install yq

- name: Create JSON array of bundle versions

- name: Process bundle versions
id: process_bundle_versions
run: |
bundle_versions=$(yq '. | keys' .github/dependencies.yaml -o=json)
echo "bundle_versions=${bundle_versions}" >> $GITHUB_OUTPUT
if [[ "${{ github.event_name }}" == "schedule" ]]; then
bundle_versions=$(yq '. | keys' .github/dependencies.yaml -o=json | tr -d '\n')
mvlassis marked this conversation as resolved.
Show resolved Hide resolved
echo "bundle_versions=${bundle_versions}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me why we need this line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "echo" is only for displaying the bundle_versions on the output of the action on Github, see here. Do you think it's best to remove this?

echo "bundle_versions=${bundle_versions}" >> $GITHUB_OUTPUT
else
python scripts/gh-actions/parse_versions.py "${{ inputs.bundle_version }}"
fi

deploy-ckf-to-aks:
needs: preprocess-input
runs-on: ubuntu-22.04
strategy:
matrix:
bundle_version: ${{ fromJSON(needs.preprocess-input.outputs.processed_bundle_versions) || fromJSON(jobs.generate-bundle-versions-on-schedule.outputs.bundle_versions) }}
bundle_version: ${{ fromJSON(needs.preprocess-input.outputs.processed_bundle_versions) }}
fail-fast: false
env:
AZURE_CORE_OUTPUT: none
Expand Down
30 changes: 12 additions & 18 deletions .github/workflows/deploy-to-eks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,45 +16,39 @@ on:
- cron: "23 0 * * 2"
jobs:
preprocess-input:
if: ${{ github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-22.04
outputs:
processed_bundle_versions: ${{ steps.process_bundle_versions.outputs.bundle_versions }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Process bundle versions
id: process_bundle_versions
run: python scripts/gh-actions/parse_versions.py "${{ inputs.bundle_version }}"

generate-bundle-versions-on-schedule:
if: ${{ github.event_name == 'schedule' }}
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install CLI tools
run: |
sudo snap install yq

- name: Create JSON array of bundle versions

- name: Process bundle versions
id: process_bundle_versions
run: |
bundle_versions=$(yq '. | keys' .github/dependencies.yaml -o=json)
echo "bundle_versions=${bundle_versions}" >> $GITHUB_OUTPUT
if [[ "${{ github.event_name }}" == "schedule" ]]; then
bundle_versions=$(yq '. | keys' .github/dependencies.yaml -o=json | tr -d '\n')
echo "bundle_versions=${bundle_versions}"
echo "bundle_versions=${bundle_versions}" >> $GITHUB_OUTPUT
else
python scripts/gh-actions/parse_versions.py "${{ inputs.bundle_version }}"
fi

deploy-ckf-to-eks:
needs: preprocess-input
runs-on: ubuntu-22.04
strategy:
matrix:
bundle_version: ${{ fromJSON(needs.preprocess-input.outputs.processed_bundle_versions) || fromJSON(jobs.generate-bundle-versions-on-schedule.outputs.bundle_versions) }}
bundle_version: ${{ fromJSON(needs.preprocess-input.outputs.processed_bundle_versions) }}
fail-fast: false
env:
PYTHON_VERSION: "3.8"
Expand Down
Loading