Skip to content

Commit

Permalink
Updating PR
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianZaccaria committed Nov 7, 2023
1 parent ac589b3 commit 8fb9608
Show file tree
Hide file tree
Showing 14 changed files with 584 additions and 68 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/e2e_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ jobs:
echo Deploying CodeFlare operator
IMG="${REGISTRY_ADDRESS}"/codeflare-operator
make image-push -e IMG="${IMG}"
make deploy -e IMG="${IMG}"
make deploy -e IMG="${IMG}" -e ENV="e2e"
kubectl wait --timeout=120s --for=condition=Available=true deployment -n openshift-operators codeflare-operator-manager
echo Setting up CodeFlare stack
make setup-e2e
make defaults manifests generate fmt vet
make defaults manifests fmt vet
cd ..
Expand Down
31 changes: 23 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,56 @@ go 1.19

require (
github.com/onsi/gomega v1.27.10
github.com/project-codeflare/codeflare-common v0.0.0-20231023092720-93d03492db16
github.com/project-codeflare/codeflare-operator v0.1.0
github.com/project-codeflare/multi-cluster-app-dispatcher v1.33.0
github.com/ray-project/kuberay/ray-operator v0.0.0-20230813033553-4892ac1094e7
github.com/project-codeflare/multi-cluster-app-dispatcher v1.37.0
github.com/ray-project/kuberay/ray-operator v1.0.0
k8s.io/api v0.26.3
k8s.io/apimachinery v0.26.3
)

require (
github.com/aymerick/douceur v0.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.4.1 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/microcosm-cc/bluemonday v1.0.18 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/openshift-online/ocm-sdk-go v0.1.368 // indirect
github.com/openshift/api v0.0.0-20230213134911-7ba313770556 // indirect
github.com/openshift/client-go v0.0.0-20221019143426-16aed247da5c // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
Expand Down
345 changes: 326 additions & 19 deletions go.sum

Large diffs are not rendered by default.

Binary file modified tests/e2e/codeflare_sdk-0.0.0.dev0-py3-none-any.whl
Binary file not shown.
19 changes: 13 additions & 6 deletions tests/e2e/install-codeflare-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ pip install poetry
poetry config virtualenvs.create false

# Clone the CodeFlare SDK repository
git clone --branch main https://github.com/project-codeflare/codeflare-sdk.git
cd codeflare-sdk
echo "first ls"
ls
pip uninstall codeflare-sdk
echo "install codeflare sdk"
pip install codeflare_sdk-0.0.0.dev0-py3-none-any.whl
echo "second ls"
ls
# 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
# # Lock dependencies and install them
# poetry lock --no-update
# poetry install --with test,docs

# Return to the previous directory
cd ..
# cd ..
87 changes: 78 additions & 9 deletions tests/e2e/kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,94 @@
# See the License for the specific language governing permissions and
# limitations under the License.

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

echo "Creating KinD cluster"
cat <<EOF | kind create cluster --config=-
kind: Cluster
cat <<EOF | kind create cluster --config -
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:
- role: control-plane
image: kindest/node:v1.25.3@sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 80
hostPort: 80
listenAddress: "0.0.0.0"
protocol: tcp
- containerPort: 443
hostPort: 443
listenAddress: "0.0.0.0"
protocol: tcp
EOF

echo "Deploying Ingress controller into KinD cluster"
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 -
kubectl annotate ingressclass nginx "ingressclass.kubernetes.io/is-default-class=true"

# install ingress controller on the KinD clsuter
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
sleep 10 # Wait for the Kubernetes API Server to create the related resources
kubectl -n ingress-nginx wait --timeout=300s --for=condition=Available deployments --all

# enable ssl passthrough
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
kubectl logs deploy/ingress-nginx-controller -n ingress-nginx

# # Deploy codeflare-operator
# cd codeflare-operator
# make deploy -e IMG=quay.io/project-codeflare/codeflare-operator:v1.0.0-rc.1

# # Install RBAC for MCAD to manage RayCluster
oc apply -f https://raw.githubusercontent.com/opendatahub-io/distributed-workloads/main/codeflare-stack/rbac/mcad-controller-ray-clusterrolebinding.yaml
oc apply -f https://raw.githubusercontent.com/opendatahub-io/distributed-workloads/main/codeflare-stack/rbac/mcad-controller-ray-clusterrole.yaml
oc apply -f tmpingressesrole.yaml
oc apply -f tmpingressesroleb.yaml

# # Install KubeRay
# helm repo add kuberay https://ray-project.github.io/kuberay-helm/
# helm repo update
# helm install kuberay-operator kuberay/kuberay-operator --version 1.0.0-rc.0





# set -euo pipefail
# : "${INGRESS_NGINX_VERSION:=controller-v1.6.4}"

# echo "Creating KinD cluster"
# cat <<EOF | kind create cluster --config=-
# kind: Cluster
# apiVersion: kind.x-k8s.io/v1alpha4
# nodes:
# - role: control-plane
# image: kindest/node:v1.25.3@sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1
# kubeadmConfigPatches:
# - |
# kind: InitConfiguration
# nodeRegistration:
# kubeletExtraArgs:
# node-labels: "ingress-ready=true"
# EOF

# echo "Deploying Ingress controller into KinD cluster"
# 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 -
# kubectl annotate ingressclass nginx "ingressclass.kubernetes.io/is-default-class=true"
# kubectl -n ingress-nginx wait --timeout=300s --for=condition=Available deployments --all

# 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
# kubectl logs deploy/ingress-nginx-controller -n ingress-nginx


# add marks extra argument --enable-ssl-passthrough to ingress DONE
# dnsmasq for domain to add to /etc/hosts to ingress

# ingress domain to cluster configuration.

# This is where dnsmasq comes in. You can configure dnsmasq
# to resolve dashboard.example.com to the IP address of your
# local ingress controller.

# For dnsmasq guide
# On the make immutable step ignore
# Just add address to that file leave everything else alone
16 changes: 16 additions & 0 deletions tests/e2e/mnist_raycluster_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from time import sleep

import ray

from torchx.specs.api import AppState, is_terminal

from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration
Expand All @@ -20,9 +22,22 @@
max_memory=1,
num_gpus=0,
instascale=False,
ingress_domain="cluster.local",
# ingress_options= {
# "ingresses": [
# {
# "ingressName": "dashboard-ingress-e2e",
# "port": 8265,
# "pathType": "Prefix",
# "path": "/",
# "host":"raydashboard-e2e-mnist.czaccari.hack",
# },
# ]
# }
)
)


cluster.up()

cluster.status()
Expand All @@ -38,6 +53,7 @@
script="mnist.py",
scheduler_args={"requirements": "requirements.txt"},
)
print("Submitting Job OSAOUBDAUDDAOUBDOUBUBAD")
job = jobdef.submit(cluster)

done = False
Expand Down
Loading

0 comments on commit 8fb9608

Please sign in to comment.