Skip to content

Commit 8fb9608

Browse files
Updating PR
1 parent ac589b3 commit 8fb9608

14 files changed

+584
-68
lines changed

.github/workflows/e2e_tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ jobs:
8080
echo Deploying CodeFlare operator
8181
IMG="${REGISTRY_ADDRESS}"/codeflare-operator
8282
make image-push -e IMG="${IMG}"
83-
make deploy -e IMG="${IMG}"
83+
make deploy -e IMG="${IMG}" -e ENV="e2e"
8484
kubectl wait --timeout=120s --for=condition=Available=true deployment -n openshift-operators codeflare-operator-manager
8585
8686
echo Setting up CodeFlare stack
8787
make setup-e2e
88-
make defaults manifests generate fmt vet
88+
make defaults manifests fmt vet
8989
9090
cd ..
9191

go.mod

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,56 @@ go 1.19
44

55
require (
66
github.com/onsi/gomega v1.27.10
7+
github.com/project-codeflare/codeflare-common v0.0.0-20231023092720-93d03492db16
78
github.com/project-codeflare/codeflare-operator v0.1.0
8-
github.com/project-codeflare/multi-cluster-app-dispatcher v1.33.0
9-
github.com/ray-project/kuberay/ray-operator v0.0.0-20230813033553-4892ac1094e7
9+
github.com/project-codeflare/multi-cluster-app-dispatcher v1.37.0
10+
github.com/ray-project/kuberay/ray-operator v1.0.0
1011
k8s.io/api v0.26.3
1112
k8s.io/apimachinery v0.26.3
1213
)
1314

