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: Carlos Eduardo Arango Gutierrez <[email protected]>
  • Loading branch information
ArangoGutierrez committed Jan 26, 2024
1 parent 83e697c commit 99bae44
Show file tree
Hide file tree
Showing 7 changed files with 552 additions and 53 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build-images.yaml
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 }}
3 changes: 0 additions & 3 deletions .github/workflows/golang-build.yaml
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
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.*
37 changes: 9 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ ifeq ($(IMAGE_NAME),)
IMAGE_NAME = $(REGISTRY)/$(DRIVER_NAME)
endif

BUILDIMAGE_TAG ?= golang$(GOLANG_VERSION)
BUILDIMAGE ?= $(IMAGE_NAME)-build:$(BUILDIMAGE_TAG)
GOCACHE := $(shell go env GOCACHE)
GOMODCACHE := $(shell go env GOMODCACHE)

CMDS := $(patsubst ./cmd/%/,%,$(sort $(dir $(wildcard ./cmd/*/))))
CMD_TARGETS := $(patsubst %,cmd-%, $(CMDS))
Expand Down Expand Up @@ -138,34 +138,15 @@ 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=/work/.cache/go \
-v $(PWD):/work \
-v $(GOCACHE):/work/.cache \
-v $(GOMODCACHE):/go/pkg/mod \
-w /work \
--user $$(id -u):$$(id -g) \
$(BUILDIMAGE) \
make $(*)
Expand Down
539 changes: 539 additions & 0 deletions coverage.out

Large diffs are not rendered by default.

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 99bae44

Please sign in to comment.