diff --git a/.vscode/launch.json b/.vscode/launch.json index d3458846..98618c3f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,7 +10,7 @@ "request": "launch", "mode": "debug", "program": "${workspaceRoot}/cmd/main.go", - "buildFlags": "--ldflags '-X gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/version.GIT_SHA=foobars -X gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/version.VERSION=v0.5.0'", + "buildFlags": "--ldflags '-X github.com/NVIDIA/skyhook/internal/version.GIT_SHA=foobars -X github.com/NVIDIA/skyhook/internal/version.VERSION=v0.5.0'", "env": { "ENABLE_WEBHOOKS": "false", "LOG_ENCODER": "console", diff --git a/containers/operator.Dockerfile b/containers/operator.Dockerfile index 65423d19..54a87fb5 100644 --- a/containers/operator.Dockerfile +++ b/containers/operator.Dockerfile @@ -31,8 +31,8 @@ COPY ./ ./ # the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -mod=vendor \ - -ldflags "-X gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/version.GIT_SHA=${GIT_SHA}\ - -X gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/version.VERSION=${VERSION}" \ + -ldflags "-X github.com/NVIDIA/skyhook/internal/version.GIT_SHA=${GIT_SHA}\ + -X github.com/NVIDIA/skyhook/internal/version.VERSION=${VERSION}" \ -a -o manager cmd/main.go # Use distroless as minimal base image to package the manager binary diff --git a/operator/.mockery.yaml b/operator/.mockery.yaml index e681eab2..0ddcc091 100644 --- a/operator/.mockery.yaml +++ b/operator/.mockery.yaml @@ -27,11 +27,11 @@ packages: interfaces: EventRecorder: ## internal packages - gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/dal: + github.com/NVIDIA/skyhook/internal/dal: config: all: True boilerplate-file: "boilerplate/boilerplate.go.txt" - gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/controller: + github.com/NVIDIA/skyhook/internal/controller: config: all: True boilerplate-file: "boilerplate/boilerplate.go.txt" diff --git a/operator/Makefile b/operator/Makefile index 47dbe33b..7be46083 100644 --- a/operator/Makefile +++ b/operator/Makefile @@ -19,10 +19,11 @@ include deps.mk VERSION ?= $(GIT_TAG_LAST) # Image URL to use all building/pushing image targets +## TODO: update this to the correct image location IMG ?= nvcr.io/nvidian/swgpu-baseos/skyhook-operator:latest -# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION := 1.30.0 +## default version of kind to use +KIND_VERSION?=1.30.8 PLATFORM := $(shell uname -s 2>/dev/null || echo unknown) SKYHOOK_NAMESPACE ?= skyhook @@ -39,8 +40,8 @@ GIT_TAG := $(shell git describe --exact-match --tags) GIT_TAG_LAST := $(shell git describe --tags --abbrev=0) ## GO Flags -GO_LDFLAGS := -ldflags "-X gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/version.GIT_SHA=$(GIT_SHA) \ - -X gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/version.VERSION=$(VERSION)" +GO_LDFLAGS := -ldflags "-X github.com/NVIDIA/skyhook/internal/version.GIT_SHA=$(GIT_SHA) \ + -X github.com/NVIDIA/skyhook/internal/version.VERSION=$(VERSION)" GOFLAGS := -mod=vendor # CONTAINER_TOOL defines the container tool to be used for building images. @@ -177,7 +178,6 @@ helm-tests: helm chainsaw $(CHAINSAW) test --test-dir e2e/chainsaw/helm $(CHAINSAW_ARGS) -KIND_VERSION?=1.29.4 create-kind-cluster: ## deletes and creates a new kind cluster. versions is set via KIND_VERSION kind delete cluster && kind create cluster --image=kindest/node:v$(KIND_VERSION) --config config/local-dev/kind-config.yaml $(KUBECTL) label node/kind-worker skyhook.nvidia.com/test-node=skyhooke2e diff --git a/operator/PROJECT b/operator/PROJECT index 675a2676..c06c3408 100644 --- a/operator/PROJECT +++ b/operator/PROJECT @@ -6,7 +6,7 @@ domain: nvidia.com layout: - go.kubebuilder.io/v4 projectName: skyhook-operator -repo: gitlab-master.nvidia.com/dgx/infra/skyhook-operator +repo: github.com/NVIDIA/skyhook resources: - api: crdVersion: v1 @@ -15,7 +15,7 @@ resources: domain: nvidia.com group: skyhook kind: Skyhook - path: gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1 + path: github.com/NVIDIA/skyhook/api/v1alpha1 version: v1alpha1 webhooks: defaulting: true diff --git a/operator/api/v1alpha1/skyhook_types.go b/operator/api/v1alpha1/skyhook_types.go index 6a11929d..70c775db 100644 --- a/operator/api/v1alpha1/skyhook_types.go +++ b/operator/api/v1alpha1/skyhook_types.go @@ -25,7 +25,7 @@ import ( "sort" "strings" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/graph" + "github.com/NVIDIA/skyhook/internal/graph" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/operator/api/v1alpha1/skyhook_webhook.go b/operator/api/v1alpha1/skyhook_webhook.go index f4e00ce4..15913e06 100644 --- a/operator/api/v1alpha1/skyhook_webhook.go +++ b/operator/api/v1alpha1/skyhook_webhook.go @@ -21,8 +21,8 @@ import ( "regexp" "strings" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/graph" - semver "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/version" + "github.com/NVIDIA/skyhook/internal/graph" + semver "github.com/NVIDIA/skyhook/internal/version" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ctrl "sigs.k8s.io/controller-runtime" diff --git a/operator/cmd/main.go b/operator/cmd/main.go index f643939b..1b17114c 100644 --- a/operator/cmd/main.go +++ b/operator/cmd/main.go @@ -38,9 +38,9 @@ import ( kzap "sigs.k8s.io/controller-runtime/pkg/log/zap" metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/controller" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/version" + "github.com/NVIDIA/skyhook/api/v1alpha1" + "github.com/NVIDIA/skyhook/internal/controller" + "github.com/NVIDIA/skyhook/internal/version" //+kubebuilder:scaffold:imports ) diff --git a/operator/deps.mk b/operator/deps.mk index a02253ce..6b6008fe 100644 --- a/operator/deps.mk +++ b/operator/deps.mk @@ -36,10 +36,10 @@ ifndef ARCH endif ## versions -GOLANGCI_LINT_VERSION ?= v1.61.0 +GOLANGCI_LINT_VERSION ?= v1.63.4 KUSTOMIZE_VERSION ?= v5.4.1 CONTROLLER_TOOLS_VERSION ?= v0.15.0 -ENVTEST_K8S_VERSION ?= 1.28.0 +ENVTEST_K8S_VERSION ?= 1.30.0 MOCKERY_VERSION ?= v2.42.3 CHAINSAW_VERSION ?= v0.2.10 HELM_VERSION ?= v3.15.0 diff --git a/operator/go.mod b/operator/go.mod index 5cc40dee..6d24164f 100644 --- a/operator/go.mod +++ b/operator/go.mod @@ -1,4 +1,4 @@ -module gitlab-master.nvidia.com/dgx/infra/skyhook-operator +module github.com/NVIDIA/skyhook go 1.23 diff --git a/operator/internal/controller/annotations.go b/operator/internal/controller/annotations.go index 555677b2..98788f1e 100644 --- a/operator/internal/controller/annotations.go +++ b/operator/internal/controller/annotations.go @@ -20,7 +20,7 @@ import ( "encoding/json" "fmt" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1" + "github.com/NVIDIA/skyhook/api/v1alpha1" corev1 "k8s.io/api/core/v1" ) diff --git a/operator/internal/controller/cluster_state_v2.go b/operator/internal/controller/cluster_state_v2.go index 14ad7c53..560490a0 100644 --- a/operator/internal/controller/cluster_state_v2.go +++ b/operator/internal/controller/cluster_state_v2.go @@ -22,10 +22,10 @@ import ( "strings" "time" + "github.com/NVIDIA/skyhook/api/v1alpha1" + "github.com/NVIDIA/skyhook/internal/version" + "github.com/NVIDIA/skyhook/internal/wrapper" "github.com/go-logr/logr" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/version" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/wrapper" "sigs.k8s.io/controller-runtime/pkg/client" corev1 "k8s.io/api/core/v1" diff --git a/operator/internal/controller/event_handler.go b/operator/internal/controller/event_handler.go index 09b07350..44a04cf2 100644 --- a/operator/internal/controller/event_handler.go +++ b/operator/internal/controller/event_handler.go @@ -19,9 +19,9 @@ package controller import ( "context" + "github.com/NVIDIA/skyhook/api/v1alpha1" + "github.com/NVIDIA/skyhook/internal/dal" "github.com/go-logr/logr" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/dal" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" diff --git a/operator/internal/controller/event_handler_test.go b/operator/internal/controller/event_handler_test.go index 695022c3..05fa6e77 100644 --- a/operator/internal/controller/event_handler_test.go +++ b/operator/internal/controller/event_handler_test.go @@ -23,11 +23,11 @@ import ( . "github.com/onsi/ginkgo/v2" // . "github.com/onsi/gomega" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/dal" - dalmock "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/dal/mock" - MockClient "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/mocks/client" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/mocks/workqueue" + "github.com/NVIDIA/skyhook/api/v1alpha1" + "github.com/NVIDIA/skyhook/internal/dal" + dalmock "github.com/NVIDIA/skyhook/internal/dal/mock" + MockClient "github.com/NVIDIA/skyhook/internal/mocks/client" + "github.com/NVIDIA/skyhook/internal/mocks/workqueue" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/operator/internal/controller/mock/SkyhookNodes.go b/operator/internal/controller/mock/SkyhookNodes.go index 85594a99..296f640f 100644 --- a/operator/internal/controller/mock/SkyhookNodes.go +++ b/operator/internal/controller/mock/SkyhookNodes.go @@ -21,9 +21,9 @@ import ( logr "github.com/go-logr/logr" mock "github.com/stretchr/testify/mock" - v1alpha1 "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1" + v1alpha1 "github.com/NVIDIA/skyhook/api/v1alpha1" - wrapper "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/wrapper" + wrapper "github.com/NVIDIA/skyhook/internal/wrapper" ) // MockSkyhookNodes is an autogenerated mock type for the SkyhookNodes type diff --git a/operator/internal/controller/pod_controller.go b/operator/internal/controller/pod_controller.go index 5c30689f..d8d44c99 100644 --- a/operator/internal/controller/pod_controller.go +++ b/operator/internal/controller/pod_controller.go @@ -21,8 +21,8 @@ import ( "errors" "fmt" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/wrapper" + "github.com/NVIDIA/skyhook/api/v1alpha1" + "github.com/NVIDIA/skyhook/internal/wrapper" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" diff --git a/operator/internal/controller/skyhook_controller.go b/operator/internal/controller/skyhook_controller.go index 44997be4..6e820254 100644 --- a/operator/internal/controller/skyhook_controller.go +++ b/operator/internal/controller/skyhook_controller.go @@ -28,11 +28,11 @@ import ( "strings" "time" + "github.com/NVIDIA/skyhook/api/v1alpha1" + "github.com/NVIDIA/skyhook/internal/dal" + "github.com/NVIDIA/skyhook/internal/version" + "github.com/NVIDIA/skyhook/internal/wrapper" "github.com/go-logr/logr" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/dal" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/version" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/wrapper" corev1 "k8s.io/api/core/v1" policyv1 "k8s.io/api/policy/v1" diff --git a/operator/internal/controller/skyhook_controller_test.go b/operator/internal/controller/skyhook_controller_test.go index ec7dcb49..451cceb0 100644 --- a/operator/internal/controller/skyhook_controller_test.go +++ b/operator/internal/controller/skyhook_controller_test.go @@ -21,11 +21,11 @@ import ( "fmt" "time" + "github.com/NVIDIA/skyhook/api/v1alpha1" + skyhookNodesMock "github.com/NVIDIA/skyhook/internal/controller/mock" + "github.com/NVIDIA/skyhook/internal/wrapper" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1" - skyhookNodesMock "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/controller/mock" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/wrapper" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/operator/internal/controller/suite_test.go b/operator/internal/controller/suite_test.go index 1e435f69..579bf85b 100644 --- a/operator/internal/controller/suite_test.go +++ b/operator/internal/controller/suite_test.go @@ -23,10 +23,10 @@ import ( "runtime" "testing" + "github.com/NVIDIA/skyhook/api/v1alpha1" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/sethvargo/go-envconfig" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" diff --git a/operator/internal/dal/dal.go b/operator/internal/dal/dal.go index 8af37777..6a879c8a 100644 --- a/operator/internal/dal/dal.go +++ b/operator/internal/dal/dal.go @@ -20,8 +20,8 @@ import ( "context" "fmt" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1" - skyhookv1alpha1 "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1" + "github.com/NVIDIA/skyhook/api/v1alpha1" + skyhookv1alpha1 "github.com/NVIDIA/skyhook/api/v1alpha1" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" diff --git a/operator/internal/dal/mock/DAL.go b/operator/internal/dal/mock/DAL.go index a1cf5929..38c5ed8a 100644 --- a/operator/internal/dal/mock/DAL.go +++ b/operator/internal/dal/mock/DAL.go @@ -26,7 +26,7 @@ import ( v1 "k8s.io/api/core/v1" - v1alpha1 "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1" + v1alpha1 "github.com/NVIDIA/skyhook/api/v1alpha1" ) // MockDAL is an autogenerated mock type for the DAL type diff --git a/operator/internal/wrapper/node.go b/operator/internal/wrapper/node.go index ee87e423..ce4d6acb 100644 --- a/operator/internal/wrapper/node.go +++ b/operator/internal/wrapper/node.go @@ -22,10 +22,10 @@ import ( "sort" "strings" + "github.com/NVIDIA/skyhook/api/v1alpha1" + "github.com/NVIDIA/skyhook/internal/graph" + "github.com/NVIDIA/skyhook/internal/version" "github.com/go-logr/logr" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/graph" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/version" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/operator/internal/wrapper/skyhook.go b/operator/internal/wrapper/skyhook.go index 61d15b21..48dd93f3 100644 --- a/operator/internal/wrapper/skyhook.go +++ b/operator/internal/wrapper/skyhook.go @@ -19,9 +19,9 @@ package wrapper import ( "fmt" + "github.com/NVIDIA/skyhook/api/v1alpha1" + "github.com/NVIDIA/skyhook/internal/version" "github.com/go-logr/logr" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/internal/version" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/operator/internal/wrapper/skyhook_test.go b/operator/internal/wrapper/skyhook_test.go index af3c849c..aa97e681 100644 --- a/operator/internal/wrapper/skyhook_test.go +++ b/operator/internal/wrapper/skyhook_test.go @@ -17,9 +17,9 @@ package wrapper import ( + "github.com/NVIDIA/skyhook/api/v1alpha1" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1" ) var _ = Describe("Skyhook wrapper tests", func() { diff --git a/operator/internal/wrapper/zz.migration.0.5.0.go b/operator/internal/wrapper/zz.migration.0.5.0.go index 81cbe678..ba223cd6 100644 --- a/operator/internal/wrapper/zz.migration.0.5.0.go +++ b/operator/internal/wrapper/zz.migration.0.5.0.go @@ -20,8 +20,8 @@ import ( "fmt" "strings" + "github.com/NVIDIA/skyhook/api/v1alpha1" "github.com/go-logr/logr" - "gitlab-master.nvidia.com/dgx/infra/skyhook-operator/api/v1alpha1" ) func migrateNodeTo_0_5_0(node *skyhookNode, logger logr.Logger) error {