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

Sync with Upstream #32

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion .github/workflows/project-codeflare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ on:
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
is-stable:
description: 'Select if the built images should be tagged as stable'
required: true
Expand Down Expand Up @@ -156,7 +159,7 @@ jobs:
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 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 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 }}
env:
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tag-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ jobs:
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/(.*KUBERAY_VERSION \?= ).*/\1${{ github.event.inputs.kuberay-version }}/" Makefile

- name: Login to Quay.io
uses: redhat-actions/podman-login@v1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CodeFlare Stack Compatibility Matrix
| Multi-Cluster App Dispatcher | [v1.38.1](https://github.com/project-codeflare/multi-cluster-app-dispatcher/releases/tag/v1.38.1) |
| CodeFlare-SDK | [v0.12.1](https://github.com/project-codeflare/codeflare-sdk/releases/tag/v0.12.1) |
| InstaScale | [v0.3.1](https://github.com/project-codeflare/instascale/releases/tag/v0.3.1) |
| KubeRay | [v0.0.0-dev](https://github.com/opendatahub-io/kuberay/releases/tag/v0.0.0-dev) |
| KubeRay | [v1.0.0-rc.0](https://github.com/opendatahub-io/kuberay/releases/tag/v1.0.0-rc.0) |
<!-- Compatibility Matrix end -->

## Development
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ require (
k8s.io/apimachinery v0.26.3
k8s.io/client-go v0.26.3
k8s.io/component-base v0.26.2
k8s.io/klog/v2 v2.90.1
k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5
sigs.k8s.io/controller-runtime v0.14.6
sigs.k8s.io/yaml v1.3.0
Expand Down Expand Up @@ -114,7 +115,6 @@ require (
k8s.io/apiextensions-apiserver v0.26.1 // indirect
k8s.io/apiserver v0.26.2 // indirect
k8s.io/klog v1.0.0 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kms v0.26.2 // indirect
k8s.io/kube-openapi v0.0.0-20230303024457-afdc3dddf62d // indirect
k8s.io/metrics v0.26.2 // indirect
Expand Down
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
_ "k8s.io/client-go/plugin/pkg/client/auth"
"k8s.io/client-go/rest"
configv1alpha1 "k8s.io/component-base/config/v1alpha1"
"k8s.io/klog/v2"
"k8s.io/utils/pointer"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
Expand Down Expand Up @@ -90,6 +91,8 @@ func main() {
flag.Parse()

ctrl.SetLogger(zap.New(zap.UseFlagOptions(&zapOptions)))
klog.SetLogger(ctrl.Log)

setupLog.Info("Build info",
"operatorVersion", OperatorVersion,
"mcadVersion", McadVersion,
Expand Down
22 changes: 22 additions & 0 deletions test/e2e/install-codeflare-sdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# go to codeflare-sdk folder and install codeflare-sdk
cd ..

# Install Poetry and configure virtualenvs
pip install poetry
poetry config virtualenvs.create false

cd codeflare-sdk
# Clone the CodeFlare SDK repository
git clone --branch main https://github.com/project-codeflare/codeflare-sdk.git

cd codeflare-sdk

# Lock dependencies and install them
poetry lock --no-update
poetry install --with test,docs

# Return to the workdir
cd ../..
cd workdir
2 changes: 1 addition & 1 deletion test/e2e/mnist_raycluster_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

done = False
time = 0
timeout = 300
timeout = 900
while not done:
status = job.status()
if is_terminal(status.state):
Expand Down
14 changes: 13 additions & 1 deletion test/e2e/mnist_raycluster_sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func TestMNISTRayClusterSDK(t *testing.T) {
"requirements.txt": ReadFile(test, "mnist_pip_requirements.txt"),
// MNIST training script
"mnist.py": ReadFile(test, "mnist.py"),
// codeflare-sdk installation script
"install-codeflare-sdk.sh": ReadFile(test, "install-codeflare-sdk.sh"),
})

// Create RBAC, retrieve token for user with limited rights
Expand Down Expand Up @@ -119,12 +121,16 @@ func TestMNISTRayClusterSDK(t *testing.T) {
{Name: "PYTHONUSERBASE", Value: "/workdir"},
{Name: "RAY_IMAGE", Value: GetRayImage()},
},
Command: []string{"/bin/sh", "-c", "pip install codeflare-sdk==" + GetCodeFlareSDKVersion() + " && cp /test/* . && python mnist_raycluster_sdk.py" + " " + namespace.Name},
Command: []string{"/bin/sh", "-c", "cp /test/* . && chmod +x install-codeflare-sdk.sh && ./install-codeflare-sdk.sh && python mnist_raycluster_sdk.py" + " " + namespace.Name},
VolumeMounts: []corev1.VolumeMount{
{
Name: "test",
MountPath: "/test",
},
{
Name: "codeflare-sdk",
MountPath: "/codeflare-sdk",
},
{
Name: "workdir",
MountPath: "/workdir",
Expand Down Expand Up @@ -154,6 +160,12 @@ func TestMNISTRayClusterSDK(t *testing.T) {
},
},
},
{
Name: "codeflare-sdk",
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
},
{
Name: "workdir",
VolumeSource: corev1.VolumeSource{
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/project-codeflare/codeflare-common/support"
)

//go:embed *.py *.txt
//go:embed *.py *.txt *.sh
var files embed.FS

func ReadFile(t support.Test, fileName string) []byte {
Expand Down