Skip to content

Commit

Permalink
Use k8s-test-infra devel image
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Lezar <[email protected]>
  • Loading branch information
elezar committed Jan 28, 2024
1 parent 6753dcb commit ec0c851
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 27 deletions.
32 changes: 6 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ REGISTRY ?= nvidia
IMAGE_NAME=$(REGISTRY)/mig-parted
endif

BUILDIMAGE_TAG ?= golang$(GOLANG_VERSION)
BUILDIMAGE ?= $(IMAGE_NAME)-build:$(BUILDIMAGE_TAG)

EXAMPLES := $(patsubst ./examples/%/,%,$(sort $(dir $(wildcard ./examples/*/))))
EXAMPLE_TARGETS := $(patsubst %,example-%,$(EXAMPLES))

Expand Down Expand Up @@ -106,30 +103,12 @@ coverage: test
cat $(COVERAGE_FILE) | grep -v "_mock.go" > $(COVERAGE_FILE).no-mocks
go tool cover -func=$(COVERAGE_FILE).no-mocks

# Generate an image for containerized builds
# Note: This image is local only
.PHONY: .build-image .pull-build-image .push-build-image
.build-image: docker/Dockerfile.devel
if [ x"$(SKIP_IMAGE_BUILD)" = x"" ]; then \
$(DOCKER) build \
--progress=plain \
--build-arg GOLANG_VERSION="$(GOLANG_VERSION)" \
--tag $(BUILDIMAGE) \
-f $(^) \
docker; \
fi

.pull-build-image:
$(DOCKER) pull $(BUILDIMAGE)

.push-build-image:
$(DOCKER) push $(BUILDIMAGE)

$(DOCKER_TARGETS): docker-%: .build-image
@echo "Running 'make $(*)' in docker container $(BUILDIMAGE)"
$(DOCKER_TARGETS): docker-%:
@echo "Running 'make $(*)' in container image $(BUILDIMAGE)"
$(DOCKER) run \
--rm \
-e GOCACHE=/tmp/.cache \
-e GOCACHE=/tmp/.cache/go \
-e GOMODCACHE=/tmp/.cache/gomod \
-v $(PWD):/work \
-w /work \
--user $$(id -u):$$(id -g) \
Expand All @@ -142,7 +121,8 @@ PHONY: .shell
$(DOCKER) run \
--rm \
-ti \
-e GOCACHE=/tmp/.cache \
-e GOCACHE=/tmp/.cache/go \
-e GOMODCACHE=/tmp/.cache/gomod \
-v $(PWD):/work \
-w /work \
--user $$(id -u):$$(id -g) \
Expand Down
5 changes: 4 additions & 1 deletion versions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ vVERSION := v$(VERSION:v%=%)
CUDA_VERSION := 12.2.2
GOLANG_VERSION := 1.20.4

NVIDIA_CTK_VERSION := v1.13.4
BUILDIMAGE_TAG ?= devel-go$(GOLANG_VERSION)
BUILDIMAGE ?= ghcr.io/nvidia/k8s-test-infra:$(BUILDIMAGE_TAG)

GIT_COMMIT ?= $(shell git describe --match="" --dirty --long --always --abbrev=40 2> /dev/null || echo "")

NVIDIA_CTK_VERSION := v1.13.4

0 comments on commit ec0c851

Please sign in to comment.