Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions containers/operator.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions operator/.mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions operator/PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion operator/api/v1alpha1/skyhook_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions operator/api/v1alpha1/skyhook_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions operator/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
4 changes: 2 additions & 2 deletions operator/deps.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion operator/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module gitlab-master.nvidia.com/dgx/infra/skyhook-operator
module github.com/NVIDIA/skyhook

go 1.23

Expand Down
2 changes: 1 addition & 1 deletion operator/internal/controller/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
6 changes: 3 additions & 3 deletions operator/internal/controller/cluster_state_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions operator/internal/controller/event_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions operator/internal/controller/event_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions operator/internal/controller/mock/SkyhookNodes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions operator/internal/controller/pod_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions operator/internal/controller/skyhook_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions operator/internal/controller/skyhook_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/controller/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions operator/internal/dal/dal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/dal/mock/DAL.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions operator/internal/wrapper/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
4 changes: 2 additions & 2 deletions operator/internal/wrapper/skyhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion operator/internal/wrapper/skyhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/wrapper/zz.migration.0.5.0.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down