Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
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
  • Loading branch information
dgrove-oss committed Apr 4, 2024
commit a7a9bca1bf395bd89aea4eb1dd937c2f97819543
2 changes: 1 addition & 1 deletion .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 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
2 changes: 1 addition & 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 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
69 changes: 17 additions & 52 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: 'Version of appwrapper to be released (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,78 +45,46 @@ 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 "AppWrapper Version: ${{ github.event.inputs.appwrapper-version }}"
echo "CodeFlare SDK Version: ${{ github.event.inputs.codeflare-sdk-version }}"
echo "InstaScale Version: ${{ github.event.inputs.instascale-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:
release-appwrapper:
needs: check-kuberay-version
runs-on: ubuntu-latest

steps:
- name: Check if MCAD release does exist
- name: Check if AppWrapper 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 }})
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 "MCAD release with version ${{ github.event.inputs.mcad-version }} already exist. Will not create MCAD release."
echo "AppWrapper release with version ${{ github.event.inputs.appwrapper-version }} already exist. Will not create AppWrapper release."
fi
echo "MCAD_RELEASE_STATUS_CODE=$status_code" >> $GITHUB_ENV
echo "APPWRAPPER_RELEASE_STATUS_CODE=$status_code" >> $GITHUB_ENV

- name: Release MCAD
- name: Release AppWrapper
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 }}
gh workflow run release.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/appwrapper --field tag=${{ github.event.inputs.appwrapper-version }}
env:
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
shell: bash
if: ${{ env.MCAD_RELEASE_STATUS_CODE != '200' }}
if: ${{ env.APPWRAPPER_RELEASE_STATUS_CODE != '200' }}

- name: Wait for MCAD run to finish
- name: Wait for AppWrapper 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
run_id=$(gh run list --workflow release.yml --repo ${{ github.event.inputs.codeflare-repository-organization }}/appwrapper --limit 1 --json databaseId --jq .[].databaseId)
gh run watch ${run_id} --repo ${{ github.event.inputs.codeflare-repository-organization }}/appwrapper --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
if: ${{ env.APPWRAPPER_RELEASE_STATUS_CODE != '200' }}

- 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
Expand Down Expand Up @@ -156,13 +121,13 @@ jobs:
if: ${{ env.SDK_RELEASE_STATUS_CODE != '200' }}

release-codeflare-operator:
needs: [release-mcad, release-instascale, release-codeflare-sdk]
needs: [release-appwrapper, 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 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
11 changes: 9 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ repos:
entry: yamllint --strict

- repo: https://github.com/dnephin/pre-commit-golang
rev: c17f835cf9
rev: v0.5.1
hooks:
- id: go-fmt
- id: golangci-lint
- id: go-mod-tidy

- repo: local
hooks:
- id: golangci-lint
name: golangci-lint
entry: make lint
language: system
pass_filenames: false
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ The following should be installed in your working environment:
## Basic Overview
The main entrypoint for the operator is `main.go`

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

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

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

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

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

Expand Down
Loading