Skip to content

Upgrade from AppWrapper v1beta1 to v1beta2 #491

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

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a7a9bca
Upgrade to AppWrapper v1beta2
dgrove-oss Mar 19, 2024
635119b
Disable operator upgrade test for MCAD to Kueue transition
dgrove-oss Mar 25, 2024
5e3595f
update for review changes in codeflare-common
dgrove-oss Mar 28, 2024
c3fa25d
review comments
dgrove-oss Mar 28, 2024
5d907b5
pick up codeflare-common@mcadv1b2 changes
dgrove-oss Mar 28, 2024
04b9b1f
port to AppWrapper controller using cert-controller
dgrove-oss Mar 28, 2024
c8ead36
Kueue-enable e2e test cases
dgrove-oss Mar 29, 2024
f291e02
RayCluster test with AppWrappers
dgrove-oss Mar 29, 2024
43c8bc9
collect Kueue logs in e2e test
dgrove-oss Mar 30, 2024
f3147a6
update to appwrapper 0.7.2
dgrove-oss Apr 2, 2024
d6c87e9
validate AppWrapper config after merging delta from config map
dgrove-oss Apr 2, 2024
39c34d8
fix errors introduced in rebase
dgrove-oss Apr 3, 2024
034992d
generate AppWrapper RBAC's from kubebuilder comments
dgrove-oss Apr 3, 2024
828d0b1
appwrapper 0.7.2
dgrove-oss Apr 3, 2024
ef0665b
AppWrapper release is managed externally
dgrove-oss Apr 3, 2024
dca8dcb
tweaks
dgrove-oss Apr 3, 2024
b88ca94
allow appwrapper controller to be disabled in config
dgrove-oss Apr 4, 2024
58dcfd0
copy edit README.md
dgrove-oss Apr 4, 2024
d29c5fe
Fix type in main.go
dgrove-oss Apr 4, 2024
cbfd580
get codeflare-common from main
dgrove-oss Apr 4, 2024
b5aa4aa
review comments
dgrove-oss Apr 4, 2024
7187933
restore olm upgrade test; this test is expected to fail
dgrove-oss Apr 4, 2024
ca6b5ec
deploy Kueue in olm_tests
dgrove-oss Apr 4, 2024
2035794
review comment: keep cert config private
dgrove-oss Apr 4, 2024
e12fa53
skip AppWrapper tests when AppWrapper controller not enabled
dgrove-oss Apr 4, 2024
318f601
fix typo
dgrove-oss Apr 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/e2e_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Set Go
uses: actions/setup-go@v5
with:
go-version: v1.20
go-version-file: './go.mod'

- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
Expand All @@ -55,6 +55,10 @@ jobs:
- name: Setup and start KinD cluster
uses: ./common/github-actions/kind

- name: Deploy Kueue
run: |
make kueue-e2e

- name: Deploy CodeFlare stack
id: deploy
run: |
Expand All @@ -78,14 +82,21 @@ jobs:
echo "CODEFLARE_TEST_OUTPUT_DIR=${CODEFLARE_TEST_OUTPUT_DIR}" >> $GITHUB_ENV

set -euo pipefail
go test -timeout 30m -v ./test/e2e -json 2>&1 | tee ${CODEFLARE_TEST_OUTPUT_DIR}/gotest.log | gotestfmt
go test -timeout 30m -v -skip ".*AppWrapper.*" ./test/e2e -json 2>&1 | tee ${CODEFLARE_TEST_OUTPUT_DIR}/gotest.log | gotestfmt
Copy link
Contributor

Choose a reason for hiding this comment

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

For the e2e tests, we can have a custom config that enables the AppWrapper controller.


- name: Print CodeFlare operator logs
if: always() && steps.deploy.outcome == 'success'
run: |
echo "Printing CodeFlare operator logs"
kubectl logs -n openshift-operators --tail -1 -l app.kubernetes.io/name=codeflare-operator | tee ${CODEFLARE_TEST_OUTPUT_DIR}/codeflare-operator.log

