From 57435a2033c737e8099d1d1786f0ad1f46284c4b Mon Sep 17 00:00:00 2001 From: Navid Shaikh Date: Fri, 8 Nov 2019 18:37:41 +0530 Subject: [PATCH] Updates OpenShift CI setup script - Also updates Dockerfile for next release --- Dockerfile | 10 +-- openshift/e2e-tests-openshift.sh | 136 ++++--------------------------- 2 files changed, 23 insertions(+), 123 deletions(-) diff --git a/Dockerfile b/Dockerfile index c1ed751710..196ca64db8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,20 +2,20 @@ FROM rhel8/go-toolset:1.12.8 AS builder WORKDIR /opt/app-root/src/go/src/github.com/knative/client USER root COPY . . -RUN TAG="v0.8.0" make build +RUN TAG="v0.10.0" make build FROM ubi8:8-released -COPY --from=builder /opt/app-root/src/go/src/github.com/knative/client/kn /usr/bin/kn +COPY --from=builder /opt/app-root/src/go/src/github.com/knative/client/kn /ko-app/kn LABEL \ com.redhat.component="openshift-serverless-1-tech-preview-client-kn-rhel8-container" \ name="openshift-serverless-1-tech-preview/client-kn-rhel8" \ - version="0.8.0" \ + version="0.10.0" \ summary="Red Hat OpenShift Serverless 1 kn CLI" \ description="CLI client 'kn' for managing Red Hat OpenShift Serverless 1" \ io.k8s.display-name="Red Hat OpenShift Serverless 1 kn CLI" \ io.k8s.description="CLI client 'kn' for managing Red Hat OpenShift Serverless 1" \ io.openshift.build.source-location="https://github.com/openshift/knative-client" \ - maintainer="nshaikh@redhat.com" + maintainer="serverless-support@redhat.com" -ENTRYPOINT ["/usr/bin/kn"] +ENTRYPOINT ["/ko-app/kn"] diff --git a/openshift/e2e-tests-openshift.sh b/openshift/e2e-tests-openshift.sh index 7b2f497f50..39da93a245 100755 --- a/openshift/e2e-tests-openshift.sh +++ b/openshift/e2e-tests-openshift.sh @@ -19,14 +19,12 @@ source $(dirname $0)/../vendor/knative.dev/test-infra/scripts/e2e-tests.sh set -x -readonly SERVING_RELEASE="release-v0.8.1" readonly KN_DEFAULT_TEST_IMAGE="gcr.io/knative-samples/helloworld-go" readonly SERVING_NAMESPACE="knative-serving" -readonly SERVICEMESH_NAMESPACE="istio-system" +readonly SERVICEMESH_NAMESPACE="knative-serving-ingress" readonly E2E_TIMEOUT="60m" readonly E2E_PARALLEL="1" -readonly CS_NS="openshift-marketplace" -readonly OPERATOR_NS="openshift-operators" +readonly OLM_NAMESPACE="openshift-marketplace" env function scale_up_workers(){ @@ -78,43 +76,6 @@ function wait_until_hostname_resolves() { return 1 } -# Waits until the given hostname resolves via DNS -# Parameters: $1 - hostname -function wait_until_hostname_resolves() { - echo -n "Waiting until hostname $1 resolves via DNS" - for i in {1..150}; do # timeout after 15 minutes - local output="$(host -t a $1 | grep 'has address')" - if [[ -n "${output}" ]]; then - echo -e "\n${output}" - return 0 - fi - echo -n "." - sleep 6 - done - echo -e "\n\nERROR: timeout waiting for hostname $1 to resolve via DNS" - return 1 -} - -# Waits until the configmap in the given namespace contains the -# desired content. -# Parameters: $1 - namespace -# $2 - configmap name -# $3 - desired content -function wait_until_configmap_contains() { - echo -n "Waiting until configmap $1/$2 contains '$3'" - for _ in {1..180}; do # timeout after 3 minutes - local output="$(oc -n "$1" get cm "$2" -oyaml | grep "$3")" - if [[ -n "${output}" ]]; then - echo -e "\n${output}" - return 0 - fi - echo -n "." - sleep 1 - done - echo -e "\n\nERROR: timeout waiting for configmap $1/$2 to contain '$3'" - return 1 -} - # Loops until duration (car) is exceeded or command (cdr) returns non-zero function timeout() { SECONDS=0; TIMEOUT=$1; shift @@ -125,49 +86,6 @@ function timeout() { return 0 } -function install_servicemesh(){ - header "Installing ServiceMesh" - - # Install the ServiceMesh Operator - oc apply -f https://raw.githubusercontent.com/openshift/knative-serving/$SERVING_RELEASE/openshift/servicemesh/operator-install.yaml - - # Wait for the istio-operator pod to appear - timeout 900 '[[ $(oc get pods -n openshift-operators | grep -c istio-operator) -eq 0 ]]' || return 1 - - # Wait until the Operator pod is up and running - wait_until_pods_running openshift-operators || return 1 - - # Deploy ServiceMesh - oc new-project $SERVICEMESH_NAMESPACE - oc apply -n $SERVICEMESH_NAMESPACE -f https://raw.githubusercontent.com/openshift/knative-serving/$SERVING_RELEASE/openshift/servicemesh/controlplane-install.yaml - cat <> Bringin down Service Mesh" - oc delete --ignore-not-found=true -n $SERVICEMESH_NAMESPACE -f https://raw.githubusercontent.com/openshift/knative-serving/$SERVING_RELEASE/openshift/servicemesh/controlplane-install.yaml - oc delete --ignore-not-found=true -f https://raw.githubusercontent.com/openshift/knative-serving/$SERVING_RELEASE/openshift/servicemesh/operator-install.yaml -} - -function teardown() { - delete_test_namespace - delete_service_mesh - delete_knative_openshift -} echo ">> Check resources" echo ">> - meminfo:" @@ -318,14 +222,10 @@ failed=0 (( !failed )) && build_knative_client || failed=1 -(( !failed )) && install_servicemesh || failed=1 - (( !failed )) && install_knative_serving || failed=1 (( !failed )) && run_e2e_tests || failed=1 -teardown - (( failed )) && exit 1 success