Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/docker-build-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Docker Build Images

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker Build - Controller Manager
run: make docker-build
- name: Docker Build - Gateway Plugins
run: make docker-build-plugins
- name: Docker Build - Runtime
run: make docker-build-runtime
34 changes: 34 additions & 0 deletions .github/workflows/docker-push-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Docker Push Images

on:
push:
branches: [ "main", "release-*"]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
# build container images
- name: Docker Build - Controller Manager
run: make docker-build
- name: Docker Build - Gateway Plugins
run: make docker-build-plugins
- name: Docker Build - Runtime
run: make docker-build-runtime
# push container image to dockerhub
- name: Push Image - Controller Manager
run: make docker-push
- name: Push Image - Gateway Plugins
run: make docker-push-plugins
- name: Push Image - Runtime
run: make docker-push-runtime
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Linter and Unit Tests

on:
push:
Expand Down
24 changes: 19 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Git Commit Hash
GIT_COMMIT_HASH := $(shell git rev-parse HEAD)

# Image URL to use all building/pushing image targets
AIBRIX_REPO ?= aibrix
IMG ?= controller:latest
PLUGINS_IMG ?= aibrix/plugins:v0.1.0
RUNTIME_IMG ?= ${AIBRIX_REPO}/runtime:latest
AIBRIX_DOCKERHUB_NAMESPACE ?= aibrix
IMG ?= ${AIBRIX_DOCKERHUB_NAMESPACE}/controller-manager:${GIT_COMMIT_HASH}
PLUGINS_IMG ?= ${AIBRIX_DOCKERHUB_NAMESPACE}/plugins:${GIT_COMMIT_HASH}
RUNTIME_IMG ?= ${AIBRIX_DOCKERHUB_NAMESPACE}/runtime:${GIT_COMMIT_HASH}
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.29.0

Expand Down Expand Up @@ -123,6 +126,17 @@ docker-build-runtime: ## Build docker image with the AI Runime.
.PHONY: docker-push
docker-push: ## Push docker image with the manager.
$(CONTAINER_TOOL) push ${IMG}
$(CONTAINER_TOOL) push ${AIBRIX_DOCKERHUB_NAMESPACE}/controller-manager:nightly

.PHONY: docker-push-plugins
docker-push-plugins: ## Push docker image with the manager.
$(CONTAINER_TOOL) push ${PLUGINS_IMG}
$(CONTAINER_TOOL) push ${AIBRIX_DOCKERHUB_NAMESPACE}/plugins:nightly

.PHONY: docker-push-runtime
docker-push-runtime: ## Push docker image with the manager.
$(CONTAINER_TOOL) push ${RUNTIME_IMG}
$(CONTAINER_TOOL) push ${AIBRIX_DOCKERHUB_NAMESPACE}/runtime:nightly

# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
Expand All @@ -149,7 +163,7 @@ build-installer: manifests generate kustomize ## Generate a consolidated YAML wi

.PHONY: docker-buildx-runtime
docker-buildx-runtime:
$(CONTAINER_TOOL) buildx build --push --platform=${PLATFORMS} -f runtime.Dockerfile . -t ${AIBRIX_REPO}/${RUNTIME_IMG}
$(CONTAINER_TOOL) buildx build --push --platform=${PLATFORMS} -f runtime.Dockerfile . -t ${RUNTIME_IMG}

##@ Deployment

Expand Down