Skip to content

Commit

Permalink
ci: add more time execution log for debugging
Browse files Browse the repository at this point in the history
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
  • Loading branch information
leninmehedy committed Oct 4, 2023
1 parent 3ea9155 commit b8ecdc9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dev/scripts/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ function build_kubectl_bats() {
echo "-----------------------------------------------------------------------------------------------------"
cd "${DOCKERFILE_DIR}/kubectl-bats" && docker build -t "${KUBECTL_BATS_IMAGE}" .
kind load docker-image "${KUBECTL_BATS_IMAGE}" -n "${CLUSTER_NAME}"

log_time "build_kubectl_bats"
}
20 changes: 20 additions & 0 deletions dev/scripts/gateway.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ function deploy_haproxy_ingress() {
echo "HAProxy Ingress Controller is already installed"
echo ""
fi

log_time "deploy_haproxy_ingress"
}

function destroy_haproxy_ingress() {
Expand All @@ -40,6 +42,8 @@ function destroy_haproxy_ingress() {

echo "HAProxy Ingress Controller is uninstalled"
echo ""

log_time "destroy_haproxy_ingress"
}

function deploy_gateway_api_crd() {
Expand Down Expand Up @@ -81,6 +85,8 @@ function deploy_envoy_gateway_api() {
fi

get_gateway_status

log_time "deploy_envoy_gateway_api"
}

function get_gateway_status() {
Expand Down Expand Up @@ -116,6 +122,8 @@ function destroy_envoy_gateway_api() {

echo "Envoy Gateway API is uninstalled"
echo ""

log_time "destroy_envoy_gateway_api"
}

function uninstall_crd() {
Expand All @@ -129,6 +137,8 @@ function uninstall_crd() {
kubectl delete crd "${name}"
done
fi

log_time "uninstall_crd"
}

function expose_envoy_gateway_svc() {
Expand All @@ -145,6 +155,8 @@ function expose_envoy_gateway_svc() {
echo "Exposing Envoy Gateway Service: ${ENVOY_SERVICE} on ${local_port}:${gateway_port}"
echo "-----------------------------------------------------------------------------------------------------"
kubectl port-forward "svc/${ENVOY_SERVICE}" -n envoy-gateway-system "${local_port}":"${gateway_port}" &

log_time "expose_envoy_gateway_svc"
}

function unexpose_envoy_gateway_svc() {
Expand All @@ -157,6 +169,8 @@ function unexpose_envoy_gateway_svc() {
echo "-----------------------------------------------------------------------------------------------------"
kill "${GATEWAY_SVC_PID}" &>/dev/null || true
fi

log_time "unexpose_envoy_gateway_svc"
}

function test_http_route() {
Expand Down Expand Up @@ -195,6 +209,8 @@ function test_http_route() {
echo "-----------------------------------------------------------------------------------------------------"
unexpose_envoy_gateway_svc || true
kubectl delete -f "${GATEWAY_API_DIR}/http-debug.yaml"

log_time "test_http_route"
}

function test_grpc_route() {
Expand Down Expand Up @@ -232,6 +248,8 @@ function test_grpc_route() {
echo "-----------------------------------------------------------------------------------------------------"
unexpose_envoy_gateway_svc || true
kubectl delete -f "${GATEWAY_API_DIR}/grpc-debug.yaml"

log_time "test_grpc_route"
}

function test_tcp_route() {
Expand Down Expand Up @@ -266,4 +284,6 @@ function test_tcp_route() {
rm deleteme.txt
unexpose_envoy_gateway_svc || true
kubectl delete -f "${GATEWAY_API_DIR}/tcp-debug.yaml"

log_time "test_tcp_route"
}
12 changes: 12 additions & 0 deletions dev/scripts/telemetry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ function fetch-prometheus-operator-bundle() {
[[ "${status}" != 0 ]] && rm "${PROMETHEUS_OPERATOR_YAML}" && echo "ERROR: Failed to fetch prometheus bundle"
return "${status}"
fi

log_time "fetch-prometheus-operator-bundle"
}

function deploy-prometheus-operator() {
Expand All @@ -36,6 +38,8 @@ function deploy-prometheus-operator() {
echo "Prometheus operator CRD is already installed"
echo ""
fi

log_time "deploy-prometheus-operator"
}

function destroy-prometheus-operator() {
Expand All @@ -45,6 +49,8 @@ function destroy-prometheus-operator() {
echo "-----------------------------------------------------------------------------------------------------"
kubectl delete -f "${PROMETHEUS_OPERATOR_YAML}"
sleep 10

log_time "destroy-prometheus-operator"
}

function deploy-prometheus() {
Expand Down Expand Up @@ -77,6 +83,8 @@ function deploy-prometheus() {

echo "Waiting for prometheus to be active (timeout 300s)..."
kubectl wait --for=condition=Ready pods -l app.kubernetes.io/name=prometheus --timeout 300s -n "${NAMESPACE}"

log_time "deploy-prometheus"
}

function destroy-prometheus() {
Expand All @@ -89,6 +97,8 @@ function destroy-prometheus() {
kubectl delete -f "${PROMETHEUS_RBAC_YAML}" || true
kubectl delete clusterrolebindings prometheus || true
sleep 5

log_time "destroy-prometheus"
}

function deploy-prometheus-example-app() {
Expand Down Expand Up @@ -143,6 +153,8 @@ function deploy_grafana_tempo() {
helm upgrade -f "${TELEMETRY_DIR}/grafana/grafana-values.yaml" --install grafana grafana/grafana
echo "Waiting for grafana to be active (timeout 300s)..."
kubectl wait --for=jsonpath='{.status.phase}'=Running pod -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=grafana" --timeout=300s

log_time "deploy_grafana_tempo"
}

function destroy_grafana_tempo() {
Expand Down

0 comments on commit b8ecdc9

Please sign in to comment.