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

Migrate prerelease flow to GHA #5590

Merged
merged 3 commits into from
Nov 2, 2022

Conversation

beni0888
Copy link
Collaborator

@beni0888 beni0888 commented Oct 28, 2022

Signed-off-by: Jesús Benito Calzada [email protected]

Description of the change

In order to be able to trigger what we call prerelease flow manually, this PR turns the current Kubeapps general pipeline workflow into a general reusable workflow, and adds two new workflows that call the former:

  • Full Integration Pipeline: it is a new workflow that is manually triggered from the GitHub Actions dashboard. It calls the general workflow providing the input run_gke_tests with the value true, so the set of e2e tests is executed on the GKE environments. It is the replacement for the old prerelease flow.
  • Main Pipeline: it is a workflow triggered automatically on push and pull request events. It calls the general workflow without providing the input parameter run_gke_tests (its default value is false), so the GKE tests aren't run. This workflow comes to replace the current kubeapps general pipeline workflow that has been turned into a reusable workflow, so we need this one to trigger it automatically.

Benefits

We have full control of the different workflows, being able to trigger the prerelease flow (now called Full Integration Pipeline) on demand, and without needing to craft a dummy prerelease branch to do it.

Possible drawbacks

  • The workflow setup is more complex, with more pieces involved.
  • Possible side effects that we haven't detected so far (mainly related to test reports and this kind of things) due to the fact of using reusable workflows.

Applicable issues

@netlify
Copy link

netlify bot commented Oct 28, 2022

Deploy Preview for kubeapps-dev canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit abe292b
🔍 Latest deploy log https://app.netlify.com/sites/kubeapps-dev/deploys/636247fd7e99560008df3bb9

Signed-off-by: Jesús Benito Calzada <[email protected]>
@beni0888 beni0888 self-assigned this Nov 2, 2022
@beni0888 beni0888 added component/ci Issue related to kubeapps ci system github_actions Pull requests that update GitHub Actions code labels Nov 2, 2022
@beni0888 beni0888 added this to the Migrate CI to GitHub Actions milestone Nov 2, 2022
@beni0888 beni0888 marked this pull request as ready for review November 2, 2022 08:43
@ppbaena
Copy link
Collaborator

ppbaena commented Nov 2, 2022

Thanks for this work. It simplifies the process and improves the experience and readability.

Copy link
Contributor

@antgamdia antgamdia left a comment

Choose a reason for hiding this comment

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

+1, thanks!

Please add a new line at the end of each file, this is the convention we are using in the project. You can configure your IDE to do so: https://stackoverflow.com/questions/16761227/how-to-make-intellij-idea-insert-a-new-line-at-every-end-of-file

CI_BOT_GPG: "80B6EB16B1328FB18DFF2A073EBA68F3347E319D"
# DEBUG_MODE allows to activate some SSH debugging steps, and modify the verbosity level of some scripts (eg. e2e-tests.sh)
DEBUG_MODE: "true"
# FIXME: DEV_MODE is used to enable dev mode, used to activate several hacks along the code:
Copy link
Contributor

Choose a reason for hiding this comment

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

Use the same convention for TODOs, this way, it easier to look for them in the future

IMG_MODIFIER: "-ci-gha"
IMG_PREFIX: "kubeapps/"
# We use IMG_PREFIX_FOR_FORKS for development purposes, it's used when the workflow is run from a fork of the kubeapps repo
IMG_PREFIX_FOR_FORKS: "beni0888/"
Copy link
Contributor

Choose a reason for hiding this comment

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

Leftover? Or is it still useful while working on the GHA?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, it is useful anytime when someone needs to develop the pipeline and push docker images to an alternative Docker Hub workspace. When the pipeline is triggered inside a fork, it will use the value from this variable. At this moment it contains my personal workspace, but it can be changed to whatever is needed.

Comment on lines +190 to +193
# Note that the max old space setting is per worker, so running the tests
# with 4 workers on a 4Gb (free plan) needs 1Gb of max old space. Forcing
# garbage collection to start earlier with 512M per worker.
NODE_OPTIONS: "--max-old-space-size=512"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this assumption still true for GHA runners?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To be honest, I don't know 😅 I copy&pasted it from the CircleCI setup and it works, so I haven't tried to change it. If you consider it is needed, we can add an issue to fine-tune its value after the migration.

GKE_ADMIN: ${{ secrets.GKE_ADMIN }}
GCLOUD_KEY: ${{ secrets.GCLOUD_KEY }}
main:
uses: ./.github/workflows/kubeapps-main-reusable.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Neat!

@beni0888 beni0888 merged commit 36a5516 into vmware-tanzu:main Nov 2, 2022
@beni0888 beni0888 deleted the migrate-prerelease-flow branch November 2, 2022 14:58
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-not-required component/ci Issue related to kubeapps ci system github_actions Pull requests that update GitHub Actions code
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants