Skip to content
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

MDBF-866 - Create bintar builder from non-EOL distro #690

Merged
merged 5 commits into from
Jan 24, 2025

Conversation

RazvanLiviuVarzaru
Copy link
Collaborator

@RazvanLiviuVarzaru RazvanLiviuVarzaru commented Jan 21, 2025

AlmaLinux 8 was chosen as the oldest non-eol distro for a new bintar which will build server versions >= 11.7
Buildbot configuration changes will follow after this PR is merged. (new builder,worker).

A dedicated workflow was defined, with a workflow_call directive to allow us to rebuild the image anytime we like.

About bintar.Dockerfile

  • it is based on the centos.Dockerfile with small changes to remove redundant code
  • use galera-4 from RHEL-8 because we no longer build on alma/rocky, neither the server or the galera library. Compatibility wise, should be ok, because we also test RHEL packages on alma/rocky VM's.

About static libs:

  • static libraries are build in a separate stage to reduce the image size
  • the general rule is to install the -devel packages (they provide headers) then to compile the static library and move it in a path used then by CMAKE
  • the strategy to compile static is to take the source rpm and then install deps + re-build. Different libs have different needs in terms of what custom modifications of the SPEC files are needed.

Testing:

  • one can build the image from scratch, compile the server and check resulted binaries with LDD
  • the list of *.sh files introduced by this patch is the minimum I found that will produce a binary package similar with what we've released so far.

@RazvanLiviuVarzaru RazvanLiviuVarzaru changed the title MDBF-866 - Create bintar builder from non-EOL builder MDBF-866 - Create bintar builder from non-EOL distro Jan 21, 2025
@RazvanLiviuVarzaru RazvanLiviuVarzaru force-pushed the feature/new-bintar branch 5 times, most recently from f4b106b to dc0ce2a Compare January 21, 2025 18:15
@RazvanLiviuVarzaru
Copy link
Collaborator Author

@cvicentiu If you want to inspect the resulting container image, please see:

docker pull quay.io/mariadb-foundation/bb-worker:test_almalinux8-bintar

@RazvanLiviuVarzaru
Copy link
Collaborator Author

RazvanLiviuVarzaru commented Jan 22, 2025

Hi @cvicentiu

The PR is ready for review, I've added 7c1fdcd to make GnuTLS work. See the commit message / gnutls.sh comments.

If you would like to test the server, I've updated
quay.io/mariadb-foundation/bb-worker:test_almalinux8-bintar

to what this PR will produce.

Copy link
Member

@cvicentiu cvicentiu left a comment

Choose a reason for hiding this comment

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

Looks good. Need to look at gnutls.sh in more depth. Will add further review tomorrow.

ci_build_images/bintar.Dockerfile Outdated Show resolved Hide resolved
@RazvanLiviuVarzaru
Copy link
Collaborator Author

Hi, @cvicentiu

I pushed 2 more commits:
a781f3e removing aarch eol bintar builder.

20046a3 introduced almalinux 8 bintar builder

Please see the commit's messages for more details.

This is all that's needed for the new bintar builder so far.
If you cannot find anything to add/fix on this PR then it's ready for merge.

Copy link
Member

@cvicentiu cvicentiu left a comment

Choose a reason for hiding this comment

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

Approve with the following changes required as discussed over the 2 hour pair-debugging session:

  1. Use GnuTLS 3.7.11 in the ./gnutls.sh
  2. Separate dropping eigen3-devel as a separate commit, mentioning that there is no need for eigen3 since the MariaDB Vector code did not show significant improvements.
  3. Separate the almalinux build steps of the libraries in separate RUN commands + hadolint exception.

AlmaLinux 8 was chosen as the oldest non-eol distro for a new bintar which will build server versions >= 11.7
Buildbot configuration changes will follow after this PR is merged. (new builder,worker).

A dedicated workflow was defined, with a workflow_call directive to allow us
to rebuild the image anytime we like.

About bintar.Dockerfile
- it is based on the centos.Dockerfile with small changes to remove redundant code
- use galera-4 from RHEL-8 because we no longer build on alma/rocky, neither
the server or the galera library. Compatibility wise, should be ok, because
we also test RHEL packages on alma/rocky VM's.

About static libs:
- static libraries are build in a separate stage to reduce the image size
- the general rule is to install the -devel packages (provide headers) then
to compile the static library and move it in a path used then by CMAKE
- the strategy to compile static is to take the source rpm and then install deps + re-build.
Different libs have different needs in terms of what custom
modifications of the SPEC files are needed.

Testing:
- one can build the image from scratch, compile the server and check resulted binaries with LDD
- the list of *.sh files introduced by this patch is the minimum I found that will produce a binary package similar
with what we've released so far.
From GnuTLS I had to disable:
--without-p11-kit
--without-idn

for 11.8 server compilation to work.
GnuTLS cannot link nettle/gmp if we don't compile these libraries statically.

The first approach was to use .src.rpm for all of them, but the distro version of nettle has a bug causing OOM during build.
In the end, I bumped the versions to the one dbart used in buildbot.mariadb.net. Hopefully this workaround will work until
almalinux-8 is EOL.

We should probably try again to compile from distro .src.rpm when nettle is updated, if ever, during the lifetime of the distro.
- never released
- not built according to bintar specs
- eol distro

If we ever need an aarch bintar we will create one according to the bintar specs.
- should run on currently idle hz-bbw7. bbw5 is sometimes unstable (OOM)
- switch centos-7 bintar to run on hz-bbw7, for the same reason as above

CMAKE:
- introduce %(kw:additional_args)s
- centos7 bintar still needs -DCURSES_NEED_NCURSES=1 flag
because curses -> ncurses symlink is missing on the image. That's not the case for almalinux-8-bintar
- already released packages have galera shared library included.
The library is already present in the almalinux-8-bintar container image so include it as extra files for CPACK
There is no need for eigen3 since the MariaDB Vector code did not show significant improvements.
@RazvanLiviuVarzaru
Copy link
Collaborator Author

Approve with the following changes required as discussed over the 2 hour pair-debugging session:

  1. Use GnuTLS 3.7.11 in the ./gnutls.sh
  2. Separate dropping eigen3-devel as a separate commit, mentioning that there is no need for eigen3 since the MariaDB Vector code did not show significant improvements.
  3. Separate the almalinux build steps of the libraries in separate RUN commands + hadolint exception.

Thanks for your help @cvicentiu
I've added the patches, I'll merge after CI checks are green.

@RazvanLiviuVarzaru RazvanLiviuVarzaru merged commit 7199ce3 into MariaDB:dev Jan 24, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants