-
Notifications
You must be signed in to change notification settings - Fork 5
WIP: chore: migrate crc-e2e #39
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
Draft
albfan
wants to merge
1
commit into
crc-org:main
Choose a base branch
from
albfan:crc-e2e
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,79 @@ | ||
| name: crc-e2e-builder | ||
|
|
||
| on: | ||
| push: | ||
| tags: [ 'crc-e2e-v*' ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| paths: ['crc-e2e/**', '.github\/workflows\/crc-e2e*' ] | ||
|
|
||
| jobs: | ||
| build: | ||
| name: build | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Build image for PR | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
| env: | ||
| CRC_E2E: ghcr.io/crc-org/ci-crc-e2e | ||
| CRC_E2E_V: pr-${{ github.event.number }} | ||
| run: | | ||
| make crc-e2e-oci-build | ||
| make crc-e2e-oci-save | ||
| echo "image=${CRC_E2E}:${CRC_E2E_V}" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Create image metadata | ||
| run: | | ||
| echo ${{ env.image }} > crc-e2e-image | ||
| echo ${{ github.event_name }} > crc-e2e-build-event | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as previous, it applies in general to all build job |
||
| - name: Upload crc-e2e | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: crc-e2e | ||
| path: crc-e2e* | ||
|
|
||
| tkn-check: | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Template tkn for PR | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
| env: | ||
| CRC_E2E: ghcr.io/crc-org/ci-crc-e2e | ||
| CRC_E2E_V: pr-${{ github.event.number }} | ||
| run: | | ||
| make crc-e2e-tkn-create | ||
|
|
||
| - name: Check tkn specs | ||
| run: | | ||
| if [[ ! -f crc-e2e/tkn/crc-e2e-installer.yaml ]]; then | ||
| exit 1 | ||
| fi | ||
| if [[ ! -f crc-e2e/tkn/crc-e2e.yaml ]]; then | ||
| exit 1 | ||
| fi | ||
| # Check if version is in sync | ||
|
|
||
| - name: Create k8s Kind Cluster | ||
| uses: helm/kind-action@v1 | ||
|
|
||
| # https://docs.openshift.com/pipelines/1.15/about/op-release-notes.html | ||
| - name: Deploy min supported tekton version | ||
| run: kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.44.5/release.yaml | ||
|
|
||
| - name: Deploy tasks | ||
| run: | | ||
| kubectl apply -f crc-e2e/tkn/crc-e2e-installer.yaml | ||
| kubectl apply -f crc-e2e/tkn/crc-e2e.yaml | ||
|
|
||
| - name: Upload crc-e2e-tkn | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: crc-e2e-tkn | ||
| path: crc-e2e/tkn/crc-e2e* | ||
This file contains hidden or 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,71 @@ | ||
| name: crc-e2e-pusher | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: crc-e2e-builder | ||
| types: | ||
| - completed | ||
|
|
||
| jobs: | ||
| push: | ||
| name: push | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as for other gh action flow, all oci related steps should be removed |
||
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| steps: | ||
| - name: Download crc-e2e assets | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: crc-e2e | ||
| run-id: ${{ github.event.workflow_run.id }} | ||
| github-token: ${{ github.token }} | ||
|
|
||
| - name: Get crc-e2e build informaiton | ||
| run: | | ||
| echo "source_event=$(cat crc-e2e-build-event)" >> "$GITHUB_ENV" | ||
| echo "image=$(cat crc-e2e-image)" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Log in to ghcr.io | ||
| if: ${{ env.source_event == 'pull_request' }} | ||
| uses: redhat-actions/podman-login@v1 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Log in quay.io | ||
| if: ${{ env.source_event == 'push' }} | ||
| uses: redhat-actions/podman-login@v1 | ||
| with: | ||
| registry: quay.io | ||
| username: ${{ secrets.QUAY_IO_USERNAME }} | ||
| password: ${{ secrets.QUAY_IO_PASSWORD }} | ||
|
|
||
| - name: Push crc-e2e | ||
| run: | | ||
| podman load -i crc-e2e-linux.tar | ||
| podman push ${{ env.image }}-linux | ||
| podman load -i crc-e2e-windows.tar | ||
| podman push ${{ env.image }}-windows | ||
| podman load -i crc-e2e-darwin.tar | ||
| podman push ${{ env.image }}-darwin | ||
|
|
||
| - name: Download crc-e2e-tkn assets | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: crc-e2e-tkn | ||
| run-id: ${{ github.event.workflow_run.id }} | ||
| github-token: ${{ github.token }} | ||
|
|
||
| - name: Push crc-e2e-tkn | ||
| env: | ||
| TKN_VERSION: '0.37.0' | ||
| run: | | ||
| curl -LO "https://github.com/tektoncd/cli/releases/download/v${TKN_VERSION}/tkn_${TKN_VERSION}_Linux_x86_64.tar.gz" | ||
| tar xvzf "tkn_${TKN_VERSION}_Linux_x86_64.tar.gz" tkn | ||
| ./tkn bundle push ${{ env.image }}-tkn \ | ||
| -f crc-e2e-installer.yaml \ | ||
| -f crc-e2e.yaml | ||
|
|
||
This file contains hidden or 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 hidden or 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,5 @@ | ||
| # Changelog | ||
|
|
||
| ## 1.0.0 | ||
|
|
||
| * Initial version |
This file contains hidden or 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,35 @@ | ||
| # CRC e2e | ||
|
|
||
| ## Modifications to the image | ||
|
|
||
| Changes to `crc-e2e/os/macos/builder/build.sh` require re-building and pushing the image to internal registry (ImageStream). Make sure the changes are pushed to some `mybranch` on your fork of the QE platform repo (`github.com/<your-username>/qe-platform`). Since the `crc-e2e/manifests/buildconfig.yaml` will be guiding the build of the image, it needs to specify your branch on your fork as the source. | ||
|
|
||
| ```diff | ||
| source: | ||
| contextDir: support/images/crc-e2e | ||
| git: | ||
| # dev | ||
| + ref: 'mybranch' | ||
| + uri: 'https://gitlab.cee.redhat.com/<your-username>/qe-platform.git' | ||
| - ref: v2.14.0 | ||
| - uri: 'https://gitlab.cee.redhat.com/crc/qe-platform.git' | ||
| type: Git | ||
| ``` | ||
|
|
||
| Log in to `codeready-container` project, apply the changes in `crc-e2e/manifests/buildconfig.yaml` and start the build from the corresponding `BuildConfig` (depending on the platform). | ||
|
|
||
| ```bash | ||
| oc apply -f support/images/crc-e2e/manifests/buildconfig.yaml | ||
| oc start-build image-crc-e2e-<platform> | ||
| ``` | ||
|
|
||
| Lastly, make sure that `imagePullPolicy` is set to `Always` in all places that use this imageStreamTag (e.g. `crc-e2e:v0.0.3-macos`). In our case, we needed to change and re-apply the following YAML. | ||
|
|
||
| ```bash | ||
| oc apply -f orchestrator/catalog/task/crc-e2e-installer/0.3/crc-e2e-installer.yaml | ||
| ``` | ||
|
|
||
| Then undo changes to `crc-e2e/manifests/buildconfig.yaml` so it points to the upstream repository. | ||
|
|
||
| _If everything works as expected, send an MR to `gitlab.cee.redhat.com/crc/qe-platform`._ | ||
|
|
This file contains hidden or 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,2 @@ | ||
| quay.io/crc-org/ci-crc-e2e | ||
| 1.0.0-dev |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.