Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

adding smoother install for serverless #473

Closed
wants to merge 1 commit into from
Closed
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
64 changes: 9 additions & 55 deletions openshift/e2e-tests-openshift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,60 +58,14 @@ function install_strimzi(){
sleep 5; while echo && kubectl get pods -n kafka | grep -v -E "(Running|Completed|STATUS)"; do sleep 5; done
}

function install_knative_serving(){
header "Installing Knative Serving"

oc new-project $SERVING_NAMESPACE

# Install CatalogSource in OLM namespace
envsubst < openshift/olm/knative-serving.catalogsource.yaml | oc apply -n $OLM_NAMESPACE -f -
timeout_non_zero 900 '[[ $(oc get pods -n $OLM_NAMESPACE | grep -c serverless) -eq 0 ]]' || return 1
wait_until_pods_running $OLM_NAMESPACE

# Deploy Serverless Operator
deploy_serverless_operator

# Wait for the CRD to appear
timeout_non_zero 900 '[[ $(oc get crd | grep -c knativeservings) -eq 0 ]]' || return 1

# Install Knative Serving
cat <<-EOF | oc apply -f -
apiVersion: operator.knative.dev/v1alpha1
kind: KnativeServing
metadata:
name: knative-serving
namespace: ${SERVING_NAMESPACE}
EOF

# Wait for 4 pods to appear first
timeout_non_zero 900 '[[ $(oc get pods -n $SERVING_NAMESPACE --no-headers | wc -l) -lt 4 ]]' || return 1
wait_until_pods_running $SERVING_NAMESPACE || return 1

wait_until_pods_running $SERVICEMESH_NAMESPACE || return 1

# wait_until_service_has_external_ip $SERVICEMESH_NAMESPACE istio-ingressgateway || fail_test "Ingress has no external IP"
# wait_until_hostname_resolves "$(kubectl get svc -n $SERVICEMESH_NAMESPACE istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')"

header "Knative Serving Installed successfully"
}

function deploy_serverless_operator(){
local name="serverless-operator"
local operator_ns
operator_ns=$(kubectl get og --all-namespaces | grep global-operators | awk '{print $1}')

cat <<-EOF | oc apply -f -
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: ${name}-subscription
namespace: ${operator_ns}
spec:
source: ${name}
sourceNamespace: $OLM_NAMESPACE
name: ${name}
channel: techpreview
EOF
function install_serverless(){
header "Installing Serverless Operator"
git clone https://github.com/openshift-knative/serverless-operator.git /tmp/serverless-operator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't always want to install the master of serverless, do we? Think about once we cut a release branch - we'll want the test to install the appropriate version of the serverless operator based on the release branch. But with this change, older versions of eventing in that release branch will still install the master (ie latest) of the serverless operator.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea is that HEAD (release-next) would always go with master from that repo.

but we could stick to desired versions e.g. 1.5.0 and update, when needed

for the 0.13.0 bits, I wanted to wait until we have 1.5.0 out, and then use that - instead of HEAD/master

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. I'm just worried we'll forget to update this every time we cut a new branch and end up accidentally testing against the wrong thing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, but I think even the other way around, means some changes are needed. I am not sure what's best to avoid that

# unset OPENSHIFT_BUILD_NAMESPACE as its used in serverless-operator's CI environment as a switch
# to use CI built images, we want pre-built images of k-s-o and k-o-i
unset OPENSHIFT_BUILD_NAMESPACE
/tmp/serverless-operator/hack/install.sh || return 1
header "Serverless Operator installed successfully"
}

function create_knative_namespace(){
Expand Down Expand Up @@ -309,7 +263,7 @@ failed=0

(( !failed )) && install_strimzi || failed=1

(( !failed )) && install_knative_serving || failed=1
(( !failed )) && install_serverless || failed=1

(( !failed )) && install_knative_eventing || failed=1

Expand Down