Skip to content

Commit f20d523

Browse files
committed
Upgrade to AppWrapper v1beta2
1. Upgrade AppWrapper from v1beta1 to v1beta2 2. Remove MCADv1 controller 3. Add AppWrapper controller 4. Remove InstaScale controller 5. Update build, test, and CI accordingly 6. Adjust Dockerfile because go-toolset:1.21 doesn't exist
1 parent 2b5d9b8 commit f20d523

39 files changed

+604
-1668
lines changed

.github/workflows/e2e_tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Set Go
4646
uses: actions/setup-go@v5
4747
with:
48-
go-version: v1.20
48+
go-version-file: './go.mod'
4949

5050
- name: Set up gotestfmt
5151
uses: gotesttools/gotestfmt-action@v2

.github/workflows/mnist-job-test-image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set Go
2020
uses: actions/setup-go@v5
2121
with:
22-
go-version: v1.20
22+
go-version-file: './go.mod'
2323

2424
- name: Login to Quay.io
2525
id: podman-login-quay

.github/workflows/olm_tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: Set Go
4545
uses: actions/setup-go@v5
4646
with:
47-
go-version: v1.20
47+
go-version-file: './go.mod'
4848

4949
- name: Set up gotestfmt
5050
uses: gotesttools/gotestfmt-action@v2

.github/workflows/operator-image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Set Go
2323
uses: actions/setup-go@v5
2424
with:
25-
go-version: v1.20
25+
go-version-file: './go.mod'
2626

2727
- name: Login to Quay.io
2828
id: podman-login-quay

.github/workflows/precommit.yml

+24-14
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,38 @@ on:
1111
jobs:
1212
precommit:
1313
runs-on: ubuntu-latest
14-
container:
15-
image: quay.io/opendatahub/pre-commit-go-toolchain:v0.2 # https://github.com/opendatahub-io/data-science-pipelines-operator/blob/main/.github
16-
env:
17-
XDG_CACHE_HOME: /cache
18-
GOCACHE: /cache/go-build
19-
GOMODCACHE: /cache/go-mod
20-
PRE_COMMIT_HOME: /cache/pre-commit
21-
volumes:
22-
- /cache
14+
# DISABLED: This container has go 1.20
15+
# container:
16+
# image: quay.io/opendatahub/pre-commit-go-toolchain:v0.2 # https://github.com/opendatahub-io/data-science-pipelines-operator/blob/main/.github
17+
# env:
18+
# XDG_CACHE_HOME: /cache
19+
# GOCACHE: /cache/go-build
20+
# GOMODCACHE: /cache/go-mod
21+
# PRE_COMMIT_HOME: /cache/pre-commit
22+
# volumes:
23+
# - /cache
2324
steps:
2425
- uses: actions/checkout@v4
2526

2627
- name: Set Go
2728
uses: actions/setup-go@v5
2829
with:
29-
go-version: v1.20
30+
go-version-file: './go.mod'
3031

31-
- name: Activate cache
32-
uses: actions/cache@v4
32+
# Compensate for lack of pre-commit-go-toolchain image
33+
- name: Set up Python
34+
uses: actions/setup-python@v5
3335
with:
34-
path: /cache
35-
key: ${{ runner.os }}-cache-${{ hashFiles('**/go.sum', '.pre-commit-config.yaml') }}
36+
python-version: '3.9'
37+
- name: Install pre-commit
38+
run: |
39+
pip install pre-commit
40+
41+
# - name: Activate cache
42+
# uses: actions/cache@v4
43+
# with:
44+
# path: /cache
45+
# key: ${{ runner.os }}-cache-${{ hashFiles('**/go.sum', '.pre-commit-config.yaml') }}
3646

3747
- name: Run pre-commit checks
3848
run: pre-commit run --all-files

.github/workflows/project-codeflare-release.yml

