Skip to content

Commit

Permalink
chore: clean up build cmds for workspace (#668)
Browse files Browse the repository at this point in the history
**Reason for Change**:
Kaito now includes both workspace and ragengine controllers, this change
cleans up the makefile for building workspace images.
  • Loading branch information
Fei-Guo authored Nov 4, 2024
1 parent 8f894bb commit 1248109
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/e2e-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
if: ${{ !inputs.isRelease }}
shell: bash
run: |
make docker-build-kaito
make docker-build-workspace
env:
REGISTRY: ${{ env.REGISTRY }}
VERSION: ${{ env.VERSION }}
Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:
if: ${{ !inputs.isRelease }}
shell: bash
run: |
make docker-build-kaito
make docker-build-workspace
env:
REGISTRY: ${{ env.REGISTRY }}
VERSION: ${{ env.VERSION }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-gh-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:

- name: Build image
run: |
OUTPUT_TYPE=type=registry make docker-build-kaito
OUTPUT_TYPE=type=registry make docker-build-workspace
env:
VERSION: ${{ needs.check-tag.outputs.tag }}
REGISTRY: ${{ steps.get-registry.outputs.registry_repository }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-mcr-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: 'Build and Publish to MCR'
id: Publish
run: |
OUTPUT_TYPE=type=registry make docker-build-kaito
OUTPUT_TYPE=type=registry make docker-build-workspace
env:
VERSION: ${{ needs.get-tag.outputs.release-tag }}
REGISTRY: ${{ secrets.KAITO_MCR_REGISTRY }}/public/aks/kaito
Expand Down
24 changes: 14 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ OUTPUT_TYPE ?= type=registry
QEMU_VERSION ?= 7.2.0-1
ARCH ?= amd64,arm64

RAGENGINE_IMAGE_NAME ?= ragengine
RAGENGINE_IMAGE_TAG ?= v0.0.1


.PHONY: docker-buildx
docker-buildx: ## Build and push docker image for the manager for cross-platform support
@if ! docker buildx ls | grep $(BUILDX_BUILDER_NAME); then \
Expand All @@ -188,10 +192,10 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform
docker buildx inspect $(BUILDX_BUILDER_NAME) --bootstrap; \
fi

.PHONY: docker-build-kaito
docker-build-kaito: docker-buildx
.PHONY: docker-build-workspace
docker-build-workspace: docker-buildx
docker buildx build \
--file ./docker/kaito/Dockerfile \
--file ./docker/workspace/Dockerfile \
--output=$(OUTPUT_TYPE) \
--platform="linux/$(ARCH)" \
--pull \
Expand All @@ -204,7 +208,7 @@ docker-build-ragengine: docker-buildx
--output=$(OUTPUT_TYPE) \
--platform="linux/$(ARCH)" \
--pull \
--tag $(REGISTRY)/$(IMG_NAME):$(IMG_TAG) .
--tag $(REGISTRY)/$(RAGENGINE_IMG_NAME):$(RAGENGINE_IMG_TAG) .

.PHONY: docker-build-adapter
docker-build-adapter: docker-buildx
Expand Down Expand Up @@ -316,13 +320,13 @@ azure-karpenter-helm: ## Update Azure client env vars and settings in helm valu
kubectl wait --for=condition=available deploy "karpenter" -n karpenter --timeout=300s

##@ Build
.PHONY: build
build: manifests generate fmt vet ## Build manager binary.
go build -o bin/manager cmd/*.go
.PHONY: build-workspace
build-workspace: manifests generate fmt vet ## Build manager binary.
go build -o bin/workspace-manager cmd/workspace/*.go

.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
go run ./cmd/main.go
.PHONY: run-workspace
run-workspace: manifests generate fmt vet ## Run a controller from your host.
go run ./cmd/workspace/main.go

##@ Build Dependencies
## Location to install dependencies to
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/controllers/ragengine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import (
"time"

"github.com/aws/karpenter-core/pkg/apis/v1alpha5"
"github.com/go-logr/logr"
kaitov1alpha1 "github.com/kaito-project/kaito/api/v1alpha1"
"github.com/kaito-project/kaito/pkg/featuregates"
"github.com/kaito-project/kaito/pkg/machine"
"github.com/kaito-project/kaito/pkg/nodeclaim"
"github.com/kaito-project/kaito/pkg/resources"
"github.com/kaito-project/kaito/pkg/utils/consts"
"github.com/go-logr/logr"
"github.com/samber/lo"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/workspace_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ import (
"sigs.k8s.io/karpenter/pkg/apis/v1beta1"

"github.com/aws/karpenter-core/pkg/apis/v1alpha5"
"github.com/go-logr/logr"
kaitov1alpha1 "github.com/kaito-project/kaito/api/v1alpha1"
"github.com/kaito-project/kaito/pkg/inference"
"github.com/kaito-project/kaito/pkg/machine"
"github.com/kaito-project/kaito/pkg/resources"
"github.com/kaito-project/kaito/pkg/utils"
"github.com/kaito-project/kaito/pkg/utils/plugin"
"github.com/go-logr/logr"
"github.com/samber/lo"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
Expand Down

0 comments on commit 1248109

Please sign in to comment.