Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
24 changes: 21 additions & 3 deletions openshift/ci-operator/generate-ci-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Comment on lines +44 to +57
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One idea to avoid hard-coding is to use the last number of minor version for the hour:

knative-v0.25.3 -> 0 5 * * 1-5
knative-v0.26 -> 0 6 * * 1-5
knative-v1.0 -> 0 0 * * 1-5
knative-v1.1 -> 0 1 * * 1-5
knative-v1.2 -> 0 2 ** 1-5

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Update with what? Sorry I didn't understand

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we cut another branch, knative-v1.3 this doesn't produce any cron expression, so when we cut a new branch or remove an old one we need to update this logic here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Or we're missing an else branch.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

By default it will fallback to the old cron expression. We would need to touch the file though, you are right.

knative-v0.25.3 -> 0 5 * * 1-5
knative-v0.26 -> 0 6 * * 1-5
knative-v1.0 -> 0 0 * * 1-5
knative-v1.1 -> 0 1 * * 1-5
knative-v1.2 -> 0 2 ** 1-5

This is good, but just adds Bash complexity IMO, which I am not a very big fan of.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added some docs in README now

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

function print_single_test {
local name=${1}
local commands=${2}
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -229,7 +247,7 @@ EOF
done
}

image_deps=$(generate_image_dependencies)
image_deps="$(generate_image_dependencies)"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Also touched this based on @devguyio comment here: #1636 (review)


print_base_images
print_build_root
Expand Down