+17-52
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,12 @@ on:
1010
replaces:
1111
description: 'The previous operator semantic version that this release replaces (for example: v0.0.0)'
1212
required: true
13-
mcad-version:
14-
description: 'Version of multi-cluster-app-dispatcher to be released (for example: v0.0.0)'
13+
appwrapper-version:
14+
description: 'Version of appwrapper to be released (for example: v0.0.0)'
1515
required: true
1616
codeflare-sdk-version:
1717
description: 'Version of CodeFlare-SDK to be released (for example: v0.0.0)'
1818
required: true
19-
instascale-version:
20-
description: 'Version of InstaScale to be released (for example: v0.0.0)'
21-
required: true
2219
kuberay-version:
2320
description: 'Tested version of KubeRay (for example: v0.0.0)'
2421
required: true
@@ -48,78 +45,46 @@ jobs:
4845
echo "Below are the release parameters set for the workflow:"
4946
echo "Operator Version: ${{ github.event.inputs.operator-version }}"
5047
echo "Replaces: ${{ github.event.inputs.replaces }}"
51-
echo "MCAD Version: ${{ github.event.inputs.mcad-version }}"
48+
echo "AppWrapper Version: ${{ github.event.inputs.appwrapper-version }}"
5249
echo "CodeFlare SDK Version: ${{ github.event.inputs.codeflare-sdk-version }}"
53-
echo "InstaScale Version: ${{ github.event.inputs.instascale-version }}"
5450
echo "Tested KubeRay Version: ${{ github.event.inputs.kuberay-version }}"
5551
echo "Is Stable: ${{ github.event.inputs.is-stable }}"
5652
echo "CodeFlare Repository Organization: ${{ github.event.inputs.codeflare-repository-organization }}"
5753
echo "Quay Organization: ${{ github.event.inputs.quay-organization }}"
5854
echo "Community Operators Prod Organization: ${{ github.event.inputs.community-operators-prod-organization }}"
5955
60-
release-mcad:
56+
release-appwrapper:
6157
needs: check-kuberay-version
6258
runs-on: ubuntu-latest
6359

6460
steps:
65-
- name: Check if MCAD release does exist
61+
- name: Check if AppWrapper release does exist
6662
run: |
67-
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 }})
63+
status_code=$(curl -s -o /dev/null -w "%{http_code}" https://github.com/project-codeflare/appwrapper/releases/tag/${{ github.event.inputs.appwrapper-version }})
6864
if [[ "$status_code" == "200" ]]; then
69-
echo "MCAD release with version ${{ github.event.inputs.mcad-version }} already exist. Will not create MCAD release."
65+
echo "AppWrapper release with version ${{ github.event.inputs.appwrapper-version }} already exist. Will not create AppWrapper release."
7066
fi
71-
echo "MCAD_RELEASE_STATUS_CODE=$status_code" >> $GITHUB_ENV
67+
echo "APPWRAPPER_RELEASE_STATUS_CODE=$status_code" >> $GITHUB_ENV
7268
73-
- name: Release MCAD
69+
- name: Release AppWrapper
7470
run: |
75-
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 }}
71+
gh workflow run release.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/appwrapper --field tag=${{ github.event.inputs.appwrapper-version }}
7672
env:
7773
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
7874
shell: bash
79-
if: ${{ env.MCAD_RELEASE_STATUS_CODE != '200' }}
75+
if: ${{ env.APPWRAPPER_RELEASE_STATUS_CODE != '200' }}
8076

81-
- name: Wait for MCAD run to finish
77+
- name: Wait for AppWrapper run to finish
8278
run: |
8379
# wait for a while for Run to be started
8480
sleep 5
85-
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)
86-
gh run watch ${run_id} --repo ${{ github.event.inputs.codeflare-repository-organization }}/multi-cluster-app-dispatcher --interval 10 --exit-status
81+
run_id=$(gh run list --workflow release.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/appwrapper --limit 1 --json databaseId --jq .[].databaseId)
82+
gh run watch ${run_id} --repo ${{ github.event.inputs.codeflare-repository-organization }}/appwrapper --interval 10 --exit-status
8783
env:
8884
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
8985
shell: bash
90-
if: ${{ env.MCAD_RELEASE_STATUS_CODE != '200' }}
91-
92-
release-instascale:
93-
needs: release-mcad
94-
runs-on: ubuntu-latest
95-
96-
steps:
97-
- name: Check if Instascale release does exist
98-
run: |
99-
status_code=$(curl -s -o /dev/null -w "%{http_code}" https://github.com/project-codeflare/instascale/releases/tag/${{ github.event.inputs.instascale-version }})
100-
if [[ "$status_code" == "200" ]]; then
101-
echo "Instascale release with version ${{ github.event.inputs.instascale-version }} already exist. Will not create Instascale release."
102-
fi
103-
echo "INSTASCALE_RELEASE_STATUS_CODE=$status_code" >> $GITHUB_ENV
86+
if: ${{ env.APPWRAPPER_RELEASE_STATUS_CODE != '200' }}
10487

105-
- name: Release InstaScale
106-
run: |
107-
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 }}
108-
env:
109-
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
110-
shell: bash
111-
if: ${{ env.INSTASCALE_RELEASE_STATUS_CODE != '200' }}
112-
113-
- name: Wait for InstaScale run to finish
114-
run: |
115-
# wait for a while for Run to be started
116-
sleep 5
117-
run_id=$(gh run list --workflow instascale-release.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/instascale --limit 1 --json databaseId --jq .[].databaseId)
118-
gh run watch ${run_id} --repo ${{ github.event.inputs.codeflare-repository-organization }}/instascale --interval 10 --exit-status
119-
env:
120-
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
121-
shell: bash
122-
if: ${{ env.INSTASCALE_RELEASE_STATUS_CODE != '200' }}
12388

