Skip to content

Commit 93675b0

Browse files
authored
chore(backend): fixed support for Podman in Makefile (kubeflow#11844)
Signed-off-by: Helber Belmiro <[email protected]>
1 parent 5c868d4 commit 93675b0

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

backend/Makefile

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ KIND_NAME ?= dev-pipelines-api
66
CERT_MANAGER_VERSION ?= v1.16.2
77

88
# Container Build Params
9-
CONTAINER_ENGINE ?= docker
9+
CONTAINER_ENGINE ?= $(shell \
10+
if command -v docker >/dev/null 2>&1; then \
11+
echo docker; \
12+
elif command -v podman >/dev/null 2>&1; then \
13+
echo podman; \
14+
fi \
15+
)
16+
1017
# IMG_REGISTRY can be used to automatically prepend registry details. e.g. "quay.io/kubeflow/"
1118
IMG_REGISTRY ?=
1219
IMG_TAG_APISERVER ?= apiserver
@@ -78,7 +85,11 @@ dev-kind-cluster:
7885
-kind create cluster --name $(KIND_NAME) --config $(CURDIR)/../tools/kind/kind-config.yaml
7986
kubectl config use-context kind-$(KIND_NAME)
8087
kind get kubeconfig --name $(KIND_NAME) > $(CURDIR)/../kubeconfig_$(KIND_NAME)
81-
kind --name $(KIND_NAME) load docker-image ${IMG_TAG_WEBHOOK_PROXY}
88+
@if [ "${CONTAINER_ENGINE}" = "docker" ]; then \
89+
kind --name ${KIND_NAME} load docker-image ${IMG_TAG_WEBHOOK_PROXY}; \
90+
else \
91+
bash -c "kind load --name ${KIND_NAME} image-archive <( ${CONTAINER_ENGINE} save ${IMG_TAG_WEBHOOK_PROXY})"; \
92+
fi
8293
$(MAKE) install-cert-manager
8394
kubectl apply -k $(CURDIR)/../manifests/kustomize/cluster-scoped-resources
8495
kubectl wait --for condition=established --timeout=1m crd/applications.app.k8s.io
@@ -89,7 +100,11 @@ dev-kind-cluster:
89100

90101
.PHONY: kind-load-driver-debug
91102
kind-load-driver-debug:
92-
kind --name $(KIND_NAME) load docker-image ${IMG_TAG_DRIVER}:debug
103+
@if [ "${CONTAINER_ENGINE}" = "docker" ]; then \
104+
kind --name ${KIND_NAME} load docker-image ${IMG_TAG_DRIVER}:debug
105+
else \
106+
bash -c "kind load --name ${KIND_NAME} image-archive <( ${CONTAINER_ENGINE} save ${IMG_TAG_DRIVER})"; \
107+
fi
93108

94109
.PHONY: kind-build-and-load-driver-debug
95110
kind-build-and-load-driver-debug: image_driver_debug kind-load-driver-debug

backend/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,10 @@ pods on the cluster using the `ml-pipeline` `Service`.
8585
[kind #1200](https://github.com/kubernetes-sigs/kind/issues/1200#issuecomment-1304855791) for an example manifest.
8686
* Optional: VSCode is installed to leverage a sample `launch.json` file.
8787
* This relies on dlv: (go install -v github.com/go-delve/delve/cmd/dlv@latest)
88-
* Note that while you can use Podman to build the KFP images, you will still require Docker installed to run the make
89-
dev-kind-cluster commands
9088

9189
#### Provisioning the Cluster
9290

93-
To provision the kind cluster, run the following from the Git repository's root directory,:
91+
To provision the kind cluster, run the following from the Git repository's root directory:
9492

9593
```bash
9694
make -C backend dev-kind-cluster

0 commit comments

Comments
 (0)