Skip to content

Commit b6c7aae

Browse files
Merge pull request #62 from ArangoGutierrez/test-infra
Use k8s-test-infra devel image
2 parents 83e697c + af9d1b8 commit b6c7aae

File tree

6 files changed

+14
-59
lines changed

6 files changed

+14
-59
lines changed

.github/workflows/golang-build.yaml .github/workflows/golang.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,5 @@ jobs:
5252
steps:
5353
- uses: actions/checkout@v4
5454

55-
- name: Build dev image
56-
run: make .build-image
57-
5855
- name: Build
5956
run: make docker-build

.github/workflows/build-images.yaml .github/workflows/images.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,3 @@ jobs:
7474
run: |
7575
echo "${VERSION}"
7676
make -f deployments/container/Makefile build-${{ matrix.dist }}
77-

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/nvidia-dra-plugin
66
.idea
77
[._]*.sw[a-p]
8+
coverage.out

Makefile

+10-34
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ ifeq ($(IMAGE_NAME),)
2626
IMAGE_NAME = $(REGISTRY)/$(DRIVER_NAME)
2727
endif
2828

29-
BUILDIMAGE_TAG ?= golang$(GOLANG_VERSION)
30-
BUILDIMAGE ?= $(IMAGE_NAME)-build:$(BUILDIMAGE_TAG)
31-
3229
CMDS := $(patsubst ./cmd/%/,%,$(sort $(dir $(wildcard ./cmd/*/))))
3330
CMD_TARGETS := $(patsubst %,cmd-%, $(CMDS))
3431

@@ -138,34 +135,14 @@ generate-clientset: .remove-clientset .remove-deepcopy .remove-crds
138135
.remove-clientset:
139136
rm -rf $(CURDIR)/$(PKG_BASE)/clientset
140137

141-
# Generate an image for containerized builds
142-
# Note: This image is local only
143-
.PHONY: .build-image .pull-build-image .push-build-image
144-
.build-image: docker/Dockerfile.devel
145-
if [ x"$(SKIP_IMAGE_BUILD)" = x"" ]; then \
146-
$(DOCKER) build \
147-
--progress=plain \
148-
--build-arg GOLANG_VERSION="$(GOLANG_VERSION)" \
149-
--tag $(BUILDIMAGE) \
150-
-f $(^) \
151-
docker; \
152-
fi
153-
154-
.pull-build-image:
155-
$(DOCKER) pull $(BUILDIMAGE)
156-
157-
.push-build-image:
158-
$(DOCKER) push $(BUILDIMAGE)
159-
160-
$(DOCKER_TARGETS): docker-%: .build-image
161-
@echo "Running 'make $(*)' in docker container $(BUILDIMAGE)"
138+
$(DOCKER_TARGETS): docker-%:
139+
@echo "Running 'make $(*)' in container image $(BUILDIMAGE)"
162140
$(DOCKER) run \
163141
--rm \
164-
-e HOME=$(PWD) \
165-
-e GOCACHE=$(PWD)/.cache/go \
166-
-e GOPATH=$(PWD)/.cache/gopath \
167-
-v $(PWD):$(PWD) \
168-
-w $(PWD) \
142+
-e GOCACHE=/tmp/.cache/go \
143+
-e GOMODCACHE=/tmp/.cache/gomod \
144+
-v $(PWD):/work \
145+
-w /work \
169146
--user $$(id -u):$$(id -g) \
170147
$(BUILDIMAGE) \
171148
make $(*)
@@ -176,10 +153,9 @@ PHONY: .shell
176153
$(DOCKER) run \
177154
--rm \
178155
-ti \
179-
-e HOME=$(PWD) \
180-
-e GOCACHE=$(PWD)/.cache/go \
181-
-e GOPATH=$(PWD)/.cache/gopath \
182-
-v $(PWD):$(PWD) \
183-
-w $(PWD) \
156+
-e GOCACHE=/tmp/.cache/go \
157+
-e GOMODCACHE=/tmp/.cache/gomod \
158+
-v $(PWD):/work \
159+
-w /work \
184160
--user $$(id -u):$$(id -g) \
185161
$(BUILDIMAGE)

docker/Dockerfile.devel

-21
This file was deleted.

versions.mk

+3
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ vVERSION := v$(VERSION:v%=%)
2424
GOLANG_VERSION ?= 1.20.4
2525
CUDA_VERSION ?= 11.8.0
2626

27+
BUILDIMAGE_TAG ?= devel-go$(GOLANG_VERSION)
28+
BUILDIMAGE ?= ghcr.io/nvidia/k8s-test-infra:$(BUILDIMAGE_TAG)
29+
2730
GIT_COMMIT ?= $(shell git describe --match="" --dirty --long --always --abbrev=40 2> /dev/null || echo "")

0 commit comments

Comments
 (0)