Skip to content

build-with-container: fixes and enhancements - #61939

Merged
zmc merged 12 commits into
ceph:mainfrom
phlogistonjohn:jjm-bwc-updates-20250219
Mar 5, 2025
Merged

zmc merged 12 commits into
ceph:mainfrom
phlogistonjohn:jjm-bwc-updates-20250219

Conversation

@phlogistonjohn

Copy link
Copy Markdown
Contributor

Fixes: https://tracker.ceph.com/issues/70103

A set of features and enhancements for the build-with-container.py tool (and related).

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@phlogistonjohn

Copy link
Copy Markdown
Contributor Author

cc: @dmick @zmc for content, design; @adk3798 for python

@phlogistonjohn phlogistonjohn changed the title Jjm bwc updates 20250219 build-with-container: fixes and enhancements Feb 20, 2025
Comment thread ContainerBuild.md Resolved
Comment thread ContainerBuild.md Resolved
Comment thread README.md Resolved
@phlogistonjohn
phlogistonjohn force-pushed the jjm-bwc-updates-20250219 branch from 39490ef to 7f996cd Compare February 21, 2025 12:51

@Thingee Thingee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, but I'll defer to the rest of the team for merge approval.

@phlogistonjohn
phlogistonjohn marked this pull request as ready for review February 26, 2025 15:40
@phlogistonjohn
phlogistonjohn requested a review from a team as a code owner February 26, 2025 15:40
@phlogistonjohn

Copy link
Copy Markdown
Contributor Author

@zdover23 or @anthonyeleven any "Doc writers" opinions on these README changes?

@anthonyeleven anthonyeleven left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You asked ;)

Comment thread ContainerBuild.md Resolved
Comment thread ContainerBuild.md Resolved
Comment thread ContainerBuild.md Resolved
Comment thread ContainerBuild.md Resolved
Comment thread ContainerBuild.md Resolved
Comment thread ContainerBuild.md Resolved
Comment thread ContainerBuild.md Resolved
Comment thread ContainerBuild.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggest double vs single backticks. Single backticks may be rendered in italics where literals are usually best in monospace.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I had to ignore your suggestions wrt backticks because this is a MarkDown (MD) formatted file rather than a reStructuredText (reST) formatted file. I followed the pattern of other MD formatted files in the root of the ceph source tree ( like README.md and SECURITY.md).
And so I followed the MD convention for preformatted text (single backtick in markdown does what double backticks in reST does). When I looked quick I saw README.md was markdown and jumped on that but didn't notice other docs in the root were .rst. FWIW I didn't plan for this doc to be included in the formal Ceph documentation as it's still under active development and this felt less official.

I'm open to converting the formatting if there's a strong desire for that but I'd ask to do that in a different PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah, understood. Make sense.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you may have already wrapped lines? I try to keep lines <80 chars, that makes editing and commenting easier.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you may have already wrapped lines? I try to keep lines <80 chars, that makes editing and commenting easier.

Comment thread ContainerBuild.md Resolved
Comment thread README.md Resolved
@phlogistonjohn
phlogistonjohn force-pushed the jjm-bwc-updates-20250219 branch from a59352c to 9aa81da Compare February 28, 2025 16:33
@phlogistonjohn

phlogistonjohn commented Feb 28, 2025 •

Copy link
Copy Markdown
Contributor Author

@anthonyeleven thanks for the feedback, I resolved most items but did want to highlight the formatting item (see the reply). I left the update in a separate patch for maximum clarity about what I changed, but I will squash that once I know things are generally ok on the docs front. Thanks.

I have kind of a pet peeve about "distro", it brings to mind https://en.wikipedia.org/wiki/Frankenstein:_The_True_Story .

After the last set of fixes and enhancements I forgot to reformat the
file. This applies standard `black` formatting to the file.

Signed-off-by: John Mulligan <[email protected]>
Add a system to define distro name aliases and use that to define some
additional aliases, primarily to match ubuntu codenames rather than
version numbers. Requested by Zack.

Signed-off-by: John Mulligan <[email protected]>
Add a new --current-branch argument that lets the user supply a name for
the current branch. This allows the automatic tag generation to avoid
calling git - something useful if the tree is not using a git checkout
(like a tarball). It also allows you to pull a temporary branch in git
but ignore it and act like the temporary branch is the base branch.

