-
Notifications
You must be signed in to change notification settings - Fork 605
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
GitHub Actions: Add Release workflow #691
Conversation
Depends on #687 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also spoke about uploading the helm packages and then publishing those to gh-pages. Is that still a goal for this PR?
10f0900
to
ceedf8f
Compare
00b282a
to
8995542
Compare
@elezar PTAL |
1f1ce54
to
323a006
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for iterating on this.
Please also update RELEASE.md
to reflect the changes here.
4d6b6e5
to
4e311fa
Compare
4e311fa
to
6d8c42b
Compare
@elezar / @tariq1890 PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are some finer points in the implementation that still need to be looked at.
git config user.name "Github Actions" | ||
git config user.email "no-reply@github.com" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question (not a blocker): can this be set in the action somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean like as an argument to the action?
The documentation and examples I have found all play it like this.
.github/workflows/release.yaml
Outdated
GH_EXTRA_ARGS="" | ||
if [[ ${{ github.ref }} == *rc* ]]; then | ||
GH_EXTRA_ARGS="--prerelease" | ||
fi | ||
gh release create ${{ github.ref }} \ | ||
--draft \ | ||
-t "${{ github.ref }}" \ | ||
-n $(./hack/generate-changelog.sh --version ${{ github.ref }}) \ | ||
-R $OWNER/$REPO \ | ||
--verify-tag \ | ||
$GH_EXTRA_ARGS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this something that we want to have in a script instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ummm I think this one and the next one(same comment) are good to have here since they are not functionality we would do manually. and is good to have GitHub actions that are readable.
So I would say no, I prefer to keep this as is
.github/workflows/release.yaml
Outdated
gh release upload ${{ github.ref }} ./nvidia-device-plugin-${{ github.event.release.tag_name }}.tgz -R $OWNER/$REPO | ||
gh release upload ${{ github.ref }} ./gpu-feature-discovery-${{ github.event.release.tag_name }}.tgz -R $OWNER/$REPO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also a script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
answer on the comment above
RELEASE.md
Outdated
- [ ] Wait for the [CI job associated with your tag] (https://gitlab.com/nvidia/kubernetes/device-plugin/-/pipelines) to complete | ||
- [ ] Create a [new release](https://github.com/NVIDIA/k8s-device-plugin/releases) on Github with the changelog | ||
- [ ] Wait for the `Release` GitHub Action to complete | ||
- [ ] Create a [new release](https://github.com/NVIDIA/k8s-device-plugin/releases) from the draft release created by the GitHub Action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
- [ ] Create a [new release](https://github.com/NVIDIA/k8s-device-plugin/releases) from the draft release created by the GitHub Action | |
- [ ] Publish the [draft release](https://github.com/NVIDIA/k8s-device-plugin/releases) created by the GitHub Action |
hack/update-helm-index.sh
Outdated
if [ -n "$asset_local" ]; then | ||
echo "Copying $asset_local..." | ||
cp -f $asset_local $HELM_REPO_PATH/stable | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this works the way we want. We are in $HELM_REPO_PATH/stable
meaning that $asset_local
would be interpreted relative to that path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HELM_REPO_PATH
is the absolute path, so it doesn't matter where we are, the cp
will perform the copy to the given path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we have to run these locally as in the "troubleshooting" case?
hack/update-helm-index.sh
Outdated
fi | ||
|
||
echo "Updating helm index" | ||
helm repo index stable --merge index.yaml --url https://nvidia.github.io/k8s-device-plugin/stable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're in $HELM_REPO_PATH/stable
. Does that mean that this should be:
```suggestion
helm repo index . --merge index.yaml --url https://nvidia.github.io/k8s-device-plugin/stable
hack/update-helm-index.sh
Outdated
|
||
echo "Updating helm index" | ||
helm repo index stable --merge index.yaml --url https://nvidia.github.io/k8s-device-plugin/stable | ||
cp -f stable/index.yaml index.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're in $HELM_REPO_PATH/stable
this command is invalid. Should it be:
cp -f stable/index.yaml index.yaml | |
cp -f index.yaml ../index.yaml |
hack/update-helm-index.sh
Outdated
cp -f stable/index.yaml index.yaml | ||
popd > /dev/null | ||
|
||
pushd $HELM_REPO_PATH > /dev/null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use git -C
for the git commands instead of pushd
/popd
?
.github/workflows/helm.yaml
Outdated
|
||
- name: Push updated Helm charts and index to gh-pages branch | ||
env: | ||
HELM_REPO_PATH: releases/helm-${{ github.event.release.tag_name }}/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Could we set HELM_REPO_PATH
as a job-level envvar?
6d8c42b
to
8a8bd30
Compare
8a8bd30
to
b20fbec
Compare
Updated as discussed @elezar |
b20fbec
to
ef3e7e2
Compare
.github/workflows/release.yaml
Outdated
OWNER: ${{ github.repository_owner }} | ||
REPO: ${{ github.event.repository.name }} | ||
run: | | ||
GH_EXTRA_ARGS="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not work as expected. See https://github.com/NVIDIA/nvidia-container-toolkit/actions/runs/9549456867/job/26319106625
Also when running the gh command line as given, it asks a number of questions. Not sure whether that would be skipped in the action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with github.ref_name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not ask questions, as it should know is running on GItHub Actions mode https://docs.github.com/en/actions/using-workflows/using-github-cli-in-workflows
ef3e7e2
to
29eb986
Compare
.github/workflows/release.yaml
Outdated
OWNER: ${{ github.repository_owner }} | ||
REPO: ${{ github.event.repository.name }} | ||
run: | | ||
gh release upload ${{ github.ref_name }} ./nvidia-device-plugin-${{ github.event.release.tag_name }}.tgz -R $OWNER/$REPO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What value does tag_name
have? Do we strip the leading v
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
responds to refs/tags/<tag_name>
so it will include the v
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Our packages don't include the v though. Can we update this?
Also, as a matter of interest, why do we use tag_name
instead of just using ref_name
consistently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about now?
29eb986
to
97829bc
Compare
d3090cf
to
5b48edf
Compare
This change updates the release scripting to create helm packages and update the helm index in the gh-pages branch. Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com> Signed-off-by: Evan Lezar <elezar@nvidia.com>
This change adds GitHub actions that create a draft release when a tag is pushed. This draft release incldes Helm packages for the device plugin. Once this release is published, these helm packages are published to the gh-pages branch. Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com> Signed-off-by: Evan Lezar <elezar@nvidia.com>
Signed-off-by: Evan Lezar <elezar@nvidia.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made the required changes to the branch.
$GH_EXTRA_ARGS | ||
|
||
- name: Install Helm | ||
uses: azure/setup-helm@v4.2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Is this one of the allowed actions?
- name: Install Helm | ||
uses: azure/setup-helm@v4.2.0 | ||
with: | ||
version: 3.14.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to just use the latest stable version here? Not a blocker for this PR though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am never against latest during testing, so I agree we should go latest
hack/generate-changelog.sh
Outdated
@@ -50,7 +50,7 @@ while [[ $# -gt 0 ]]; do | |||
shift # past value | |||
;; | |||
--version) | |||
VERSION="$2" | |||
VERSION="$2#v" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't required in this script.
No description provided.