- name: Print Kueue operator logs
if: always() && steps.deploy.outcome == 'success'
run: |
echo "Printing Kueue operator logs"
KUEUE_CONTROLLER_POD=$(kubectl get pods -n kueue-system | grep kueue-controller | awk '{print $1}')
kubectl logs -n kueue-system --tail -1 ${KUEUE_CONTROLLER_POD} | tee ${CODEFLARE_TEST_OUTPUT_DIR}/kueue.log

- name: Print KubeRay operator logs
if: always() && steps.deploy.outcome == 'success'
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mnist-job-test-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set Go
uses: actions/setup-go@v5
with:
go-version: v1.20
go-version-file: './go.mod'

- name: Login to Quay.io
id: podman-login-quay
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/olm_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Set Go
uses: actions/setup-go@v5
with:
go-version: v1.20
go-version-file: './go.mod'

- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
Expand All @@ -54,6 +54,10 @@ jobs:
- name: Setup and start KinD cluster
uses: ./common/github-actions/kind

- name: Deploy Kueue
run: |
make kueue-e2e

- name: Install OLM
run: |
kubectl create -f https://github.com/operator-framework/operator-lifecycle-manager/releases/download/${OLM_VERSION}/crds.yaml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/operator-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set Go
uses: actions/setup-go@v5
with:
go-version: v1.20
go-version-file: './go.mod'

- name: Login to Quay.io
id: podman-login-quay
Expand Down
38 changes: 24 additions & 14 deletions .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,38 @@ on:
jobs:
precommit:
runs-on: ubuntu-latest
container:
image: quay.io/opendatahub/pre-commit-go-toolchain:v0.2 # https://github.com/opendatahub-io/data-science-pipelines-operator/blob/main/.github
env:
XDG_CACHE_HOME: /cache
GOCACHE: /cache/go-build
GOMODCACHE: /cache/go-mod
PRE_COMMIT_HOME: /cache/pre-commit
volumes:
- /cache
# DISABLED: This container has go 1.20
# container:
# image: quay.io/opendatahub/pre-commit-go-toolchain:v0.2 # https://github.com/opendatahub-io/data-science-pipelines-operator/blob/main/.github
# env:
# XDG_CACHE_HOME: /cache
# GOCACHE: /cache/go-build
# GOMODCACHE: /cache/go-mod
# PRE_COMMIT_HOME: /cache/pre-commit
# volumes:
# - /cache
steps:
- uses: actions/checkout@v4

- name: Set Go
uses: actions/setup-go@v5
with:
go-version: v1.20
go-version-file: './go.mod'

- name: Activate cache
uses: actions/cache@v4
# Compensate for lack of pre-commit-go-toolchain image
- name: Set up Python
uses: actions/setup-python@v5
with:
path: /cache
key: ${{ runner.os }}-cache-${{ hashFiles('**/go.sum', '.pre-commit-config.yaml') }}
python-version: '3.9'
- name: Install pre-commit
run: |
pip install pre-commit

# - name: Activate cache
# uses: actions/cache@v4
# with:
# path: /cache
# key: ${{ runner.os }}-cache-${{ hashFiles('**/go.sum', '.pre-commit-config.yaml') }}