Signed-off-by: John Mulligan <[email protected]>
Previously, we were passing build argument of CEPH_BRANCH, but that was
a bit misleading as we expect the current branch to vary a bit (as users
will be using branches to develop and test the code). What we actually
care about is the base branch ('main', 'squid', etc) as that is fed into
our bootstrap script and we want the option to simple variations based
on the name of said base branch.
Rename CEPH_BRANCH to CEPH_BASE_BRANCH for clarity.

Signed-off-by: John Mulligan <[email protected]>
Add a command line option --base-branch that allows the user to supply a
custom base branch name. git doesn't make determining this easy so we
always assume a base branch of 'main' by default - but this option lets
one change that.

Signed-off-by: John Mulligan <[email protected]>
Previously, one could use the `--tag` option to completely override the
container tag generated by the script. However, there are cases where
one may want to add information to the tag rather than override it.
Allow the tag value to start with a plus (+) character that indicates
that the remainder of the string is to be suffixed to the generated tag.

Signed-off-by: John Mulligan <[email protected]>
Add a `packages` target to build-with-container.py that requests a build
of packages, whatever package type is native to the distro selected.
For example `./src/script/build-with-container.py -d ubuntu22.04 -e
packages` will automatically select a deb packages build where
`./src/script/build-with-container.py -d centos9 -e packages` will
trigger rpm packages to be built. The underlying package-type specific
targets remain unchanged.

Signed-off-by: John Mulligan <[email protected]>
Construct the builder image using the --pull=always flag to initiate a
pull of the base image (centos, ubuntu, etc) in order to avoid using a
stale base image. Since the script automatically (by default) avoids
building if a matching tag is in local container storage it is handy to
use a fresh base when it *is* time to build something. Otherwise, you
end up in a situation like I sometimes do - using a months old base
unintentionally.

Signed-off-by: John Mulligan <[email protected]>
On the original github pr ceph#59841 user fayak kindly informed us that the
--volume option was not supported by docker build. Since this section
was a leftover from a previous way of constructing the builder image and
was no longer needed we simply removed it.

Signed-off-by: John Mulligan <[email protected]>
When using docker the --volume option is not available during build
(docker [buildx] build), unlike podman. Since passing these volumes must
be conditional on them being set up I see no way to handle this short of
just disabling the option on docker. Log the fact that it's being
skipped - the only other issue is that we pointlessly set up some dirs
and the build may be a bit slower.

Signed-off-by: John Mulligan <[email protected]>
The source dir (aka homedir, default /ceph) is mounted in the container
read-write. This is needed as the various ceph build scripts expect to
write things into the tree - often this is in the build directory - but
not always. This can lead to small messes and/or situations that are
confusing to debug, especially if one is jumping between distros often.
Add an option to use an overlay volume for the homedir - by default we
enable a persistent overlay with a supplied "upper dir" where files that
were written will appear. One can also enable a temporary overlay that
forgets the writes when the container exits - maybe useful when doing
experiments in 'interactive' mode.

To use this option run the command with the `--overlay=<dir>` option.
For example: `./src/script/build-with-container.py -b build.inner
--overlay-dir build.ovr`. This will create a directory
`build.ovr/content` automatically and all new files will appear there.
For example the build directory will appear at
`build.ovr/content/build.inner`.

To use the temporary overlay use a `-` as the directory name. For
example: `./src/script/build-with-container.py -b build.inner
--overlay-dir -`

Signed-off-by: John Mulligan <[email protected]>
Add a new markdown file in the root of the tree, ContainerBuild.md, that
can serve as a basic introduction to the new container build tools
recently merged to ceph.
Add a small 'breadcrumb' section to the project README.md to help find
this new document.

Signed-off-by: John Mulligan <[email protected]>
@phlogistonjohn
phlogistonjohn force-pushed the jjm-bwc-updates-20250219 branch from 9aa81da to 3135461 Compare February 28, 2025 20:16
@phlogistonjohn

Copy link
Copy Markdown
Contributor Author

I have pushed the doc updates squashed into the previous doc patch, thanks.

I am unclear why you edited my comment to put your note. Maybe clicked the wrong button? I don't see the connection between that film and 'distro' but rather than distract others with that side conversation, feel free to message me on slack if you want to explain it. :-D

@anthonyeleven

Copy link
Copy Markdown
Contributor

Wasn't my intent, must have hit the wrong button

@phlogistonjohn

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@phlogistonjohn

Copy link
Copy Markdown
Contributor Author

jenkins test api

@phlogistonjohn

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@zmc
zmc merged commit 9c44d9d into ceph:main Mar 5, 2025
@phlogistonjohn
phlogistonjohn deleted the jjm-bwc-updates-20250219 branch March 6, 2025 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants