-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup old stuff now that Zarf package is done
- Loading branch information
Showing
2 changed files
with
7 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.