diff --git a/Makefile b/Makefile index 2c8a9730..8d55c579 100644 --- a/Makefile +++ b/Makefile @@ -27,11 +27,8 @@ BUILDIMAGE ?= $(IMAGE_NAME)-build:$(BUILDIMAGE_TAG) EXAMPLES := $(patsubst ./examples/%/,%,$(sort $(dir $(wildcard ./examples/*/)))) EXAMPLE_TARGETS := $(patsubst %,example-%,$(EXAMPLES)) -# The automatic detection of commands does not work in this case, were subcommands exist as -# folders under the cmd folder. -# CMDS := $(patsubst ./cmd/%/,%,$(sort $(dir $(wildcard ./cmd/*/)))) -CMDS := nvidia-mig-parted -CMD_TARGETS := $(patsubst %,cmd-%,$(CMDS)) +CMDS := $(patsubst ./cmd/%/,%,$(sort $(dir $(wildcard ./cmd/*/)))) +CMD_TARGETS := $(patsubst %,cmd-%, $(CMDS)) CHECK_TARGETS := assert-fmt vet lint ineffassign misspell MAKE_TARGETS := binaries build check fmt lint-internal test examples cmds coverage generate $(CHECK_TARGETS) diff --git a/deployments/gpu-operator/main.go b/cmd/nvidia-mig-manager/main.go similarity index 100% rename from deployments/gpu-operator/main.go rename to cmd/nvidia-mig-manager/main.go diff --git a/deployments/gpu-operator/Dockerfile.ubi8 b/deployments/gpu-operator/Dockerfile.ubi8 index cf75635d..6342edab 100644 --- a/deployments/gpu-operator/Dockerfile.ubi8 +++ b/deployments/gpu-operator/Dockerfile.ubi8 @@ -27,11 +27,11 @@ ARG TARGETARCH WORKDIR /build COPY . . +RUN mkdir /artifacts ARG VERSION="N/A" ARG GIT_COMMIT="unknown" RUN make PREFIX=/artifacts cmds -RUN go build -o /artifacts/nvidia-mig-manager ./deployments/gpu-operator/ RUN cp ./deployments/gpu-operator/reconfigure-mig.sh /artifacts/reconfigure-mig.sh RUN OS_ARCH=${TARGETARCH/x86_64/amd64} && OS_ARCH=${OS_ARCH/aarch64/arm64} && curl -o /artifacts/kubectl -L "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${OS_ARCH}/kubectl"; diff --git a/deployments/gpu-operator/Dockerfile.ubuntu b/deployments/gpu-operator/Dockerfile.ubuntu index d9fb6157..07c11d22 100644 --- a/deployments/gpu-operator/Dockerfile.ubuntu +++ b/deployments/gpu-operator/Dockerfile.ubuntu @@ -27,11 +27,11 @@ ARG TARGETARCH WORKDIR /build COPY . . +RUN mkdir /artifacts ARG VERSION="N/A" ARG GIT_COMMIT="unknown" RUN make PREFIX=/artifacts cmds -RUN go build -o /artifacts/nvidia-mig-manager ./deployments/gpu-operator/ RUN cp ./deployments/gpu-operator/reconfigure-mig.sh /artifacts/reconfigure-mig.sh RUN OS_ARCH=${TARGETARCH/x86_64/amd64} && OS_ARCH=${OS_ARCH/aarch64/arm64} && curl -o /artifacts/kubectl -L "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${OS_ARCH}/kubectl";