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

(WIP) Refactor and modularize OpenShift CI script for better maintainability of our CI execution #1992

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

gustavolira
Copy link
Contributor

Modularized the OpenShift CI script by separating main functionalities into individual files. This change improves the maintainability and readability of the scripts by isolating specific tasks, such as handling AKS/GKE deployments and finalizers.

Description

Please explain the changes you made here.

Which issue(s) does this PR fix

  • Fixes #?

PR acceptance criteria

Please make sure that the following steps are complete:

  • GitHub Actions are completed and successful
  • Unit Tests are updated and passing
  • E2E Tests are updated and passing
  • Documentation is updated if necessary (requirement for new features)
  • Add a screenshot if the change is UX/UI related

How to test changes / Special notes to the reviewer

Copy link

openshift-ci bot commented Nov 26, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from gustavolira. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

github-actions bot commented Nov 26, 2024

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "(WIP) Refactor and modularize OpenShift CI  script for better maintainability of our CI execution". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat
 - fix
 - chore
 - docs
 - style
 - refactor
 - perf
 - test
 - revert

Copy link
Contributor

Copy link
Member

@zdrapela zdrapela left a comment

Choose a reason for hiding this comment

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

Hi @gustavolira, thank you for that, this is definitely needed! I have a couple of thoughts about that though.

  1. There are already separate files with functions for AKS, GKE (and OSD) located here: https://github.com/janus-idp/backstage-showcase/blob/main/.ibm/pipelines//cluster
    Please make sure to take them into account and incorporate them.
  2. We have the install_oc and install_helm functions there (in openshift-ci-tests.sh or utils.sh), but they are redundant, since we are already installing both in the https://github.com/janus-idp/backstage-showcase/blob/main/.ibm/images/Dockerfile#L37. I vote for deleting them.
  3. Now we use only a single openshift-ci-tests.sh file to run the jobs and then we differentiate it based on the job name. I think we better split it and use the openshift-ci-tests.sh for OCP tests and https://github.com/janus-idp/backstage-showcase/blob/main/.ibm/pipelines/kubernetes-tests.sh for Kubernetes tests (GKE and AKS). (I would delete the kubernetes-tests.shs content first, as it is not used anymore, and start from scratch.)
    To do that, we can edit https://github.com/openshift/release/blob/4d24aecb5f0cb787a9ec0e3e6d1744f234c3e184/ci-operator/step-registry/janus-idp/backstage-showcase/helm-aks-nightly/janus-idp-backstage-showcase-helm-aks-nightly-commands.sh#L19 and https://github.com/openshift/release/blob/4d24aecb5f0cb787a9ec0e3e6d1744f234c3e184/ci-operator/step-registry/janus-idp/backstage-showcase/helm-gke-nightly/janus-idp-backstage-showcase-helm-gke-nightly-commands.sh#L19
    That way we can avoid some more ifs and case switches.

I offer my assistance with AKS and GKE.

If you want to test that these changes are not breaking AKS and GKE yourself, you can follow this doc and also set JOB_NAME=periodic-aks or JOB_NAME=periodic-gke respectively.

@gustavolira
Copy link
Contributor Author

Hi @gustavolira, thank you for that, this is definitely needed! I have a couple of thoughts about that though.

  1. There are already separate files with functions for AKS, GKE (and OSD) located here: https://github.com/janus-idp/backstage-showcase/blob/main/.ibm/pipelines//cluster
    Please make sure to take them into account and incorporate them.
  2. We have the install_oc and install_helm functions there (in openshift-ci-tests.sh or utils.sh), but they are redundant, since we are already installing both in the https://github.com/janus-idp/backstage-showcase/blob/main/.ibm/images/Dockerfile#L37. I vote for deleting them.
  3. Now we use only a single openshift-ci-tests.sh file to run the jobs and then we differentiate it based on the job name. I think we better split it and use the openshift-ci-tests.sh for OCP tests and https://github.com/janus-idp/backstage-showcase/blob/main/.ibm/pipelines/kubernetes-tests.sh for Kubernetes tests (GKE and AKS). (I would delete the kubernetes-tests.shs content first, as it is not used anymore, and start from scratch.)
    To do that, we can edit https://github.com/openshift/release/blob/4d24aecb5f0cb787a9ec0e3e6d1744f234c3e184/ci-operator/step-registry/janus-idp/backstage-showcase/helm-aks-nightly/janus-idp-backstage-showcase-helm-aks-nightly-commands.sh#L19 and https://github.com/openshift/release/blob/4d24aecb5f0cb787a9ec0e3e6d1744f234c3e184/ci-operator/step-registry/janus-idp/backstage-showcase/helm-gke-nightly/janus-idp-backstage-showcase-helm-gke-nightly-commands.sh#L19
    That way we can avoid some more ifs and case switches.

I offer my assistance with AKS and GKE.

If you want to test that these changes are not breaking AKS and GKE yourself, you can follow this doc and also set JOB_NAME=periodic-aks or JOB_NAME=periodic-gke respectively.

Hi @zdrapela thank you very much for your attention here!

  1. ACK
  2. thank you very much for the heads up, I will delete them
  3. Can we address this after completing the refactoring? I have limited knowledge of those files, and I want to avoid making this process more complex. Delaying the merge will likely result in numerous Git conflicts, so I’d prefer to merge it as soon as possible to minimize that risk.

Copy link
Contributor

Copy link

openshift-ci bot commented Nov 27, 2024

@gustavolira: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-tests 94ae839 link true /test e2e-tests

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Modularized the OpenShift CI script by separating main functionalities into individual files. This change improves the maintainability and readability of the scripts by isolating specific tasks, such as handling AKS/GKE deployments and finalizers.

Signed-off-by: Gustavo Lira <[email protected]>
Renamed, deleted, and refactored scripts to improve maintainability. Loaded utility functions and environment-specific scripts in a cleaner manner. Simplified the main function to use a case statement for deployment initiation.

Signed-off-by: Gustavo Lira <[email protected]>
Removed redundant installation commands for Helm and oc from various deployment scripts. The utilities for installing Helm and oc have been eliminated, streamlining the setup process across different environments.

Signed-off-by: Gustavo Lira <[email protected]>
Signed-off-by: Gustavo Lira <[email protected]>
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants