-
-
Notifications
You must be signed in to change notification settings - Fork 257
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
Added optional arg to -D/--podman/--docker base image to use #3869
Conversation
I'm going to continue to work on this until build passes on fedora and rhel, but initial comments welcommed |
5058bd8
to
a7c0a75
Compare
1e39878
to
84ab0b2
Compare
Ok, it seems feature completed. Sorry for that reordering, but it speedup things really a lot. There are still weird random failures solvable by
I could hjave casued that by reorder of steps. But I Did not moved the content behind |
The failures seems to be related to eol of centos7 Actually, I had not tested this on centos7, will try |
tested matrix (hw f40, amd64/aarch64, thusdefault is quay.io)
|
Ok, I consider testing table as finished and ok to go. Any prerequisites ion newer jdks on el7? |
it is also correctly passed to image generator, however taht is not tuned to work
With this, the fedora containers finshed correctly with images
Co-authored-by: Martijn Verburg <[email protected]>
Co-authored-by: Martijn Verburg <[email protected]>
Generally sort them by disk footprint size. Motivation is, that allt he snapshjots were created after the install of all deps hapened. So instead of snapshoting 55mb base image with new symlink, it was snapshoting 1g or more image with all deps. Now all small-sized operations happens firsr then basic dependences happens, so most of the other operations can run last are huge ones: installing of all dependencies and cloning the jdk All is closed byu change of user to openjdk That reuired splitting of dn/apt to two parts, and thus extracting a bit of suddenly duplicated code to functions
Co-authored-by: Martijn Verburg <[email protected]>
Co-authored-by: Martijn Verburg <[email protected]>
Co-authored-by: Martijn Verburg <[email protected]>
I had dropped that comment. It is needed. I will consult with more rhel jdk developers thogh (but it may take quite a time) |
if echo "${IMAGE}" | grep -e "stream8" -e "centos:7" ; then | ||
echo " | ||
RUN cd /etc/yum.repos.d/ ; sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* | ||
RUN cd /etc/yum.repos.d/ ; sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* " >> "$DOCKERFILE_PATH" |
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.
This is going to need a follow-on change as the non-x64 ones (aarch64 and ppc64le) are under vault.centos.org/altarch (This wasn't a problem for the CentOS6 ones we translated in the past as we only used that one on x64)
@steelhead31 is working on a fix elsewhere as he hit the same problem after merging adoptium/infrastructure#3643 so once he's completed that we can replicate the same operation in here.
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.
That sould be simple check, but I was trying both centos:stream{8,9} on aarch64. And centos8 seems to be already facing the "need of sed" issue. I will double check. I could have had swapped VM.
If it indeed will not run, I will adjust, shoudl be simple. TYVM!
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.
Really, it works for8:
tester@fedora:~/temurin-build$ sh makejdk-any-platform.sh -D centos:stream8 --custom-cacerts jdk21u
Starting makejdk-any-platform.sh to configure, build (Adoptium)OpenJDK binary
Parsing opt: -D
Possible opt arg: centos:stream8
base image will be set to: centos:stream8
Parsing opt: --custom-cacerts
Possible opt arg: jdk21u
Setting version based on forest_name=jdk21u
Default branch set to BUILD_CONFIG[BRANCH]=master
Using source repository https://github.com/openjdk/jdk21u
Working dir is ./build/
[debug] COPY_MACOSX_FREE_FONT_LIB_FOR_JDK_FLAG=false
[debug] COPY_MACOSX_FREE_FONT_LIB_FOR_JRE_FLAG=false
JDK Image folder name: jdk
JRE Image folder name: jre
Removing Dockerfile* from docker/jdk21/aarch64/centos
centos:stream8
centos:stream8
centos:stream8
Dockerfile created at docker/jdk21/aarch64/centos/Dockerfile
...
--> c9d0997cfc9c
STEP 18/42: RUN chmod 755 /home/tester/temurin-build/workspace/config
--> 0034495152dd
STEP 19/42: RUN chown -R build /home/tester/temurin-build/workspace/config
--> 2754a7505488
STEP 20/42: RUN cd /etc/yum.repos.d/ ; sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
--> ce5684c8a2eb
STEP 21/42: RUN cd /etc/yum.repos.d/ ; sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
--> a6ed67c4dbcc
STEP 22/42: RUN dnf -y update --allowerasing
CentOS Stream 8 - AppStream 22 MB/s | 25 MB 00:01
CentOS Stream 8 - BaseOS 11 MB/s | 7.0 MB 00:00
CentOS Stream 8 - Extras 39 kB/s | 17 kB 00:00
CentOS Stream 8 - Extras common packages 18 kB/s | 8.0 kB 00:00
Dependencies resolved.
================================================================================
Package Architecture Version Repository Size
================================================================================
Upgrading:
hostname aarch64 3.20-7.el8.0.1 baseos 32 k
Transaction Summary
================================================================================
Upgrade 1 Package
Total download size: 32 k
Downloading Packages:
hostname-3.20-7.el8.0.1.aarch64.rpm 45 kB/s | 32 kB 00:00
--------------------------------------------------------------------------------
Total 45 kB/s | 32 kB 00:00
CentOS Stream 8 - BaseOS 1.6 MB/s | 1.6 kB 00:00
Importing GPG key 0x8483C65D:
Userid : "CentOS (CentOS Official Signing Key) <[email protected]>"
...
Verifying : hostname-3.20-6.el8.aarch64 2/2
Upgraded:
hostname-3.20-7.el8.0.1.aarch64
Complete!
--> f57ef513cfff
STEP 23/42: RUN dnf -y install --allowerasing bzip2-libs bzip2 curl git unzip wget zip
Last metadata expiration check: 0:00:09 ago on Tue Jul 2 10:00:52 2024.
Package bzip2-libs-1.0.6-26.el8.aarch64 is already installed.
Package curl-7.61.1-34.el8.aarch64 is already installed.
Dependencies resolved.
=======================================================================================
Package Arch Version Repo Size
=======================================================================================
Installing:
bzip2 aarch64 1.0.6-26.el8 baseos 60 k
git aarch64 2.43.0-1.el8 appstream 92 k
unzip aarch64 6.0-46.el8 baseos 189 k
wget aarch64 1.19.5-11.el8 appstream 717 k
zip aarch64 3.0-23.el8 baseos 265 k
Installing dependencies:
...
our archive was created as /home/tester/temurin-build/workspace/build/src/build/linux-aarch64-server-release/images/OpenJDK.tar.gz
Moving the artifact to location /home/tester/temurin-build/workspace/target//OpenJDK-static-libs-glibc.tar.gz
archive done.
Archiving and compressing with gzip
gzip: warning: GZIP environment variable is deprecated; use an alias or script
Your archive was created as /home/tester/temurin-build/workspace/build/src/build/linux-aarch64-server-release/images/OpenJDK.tar.gz
Moving the artifact to location /home/tester/temurin-build/workspace/target//OpenJDK-jdk.tar.gz
real 0m49.688s
user 0m48.709s
sys 0m1.121s
archive done.
Skip generating SBOM
build.sh : 10:19:01 : All done!
The finished image can be found in /home/tester/temurin-build/workspace/target on the host system
Removing container jdk21-hotspot
3d0f00425bbf
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.
The alt-arch was only cento7 speciality. So I guess you were referring to it. Sorry, I misread a bit. I will try alsocentos7 on aarch64, and I guess thatr will need the alt for sure.
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.
Again, my solution is pretty similar.. wrapped in an if statement..
sed -i 's|#baseurl=http://mirror.centos.org/altarch/\$releasever/|baseurl=http://vault.centos.org/altarch/7.9.2009/|' /etc/yum.repos.d/CentOS-Base.repo; \
RUN sed -i -e 's!mirrorlist!#mirrorlist!g' /etc/yum.repos.d/CentOS-Base.repo
RUN if \[ "$(uname -m)" = "aarch64" \]; then \\
echo "Running on arm64 architecture"; \\
sed -i 's|#baseurl=http://mirror.centos.org/altarch/\$releasever/|baseurl=http://vault.centos.org/altarch/7.9.2009/|' /etc/yum.repos.d/CentOS-Base.repo; \\
elif \[ "$(uname -m)" = "ppc64le" \]; then \\
echo "Running on ppc64le architecture"; \\
sed -i 's|#baseurl=http://mirror.centos.org/altarch/\$releasever/|baseurl=http://vault.centos.org/altarch/7.9.2009/|' /etc/yum.repos.d/CentOS-Base.repo; \\
else \\
# Default To x64; \\
echo "Running on another architecture"; \\
sed -i -e 's!#baseurl=http://mirror.centos.org/centos/\$releasever!baseurl=https://vault.centos.org/7.9.2009/!g' /etc/yum.repos.d/CentOS-Base.repo; \\
fi
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.
Again, my solution is pretty similar.. wrapped in an if statement..
sed -i 's|#baseurl=http://mirror.centos.org/altarch/\$releasever/|baseurl=http://vault.centos.org/altarch/7.9.2009/|' /etc/yum.repos.d/CentOS-Base.repo; \
RUN sed -i -e 's!mirrorlist!#mirrorlist!g' /etc/yum.repos.d/CentOS-Base.repo RUN if \[ "$(uname -m)" = "aarch64" \]; then \\ echo "Running on arm64 architecture"; \\ sed -i 's|#baseurl=http://mirror.centos.org/altarch/\$releasever/|baseurl=http://vault.centos.org/altarch/7.9.2009/|' /etc/yum.repos.d/CentOS-Base.repo; \\ elif \[ "$(uname -m)" = "ppc64le" \]; then \\ echo "Running on ppc64le architecture"; \\ sed -i 's|#baseurl=http://mirror.centos.org/altarch/\$releasever/|baseurl=http://vault.centos.org/altarch/7.9.2009/|' /etc/yum.repos.d/CentOS-Base.repo; \\ else \\ # Default To x64; \\ echo "Running on another architecture"; \\ sed -i -e 's!#baseurl=http://mirror.centos.org/centos/\$releasever!baseurl=https://vault.centos.org/7.9.2009/!g' /etc/yum.repos.d/CentOS-Base.repo; \\ fi
Thanx!! I will reuse it immediately if it bites back or if @sxa insits.
@sxa mm... it works also with centos:7!
|
@sxa see #3869 (comment) it seems centos7 is ok. Is there anything missing to yuou in that table? |
Gosh. that centos7 thing is pulling x86_64 packages.... Sorry,. overlooked that |
Because it is intel image! |
@sxa ...so after double-checked the architectures (what a burned 3hours!.. but I got my lesson) It reallyh seems I do not need to sed the repos . All deps were pulled and jdk 8 built fine. I removed all images and trying again. |
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.
On the basis that the testing looks good, and this will not have an impact on the Production builds I'm happy to approve. I will note that we should look at updating from the default of an out-of-support Ubuntu 18.04 at some point for the container.
it is also correctly passed to image generator, however taht is not tuned to work
#3855