Skip to content

Commit

Permalink
cleanup old stuff now that Zarf package is done
Browse files Browse the repository at this point in the history
  • Loading branch information
gphorvath committed Jul 19, 2024
1 parent 29bd9e5 commit ad83b0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 47 deletions.
50 changes: 7 additions & 43 deletions packages/k3d-gpu/Makefile
Original file line number Diff line number Diff line change
@@ -1,47 +1,11 @@

REG_PORT ?= 5000
REG_NAME ?= registry

MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
ORGANIZATION := defenseunicorns
PLATFORM := linux/amd64
TAG := latest
UDS_CORE := k3d-core-slim-dev:0.24.0
K3S_TAG := $(shell jq -r .k3s_tag ${MAKEFILE_DIR}/version_config.json)
CUDA_TAG := $(shell jq -r .cuda_tag ${MAKEFILE_DIR}/version_config.json)

echo-config:
@echo "DIR: ${MAKEFILE_DIR}"
@echo "K3S_TAG: ${K3S_TAG}"
@echo "CUDA_TAG: ${CUDA_TAG}"

local-registry: ## Start up a local container registry. Errors in this target are ignored.
@echo "Creating local Docker registry..."
-@docker run -d -p ${REG_PORT}:5000 --restart=always --name ${REG_NAME} registry:2
@echo "Local registry created at localhost:${REG_PORT}"

build-k3d-gpu: local-registry echo-config ## Build the k3d-gpu-support image
# Change to the root of the repository and build the image
@cd ${MAKEFILE_DIR}/../.. && \
docker build \
--platform=${PLATFORM} \
--build-arg K3S_TAG=${K3S_TAG} \
--build-arg CUDA_TAG=${CUDA_TAG} \
-t ghcr.io/${ORGANIZATION}/k3d-gpu-support:${TAG} \
-f ${MAKEFILE_DIR}/Dockerfile .
# Tag the image for the local registry
@docker tag ghcr.io/${ORGANIZATION}/k3d-gpu-support:${TAG} localhost:${REG_PORT}/${ORGANIZATION}/k3d-gpu-support:${TAG}

push-k3d-gpu: local-registry build-k3d-gpu
@docker push localhost:${REG_PORT}/${ORGANIZATION}/k3d-gpu-support:${TAG}

uds-gpu-cluster: local-registry build-k3d-gpu push-k3d-gpu
uds deploy ${UDS_CORE} --set K3D_EXTRA_ARGS="--gpus=all --image=localhost:${REG_PORT}/${ORGANIZATION}/k3d-gpu-support:${TAG}" --confirm
k3d-gpu-package:
@cd ${MAKEFILE_DIR} && \
uds zarf package create

test-k3d-gpu:
@uds zarf tools kubectl apply -f ${MAKEFILE_DIR}/test/cuda-vector-add.yaml
@uds zarf tools kubectl wait --for=jsonpath='{.status.phase}'=Succeeded --timeout=15s pod -l app=gpu-pod
@uds zarf tools kubectl logs -l app=gpu-pod
@uds zarf tools kubectl delete -f ${MAKEFILE_DIR}/test/cuda-vector-add.yaml
create-uds-gpu-cluster:
@cd ${MAKEFILE_DIR} && \
uds zarf package deploy zarf-package-k3d-gpu-amd64-*.tar.zst --confirm

.PHONY: all local-registry build-k3d-gpu push-k3d-gpu test-k3d-gpu
.PHONY: k3d-gpu-package create-uds-gpu-cluster
4 changes: 0 additions & 4 deletions packages/k3d-gpu/version_config.json

This file was deleted.

0 comments on commit ad83b0b

Please sign in to comment.