Skip to content

Lock all versions to "jammy" (no "noble" auto-upgrade) #284

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

Merged
merged 1 commit into from
Aug 1, 2024
Merged
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
16 changes: 15 additions & 1 deletion versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ declare -A javaVersions=(
[4.0]='11'
[4.1]='11'
)
declare -A suiteOverrides=(
# see notes about python2 vs python3 in Dockerfile.template (noble does not have python2)
[3.0]='jammy'
[3.11]='jammy'
# https://issues.apache.org/jira/browse/CASSANDRA-19206: "cqlsh breaks with Python 3.12" ("ModuleNotFoundError: No module named 'six.moves'")
[4.0]='jammy'
[4.1]='jammy'
# "Warning: unsupported version of Python, required 3.6-3.11 but found 3.12"
# https://github.com/apache/cassandra/commit/8fd44ca8fc9e0b0e94932bcd855e2833bf6ca3cb#diff-8d8ae48aaf489a8a0e726d3e4a6230a26dcc76e7c739e8e3968e3f65c995d148
# https://issues.apache.org/jira/browse/CASSANDRA-19245?focusedCommentId=17803539#comment-17803539
# https://github.com/apache/cassandra/blob/cassandra-5.0-rc1/bin/cqlsh#L65
[5.0]='jammy'
)

cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"

Expand Down Expand Up @@ -49,10 +62,11 @@ for version in "${versions[@]}"; do
export fullVersion sha512

export javaVersion="${javaVersions[$version]:-$defaultJavaVersion}"
suiteOverride="${suiteOverrides[$version]:-}"

# for the given Java version, find the "default" Eclipse Temurin tag with stable specificity ("X-jre-SUITE")
from="$(
bashbrew --arch amd64 list --arch-filter "https://github.com/docker-library/official-images/raw/HEAD/library/eclipse-temurin:$javaVersion-jre" \
bashbrew --arch amd64 list --arch-filter "https://github.com/docker-library/official-images/raw/HEAD/library/eclipse-temurin:$javaVersion-jre${suiteOverride:+-$suiteOverride}" \
| grep -F ":$javaVersion-jre-" \
| tail -1
)"
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we should double check that from has a value in order to catch the case where a cassandra version is stuck on an Ubuntu that eclipse-temurin no longer supports.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah good call -- I did it this way (with keeping the round trip through bashbrew list even though the answer should be literally eclipse-temurin:XXX-jre-YYY that we could've generated without going through this) specifically for being able to make sure the image we're trying to use actually does exist and is still supported 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, that case is already handled by set -e (and set -o pipefail) because bashbrew list will explicitly non-zero exit. 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

To illustrate:

$ git --no-pager diff
diff --git a/versions.sh b/versions.sh
index 6532c13..b40ffc8 100755
--- a/versions.sh
+++ b/versions.sh
@@ -22,7 +22,7 @@ declare -A suiteOverrides=(
 	# https://github.com/apache/cassandra/commit/8fd44ca8fc9e0b0e94932bcd855e2833bf6ca3cb#diff-8d8ae48aaf489a8a0e726d3e4a6230a26dcc76e7c739e8e3968e3f65c995d148
 	# https://issues.apache.org/jira/browse/CASSANDRA-19245?focusedCommentId=17803539#comment-17803539
 	# https://github.com/apache/cassandra/blob/cassandra-5.0-rc1/bin/cqlsh#L65
-	[5.0]='jammy'
+	[5.0]='foobar'
 )
 
 cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
$ ./update.sh 5.0
failed fetching repo "https://github.com/docker-library/official-images/raw/HEAD/library/eclipse-temurin:17-jre-foobar"
tag not found in manifest for "eclipse-temurin": "17-jre-foobar"
$ echo $?
1

Expand Down
Loading