Skip to content

Commit 908f737

Browse files
committed
Enable TestMNISTRayClusterSDK test
1 parent e95759a commit 908f737

File tree

8 files changed

+107
-269
lines changed

8 files changed

+107
-269
lines changed

.github/actions/kind/action.yml

+16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: "Set up KinD"
22
description: "Step to start and configure KinD cluster"
33

4+
inputs:
5+
kind-node-hostname:
6+
description: "Hostname of the main kind node"
7+
required: false
8+
default: kind
9+
410
runs:
511
using: "composite"
612
steps:
@@ -56,3 +62,13 @@ runs:
5662
curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/"${VERSION}"/deploy/static/provider/kind/deploy.yaml | sed "s/--publish-status-address=localhost/--report-node-internal-ip-address\\n - --status-update-interval=10/g" | kubectl apply -f -
5763
kubectl annotate ingressclass nginx "ingressclass.kubernetes.io/is-default-class=true"
5864
kubectl -n ingress-nginx wait --timeout=300s --for=condition=Available deployments --all
65+
66+
- name: Add ${{ inputs.kind-node-hostname }} host to machine hosts
67+
shell: bash
68+
run: echo "127.0.0.1 ${{ inputs.kind-node-hostname }}" | sudo tee -a /etc/hosts
69+
70+
- name: Set env variables for tests to properly leverage KinD cluster
71+
shell: bash
72+
run: |
73+
echo "CLUSTER_TYPE=KIND" >> $GITHUB_ENV
74+
echo "CLUSTER_HOSTNAME=${{ inputs.kind-node-hostname }}" >> $GITHUB_ENV

.github/workflows/e2e_tests.yaml

+8-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
echo "CODEFLARE_TEST_OUTPUT_DIR=${CODEFLARE_TEST_OUTPUT_DIR}" >> $GITHUB_ENV
7272
7373
set -euo pipefail
74-
go test -timeout 30m -v ./test/e2e -json 2>&1 | tee ${CODEFLARE_TEST_OUTPUT_DIR}/gotest.log | gotestfmt
74+
go test -timeout 30m -run TestMNISTRayClusterSDK -v ./test/e2e -json 2>&1 | tee ${CODEFLARE_TEST_OUTPUT_DIR}/gotest.log | gotestfmt
7575
7676
- name: Print CodeFlare operator logs
7777
if: always() && steps.deploy.outcome == 'success'
@@ -85,6 +85,13 @@ jobs:
8585
echo "Printing KubeRay operator logs"
8686
kubectl logs -n ray-system --tail -1 -l app.kubernetes.io/name=kuberay | tee ${CODEFLARE_TEST_OUTPUT_DIR}/kuberay.log
8787
88+
- name: Print Ingress
89+
if: always() && steps.deploy.outcome == 'success'
90+
run: |
91+
echo "Printing Ingress"
92+
kubectl describe ingress -A
93+
kubectl get ingress -A -o yaml
94+
8895
- name: Upload logs
8996
uses: actions/upload-artifact@v3
9097
if: always() && steps.deploy.outcome == 'success'

.github/workflows/olm_tests.yaml

-174
This file was deleted.

go.mod

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ require (
2121

2222
replace sigs.k8s.io/custom-metrics-apiserver => sigs.k8s.io/custom-metrics-apiserver v1.25.1-0.20230306170449-63d8c93851f3
2323

24+
replace github.com/project-codeflare/codeflare-common => github.com/sutaakar/codeflare-common v0.0.0-20231110120152-dbaedcac175e
25+
2426
require (
2527
github.com/NYTimes/gziphandler v1.1.1 // indirect
2628
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,6 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
391391
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
392392
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
393393
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
394-
github.com/project-codeflare/codeflare-common v0.0.0-20231023092720-93d03492db16 h1:TRMLDP6IYt0CAd3+BkvY/r2lkpjI3sOsxf3tnQojZ9k=
395-
github.com/project-codeflare/codeflare-common v0.0.0-20231023092720-93d03492db16/go.mod h1:zdi2GCYJX+QyxFWyCLMoTme3NMz/aucWDJWMqKfigxk=
396394
github.com/project-codeflare/instascale v0.3.0 h1:PSlwbqqUsFTkTQ5KUhMFRebfokySnEZwav97xZixLQs=
397395
github.com/project-codeflare/instascale v0.3.0/go.mod h1:IU1Wl+zqTpMpZ49BOcr6U+A6gF3AjcmFdKo9ZwP3TDI=
398396
github.com/project-codeflare/multi-cluster-app-dispatcher v1.38.0 h1:dU2Ev0SijdNm30Y9mjdKJL1Fp6l07rnRBKhSbx1kX9g=
@@ -463,6 +461,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
463461
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
464462
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
465463
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
464+
github.com/sutaakar/codeflare-common v0.0.0-20231110120152-dbaedcac175e h1:xWNK1SCWHkmlpnelVjnmAYdoCTJ466B21Ssa1GGUbk4=
465+
github.com/sutaakar/codeflare-common v0.0.0-20231110120152-dbaedcac175e/go.mod h1:zdi2GCYJX+QyxFWyCLMoTme3NMz/aucWDJWMqKfigxk=
466466
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA=
467467
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
468468
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=

test/e2e/kind.sh

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ nodes:
3030
nodeRegistration:
3131
kubeletExtraArgs:
3232
node-labels: "ingress-ready=true"
33+
extraPortMappings:
34+
- containerPort: 80
35+
hostPort: 80
36+
listenAddress: "0.0.0.0"
37+
protocol: tcp
3338
EOF
3439

3540
echo "Deploying Ingress controller into KinD cluster"

test/e2e/mnist_raycluster_sdk.py

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2+
import os
23

34
from time import sleep
45

@@ -9,16 +10,36 @@
910

1011
namespace = sys.argv[1]
1112

13+
ingress_options = {}
14+
15+
host = os.getenv('CLUSTER_HOSTNAME')
16+
if host is not None:
17+
ingress_options = {
18+
"ingresses": [
19+
{
20+
"ingressName": "ray-dashboard",
21+
"port": 8265,
22+
"pathType": "Prefix",
23+
"path": "/",
24+
"host": host,
25+
},
26+
]
27+
}
28+
29+
1230
cluster = Cluster(ClusterConfiguration(
1331
name='mnist',
1432
namespace=namespace,
1533
num_workers=1,
34+
head_cpus='500m',
35+
head_memory=2,
1636
min_cpus='500m',
1737
max_cpus=1,
1838
min_memory=0.5,
19-
max_memory=1,
39+
max_memory=2,
2040
num_gpus=0,
2141
instascale=False,
42+
ingress_options = ingress_options
2243
))
2344

2445
cluster.up()

0 commit comments

Comments
 (0)