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

Github actions workflow fix for Helm chart deployment #1456

Merged

Conversation

vara-bonthu
Copy link
Contributor

What does this PR do?

Problem:

Helm Chart release deployment workflow is broken since spark-operator-chart-1.1.15 due to an issue within the release workflow. Release workflow name: Release Spark-Operator Docker Image to github container registry step is building the Docker image and pushing the image to Github container registry. This step also creates a git tag and pushes the tag to this repo. The subsequent git action step name: Run chart-releaser is pulling the latest tag from the repo to identify the changes in the chart folder. This Helm chart step could never find the changes in the repo due to tag commit from the previous step.

Solution:

This PR moved git tag and git push tags to a new github action step name: Release Spark-Operator Docker Image at end of the workflow. This ensures Docker image is published and the Helm Chart is published before pushing the TAG to the repo.

@aneagoe
Copy link
Contributor

aneagoe commented Jan 16, 2022

@vara-bonthu although chart-releaser-action is quite new to me, the problem doesn't really seem to be related to the git tag steps/ordering. Those only extract the app version and not the chart version. From what I understand so far, the release process for the chart is only partly automated, requiring a manual git tag.
Further, docker image release and chart release should be detached; just because there's a newer image it doesn't necessarily mean we have to update and re-release the chart. As well, we might have chart changes that don't really require a new image.
I'm wondering what would be the best way to test this...

@aneagoe
Copy link
Contributor

aneagoe commented Jan 16, 2022

Ok, after a more careful review, it looks like changing the order would actually do the trick as it would force the chart-releaser-action (function lookup_changed_charts) to detect the changes.

@vara-bonthu
Copy link
Contributor Author

lookup_changed_charts

Yes, absolutely. This function is crucial which uses the latest_tag -> git describe --tags --abbrev=0 to identify the Helm chart changes.

  • Now, the Helm chart deployment will be triggered since we moved the git tag and git push tag to the last step.
  • Helm Chart release won't be triggered if there are no changes under chart folder however it can still deploy the new image with this workflow.
  • Bumping the Helm Chart version is sufficient to detect the change and deploy the new version of Helm Chart with this change
  • I have tested the workflow locally using echo statements without having to push the images to the repo to validate the functionality.

@liyinan926
Copy link
Collaborator

Thanks for fixing the flow! Merging.

@liyinan926 liyinan926 merged commit e918216 into kubeflow:master Jan 17, 2022
jbhalodia-slack pushed a commit to jbhalodia-slack/spark-operator that referenced this pull request Oct 4, 2024
* Github actions workflow fix for Helm chart deployment

* Updated the if condition for Release Spark-Operator Docker Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants