-
Notifications
You must be signed in to change notification settings - Fork 213
fix: move orchestrator tests to nightly-only and fix log functions in subshells #3982
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
base: main
Are you sure you want to change the base?
Changes from all commits
4bb0a83
960da57
1ee24ca
4773890
a084b7f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,6 +82,19 @@ yq_merge_value_files() { | |
| fi | ||
| } | ||
|
|
||
| # Skip orchestrator on mandatory PR presubmit job (e2e-ocp-helm) to speed up CI. | ||
| # Nightly jobs (e2e-ocp-helm-nightly) should run orchestrator for full testing. | ||
| should_skip_orchestrator() { | ||
| [[ "${JOB_NAME}" =~ e2e-ocp-helm ]] && [[ "${JOB_NAME}" != *nightly* ]] | ||
| } | ||
|
|
||
| # Post-process merged Helm values to disable all orchestrator plugins | ||
| # This avoids hardcoding plugin versions in PR diff files | ||
| disable_orchestrator_plugins_in_values() { | ||
| local values_file=$1 | ||
| yq eval -i '(.global.dynamic.plugins[] | select(.package | contains("orchestrator")) | .disabled) = true' "${values_file}" | ||
| } | ||
|
|
||
| # Waits for a Kubernetes/OpenShift deployment to become ready within a specified timeout period | ||
| wait_for_deployment() { | ||
| local namespace=$1 | ||
|
|
@@ -945,11 +958,12 @@ cluster_setup_ocp_helm() { | |
| install_pipelines_operator | ||
| install_crunchy_postgres_ocp_operator | ||
|
|
||
| # Skip orchestrator infra installation on OSD-GCP due to infrastructure limitations | ||
| if [[ ! "${JOB_NAME}" =~ osd-gcp ]]; then | ||
| install_orchestrator_infra_chart | ||
| # Skip orchestrator infra installation on OSD-GCP due to infrastructure limitations. | ||
| # Also skip it for the mandatory PR job (e2e-ocp-helm) to speed up presubmits. | ||
| if [[ "${JOB_NAME}" =~ osd-gcp ]] || should_skip_orchestrator; then | ||
| echo "Skipping orchestrator-infra installation on this job: ${JOB_NAME}" | ||
| else | ||
| echo "Skipping orchestrator-infra installation on OSD-GCP environment" | ||
| install_orchestrator_infra_chart | ||
| fi | ||
|
|
||
| # then wait for the right status one by one | ||
|
|
@@ -1056,9 +1070,29 @@ base_deployment() { | |
| local rhdh_base_url="https://${RELEASE_NAME}-developer-hub-${NAME_SPACE}.${K8S_CLUSTER_ROUTER_BASE}" | ||
| apply_yaml_files "${DIR}" "${NAME_SPACE}" "${rhdh_base_url}" | ||
| log::info "Deploying image from repository: ${QUAY_REPO}, TAG_NAME: ${TAG_NAME}, in NAME_SPACE: ${NAME_SPACE}" | ||
| perform_helm_install "${RELEASE_NAME}" "${NAME_SPACE}" "${HELM_CHART_VALUE_FILE_NAME}" | ||
|
|
||
| deploy_orchestrator_workflows "${NAME_SPACE}" | ||
| if should_skip_orchestrator; then | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we differentiate the setup at the level of
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can have different
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| local merged_pr_value_file="/tmp/merged-values_showcase_PR.yaml" | ||
| yq_merge_value_files "merge" "${DIR}/value_files/${HELM_CHART_VALUE_FILE_NAME}" "${DIR}/value_files/diff-values_showcase_PR.yaml" "${merged_pr_value_file}" | ||
| disable_orchestrator_plugins_in_values "${merged_pr_value_file}" | ||
|
|
||
| mkdir -p "${ARTIFACT_DIR}/${NAME_SPACE}" | ||
| cp -a "${merged_pr_value_file}" "${ARTIFACT_DIR}/${NAME_SPACE}/" || true | ||
| # shellcheck disable=SC2046 | ||
| helm upgrade -i "${RELEASE_NAME}" -n "${NAME_SPACE}" \ | ||
| "${HELM_CHART_URL}" --version "${CHART_VERSION}" \ | ||
| -f "${merged_pr_value_file}" \ | ||
| --set global.clusterRouterBase="${K8S_CLUSTER_ROUTER_BASE}" \ | ||
| $(get_image_helm_set_params) | ||
| else | ||
| perform_helm_install "${RELEASE_NAME}" "${NAME_SPACE}" "${HELM_CHART_VALUE_FILE_NAME}" | ||
| fi | ||
|
|
||
| if should_skip_orchestrator; then | ||
| log::warn "Skipping orchestrator workflows deployment on PR job: ${JOB_NAME}" | ||
| else | ||
| deploy_orchestrator_workflows "${NAME_SPACE}" | ||
| fi | ||
| } | ||
|
|
||
| rbac_deployment() { | ||
|
|
@@ -1070,20 +1104,43 @@ rbac_deployment() { | |
| local rbac_rhdh_base_url="https://${RELEASE_NAME_RBAC}-developer-hub-${NAME_SPACE_RBAC}.${K8S_CLUSTER_ROUTER_BASE}" | ||
| apply_yaml_files "${DIR}" "${NAME_SPACE_RBAC}" "${rbac_rhdh_base_url}" | ||
| log::info "Deploying image from repository: ${QUAY_REPO}, TAG_NAME: ${TAG_NAME}, in NAME_SPACE: ${RELEASE_NAME_RBAC}" | ||
| perform_helm_install "${RELEASE_NAME_RBAC}" "${NAME_SPACE_RBAC}" "${HELM_CHART_RBAC_VALUE_FILE_NAME}" | ||
| if should_skip_orchestrator; then | ||
| local merged_pr_rbac_value_file="/tmp/merged-values_showcase-rbac_PR.yaml" | ||
| yq_merge_value_files "merge" "${DIR}/value_files/${HELM_CHART_RBAC_VALUE_FILE_NAME}" "${DIR}/value_files/diff-values_showcase-rbac_PR.yaml" "${merged_pr_rbac_value_file}" | ||
| disable_orchestrator_plugins_in_values "${merged_pr_rbac_value_file}" | ||
|
|
||
| mkdir -p "${ARTIFACT_DIR}/${NAME_SPACE_RBAC}" | ||
| cp -a "${merged_pr_rbac_value_file}" "${ARTIFACT_DIR}/${NAME_SPACE_RBAC}/" || true | ||
| # shellcheck disable=SC2046 | ||
| helm upgrade -i "${RELEASE_NAME_RBAC}" -n "${NAME_SPACE_RBAC}" \ | ||
| "${HELM_CHART_URL}" --version "${CHART_VERSION}" \ | ||
| -f "${merged_pr_rbac_value_file}" \ | ||
| --set global.clusterRouterBase="${K8S_CLUSTER_ROUTER_BASE}" \ | ||
| $(get_image_helm_set_params) | ||
| else | ||
| perform_helm_install "${RELEASE_NAME_RBAC}" "${NAME_SPACE_RBAC}" "${HELM_CHART_RBAC_VALUE_FILE_NAME}" | ||
| fi | ||
|
|
||
| # NOTE: This is a workaround to allow the sonataflow platform to connect to the external postgres db using ssl. | ||
| # Wait for the sonataflow database creation job to complete with robust error handling | ||
| if ! wait_for_job_completion "${NAME_SPACE_RBAC}" "${RELEASE_NAME_RBAC}-create-sonataflow-database" 10 10; then | ||
| echo "❌ Failed to create sonataflow database. Aborting RBAC deployment." | ||
| return 1 | ||
| if should_skip_orchestrator; then | ||
| log::warn "Skipping sonataflow (orchestrator) external DB SSL workaround on PR job: ${JOB_NAME}" | ||
| else | ||
| # Wait for the sonataflow database creation job to complete with robust error handling | ||
| if ! wait_for_job_completion "${NAME_SPACE_RBAC}" "${RELEASE_NAME_RBAC}-create-sonataflow-database" 10 10; then | ||
| echo "❌ Failed to create sonataflow database. Aborting RBAC deployment." | ||
| return 1 | ||
| fi | ||
| oc -n "${NAME_SPACE_RBAC}" patch sfp sonataflow-platform --type=merge \ | ||
| -p '{"spec":{"services":{"jobService":{"podTemplate":{"container":{"env":[{"name":"QUARKUS_DATASOURCE_REACTIVE_URL","value":"postgresql://postgress-external-db-primary.postgress-external-db.svc.cluster.local:5432/sonataflow?search_path=jobs-service&sslmode=require&ssl=true&trustAll=true"},{"name":"QUARKUS_DATASOURCE_REACTIVE_SSL_MODE","value":"require"},{"name":"QUARKUS_DATASOURCE_REACTIVE_TRUST_ALL","value":"true"}]}}}}}}' | ||
| oc rollout restart deployment/sonataflow-platform-jobs-service -n "${NAME_SPACE_RBAC}" | ||
| fi | ||
| oc -n "${NAME_SPACE_RBAC}" patch sfp sonataflow-platform --type=merge \ | ||
| -p '{"spec":{"services":{"jobService":{"podTemplate":{"container":{"env":[{"name":"QUARKUS_DATASOURCE_REACTIVE_URL","value":"postgresql://postgress-external-db-primary.postgress-external-db.svc.cluster.local:5432/sonataflow?search_path=jobs-service&sslmode=require&ssl=true&trustAll=true"},{"name":"QUARKUS_DATASOURCE_REACTIVE_SSL_MODE","value":"require"},{"name":"QUARKUS_DATASOURCE_REACTIVE_TRUST_ALL","value":"true"}]}}}}}}' | ||
| oc rollout restart deployment/sonataflow-platform-jobs-service -n "${NAME_SPACE_RBAC}" | ||
|
|
||
| # initiate orchestrator workflows deployment | ||
| deploy_orchestrator_workflows "${NAME_SPACE_RBAC}" | ||
| if should_skip_orchestrator; then | ||
| log::warn "Skipping orchestrator workflows deployment on PR job: ${JOB_NAME}" | ||
| else | ||
| deploy_orchestrator_workflows "${NAME_SPACE_RBAC}" | ||
| fi | ||
| } | ||
|
|
||
| initiate_deployments() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # This file is for the mandatory PR job only (e2e-ocp-helm). | ||
| # It is applied by `helm upgrade` after the `values_showcase-rbac.yaml` is applied and only contains complementary differences for PRs. | ||
| # Note, that it overwrites the whole key that is present in this file. | ||
| # The only exception is global.dynamic.plugins, that gets merged with the base file. | ||
|
|
||
| # Disable orchestrator for PRs to speed up the mandatory presubmit job and avoid extra infra installs. | ||
| # Orchestrator dynamic plugins are disabled via post-processing (see rbac_deployment in utils.sh) | ||
| #orchestrator: null |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # This file is for the mandatory PR job only (e2e-ocp-helm). | ||
| # It is applied by `helm upgrade` after the `values_showcase.yaml` is applied and only contains complementary differences for PRs. | ||
| # Note, that it overwrites the whole key that is present in this file. | ||
| # The only exception is global.dynamic.plugins, that gets merged with the base file. | ||
|
|
||
| # Disable orchestrator for PRs to speed up the mandatory presubmit job and avoid extra infra installs. | ||
| # Orchestrator dynamic plugins are disabled via post-processing (see base_deployment in utils.sh) | ||
| orchestrator: null |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's skip it, also for
"${JOB_NAME}" =~ osd-gcp. We are already skipping the installation there, so it makes sense to skip it completely...