1415
require (
16+
github.com/aymerick/douceur v0.2.0 // indirect
17+
github.com/beorn7/perks v1.0.1 // indirect
18+
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
19+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
1520
github.com/davecgh/go-spew v1.1.1 // indirect
16-
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
21+
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
1722
github.com/go-logr/logr v1.2.4 // indirect
1823
github.com/go-openapi/jsonpointer v0.19.6 // indirect
1924
github.com/go-openapi/jsonreference v0.20.1 // indirect
2025
github.com/go-openapi/swag v0.22.3 // indirect
2126
github.com/gogo/protobuf v1.3.2 // indirect
27+
github.com/golang-jwt/jwt/v4 v4.4.1 // indirect
28+
github.com/golang/glog v1.0.0 // indirect
2229
github.com/golang/protobuf v1.5.3 // indirect
23-
github.com/google/gnostic v0.5.7-v3refs // indirect
30+
github.com/google/gnostic v0.6.9 // indirect
2431
github.com/google/go-cmp v0.5.9 // indirect
2532
github.com/google/gofuzz v1.2.0 // indirect
2633
github.com/google/uuid v1.3.0 // indirect
34+
github.com/gorilla/css v1.0.0 // indirect
2735
github.com/imdario/mergo v0.3.12 // indirect
2836
github.com/josharian/intern v1.0.0 // indirect
2937
github.com/json-iterator/go v1.1.12 // indirect
3038
github.com/mailru/easyjson v0.7.7 // indirect
39+
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
40+
github.com/microcosm-cc/bluemonday v1.0.18 // indirect
3141
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
3242
github.com/modern-go/reflect2 v1.0.2 // indirect
3343
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
44+
github.com/openshift-online/ocm-sdk-go v0.1.368 // indirect
3445
github.com/openshift/api v0.0.0-20230213134911-7ba313770556 // indirect
3546
github.com/openshift/client-go v0.0.0-20221019143426-16aed247da5c // indirect
47+
github.com/prometheus/client_golang v1.14.0 // indirect
48+
github.com/prometheus/client_model v0.3.0 // indirect
49+
github.com/prometheus/common v0.37.0 // indirect
50+
github.com/prometheus/procfs v0.8.0 // indirect
3651
github.com/spf13/pflag v1.0.5 // indirect
37-
golang.org/x/net v0.12.0 // indirect
52+
golang.org/x/net v0.17.0 // indirect
3853
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
39-
golang.org/x/sys v0.10.0 // indirect
40-
golang.org/x/term v0.10.0 // indirect
41-
golang.org/x/text v0.11.0 // indirect
54+
golang.org/x/sys v0.13.0 // indirect
55+
golang.org/x/term v0.13.0 // indirect
56+
golang.org/x/text v0.13.0 // indirect
4257
golang.org/x/time v0.3.0 // indirect
4358
google.golang.org/appengine v1.6.7 // indirect
4459
google.golang.org/protobuf v1.28.1 // indirect

go.sum

Lines changed: 326 additions & 19 deletions
Large diffs are not rendered by default.
Binary file not shown.

tests/e2e/install-codeflare-sdk.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@ pip install poetry
55
poetry config virtualenvs.create false
66

77
# Clone the CodeFlare SDK repository
8-
git clone --branch main https://github.com/project-codeflare/codeflare-sdk.git
9-
cd codeflare-sdk
8+
echo "first ls"
9+
ls
10+
pip uninstall codeflare-sdk
11+
echo "install codeflare sdk"
12+
pip install codeflare_sdk-0.0.0.dev0-py3-none-any.whl
13+
echo "second ls"
14+
ls
15+
# git clone --branch main https://github.com/project-codeflare/codeflare-sdk.git
16+
# cd codeflare-sdk
1017

11-
# Lock dependencies and install them
12-
poetry lock --no-update
13-
poetry install --with test,docs
18+
# # Lock dependencies and install them
19+
# poetry lock --no-update
20+
# poetry install --with test,docs
1421

1522
# Return to the previous directory
16-
cd ..
23+
# cd ..

tests/e2e/kind.sh

Lines changed: 78 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,94 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
set -euo pipefail
18-
: "${INGRESS_NGINX_VERSION:=controller-v1.6.4}"
1917

20-
echo "Creating KinD cluster"
21-
cat <<EOF | kind create cluster --config=-
22-
kind: Cluster
18+
cat <<EOF | kind create cluster --config -
2319
apiVersion: kind.x-k8s.io/v1alpha4
20+
kind: Cluster
2421
nodes:
2522
- role: control-plane
26-
image: kindest/node:v1.25.3@sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1
2723
kubeadmConfigPatches:
2824
- |
2925
kind: InitConfiguration
3026
nodeRegistration:
3127
kubeletExtraArgs:
3228
node-labels: "ingress-ready=true"
29+
extraPortMappings:
30+
- containerPort: 80
31+
hostPort: 80
32+
listenAddress: "0.0.0.0"
33+
protocol: tcp
34+
- containerPort: 443
35+
hostPort: 443
36+
listenAddress: "0.0.0.0"
37+
protocol: tcp
3338
EOF
3439

35-
echo "Deploying Ingress controller into KinD cluster"
36-
curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/"${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 -
37-
kubectl annotate ingressclass nginx "ingressclass.kubernetes.io/is-default-class=true"
40+
41+
# install ingress controller on the KinD clsuter
42+
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
43+
sleep 10 # Wait for the Kubernetes API Server to create the related resources
3844
kubectl -n ingress-nginx wait --timeout=300s --for=condition=Available deployments --all
45+
46+
# enable ssl passthrough
47+
kubectl patch deploy --type json --patch '[{"op":"add","path": "/spec/template/spec/containers/0/args/-","value":"--enable-ssl-passthrough"}]' ingress-nginx-controller -n ingress-nginx
48+
kubectl logs deploy/ingress-nginx-controller -n ingress-nginx
49+
50+
# # Deploy codeflare-operator
51+
# cd codeflare-operator
52+
# make deploy -e IMG=quay.io/project-codeflare/codeflare-operator:v1.0.0-rc.1
53+
54+
# # Install RBAC for MCAD to manage RayCluster
55+
oc apply -f https://raw.githubusercontent.com/opendatahub-io/distributed-workloads/main/codeflare-stack/rbac/mcad-controller-ray-clusterrolebinding.yaml
56+
oc apply -f https://raw.githubusercontent.com/opendatahub-io/distributed-workloads/main/codeflare-stack/rbac/mcad-controller-ray-clusterrole.yaml
57+
oc apply -f tmpingressesrole.yaml
58+
oc apply -f tmpingressesroleb.yaml
59+
60+
# # Install KubeRay
61+
# helm repo add kuberay https://ray-project.github.io/kuberay-helm/
62+
# helm repo update
63+
# helm install kuberay-operator kuberay/kuberay-operator --version 1.0.0-rc.0
64+
65+
66+
67+
68+
69+
# set -euo pipefail
70+
# : "${INGRESS_NGINX_VERSION:=controller-v1.6.4}"
71+
72+
# echo "Creating KinD cluster"
73+
# cat <<EOF | kind create cluster --config=-
74+
# kind: Cluster
75+
# apiVersion: kind.x-k8s.io/v1alpha4
76+
# nodes:
77+
# - role: control-plane
78+
# image: kindest/node:v1.25.3@sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1
79+
# kubeadmConfigPatches:
80+
# - |
81+
# kind: InitConfiguration
82+
# nodeRegistration:
83+
# kubeletExtraArgs:
84+
# node-labels: "ingress-ready=true"
85+
# EOF
86+
87+
# echo "Deploying Ingress controller into KinD cluster"
88+
# curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/"${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 -
89+
# kubectl annotate ingressclass nginx "ingressclass.kubernetes.io/is-default-class=true"
90+
# kubectl -n ingress-nginx wait --timeout=300s --for=condition=Available deployments --all
91+
92+
# kubectl patch deploy --type json --patch '[{"op":"add","path": "/spec/template/spec/containers/0/args/-","value":"--enable-ssl-passthrough"}]' ingress-nginx-controller -n ingress-nginx
93+
# kubectl logs deploy/ingress-nginx-controller -n ingress-nginx
94+
95+
96+
# add marks extra argument --enable-ssl-passthrough to ingress DONE
97+
# dnsmasq for domain to add to /etc/hosts to ingress
98+
99+
# ingress domain to cluster configuration.
100+
101+
# This is where dnsmasq comes in. You can configure dnsmasq
102+
# to resolve dashboard.example.com to the IP address of your
103+
# local ingress controller.
104+
105+
# For dnsmasq guide
106+
# On the make immutable step ignore
107+
# Just add address to that file leave everything else alone

tests/e2e/mnist_raycluster_sdk.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from time import sleep
44

5+
import ray
6+
57
from torchx.specs.api import AppState, is_terminal
68

79
from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration
@@ -20,9 +22,22 @@
2022
max_memory=1,
2123
num_gpus=0,
2224
instascale=False,
25+
ingress_domain="cluster.local",
26+
# ingress_options= {
27+
# "ingresses": [
28+
# {
29+
# "ingressName": "dashboard-ingress-e2e",
30+
# "port": 8265,
31+
# "pathType": "Prefix",
32+
# "path": "/",
33+
# "host":"raydashboard-e2e-mnist.czaccari.hack",
34+
# },
35+
# ]
36+
# }
2337
)
2438
)
2539

40+
2641
cluster.up()
2742

2843
cluster.status()
@@ -38,6 +53,7 @@
3853
script="mnist.py",
3954
scheduler_args={"requirements": "requirements.txt"},
4055
)
56+
print("Submitting Job OSAOUBDAUDDAOUBDOUBUBAD")
4157
job = jobdef.submit(cluster)
4258

4359
done = False

0 commit comments

Comments
 (0)