-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GH workflow for automatically updating nvidia device plugin stati…
…c manifest
- Loading branch information
Showing
4 changed files
with
95 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ name: Update generated files | |
on: | ||
workflow_dispatch: {} | ||
schedule: | ||
- cron: "0 5 * * Thu" | ||
- cron: "0 5 * * Thu" | ||
|
||
permissions: | ||
id-token: write | ||
|
@@ -15,47 +15,47 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
resource: ["coredns", "aws-node"] | ||
resource: ["coredns", "aws-node", "nvidia-device-plugin"] | ||
name: Update ${{ matrix.resource }} and open PR | ||
runs-on: ubuntu-latest | ||
container: public.ecr.aws/eksctl/eksctl-build:833f4464e865a6398788bf6cbc5447967b8974b7 | ||
env: | ||
GOPRIVATE: "" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 #v4.1.2 | ||
with: | ||
token: ${{ secrets.EKSCTLBOT_TOKEN }} | ||
fetch-depth: 0 | ||
- name: Configure AWS credentials for coredns update | ||
if: ${{ matrix.resource == 'coredns' }} | ||
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 | ||
with: | ||
aws-region: us-west-2 | ||
role-duration-seconds: 900 | ||
role-session-name: eksctl-update-coredns-assets | ||
role-to-assume: ${{ secrets.UPDATE_COREDNS_ROLE_ARN }} | ||
- name: Setup identity as eksctl-bot | ||
uses: ./.github/actions/setup-identity | ||
with: | ||
token: "${{ secrets.EKSCTLBOT_TOKEN }}" | ||
- name: Cache go-build and mod | ||
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2 | ||
with: | ||
path: | | ||
~/.cache/go-build/ | ||
~/go/pkg/mod/ | ||
key: go-${{ hashFiles('go.sum') }} | ||
restore-keys: | | ||
go- | ||
- name: Update ${{ matrix.resource }} | ||
run: make update-${{ matrix.resource }} | ||
- name: Upsert pull request | ||
uses: peter-evans/create-pull-request@70a41aba780001da0a30141984ae2a0c95d8704e #v6.0.2 | ||
with: | ||
token: ${{ secrets.EKSCTLBOT_TOKEN }} | ||
commit-message: update ${{ matrix.resource }} | ||
committer: eksctl-bot <[email protected]> | ||
title: 'Update ${{ matrix.resource }}' | ||
branch: update-${{ matrix.resource }} | ||
labels: area/tech-debt | ||
- name: Checkout | ||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 #v4.1.2 | ||
with: | ||
token: ${{ secrets.EKSCTLBOT_TOKEN }} | ||
fetch-depth: 0 | ||
- name: Configure AWS credentials for coredns update | ||
if: ${{ matrix.resource == 'coredns' }} | ||
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 | ||
with: | ||
aws-region: us-west-2 | ||
role-duration-seconds: 900 | ||
role-session-name: eksctl-update-coredns-assets | ||
role-to-assume: ${{ secrets.UPDATE_COREDNS_ROLE_ARN }} | ||
- name: Setup identity as eksctl-bot | ||
uses: ./.github/actions/setup-identity | ||
with: | ||
token: "${{ secrets.EKSCTLBOT_TOKEN }}" | ||
- name: Cache go-build and mod | ||
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2 | ||
with: | ||
path: | | ||
~/.cache/go-build/ | ||
~/go/pkg/mod/ | ||
key: go-${{ hashFiles('go.sum') }} | ||
restore-keys: | | ||
go- | ||
- name: Update ${{ matrix.resource }} | ||
run: make update-${{ matrix.resource }} | ||
- name: Upsert pull request | ||
uses: peter-evans/create-pull-request@70a41aba780001da0a30141984ae2a0c95d8704e #v6.0.2 | ||
with: | ||
token: ${{ secrets.EKSCTLBOT_TOKEN }} | ||
commit-message: update ${{ matrix.resource }}${{ env.LATEST_RELEASE_TAG }} | ||
committer: eksctl-bot <[email protected]> | ||
title: 'Update ${{ matrix.resource }}${{ env.LATEST_RELEASE_TAG }}' | ||
branch: update-${{ matrix.resource }} | ||
labels: area/tech-debt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
get_latest_release_tag() { | ||
curl -sL https://api.github.com/repos/NVIDIA/k8s-device-plugin/releases/latest | jq -r '.tag_name' | ||
} | ||
|
||
latest_release_tag=$(get_latest_release_tag) | ||
|
||
# Check if the latest release tag was found | ||
if [ -z "$latest_release_tag" ]; then | ||
echo "Could not find the latest release tag." | ||
exit 1 | ||
fi | ||
|
||
# If running in GitHub Actions, export the release tag for use in the workflow | ||
if [ "$GITHUB_ACTIONS" = "true" ]; then | ||
echo "LATEST_RELEASE_TAG= to $latest_release_tag" >> $GITHUB_ENV | ||
else | ||
echo "Found the latest release tag: $latest_release_tag" | ||
fi | ||
|
||
assets_addons_dir="pkg/addons/assets" | ||
|
||
curl -sL "https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/$latest_release_tag/deployments/static/nvidia-device-plugin.yml" -o "$assets_addons_dir/nvidia-device-plugin.yaml" | ||
|
||
|
||
# Check if the download was successful | ||
if [ $? -eq 0 ]; then | ||
echo "Downloaded the latest NVIDIA device plugin manifest to $assets_addons_dir/nvidia-device-plugin.yaml" | ||
else | ||
echo "Failed to download the NVIDIA device plugin manifest." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters