diff --git a/cmd/experimental/kueue-viz/.gitignore b/cmd/experimental/kueue-viz/.gitignore new file mode 100644 index 0000000000..eaeec31871 --- /dev/null +++ b/cmd/experimental/kueue-viz/.gitignore @@ -0,0 +1,2 @@ +kubeconfig + diff --git a/cmd/experimental/kueue-viz/LICENSE b/cmd/experimental/kueue-viz/LICENSE index c4ea8b6f9d..f37fd9764f 100644 --- a/cmd/experimental/kueue-viz/LICENSE +++ b/cmd/experimental/kueue-viz/LICENSE @@ -176,7 +176,7 @@ END OF TERMS AND CONDITIONS - Copyright 2014 Red Hat, Inc. + Copyright 2024, The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/experimental/kueue-viz/README.md b/cmd/experimental/kueue-viz/README.md index bbd433db40..fa50bdf0fb 100644 --- a/cmd/experimental/kueue-viz/README.md +++ b/cmd/experimental/kueue-viz/README.md @@ -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) + + + + + diff --git a/cmd/experimental/kueue-viz/backend/.gitignore b/cmd/experimental/kueue-viz/backend/.gitignore index d855be8950..2d67e10233 100644 --- a/cmd/experimental/kueue-viz/backend/.gitignore +++ b/cmd/experimental/kueue-viz/backend/.gitignore @@ -1,2 +1,3 @@ bin/ +kubeconfig diff --git a/cmd/experimental/kueue-viz/backend/Dockerfile b/cmd/experimental/kueue-viz/backend/Dockerfile index 7cc2a279ff..c0e41fb9d4 100644 --- a/cmd/experimental/kueue-viz/backend/Dockerfile +++ b/cmd/experimental/kueue-viz/backend/Dockerfile @@ -1,11 +1,7 @@ # Build stage -FROM golang:latest as builder - -# Install necessary tools for building -# RUN apk add --no-cache gcc musl-dev - -# Set the working directory -WORKDIR /app +ARG BUILDER_IMAGE=golang:1.23 +ARG BASE_IMAGE=gcr.io/distroless/static:nonroot +FROM --platform=${BUILDPLATFORM} ${BUILDER_IMAGE} AS builder # Copy Go modules manifests and download dependencies COPY go.mod go.sum ./ @@ -15,38 +11,21 @@ RUN go mod download COPY . . # Build the application -RUN go build -o app . +RUN CGO_ENABLED=0 go build -o /kueue-viz # Runtime stage -FROM golang:latest -USER root -# Install CA certificates for HTTPS support -# RUN apk add --no-cache ca-certificates - -# Set environment variables -ENV PORT=8080 - -# Create a non-root user -# RUN adduser -D appuser -# USER nobody - -# Set the working directory -WORKDIR /app +FROM --platform=${BUILDPLATFORM} ${BASE_IMAGE} +USER 65532:65532 # Copy the built application from the builder stage -COPY --from=builder /app/app . - -# Change ownership to the non-root user -RUN useradd nobody || true && groupadd nobody || true -RUN chown -R nobody:nobody /app - -# Run as the non-root user -USER nobody +COPY --from=builder /kueue-viz / +# Set environment variables +ENV PORT=8080 # Expose the application port EXPOSE 8080 # Command to run the application -ENTRYPOINT ["./app"] +ENTRYPOINT ["/kueue-viz"] diff --git a/cmd/experimental/kueue-viz/backend/Makefile b/cmd/experimental/kueue-viz/backend/Makefile index 99485878f8..dda11f8001 100644 --- a/cmd/experimental/kueue-viz/backend/Makefile +++ b/cmd/experimental/kueue-viz/backend/Makefile @@ -1,7 +1,7 @@ # Makefile for kueue-viz-go -APP_NAME := kueue_ws_app -MODULE_NAME := github.com/akram/kueue-viz-go +APP_NAME := kueue-viz +MODULE_NAME := kueue-viz .PHONY: all build run test tidy clean help @@ -21,7 +21,7 @@ run: build ## Run debug debug: build @echo "Running in debug mode with hot code replacement enabled..." - CompileDaemon --build="make" --command=./bin/kueue_ws_app + CompileDaemon --build="make" --command=./bin/$(APP_NAME) ## Run tests test: diff --git a/cmd/experimental/kueue-viz/backend/go.mod b/cmd/experimental/kueue-viz/backend/go.mod index 31ceccdd18..95b60446fc 100644 --- a/cmd/experimental/kueue-viz/backend/go.mod +++ b/cmd/experimental/kueue-viz/backend/go.mod @@ -1,8 +1,6 @@ -module github.com/akram/kueue-viz-go +module kueue-viz -go 1.22.0 - -toolchain go1.22.5 +go 1.23.0 require ( github.com/gin-gonic/gin v1.10.0 diff --git a/cmd/experimental/kueue-viz/backend/handlers/cluster_queues.go b/cmd/experimental/kueue-viz/backend/handlers/cluster_queues.go index cfefce6c25..05eeb1b7c5 100644 --- a/cmd/experimental/kueue-viz/backend/handlers/cluster_queues.go +++ b/cmd/experimental/kueue-viz/backend/handlers/cluster_queues.go @@ -1,3 +1,18 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package handlers import ( diff --git a/cmd/experimental/kueue-viz/backend/handlers/cohorts.go b/cmd/experimental/kueue-viz/backend/handlers/cohorts.go index 63e35f0db1..e800da9731 100644 --- a/cmd/experimental/kueue-viz/backend/handlers/cohorts.go +++ b/cmd/experimental/kueue-viz/backend/handlers/cohorts.go @@ -1,3 +1,18 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package handlers import ( diff --git a/cmd/experimental/kueue-viz/backend/handlers/gvr.go b/cmd/experimental/kueue-viz/backend/handlers/gvr.go index 96146ccfa7..21fe1f4406 100644 --- a/cmd/experimental/kueue-viz/backend/handlers/gvr.go +++ b/cmd/experimental/kueue-viz/backend/handlers/gvr.go @@ -1,3 +1,18 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package handlers import ( diff --git a/cmd/experimental/kueue-viz/backend/handlers/handlers.go b/cmd/experimental/kueue-viz/backend/handlers/handlers.go index 0321aa7b06..81b4777b3d 100644 --- a/cmd/experimental/kueue-viz/backend/handlers/handlers.go +++ b/cmd/experimental/kueue-viz/backend/handlers/handlers.go @@ -1,3 +1,18 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package handlers import ( diff --git a/cmd/experimental/kueue-viz/backend/handlers/local_queue_workloads.go b/cmd/experimental/kueue-viz/backend/handlers/local_queue_workloads.go index 55ef1aba5d..b67bf2c9e6 100644 --- a/cmd/experimental/kueue-viz/backend/handlers/local_queue_workloads.go +++ b/cmd/experimental/kueue-viz/backend/handlers/local_queue_workloads.go @@ -1,3 +1,18 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package handlers import ( diff --git a/cmd/experimental/kueue-viz/backend/handlers/local_queues.go b/cmd/experimental/kueue-viz/backend/handlers/local_queues.go index f163254863..5d4a494ca5 100644 --- a/cmd/experimental/kueue-viz/backend/handlers/local_queues.go +++ b/cmd/experimental/kueue-viz/backend/handlers/local_queues.go @@ -1,3 +1,18 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package handlers import ( diff --git a/cmd/experimental/kueue-viz/backend/handlers/resource_flavors.go b/cmd/experimental/kueue-viz/backend/handlers/resource_flavors.go index 0eb3818c66..f3aba588b2 100644 --- a/cmd/experimental/kueue-viz/backend/handlers/resource_flavors.go +++ b/cmd/experimental/kueue-viz/backend/handlers/resource_flavors.go @@ -1,3 +1,18 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package handlers import ( diff --git a/cmd/experimental/kueue-viz/backend/handlers/websocket_handler.go b/cmd/experimental/kueue-viz/backend/handlers/websocket_handler.go index b2657ba927..81eddb9137 100644 --- a/cmd/experimental/kueue-viz/backend/handlers/websocket_handler.go +++ b/cmd/experimental/kueue-viz/backend/handlers/websocket_handler.go @@ -1,3 +1,18 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package handlers import ( diff --git a/cmd/experimental/kueue-viz/backend/handlers/workloads.go b/cmd/experimental/kueue-viz/backend/handlers/workloads.go index 9662791035..7c8453516a 100644 --- a/cmd/experimental/kueue-viz/backend/handlers/workloads.go +++ b/cmd/experimental/kueue-viz/backend/handlers/workloads.go @@ -1,3 +1,18 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package handlers import ( diff --git a/cmd/experimental/kueue-viz/backend/handlers/workloads_dashboard.go b/cmd/experimental/kueue-viz/backend/handlers/workloads_dashboard.go index 95cdee5621..fa86b31bce 100644 --- a/cmd/experimental/kueue-viz/backend/handlers/workloads_dashboard.go +++ b/cmd/experimental/kueue-viz/backend/handlers/workloads_dashboard.go @@ -1,3 +1,18 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package handlers import ( diff --git a/cmd/experimental/kueue-viz/backend/kubernetes_client.go b/cmd/experimental/kueue-viz/backend/kubernetes_client.go index 5d9817c15a..e9ec541bed 100644 --- a/cmd/experimental/kueue-viz/backend/kubernetes_client.go +++ b/cmd/experimental/kueue-viz/backend/kubernetes_client.go @@ -1,3 +1,18 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package main import ( @@ -24,13 +39,17 @@ func createK8sClient() (*kubernetes.Clientset, dynamic.Interface, error) { } fmt.Println("Using in-cluster configuration") } else { - // Fall back to using local kubeconfig - kubeconfig := filepath.Join(os.Getenv("HOME"), ".kube", "config") + // Fall back to using KUBECONFIG or default kubeconfig path + kubeconfig := os.Getenv("KUBECONFIG") + if kubeconfig == "" { + kubeconfig = filepath.Join(os.Getenv("HOME"), ".kube", "config") + } + config, err = clientcmd.BuildConfigFromFlags("", kubeconfig) if err != nil { - return nil, nil, fmt.Errorf("failed to load local kubeconfig: %v", err) + return nil, nil, fmt.Errorf("failed to load kubeconfig from %s: %v", kubeconfig, err) } - fmt.Println("Using local kubeconfig") + fmt.Printf("Using kubeconfig: %s\n", kubeconfig) } // Create the Kubernetes clientset diff --git a/cmd/experimental/kueue-viz/backend/main.go b/cmd/experimental/kueue-viz/backend/main.go index 80ee09995f..8b244a35a6 100644 --- a/cmd/experimental/kueue-viz/backend/main.go +++ b/cmd/experimental/kueue-viz/backend/main.go @@ -1,9 +1,25 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package main import ( "log" - "github.com/akram/kueue-viz-go/handlers" + "kueue-viz/handlers" + "github.com/gin-gonic/gin" "net/http" diff --git a/cmd/experimental/kueue-viz/frontend/.env b/cmd/experimental/kueue-viz/frontend/.env index 191eb38d04..c2f275d406 100644 --- a/cmd/experimental/kueue-viz/frontend/.env +++ b/cmd/experimental/kueue-viz/frontend/.env @@ -1,2 +1 @@ -REACT_APP_WEBSOCKET_URL=wss://backend-kueue-viz.apps.rosa.akram.3psf.p3.openshiftapps.com REACT_APP_WEBSOCKET_URL=ws://localhost:8080 diff --git a/cmd/experimental/kueue-viz/frontend/package.json b/cmd/experimental/kueue-viz/frontend/package.json index b12dbddf59..e58c2c8f20 100644 --- a/cmd/experimental/kueue-viz/frontend/package.json +++ b/cmd/experimental/kueue-viz/frontend/package.json @@ -39,5 +39,5 @@ ] }, "author": "Akram Ben Aissi", - "license": "MIT" + "license": "Apache 2.0" } diff --git a/cmd/experimental/kueue-viz/frontend/public/env.js b/cmd/experimental/kueue-viz/frontend/public/env.js index 00cf6c8b9e..63649a035c 100644 --- a/cmd/experimental/kueue-viz/frontend/public/env.js +++ b/cmd/experimental/kueue-viz/frontend/public/env.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + export const env = { ...process.env, ...window['env'] } diff --git a/cmd/experimental/kueue-viz/frontend/react-inject-env.config.js b/cmd/experimental/kueue-viz/frontend/react-inject-env.config.js index c64e24d18e..a9678196d8 100644 --- a/cmd/experimental/kueue-viz/frontend/react-inject-env.config.js +++ b/cmd/experimental/kueue-viz/frontend/react-inject-env.config.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + module.exports = { include: ["REACT_APP_WEBSOCKET_URL"] }; diff --git a/cmd/experimental/kueue-viz/frontend/src/App.js b/cmd/experimental/kueue-viz/frontend/src/App.js index 1157e464a4..ed5a90b82f 100644 --- a/cmd/experimental/kueue-viz/frontend/src/App.js +++ b/cmd/experimental/kueue-viz/frontend/src/App.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React from 'react'; import { Route, BrowserRouter as Router, Routes } from 'react-router-dom'; import ClusterQueues from './ClusterQueues'; diff --git a/cmd/experimental/kueue-viz/frontend/src/ClusterQueueDetail.js b/cmd/experimental/kueue-viz/frontend/src/ClusterQueueDetail.js index 5b05a55ac7..3eab49ea5a 100644 --- a/cmd/experimental/kueue-viz/frontend/src/ClusterQueueDetail.js +++ b/cmd/experimental/kueue-viz/frontend/src/ClusterQueueDetail.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import { CircularProgress, Grid, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Tooltip, Typography } from '@mui/material'; import React, { useEffect, useState } from 'react'; import { useParams, Link } from 'react-router-dom'; diff --git a/cmd/experimental/kueue-viz/frontend/src/ClusterQueues.js b/cmd/experimental/kueue-viz/frontend/src/ClusterQueues.js index b872cb5e3c..23facd9a06 100644 --- a/cmd/experimental/kueue-viz/frontend/src/ClusterQueues.js +++ b/cmd/experimental/kueue-viz/frontend/src/ClusterQueues.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { useState, useEffect } from 'react'; import { Link } from 'react-router-dom'; import useWebSocket from './useWebSocket'; diff --git a/cmd/experimental/kueue-viz/frontend/src/CohortDetail.js b/cmd/experimental/kueue-viz/frontend/src/CohortDetail.js index 1402f97cd0..d3a6dd2219 100644 --- a/cmd/experimental/kueue-viz/frontend/src/CohortDetail.js +++ b/cmd/experimental/kueue-viz/frontend/src/CohortDetail.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { useState, useEffect } from 'react'; import { useParams,Link } from 'react-router-dom'; import { Typography, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, CircularProgress } from '@mui/material'; diff --git a/cmd/experimental/kueue-viz/frontend/src/Cohorts.js b/cmd/experimental/kueue-viz/frontend/src/Cohorts.js index 2bbf8fa5c3..f3fc71350b 100644 --- a/cmd/experimental/kueue-viz/frontend/src/Cohorts.js +++ b/cmd/experimental/kueue-viz/frontend/src/Cohorts.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { useState, useEffect } from 'react'; import { Link } from 'react-router-dom'; import { Typography, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, CircularProgress } from '@mui/material'; diff --git a/cmd/experimental/kueue-viz/frontend/src/Dashboard.js b/cmd/experimental/kueue-viz/frontend/src/Dashboard.js index 037ea1cf09..1bd032ec69 100644 --- a/cmd/experimental/kueue-viz/frontend/src/Dashboard.js +++ b/cmd/experimental/kueue-viz/frontend/src/Dashboard.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import { Grid, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Tooltip, Typography, IconButton, Collapse, Button } from '@mui/material'; import React, { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; diff --git a/cmd/experimental/kueue-viz/frontend/src/FlavorTable.js b/cmd/experimental/kueue-viz/frontend/src/FlavorTable.js index d0b57b854c..b896619e9b 100644 --- a/cmd/experimental/kueue-viz/frontend/src/FlavorTable.js +++ b/cmd/experimental/kueue-viz/frontend/src/FlavorTable.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React from 'react'; import { Link } from 'react-router-dom'; import { Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Typography, Paper } from '@mui/material'; diff --git a/cmd/experimental/kueue-viz/frontend/src/LocalQueueDetail.js b/cmd/experimental/kueue-viz/frontend/src/LocalQueueDetail.js index 76658b89db..7b8b57469a 100644 --- a/cmd/experimental/kueue-viz/frontend/src/LocalQueueDetail.js +++ b/cmd/experimental/kueue-viz/frontend/src/LocalQueueDetail.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { useState, useEffect } from 'react'; import { useParams } from 'react-router-dom'; import { Typography, Paper, Grid, CircularProgress, Table, TableBody, TableCell, TableContainer, TableHead, TableRow } from '@mui/material'; diff --git a/cmd/experimental/kueue-viz/frontend/src/LocalQueues.js b/cmd/experimental/kueue-viz/frontend/src/LocalQueues.js index e9258f4fe9..dabdfe45ce 100644 --- a/cmd/experimental/kueue-viz/frontend/src/LocalQueues.js +++ b/cmd/experimental/kueue-viz/frontend/src/LocalQueues.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import { CircularProgress, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Typography } from '@mui/material'; import React, { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; diff --git a/cmd/experimental/kueue-viz/frontend/src/Navbar.js b/cmd/experimental/kueue-viz/frontend/src/Navbar.js index d8d7f72276..5bc5c11215 100644 --- a/cmd/experimental/kueue-viz/frontend/src/Navbar.js +++ b/cmd/experimental/kueue-viz/frontend/src/Navbar.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React from 'react'; import { Link } from 'react-router-dom'; import { AppBar, Toolbar, Button } from '@mui/material'; diff --git a/cmd/experimental/kueue-viz/frontend/src/ResourceFlavorDetail.js b/cmd/experimental/kueue-viz/frontend/src/ResourceFlavorDetail.js index 77f50b524a..1eefa03348 100644 --- a/cmd/experimental/kueue-viz/frontend/src/ResourceFlavorDetail.js +++ b/cmd/experimental/kueue-viz/frontend/src/ResourceFlavorDetail.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { useState, useEffect } from 'react'; import { useParams } from 'react-router-dom'; import { Typography, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, CircularProgress, Box } from '@mui/material'; diff --git a/cmd/experimental/kueue-viz/frontend/src/ResourceFlavors.js b/cmd/experimental/kueue-viz/frontend/src/ResourceFlavors.js index ab2195c0fe..525bc52f9a 100644 --- a/cmd/experimental/kueue-viz/frontend/src/ResourceFlavors.js +++ b/cmd/experimental/kueue-viz/frontend/src/ResourceFlavors.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { useState, useEffect } from 'react'; import { Link } from 'react-router-dom'; import { Typography, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, CircularProgress } from '@mui/material'; diff --git a/cmd/experimental/kueue-viz/frontend/src/WorkloadDetail.js b/cmd/experimental/kueue-viz/frontend/src/WorkloadDetail.js index 8ba45e8880..81ec7294d0 100644 --- a/cmd/experimental/kueue-viz/frontend/src/WorkloadDetail.js +++ b/cmd/experimental/kueue-viz/frontend/src/WorkloadDetail.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React, { useEffect, useState } from 'react'; import { useParams, Link } from 'react-router-dom'; import { Typography, Paper, CircularProgress, Grid, Table, TableBody, TableCell, TableContainer, TableHead, TableRow } from '@mui/material'; diff --git a/cmd/experimental/kueue-viz/frontend/src/Workloads.js b/cmd/experimental/kueue-viz/frontend/src/Workloads.js index 09095f02c7..8688f327b0 100644 --- a/cmd/experimental/kueue-viz/frontend/src/Workloads.js +++ b/cmd/experimental/kueue-viz/frontend/src/Workloads.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import { CircularProgress, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Tooltip, Typography } from '@mui/material'; import React, { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; diff --git a/cmd/experimental/kueue-viz/frontend/src/WorkloadsList.js b/cmd/experimental/kueue-viz/frontend/src/WorkloadsList.js index 3d09f687fc..0838f026b8 100644 --- a/cmd/experimental/kueue-viz/frontend/src/WorkloadsList.js +++ b/cmd/experimental/kueue-viz/frontend/src/WorkloadsList.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import { Link, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Tooltip } from '@mui/material'; import React from 'react'; import './App.css'; diff --git a/cmd/experimental/kueue-viz/frontend/src/env.js b/cmd/experimental/kueue-viz/frontend/src/env.js index 00cf6c8b9e..63649a035c 100644 --- a/cmd/experimental/kueue-viz/frontend/src/env.js +++ b/cmd/experimental/kueue-viz/frontend/src/env.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + export const env = { ...process.env, ...window['env'] } diff --git a/cmd/experimental/kueue-viz/frontend/src/index.js b/cmd/experimental/kueue-viz/frontend/src/index.js index d166890dd8..a814a10d61 100644 --- a/cmd/experimental/kueue-viz/frontend/src/index.js +++ b/cmd/experimental/kueue-viz/frontend/src/index.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; diff --git a/cmd/experimental/kueue-viz/frontend/src/useWebSocket.js b/cmd/experimental/kueue-viz/frontend/src/useWebSocket.js index e8d686e93c..d21005df23 100644 --- a/cmd/experimental/kueue-viz/frontend/src/useWebSocket.js +++ b/cmd/experimental/kueue-viz/frontend/src/useWebSocket.js @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + import { useEffect, useState } from 'react'; import { env } from './env'