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

Introduce "base" variant of SLE-Micro-for-Rancher #1050

Merged
merged 2 commits into from
Oct 18, 2023

Conversation

kkaempf
Copy link
Contributor

@kkaempf kkaempf commented Oct 17, 2023

This defines the "base" packages required to run Kubernetes (k3s or rke2) with a minimal number of packages.

Esp. missing is "kernel-firmware-all" which drags in 350MB in packages.

All other SLE Micro for Rancher variants should be derived from "base" and
serve as examples of how to build derived images.

This defines the "base" packages required to run Kubernetes (k3s or
rke2) with a minimal number of packages.

Esp. missing is "kernel-firmware-all" which drags in 350MB in packages.

All other SLE Micro for Rancher variants should be derived from "base".

Signed-off-by: Klaus Kämpf <kkaempf@suse.de>
@kkaempf kkaempf requested a review from a team as a code owner October 17, 2023 15:50
Copy link
Contributor

@davidcassany davidcassany left a comment

Choose a reason for hiding this comment

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

LGTM

RUN zypper --installroot /osimage in --no-recommends -y apparmor-parser

# add elemental
RUN zypper --installroot /osimage in --no-recommends -y elemental
Copy link
Contributor

Choose a reason for hiding this comment

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

JFYI here we explicitly require elemental package and hence OBS includes this package as part of the buildenv. Then there is the replace_using_package_version OBS buildtime service that finds this package, gets the version of it and replaces a given placeholder with the computed version.

Just something to keep in mind for our own derivatives, we used to compute the tag from elemental package version. We could also compute that version|tag from github tags if the sources are pulled from github. This mostly relates to the images we want to build in OBS.


# Version value is taken form the elemental repository tags
# Release value of this image and os image are unrelated
RUN elemental --debug --config-dir . build-iso -o /output -n "sle-micro-rancher.$(uname -m)-base-%VERSION%-Build%RELEASE%" dir:rootfs
Copy link
Contributor

Choose a reason for hiding this comment

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

In former iso images in OBS this %VERSION% is a placeholder to be replaced with the version computed from github sources, more specific form the elemental.obsinfo file. For that the _service file requires an obs_scm service and replace_with_package_version service. Something like:

  <service name="obs_scm">
    <param name="url">https://github.com/rancher/elemental</param>
    <param name="scm">git</param>
    <param name="include">.obs</param>
    <param name="extract">.obs/dockerfile/slem4r-base-iso/Dockerfile</param>
    <param name="revision">main</param>
    <param name="filename">elemental</param>
    <param name="versionformat">@PARENT_TAG@+git%cd.%h</param>
    <param name="versionrewrite-pattern">v([^-]+)-?.*(\+git.*)</param>
    <param name="versionrewrite-replacement">\1\2</param>
  </service>
  <service name="replace_using_package_version" mode="buildtime">
    <param name="file">Dockerfile</param>
    <param name="regex">%VERSION%</param>
    <param name="package">elemental</param>
    <param name="parse-version">patch</param>
  </service>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this will be part of the package submission in OBS

@kkaempf
Copy link
Contributor Author

kkaempf commented Oct 18, 2023

Merging as-is, it doesn't influence any other builds.

@kkaempf kkaempf merged commit 1726284 into rancher:main Oct 18, 2023
11 checks passed
@kkaempf kkaempf deleted the slem4r-base branch October 18, 2023 13:54
@kkaempf kkaempf mentioned this pull request Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants