Skip to content

Commit

Permalink
disable k8 if build image_version is supplied (#1400)
Browse files Browse the repository at this point in the history
This is for #1363.

Disable building image if image version is supplied.  This is useful in the Mac where building image might not work.  In this case, we use image supplied built using Linux.

Also, by default use proxy for accessing Minikube cluster since Docker for Mac doesn't map ports from Minikube to host automatically.
  • Loading branch information
sehz committed Aug 8, 2021
1 parent 71886d8 commit b89887f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ GIT_COMMIT=$(shell git rev-parse HEAD)
DOCKER_TAG=$(VERSION)-$(GIT_COMMIT)
DOCKER_REGISTRY=infinyon
K8_CLUSTER?=$(shell ./k8-util/cluster/cluster-type.sh)
DOCKER_IMAGE=$(DOCKER_REGISTRY)/fluvio
TARGET_MUSL=x86_64-unknown-linux-musl
TARGET?=
IMAGE_VERSION?= # If set, this indicates that the image is pre-built and should not be built
BUILD_PROFILE=$(if $(RELEASE),release,debug)
CARGO_BUILDER=$(if $(findstring arm,$(TARGET)),cross,cargo) # If TARGET contains the substring "arm"
FLUVIO_BIN=$(if $(TARGET),./target/$(TARGET)/$(BUILD_PROFILE)/fluvio,./target/$(BUILD_PROFILE)/fluvio)
Expand All @@ -33,7 +33,7 @@ TEST_ENV_FLV_SPU_DELAY=
TEST_ARG_SPU=--spu ${DEFAULT_SPU}
TEST_ARG_LOG=--client-log ${CLIENT_LOG} --server-log ${SERVER_LOG}
TEST_ARG_REPLICATION=-r ${REPL}
TEST_ARG_DEVELOP=--develop
TEST_ARG_DEVELOP=$(if $(IMAGE_VERSION),--image-version ${IMAGE_VERSION}, --develop)
TEST_ARG_SKIP_CHECKS=
TEST_ARG_EXTRA=
TEST_ARG_CONSUMER_WAIT=
Expand All @@ -54,6 +54,7 @@ helm_pkg:
build-cli: install_rustup_target
$(CARGO_BUILDER) build --bin fluvio $(RELEASE_FLAG) $(TARGET_FLAG) $(VERBOSE_FLAG)


build-cli-minimal: install_rustup_target
# https://github.com/infinyon/fluvio/issues/1255
cargo build --bin fluvio $(RELEASE_FLAG) $(TARGET_FLAG) $(VERBOSE_FLAG) --no-default-features --features consumer --manifest-path ./src/cli/Cargo.toml
Expand Down Expand Up @@ -125,7 +126,7 @@ k8-setup:
# Kubernetes Tests

smoke-test-k8: TEST_ARG_EXTRA=$(EXTRA_ARG)
smoke-test-k8: build_k8_image smoke-test
smoke-test-k8: smoke-test build_k8_image

smoke-test-k8-tls: TEST_ARG_EXTRA=--tls $(EXTRA_ARG)
smoke-test-k8-tls: build_k8_image smoke-test
Expand Down Expand Up @@ -230,6 +231,8 @@ run-client-doc-test: install_rustup_target
# In CI mode, do not build k8 image
ifeq (${CI},true)
build_k8_image:
else ifeq (${IMAGE_VERSION},true)
build_k8_image:
else
# When not in CI (i.e. development), build image before testing
build_k8_image: fluvio_image
Expand Down
11 changes: 9 additions & 2 deletions k8-util/cluster/reset-minikube.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#!/bin/bash
# delete and re-install minikube ready for fluvio
# this defaults to docker and assume you have have sudo access
# it uses docker as default driver
set -e
set -x
ARG1=${1:-docker}
K8_VERSION=${2:-1.21.2}

if [ "$(uname)" == "Darwin" ]; then
EXTRA_CONFIG=--extra-config=apiserver.service-node-port-range=32700-32800 --ports=127.0.0.1:32700-32800:32700-32800
fi


minikube delete
minikube start --driver $ARG1 --kubernetes-version=$K8_VERSION
minikube start --driver $ARG1 --kubernetes-version=$K8_VERSION $EXTRA_CONFIG
# minikube start --extra-config=apiserver.v=10

0 comments on commit b89887f

Please sign in to comment.