- name: Run pre-commit checks
run: pre-commit run --all-files
94 changes: 20 additions & 74 deletions .github/workflows/project-codeflare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@ on:
replaces:
description: 'The previous operator semantic version that this release replaces (for example: v0.0.0)'
required: true
mcad-version:
description: 'Version of multi-cluster-app-dispatcher to be released (for example: v0.0.0)'
appwrapper-version:
description: 'Tested version of AppWrapper (for example: v0.0.0)'
required: true
codeflare-sdk-version:
description: 'Version of CodeFlare-SDK to be released (for example: v0.0.0)'
required: true
instascale-version:
description: 'Version of InstaScale to be released (for example: v0.0.0)'
required: true
kuberay-version:
description: 'Tested version of KubeRay (for example: v0.0.0)'
required: true
Expand Down Expand Up @@ -48,81 +45,16 @@ jobs:
echo "Below are the release parameters set for the workflow:"
echo "Operator Version: ${{ github.event.inputs.operator-version }}"
echo "Replaces: ${{ github.event.inputs.replaces }}"
echo "MCAD Version: ${{ github.event.inputs.mcad-version }}"
echo "CodeFlare SDK Version: ${{ github.event.inputs.codeflare-sdk-version }}"
echo "InstaScale Version: ${{ github.event.inputs.instascale-version }}"
echo "Tested AppWrapper Version: ${{ github.event.inputs.appwrapper-version }}"
echo "Tested KubeRay Version: ${{ github.event.inputs.kuberay-version }}"
echo "Is Stable: ${{ github.event.inputs.is-stable }}"
echo "CodeFlare Repository Organization: ${{ github.event.inputs.codeflare-repository-organization }}"
echo "Quay Organization: ${{ github.event.inputs.quay-organization }}"
echo "Community Operators Prod Organization: ${{ github.event.inputs.community-operators-prod-organization }}"

release-mcad:
needs: check-kuberay-version
runs-on: ubuntu-latest

