From 0793ede0d73797e5e192ecd80c7ddfc0185d718a Mon Sep 17 00:00:00 2001 From: Ali Ok Date: Mon, 14 Feb 2022 16:40:29 +0300 Subject: [PATCH 1/3] Different cron times for branches --- openshift/ci-operator/generate-ci-config.sh | 22 +++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/openshift/ci-operator/generate-ci-config.sh b/openshift/ci-operator/generate-ci-config.sh index 74aef74fd7c..fde0fb628fa 100755 --- a/openshift/ci-operator/generate-ci-config.sh +++ b/openshift/ci-operator/generate-ci-config.sh @@ -41,6 +41,20 @@ EOF done } +function generate_cron_expression { + if [[ "$branch" == "knative-v0.25.3" ]]; then + echo '0 1 * * 1-5' + elif [[ "$branch" == "knative-v0.26" ]]; then + echo '0 3 * * 1-5' + elif [[ "$branch" == "knative-v1.0" ]]; then + echo '0 5 * * 1-5' + elif [[ "$branch" == "knative-v1.1" ]]; then + echo '0 7 * * 1-5' + elif [[ "$branch" == "knative-v1.2" ]]; then + echo '0 9 * * 1-5' + fi +} + function print_single_test { local name=${1} local commands=${2} @@ -115,22 +129,26 @@ EOF } function print_openshift_47_tests { + cron=$(generate_cron_expression) + print_single_test "e2e-aws-ocp-${openshift//./}" "make test-e2e" "aws" "false" "ipi-aws" "" print_single_test "conformance-aws-ocp-${openshift//./}" "make test-conformance" "aws" "false" "ipi-aws" "" print_single_test "reconciler-aws-ocp-${openshift//./}" "make test-reconciler" "aws" "false" "ipi-aws" "" if [[ "$generate_continuous" == true ]]; then - print_single_test "e2e-aws-ocp-${openshift//./}-continuous" "make test-e2e" "aws" "false" "ipi-aws" "0 */12 * * 1-5" + print_single_test "e2e-aws-ocp-${openshift//./}-continuous" "make test-e2e" "aws" "false" "ipi-aws" "${cron}" fi } function print_non_openshift_47_tests { + cron=$(generate_cron_expression) + print_single_test "e2e-aws-ocp-${openshift//./}" "make test-e2e" "" "true" "generic-claim" "" print_single_test "conformance-aws-ocp-${openshift//./}" "make test-conformance" "" "true" "generic-claim" "" print_single_test "reconciler-aws-ocp-${openshift//./}" "make test-reconciler" "" "true" "generic-claim" "" if [[ "$generate_continuous" == true ]]; then - print_single_test "e2e-aws-ocp-${openshift//./}-continuous" "make test-e2e" "" "true" "generic-claim" "0 */12 * * 1-5" + print_single_test "e2e-aws-ocp-${openshift//./}-continuous" "make test-e2e" "" "true" "generic-claim" "${cron}" fi } From 09e1a289a36362c59b7e3e197cdab7d731f1879a Mon Sep 17 00:00:00 2001 From: Ali Ok Date: Wed, 16 Feb 2022 14:36:42 +0300 Subject: [PATCH 2/3] Wrap function invocations in quotes --- openshift/ci-operator/generate-ci-config.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openshift/ci-operator/generate-ci-config.sh b/openshift/ci-operator/generate-ci-config.sh index fde0fb628fa..4564cfef93d 100755 --- a/openshift/ci-operator/generate-ci-config.sh +++ b/openshift/ci-operator/generate-ci-config.sh @@ -129,7 +129,7 @@ EOF } function print_openshift_47_tests { - cron=$(generate_cron_expression) + cron="$(generate_cron_expression)" print_single_test "e2e-aws-ocp-${openshift//./}" "make test-e2e" "aws" "false" "ipi-aws" "" print_single_test "conformance-aws-ocp-${openshift//./}" "make test-conformance" "aws" "false" "ipi-aws" "" @@ -141,7 +141,7 @@ function print_openshift_47_tests { } function print_non_openshift_47_tests { - cron=$(generate_cron_expression) + cron="$(generate_cron_expression)" print_single_test "e2e-aws-ocp-${openshift//./}" "make test-e2e" "" "true" "generic-claim" "" print_single_test "conformance-aws-ocp-${openshift//./}" "make test-conformance" "" "true" "generic-claim" "" @@ -247,7 +247,7 @@ EOF done } -image_deps=$(generate_image_dependencies) +image_deps="$(generate_image_dependencies)" print_base_images print_build_root From 906974f45fecce93685864f930eb7b6c07edebeb Mon Sep 17 00:00:00 2001 From: Ali Ok Date: Thu, 17 Feb 2022 09:53:36 +0300 Subject: [PATCH 3/3] Add instructions --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 31f6cb45002..0a62cf2ff50 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,9 @@ The basic ci-operator configs mentioned above are generated via the generate-release.sh file in the openshift/knative-eventing repository. They are generated to alleviate the burden of having to add all possible test images to the manifest manually, which is error -prone. +prone. That script calls `generate-ci-config.sh` for generating the files. +When you create a new branch update the cron expression in +`generate-ci-config.sh` for the branch for the execution time of the periodics. Once the file is generated, it must be committed to the [openshift/release](https://github.com/openshift/release) repository, as the other manifests linked above. The @@ -127,7 +129,7 @@ steps 1. and 2. below. 1. Create a release branch from the upstream’s release tag, i.e. release-v0.5.0. This is created in the fork that we maintain of upstream. -2. Create a CI job for that branch in openshift/release. See our CI setup instructions for deeper information. +2. Create a CI job for that branch in openshift/release. See our CI setup instructions for deeper information but don't forget to update the cron expression in `generate-ci-config.sh` for the branch. 3. Do whatever you need to do to make this CI pass 4. Create a “dummy” PR with a ci file, which contains the current output of “date”. This is to trigger CI explicitly. 5. Make sure that PR is green and merge it. This will trigger the images to become available on the CI registry.