Skip to content

Commit

Permalink
Merge pull request #62 from ArangoGutierrez/test-infra
Browse files Browse the repository at this point in the history
Use k8s-test-infra devel image
  • Loading branch information
ArangoGutierrez authored Jan 28, 2024
2 parents 83e697c + af9d1b8 commit b6c7aae
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,5 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Build dev image
run: make .build-image

- name: Build
run: make docker-build
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,3 @@ jobs:
run: |
echo "${VERSION}"
make -f deployments/container/Makefile build-${{ matrix.dist }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/nvidia-dra-plugin
.idea
[._]*.sw[a-p]
coverage.out
44 changes: 10 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ ifeq ($(IMAGE_NAME),)
IMAGE_NAME = $(REGISTRY)/$(DRIVER_NAME)
endif

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

CMDS := $(patsubst ./cmd/%/,%,$(sort $(dir $(wildcard ./cmd/*/))))
CMD_TARGETS := $(patsubst %,cmd-%, $(CMDS))

Expand Down Expand Up @@ -138,34 +135,14 @@ generate-clientset: .remove-clientset .remove-deepcopy .remove-crds
.remove-clientset:
rm -rf $(CURDIR)/$(PKG_BASE)/clientset

# 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 HOME=$(PWD) \
-e GOCACHE=$(PWD)/.cache/go \
-e GOPATH=$(PWD)/.cache/gopath \
-v $(PWD):$(PWD) \
-w $(PWD) \
-e GOCACHE=/tmp/.cache/go \
-e GOMODCACHE=/tmp/.cache/gomod \
-v $(PWD):/work \
-w /work \
--user $$(id -u):$$(id -g) \
$(BUILDIMAGE) \
make $(*)
Expand All @@ -176,10 +153,9 @@ PHONY: .shell
$(DOCKER) run \
--rm \
-ti \
-e HOME=$(PWD) \
-e GOCACHE=$(PWD)/.cache/go \
-e GOPATH=$(PWD)/.cache/gopath \
-v $(PWD):$(PWD) \
-w $(PWD) \
-e GOCACHE=/tmp/.cache/go \
-e GOMODCACHE=/tmp/.cache/gomod \
-v $(PWD):/work \
-w /work \
--user $$(id -u):$$(id -g) \
$(BUILDIMAGE)
21 changes: 0 additions & 21 deletions docker/Dockerfile.devel

This file was deleted.

3 changes: 3 additions & 0 deletions versions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ vVERSION := v$(VERSION:v%=%)
GOLANG_VERSION ?= 1.20.4
CUDA_VERSION ?= 11.8.0

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 "")

0 comments on commit b6c7aae

Please sign in to comment.