12489
release-codeflare-sdk:
12590
needs: check-kuberay-version
@@ -156,13 +121,13 @@ jobs:
156121
if: ${{ env.SDK_RELEASE_STATUS_CODE != '200' }}
157122

158123
release-codeflare-operator:
159-
needs: [release-mcad, release-instascale, release-codeflare-sdk]
124+
needs: [release-appwrapper, release-codeflare-sdk]
160125
runs-on: ubuntu-latest
161126

162127
steps:
163128
- name: Release CodeFlare operator
164129
run: |
165-
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 }}
130+
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 }}
166131
env:
167132
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
168133
shell: bash

.github/workflows/tag-and-build.yml

+8-15
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,14 @@ on:
1212
description: 'The previous semantic version that this tag replaces.'
1313
required: true
1414
default: 'v0.0.0-dev'
15-
mcad-version:
16-
description: 'Published version of multi-cluster-app-dispatcher'
15+
appwrapper-version:
16+
description: 'Published version of appwrapper'
1717
required: true
1818
default: 'v0.0.0-dev'
1919
codeflare-sdk-version:
2020
description: 'Published version of CodeFlare-SDK'
2121
required: true
2222
default: 'v0.0.0-dev'
23-
instascale-version:
24-
description: 'Published version of InstaScale'
25-
required: true
26-
default: 'v0.0.0-dev'
2723
kuberay-version:
2824
description: 'Tested version of KubeRay'
2925
required: true
@@ -64,7 +60,7 @@ jobs:
6460
- name: Set Go
6561
uses: actions/setup-go@v5
6662
with:
67-
go-version: v1.20
63+
go-version-file: './go.mod'
6864

6965
- name: Verify that release doesn't exist yet
7066
shell: bash {0}
@@ -90,16 +86,14 @@ jobs:
9086
- name: Adjust Compatibility Matrix in readme
9187
run: |
9288
sed -i -E "s|(.*CodeFlare Operator.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.version }}\2${{ github.event.inputs.version }}\3|" README.md
93-
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
89+
sed -i -E "s|(.*AppWrapper.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.appwrapper-version }}\2${{ github.event.inputs.appwrapper-version }}\3|" README.md
9490
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
95-
sed -i -E "s|(.*InstaScale.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.instascale-version }}\2${{ github.event.inputs.instascale-version }}\3|" README.md
9691
sed -i -E "s|(.*KubeRay.*\[).*(\].*releases/tag/).*(\).*)|\1${{ github.event.inputs.kuberay-version }}\2${{ github.event.inputs.kuberay-version }}\3|" README.md
9792
98-
- name: Adjust MCAD, SDK and InstaScale dependencies in the code
93+
- name: Adjust AppWrapper and SDK dependencies in the code
9994
run: |
100-
sed -i -E "s/(.*MCAD_VERSION \?= ).*/\1${{ github.event.inputs.mcad-version }}/" Makefile
101-
sed -i -E "s/(.*MCAD_REF \?= ).*/\1release-\${MCAD_VERSION}/" Makefile
102-
sed -i -E "s/(.*INSTASCALE_VERSION \?= ).*/\1${{ github.event.inputs.instascale-version }}/" Makefile
95+
sed -i -E "s/(.*APPWRAPPER_VERSION \?= ).*/\1${{ github.event.inputs.appwrapper-version }}/" Makefile
96+
sed -i -E "s/(.*APPWRAPPER_REF \?= ).*/\1release-\${APPWRAPPER_VERSION}/" Makefile
10397
sed -i -E "s/(.*KUBERAY_VERSION \?= ).*/\1${{ github.event.inputs.kuberay-version }}/" Makefile
10498
10599
- name: Update image version in params.env
@@ -192,8 +186,7 @@ jobs:
192186
env:
193187
VERSION: ${{ github.event.inputs.version }}
194188
PREVIOUS_VERSION: ${{ github.event.inputs.replaces }}
195-
INSTASCALE_VERSION: ${{ github.event.inputs.instascale-version }}
196-
MCAD_VERSION: ${{ github.event.inputs.mcad-version }}
189+
APPWRAPPER_VERSION: ${{ github.event.inputs.appwrapper-version }}
197190
GH_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
198191
OPERATORS_REPO_FORK_ORG: ${{ github.event.inputs.community-operators-prod-fork-organization }}
199192
OPERATORS_REPO_ORG: ${{ github.event.inputs.community-operators-prod-organization }}

