Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - disable k8 if build image_version is supplied #1400

Closed
wants to merge 2 commits into from
Closed
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
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
4 changes: 4 additions & 0 deletions src/cluster/src/start/k8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ pub struct ClusterConfig {
/// ```
#[builder(default = "false")]
render_checks: bool,

/// Use proxy address for communicating with kubernetes cluster
#[builder(setter(into), default)]
proxy_addr: Option<String>,
}

impl ClusterConfig {
Expand Down
8 changes: 8 additions & 0 deletions tests/runner/src/utils/test_meta/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ pub struct EnvironmentSetup {
/// In seconds, the maximum time a test will run before considered a fail (default: 1 hour)
#[structopt(long, parse(try_from_str = parse_timeout_seconds), default_value = "3600")]
pub timeout: Duration,

/// K8: use specific image version
#[structopt(long)]
pub image_version: Option<String>,

/// K8: use sc address
#[structopt(long)]
pub proxy_addr: Option<String>,
}

#[allow(clippy::unnecessary_wraps)]
Expand Down