steps:
- name: Check if MCAD release does exist
run: |
status_code=$(curl -s -o /dev/null -w "%{http_code}" https://github.com/project-codeflare/multi-cluster-app-dispatcher/releases/tag/${{ github.event.inputs.mcad-version }})
if [[ "$status_code" == "200" ]]; then
echo "MCAD release with version ${{ github.event.inputs.mcad-version }} already exist. Will not create MCAD release."
fi
echo "MCAD_RELEASE_STATUS_CODE=$status_code" >> $GITHUB_ENV

- name: Release MCAD
run: |
gh workflow run mcad-release.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/multi-cluster-app-dispatcher --ref go-1.20 --field tag=${{ github.event.inputs.mcad-version }}
env:
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
shell: bash
if: ${{ env.MCAD_RELEASE_STATUS_CODE != '200' }}

- name: Wait for MCAD run to finish
run: |
# wait for a while for Run to be started
sleep 5
run_id=$(gh run list --workflow mcad-release.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/multi-cluster-app-dispatcher --limit 1 --json databaseId --jq .[].databaseId)
gh run watch ${run_id} --repo ${{ github.event.inputs.codeflare-repository-organization }}/multi-cluster-app-dispatcher --interval 10 --exit-status
env:
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
shell: bash
if: ${{ env.MCAD_RELEASE_STATUS_CODE != '200' }}

release-instascale:
needs: release-mcad
runs-on: ubuntu-latest

steps:
- name: Check if Instascale release does exist
run: |
status_code=$(curl -s -o /dev/null -w "%{http_code}" https://github.com/project-codeflare/instascale/releases/tag/${{ github.event.inputs.instascale-version }})
if [[ "$status_code" == "200" ]]; then
echo "Instascale release with version ${{ github.event.inputs.instascale-version }} already exist. Will not create Instascale release."
fi
echo "INSTASCALE_RELEASE_STATUS_CODE=$status_code" >> $GITHUB_ENV

- name: Release InstaScale
run: |
gh workflow run instascale-release.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/instascale --ref ${{ github.ref }} --field tag=${{ github.event.inputs.instascale-version }} --field mcad-version=${{ github.event.inputs.mcad-version }}
env:
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
shell: bash
if: ${{ env.INSTASCALE_RELEASE_STATUS_CODE != '200' }}

- name: Wait for InstaScale run to finish
run: |
# wait for a while for Run to be started
sleep 5
run_id=$(gh run list --workflow instascale-release.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/instascale --limit 1 --json databaseId --jq .[].databaseId)
gh run watch ${run_id} --repo ${{ github.event.inputs.codeflare-repository-organization }}/instascale --interval 10 --exit-status
env:
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
shell: bash
if: ${{ env.INSTASCALE_RELEASE_STATUS_CODE != '200' }}

release-codeflare-sdk:
needs: check-kuberay-version
needs: [check-appwrapper-version, check-kuberay-version]
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -156,13 +88,13 @@ jobs:
if: ${{ env.SDK_RELEASE_STATUS_CODE != '200' }}

release-codeflare-operator:
needs: [release-mcad, release-instascale, release-codeflare-sdk]
needs: [release-codeflare-sdk]
runs-on: ubuntu-latest

steps:
- name: Release CodeFlare operator
run: |
gh workflow run tag-and-build.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/codeflare-operator --ref ${{ github.ref }} --field is-stable=${{ github.event.inputs.is-stable }} --field version=${{ github.event.inputs.operator-version }} --field replaces=${{ github.event.inputs.replaces }} --field mcad-version=${{ github.event.inputs.mcad-version }} --field codeflare-sdk-version=${{ github.event.inputs.codeflare-sdk-version }} --field instascale-version=${{ github.event.inputs.instascale-version }} --field kuberay-version=${{ github.event.inputs.kuberay-version }} --field quay-organization=${{ github.event.inputs.quay-organization }} --field community-operators-prod-fork-organization=${{ github.event.inputs.codeflare-repository-organization }} --field community-operators-prod-organization=${{ github.event.inputs.community-operators-prod-organization }}
gh workflow run tag-and-build.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/codeflare-operator --ref ${{ github.ref }} --field is-stable=${{ github.event.inputs.is-stable }} --field version=${{ github.event.inputs.operator-version }} --field replaces=${{ github.event.inputs.replaces }} --field appwrapper-version=${{ github.event.inputs.appwrapper-version }} --field codeflare-sdk-version=${{ github.event.inputs.codeflare-sdk-version }} --field kuberay-version=${{ github.event.inputs.kuberay-version }} --field quay-organization=${{ github.event.inputs.quay-organization }} --field community-operators-prod-fork-organization=${{ github.event.inputs.codeflare-repository-organization }} --field community-operators-prod-organization=${{ github.event.inputs.community-operators-prod-organization }}
env:
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
shell: bash
Expand All @@ -177,6 +109,20 @@ jobs:
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
shell: bash

check-appwrapper-version:
runs-on: ubuntu-latest

steps:
- name: Check if AppWrapper release exists
run: |
status_code=$(curl -s -o /dev/null -w "%{http_code}" https://github.com/project-codeflare/appwrapper/releases/tag/${{ github.event.inputs.appwrapper-version }})
if [[ "$status_code" == "200" ]]; then
echo "AppWrapper release with version ${{ github.event.inputs.appwrapper-version }} exists and available to use."
else
echo "AppWrapper release with version ${{ github.event.inputs.appwrapper-version }} does not exist. Please select an existing version."
exit 1
fi

check-kuberay-version:
runs-on: ubuntu-latest

Expand Down
23 changes: 8 additions & 15 deletions .github/workflows/tag-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,14 @@ on:
description: 'The previous semantic version that this tag replaces.'
required: true
default: 'v0.0.0-dev'
mcad-version:
description: 'Published version of multi-cluster-app-dispatcher'
appwrapper-version:
description: 'Published version of appwrapper'
required: true
default: 'v0.0.0-dev'
codeflare-sdk-version:
description: 'Published version of CodeFlare-SDK'
required: true
default: 'v0.0.0-dev'
instascale-version:
description: 'Published version of InstaScale'
required: true
default: 'v0.0.0-dev'
kuberay-version:
description: 'Tested version of KubeRay'
required: true
Expand Down Expand Up @@ -64,7 +60,7 @@ jobs:
- name: Set Go
uses: actions/setup-go@v5
with:
go-version: v1.20
go-version-file: './go.mod'

- name: Verify that release doesn't exist yet
shell: bash {0}
Expand All @@ -90,16 +86,14 @@ jobs:
- name: Adjust Compatibility Matrix in readme
run: |
sed -i -E "s|(.*CodeFlare Operator.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.version }}\2${{ github.event.inputs.version }}\3|" README.md
sed -i -E "s|(.*Multi-Cluster App Dispatcher.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.mcad-version }}\2${{ github.event.inputs.mcad-version }}\3|" README.md
sed -i -E "s|(.*AppWrapper.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.appwrapper-version }}\2${{ github.event.inputs.appwrapper-version }}\3|" README.md
sed -i -E "s|(.*CodeFlare-SDK.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.codeflare-sdk-version }}\2${{ github.event.inputs.codeflare-sdk-version }}\3|" README.md
sed -i -E "s|(.*InstaScale.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.instascale-version }}\2${{ github.event.inputs.instascale-version }}\3|" README.md
sed -i -E "s|(.*KubeRay.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.kuberay-version }}\2${{ github.event.inputs.kuberay-version }}\3|" README.md

- name: Adjust MCAD, SDK and InstaScale dependencies in the code
- name: Adjust AppWrapper and SDK dependencies in the code
run: |
sed -i -E "s/(.*MCAD_VERSION \?= ).*/\1${{ github.event.inputs.mcad-version }}/" Makefile
sed -i -E "s/(.*MCAD_REF \?= ).*/\1release-\${MCAD_VERSION}/" Makefile
sed -i -E "s/(.*INSTASCALE_VERSION \?= ).*/\1${{ github.event.inputs.instascale-version }}/" Makefile
sed -i -E "s/(.*APPWRAPPER_VERSION \?= ).*/\1${{ github.event.inputs.appwrapper-version }}/" Makefile
sed -i -E "s/(.*APPWRAPPER_REF \?= ).*/\1release-\${APPWRAPPER_VERSION}/" Makefile
sed -i -E "s/(.*KUBERAY_VERSION \?= ).*/\1${{ github.event.inputs.kuberay-version }}/" Makefile

- name: Update image version in params.env
Expand Down Expand Up @@ -192,8 +186,7 @@ jobs:
env:
VERSION: ${{ github.event.inputs.version }}
PREVIOUS_VERSION: ${{ github.event.inputs.replaces }}
INSTASCALE_VERSION: ${{ github.event.inputs.instascale-version }}
MCAD_VERSION: ${{ github.event.inputs.mcad-version }}
APPWRAPPER_VERSION: ${{ github.event.inputs.appwrapper-version }}
GH_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
OPERATORS_REPO_FORK_ORG: ${{ github.event.inputs.community-operators-prod-fork-organization }}
OPERATORS_REPO_ORG: ${{ github.event.inputs.community-operators-prod-organization }}
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container:
image: quay.io/opendatahub/pre-commit-go-toolchain:v0.2 # https://github.com/opendatahub-io/data-science-pipelines-operator/blob/main/.github
env:
XDG_CACHE_HOME: /cache
GOCACHE: /cache/go-build
GOMODCACHE: /cache/go-mod
PRE_COMMIT_HOME: /cache/pre-commit
volumes:
- /cache
# DISABLED: This container has go 1.20
# container:
# image: quay.io/opendatahub/pre-commit-go-toolchain:v0.2 # https://github.com/opendatahub-io/data-science-pipelines-operator/blob/main/.github
# env:
# XDG_CACHE_HOME: /cache
# GOCACHE: /cache/go-build
# GOMODCACHE: /cache/go-mod
# PRE_COMMIT_HOME: /cache/pre-commit
# volumes:
# - /cache
steps:
- uses: actions/checkout@v4

- name: Set Go
uses: actions/setup-go@v5
with:
go-version: v1.20
go-version-file: './go.mod'

- name: Activate cache
uses: actions/cache@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/verify_generated_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set Go
uses: actions/setup-go@v5
with:
go-version: v1.20
go-version-file: './go.mod'
- name: Verify that imports are organized
run: make verify-imports

Expand All @@ -35,6 +35,6 @@ jobs:
- name: Set Go
uses: actions/setup-go@v5
with:
go-version: v1.20
go-version-file: './go.mod'
- name: Verify that the latest WebhookConfigurations, ClusterRoles, and CustomResourceDefinitions have been generated
run: make manifests && git diff --exit-code
Loading
Loading