.github/workflows/unit_tests.yml

+11-10
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,23 @@ on:
1212
jobs:
1313
build:
1414
runs-on: ubuntu-latest
15-
container:
16-
image: quay.io/opendatahub/pre-commit-go-toolchain:v0.2 # https://github.com/opendatahub-io/data-science-pipelines-operator/blob/main/.github
17-
env:
18-
XDG_CACHE_HOME: /cache
19-
GOCACHE: /cache/go-build
20-
GOMODCACHE: /cache/go-mod
21-
PRE_COMMIT_HOME: /cache/pre-commit
22-
volumes:
23-
- /cache
15+
# DISABLED: This container has go 1.20
16+
# container:
17+
# image: quay.io/opendatahub/pre-commit-go-toolchain:v0.2 # https://github.com/opendatahub-io/data-science-pipelines-operator/blob/main/.github
18+
# env:
19+
# XDG_CACHE_HOME: /cache
20+
# GOCACHE: /cache/go-build
21+
# GOMODCACHE: /cache/go-mod
22+
# PRE_COMMIT_HOME: /cache/pre-commit
23+
# volumes:
24+
# - /cache
2425
steps:
2526
- uses: actions/checkout@v4
2627

2728
- name: Set Go
2829
uses: actions/setup-go@v5
2930
with:
30-
go-version: v1.20
31+
go-version-file: './go.mod'
3132

3233
- name: Activate cache
3334
uses: actions/cache@v4

.github/workflows/verify_generated_files.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Set Go
2525
uses: actions/setup-go@v5
2626
with:
27-
go-version: v1.20
27+
go-version-file: './go.mod'
2828
- name: Verify that imports are organized
2929
run: make verify-imports
3030

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

.pre-commit-config.yaml

+9-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,15 @@ repos:
2121
entry: yamllint --strict
2222

2323
- repo: https://github.com/dnephin/pre-commit-golang
24-
rev: c17f835cf9
24+
rev: v0.5.1
2525
hooks:
2626
- id: go-fmt
27-
- id: golangci-lint
2827
- id: go-mod-tidy
28+
29+
- repo: local
30+
hooks:
31+
- id: golangci-lint
32+
name: golangci-lint
33+
entry: make lint
34+
language: system
35+
pass_filenames: false

CONTRIBUTING.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ The following should be installed in your working environment:
1414
## Basic Overview
1515
The main entrypoint for the operator is `main.go`
1616

17-
The MCAD and InstaScale custom resources are defined under the `api` dir:
18-
- See `mcad_types.go` and `instascale_types.go`
17+
The AppWrapper custom resources are defined under the `api` dir:
18+
- See `appwraper_types.go`
1919

20-
The MCAD and InstaScale resource templates can be found under `config/internal`:
21-
- Sorted under `mcad` and `instascale` subdirs
20+
The AppWrapper resource templates can be found under `config/internal`:
21+
- Sorted under `appwrapper` subdirs
2222

23-
The code for MCAD/InstaScale resource reconcilliation can be found in the `controllers` dir:
24-
- See `mcad_controller.go` and `instascale_controller.go`
23+
The code for AppWrapper resource reconcilliation can be found in the `controllers` dir:
24+
- See `appwrapper_controller.go`
2525

2626
## Building and Deployment
2727
If changes are made in the `api` dir, run: `make manifests`
@@ -53,7 +53,7 @@ The CodeFlare Operator currently has unit tests and pre-commit checks
5353
- Note that both are required for CI to pass on pull requests
5454

5555
To write and inspect unit tests:
56-
- MCAD and InstaScale unit tests under `mcad_controller_test.go` and `instascale_controller_test.go` in the `controllers` dir
56+
- AppWrapper unit tests under `appwrapper_controller_test.go` in the `controllers` dir
5757
- Unit test functions are defined in `suite_test.go` (with utils in `util/util.go`) in the `controllers dir`
5858
- Test cases defined under `controllers/testdata`
5959

0 commit comments

Comments
 (0)