Skip to content

Commit

Permalink
Parametrize ray operator makefile to support other container engines (r…
Browse files Browse the repository at this point in the history
…ay-project#1121)

Parametrize ray operator makefile to support other container engines
  • Loading branch information
anishasthana committed Jun 1, 2023
1 parent 8e07b06 commit b39c728
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion ray-operator/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ kubectl | v1.21.0+ | [download](https://kubernetes.io/docs/tasks/tools/insta
go | v1.17|[download](https://golang.org/dl/)
docker | 19.03+|[download](https://docs.docker.com/install/)

Alternatively, you can use podman (version 4.5+) instead of docker. See [podman.io](https://podman.io/getting-started/installation) for installation instructions. The Makefile allows you to specify the container engine to use via the `ENGINE` variable. For example, to use podman, you can run `ENGINE=podman make docker-build`.

The instructions assume you have access to a running Kubernetes cluster via ``kubectl``. If you want to test locally, consider using [Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/).

### Setup on Kind
Expand Down Expand Up @@ -46,7 +48,7 @@ kind create cluster --image=kindest/node:v1.24.0
# Step 2: Modify KubeRay source code
# For example, add a log "Hello KubeRay" in the function `Reconcile` in `raycluster_controller.go`.

# Step 3: Build a Docker image
# Step 3: Build an image
# This command will copy the source code directory into the image, and build it.
# Command: IMG={IMG_REPO}:{IMG_TAG} make docker-build
IMG=kuberay/operator:nightly make docker-build
Expand Down
11 changes: 7 additions & 4 deletions ray-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ endif
SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec

# Container Engine to be used for building images
ENGINE ?= "docker"

all: build

##@ General
Expand Down Expand Up @@ -82,12 +85,12 @@ run: manifests generate fmt vet ## Run a controller from your host.
go run ./main.go

docker-image: ## Build image only
docker build -t ${IMG} .
${ENGINE} build -t ${IMG} .

docker-build: test docker-image ## Build docker image with the manager.
docker-build: test docker-image ## Build image with the manager.

docker-push: ## Push docker image with the manager.
docker push ${IMG}
docker-push: ## Push image with the manager.
${ENGINE} push ${IMG}

##@ Deployment

Expand Down

0 comments on commit b39c728

Please sign in to comment.