Skip to content

Commit

Permalink
fix registry variable names and make targets
Browse files Browse the repository at this point in the history
  • Loading branch information
gphorvath committed Jul 19, 2024
1 parent 58d55f4 commit 27b282c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARCH ?= amd64
KEY ?= ""
REG_PORT ?= 5000
REG_NAME ?= registry

VERSION ?= $(shell git describe --abbrev=0 --tags)
LOCAL_VERSION ?= $(shell git rev-parse --short HEAD)
Expand Down Expand Up @@ -33,13 +34,16 @@ gen-python: ## Generate the protobufs for the OpenAI typing within the leapfroga
src/leapfrogai_sdk/proto/leapfrogai_sdk/**/*.proto

local-registry: ## Start up a local container registry. Errors in this target are ignored.
-docker run -d -p ${REG_PORT}:5000 --restart=always --name registry registry:2
@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}"


# Clean up: Stop and remove the local registry
clean-registry:
@echo "Cleaning up..."
@docker stop ${REGISTRY_NAME} || true
@docker rm ${REGISTRY_NAME} || true
@docker stop registry
@docker rm ${REG_NAME}

sdk-wheel: ## build wheels for the leapfrogai_sdk package as a dependency for other lfai components
docker build --platform=linux/${ARCH} -t ghcr.io/defenseunicorns/leapfrogai/leapfrogai-sdk:${LOCAL_VERSION} -f src/leapfrogai_sdk/Dockerfile .
Expand Down
18 changes: 9 additions & 9 deletions packages/k3d-gpu/Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@

REG_PORT ?= 5000
REG_NAME ?= registry

MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
REGISTRY_NAME := registry
REGISTRY_PORT := 5000
ORGANIZATION := defenseunicorns
PLATFORM := linux/amd64
TAG := latest
K3D_CLUSTER_NAME := k3d-core-slim-dev:0.24.0
K3S_TAG := v1.28.8-k3s1
CUDA_TAG := 12.4.1-base-ubuntu22.04

# Create local Docker registry
local-registry:
local-registry: ## Start up a local container registry. Errors in this target are ignored.
@echo "Creating local Docker registry..."
-@docker run -d -p ${REGISTRY_PORT}:5000 --name ${REGISTRY_NAME} registry:2
@echo "Local registry created at localhost:${REGISTRY_PORT}"
-@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
@docker build \
Expand All @@ -22,13 +22,13 @@ build-k3d-gpu: local-registry
--build-arg CUDA_TAG=${CUDA_TAG} \
-t ghcr.io/${ORGANIZATION}/k3d-gpu-support:${TAG} \
-f ${MAKEFILE_DIR}/Dockerfile ${MAKEFILE_DIR}
@docker tag ghcr.io/${ORGANIZATION}/k3d-gpu-support:${TAG} localhost:${REGISTRY_PORT}/${ORGANIZATION}/k3d-gpu-support:${TAG}
@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:${REGISTRY_PORT}/${ORGANIZATION}/k3d-gpu-support:${TAG}
@docker push localhost:${REG_PORT}/${ORGANIZATION}/k3d-gpu-support:${TAG}

uds-gpu-cluster: local-registry build-k3d-gpu push-k3d-gpu
uds deploy ${K3D_CLUSTER_NAME} --set K3D_EXTRA_ARGS="--gpus=all --image=localhost:${REGISTRY_PORT}/${ORGANIZATION}/k3d-gpu-support:${TAG}" --confirm
uds deploy ${K3D_CLUSTER_NAME} --set K3D_EXTRA_ARGS="--gpus=all --image=localhost:${REG_PORT}/${ORGANIZATION}/k3d-gpu-support:${TAG}" --confirm

test-k3d-gpu:
@uds zarf tools kubectl apply -f ${MAKEFILE_DIR}/test/cuda-vector-add.yaml
Expand Down

0 comments on commit 27b282c

Please sign in to comment.