generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Adding README.md instructions on how to run on kind - Removing OpenShift instructions - Cleaning env files - Adding Copyright header in .js and .go files - Aligning image builders and golang versions
- Loading branch information
Showing
41 changed files
with
583 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
kubeconfig | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,83 @@ | ||
# Build and run on OpenShift | ||
# Build and Run locally | ||
|
||
## Prerequisites | ||
You need a kubernetes cluster running kueue. | ||
If you don't have a running cluster, you can create one using kind and install kueue using helm. | ||
|
||
``` | ||
git clone https://github.com/akram/kueue-viz.git | ||
oc new-project kueue-viz | ||
KUEUE_VIZ_HOME=$PWD/kueue-viz | ||
kind create cluster | ||
kind get kubeconfig > kubeconfig | ||
export KUBECONFIG=$PWD/kubeconfig | ||
helm install kueue oci://us-central1-docker.pkg.dev/k8s-staging-images/charts/kueue \ | ||
--version="v0.9.1" --create-namespace --namespace=kueue-system | ||
``` | ||
|
||
then: | ||
## Build | ||
Clone the kueue repository and build the projects: | ||
|
||
``` | ||
git clone https://github.com/kubernetes-sigs/kueue | ||
cd kueue/cmd/experimental/kueue-viz | ||
KUEUE_VIZ_HOME=$PWD | ||
kubectl create ns kueue-viz | ||
cd backend && make && cd .. | ||
cd frontend && make && cd .. | ||
``` | ||
|
||
## Authorize | ||
Creating a cluster role that just has read only access on | ||
Create a cluster role that just has read only access on | ||
`kueue` objects and pods, nodes and events. | ||
|
||
Create the cluster role: | ||
|
||
``` | ||
oc create clusterrole kueue-backend-read-access --verb=get,list,watch \ | ||
--resource=workloads,clusterqueues,localqueues,resourceflavors,pods,workloadpriorityclass,events,nodes | ||
oc adm policy add-cluster-role-to-user kueue-backend-read-access -z default | ||
kubectl create clusterrole kueue-backend-read-access --verb=get,list,watch \ | ||
--resource=workloads,clusterqueues,localqueues,resourceflavors,pods,workloadpriorityclass,events,nodes | ||
``` | ||
|
||
## Build | ||
and bind it to the service account `default` in the `kueue-viz` namespace: | ||
|
||
``` | ||
for i in backend frontend | ||
do | ||
oc new-build . --name $i --context-dir=$i | ||
done | ||
kubectl create -f - << EOF | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: kueue-backend-read-access-binding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: kueue-backend-read-access | ||
subjects: | ||
- kind: ServiceAccount | ||
name: default | ||
namespace: kueue-viz | ||
EOF | ||
``` | ||
## Run | ||
|
||
## Deploy | ||
In a first terminal run: | ||
``` | ||
oc new-app backend --name=backend | ||
oc new-app frontend --name=frontend | ||
cd backend && make debug | ||
``` | ||
|
||
## Expose | ||
``` | ||
oc create route edge --service=svc/backend | ||
oc create route edge --service=svc/frontend | ||
``` | ||
In another terminal run: | ||
|
||
## Configure | ||
``` | ||
BACKEND_URL=$(oc get route backend -o jsonpath='{.spec.host}') | ||
FRONTEND_URL=$(oc get route frontend -o jsonpath='{.spec.host}') | ||
oc set env deployment/backend FRONTEND_URL=https://$FRONTEND_URL | ||
oc set env deployment/frontend REACT_APP_BACKEND_URL=https://$BACKEND_URL \ | ||
REACT_APP_WEBSOCKET_URL=wss://$BACKEND_URL | ||
cd frontend && make debug | ||
``` | ||
|
||
|
||
## Test | ||
Create test data using the resources in `examples/` directory. | ||
|
||
``` | ||
oc create -f https://raw.githubusercontent.com/opendatahub-io/distributed-workloads/2c6a14f792b8d94ad3fc2146316e52ace33b6a1e/examples/kueue-usage/kueue-with-jobs/00-common.yaml | ||
oc create -f examples/ | ||
``` | ||
And check that you have some data in the Resource Flavors tab of the application. | ||
And check that you have some data on the dashboard. | ||
|
||
## Improve | ||
|
||
See [contribution guide](CONTRIBUTING.md) | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
bin/ | ||
kubeconfig | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
cmd/experimental/kueue-viz/backend/handlers/cluster_queues.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
cmd/experimental/kueue-viz/backend/handlers/local_queue_workloads.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
cmd/experimental/kueue-viz/backend/handlers/local_queues.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
cmd/experimental/kueue-viz/backend/handlers/resource_flavors.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
cmd/experimental/kueue-viz/backend/handlers/websocket_handler.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.