Repository navigation
tentacle: Use /etc/ceph_version to append vendor release version to the version string - #67693
Naveenaidu wants to merge 2 commits into
Conversation
bill-scales
left a comment
There was a problem hiding this comment.
LGTM - same change as merged in main
|
@batrick can you please approve this PR to be merged into the tentacle branch |
batrick
left a comment
There was a problem hiding this comment.
No sorry, this cannot be merged and the original PR needs redone.
The larger issue in my eyes is the potential for breakage/confusion of orchestrators like cephadm or rook which very much care about the format of ceph versions. This needs run through their test suites and ACKed that they can tolerate arbitrary strings at the end of each version string. My suggestion would be a separate command for obtaining the downstream version / vendor and make it configured on build time. Sourcing from a random file seems unnecessary when the vendor controls the build.
|
|
||
| std::string content; | ||
| try { | ||
| content.assign(std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>()); |
| @@ -43,6 +47,29 @@ const char *git_version_to_str(void) | |||
| return STRINGIFY(CEPH_GIT_VER); | |||
| } | |||
|
|
|||
| static std::string read_vendor_release_file() | |||
| { | |||
| auto filename = "/etc/ceph_version"; | |||
There was a problem hiding this comment.
This will not work on alternative platforms. It would need to be configurable.
|
@batrick Thanks for the review. Some context for the PR. The ability to show the vendor version is a downstream only requirement. The discussion related to changes are documented here: https://jsw.ibm.com/browse/ISCE-2817 During the initial discussion of the feature (RADOS team call), we decided against having a new command for showing the downstream version for the sake of maintainability. A separate command for showing the downstream version would be code we'd have to carry only for downstream. The consensus was that a single command showing the full version is semantically cleaner than splitting it across two. The approach for using a build time configurable option was presented but there was a lot of push back from the build team since they would have to maintain two images - which made us drop that approach. We had a POC for that here . Ref 1, Ref 2 The compromise we arrived was that we use the filename approach to fetch the version string. The build teams is responsible for maintaining the file and this feature was only scoped to the containerized builds - which use centos 9 - Hence the filename being
My understanding during the discussion was that - a small prefix to the version string would not cause issue to cephadm or rook. During the testing by the QA team - they used cephadm to deploy the cluster and everything was working as expected. I can definitely get an ACK from those teams saying that they can tolerate arbitrary strings. The gist is that, this is very much a downstream feature but we have the logic in upstream for better maintainability. We do not intend to bring this feature information in front of our upstream users. (that said, I do understand that if the code is in upstream - users can gleam that information by reading the source!) cc: @yaarith |
Any relevant discussion should be moved to upstream trackers. We do not have shadow discussions on upstream changes in an IBM forum.
I disagree. There could be a
Okay, so the ask is to make it easier to rebrand (re-vendor) containers built on the same binaries. That can be achieved in a few ways:
however the container environment variable is static and part of the container image. I don't see an issue here. cc @travisn @adk3798 Since this problem is specific to containers, I would prefer a container environment variable which can override the "build time" setting.
Even if it were okay, putting this file in
It's needs to be tested there too. This is not a small change as it could break upgrades in surprising ways that cannot be anticipated until it's in the wild.
Once it's upstream then it becomes our problem to maintain. Distributions may decide to put "Debian" in this vendor string once it's available (and honestly, that seems appropriate, no?). |
Understood, I will be conscious of the fact moving forward. Apologies about that. If I understand correctly - you are suggesting the following: Create a new command called One question:
Sorry, can you please clarify by a "build time" setting. Please correct me if I am wrong, are you suggesting that we have the vendor version be built in during the build time and also have an environment variable to override the value ?
Noted! |
default of "ceph.io" or similar seems good for the RPM/containers we produce.
If this is truly undesirable, you can enable the envvar lookup via a build time config.
I don't really think it's a concern.
Yes. A build time setting would be a define when running cmake. |
|
@batrick What is the use case of adding a new spec? do we need to make use of the new |
This code as-is would add an arbitrary string to: pretty_version_to_str. That would (at the very least) potentially impact upgrade procedures that look at that string. |
|
Rook very much relies on parsing the ceph version to determine the upstream version with the following procedure:
I believe extra info on the end of the output of Rook also runs |
|
@batrick thanks for reviewing. It’s a good idea to make
and have it by default under If upgrade tests are working as expected, and we have confirmation from cephadm and rook that it is safe to rely on the |
I have a few concerns:
|
Introduce a build-time mechanism to allow vendors or downstream distributions to append their release/version metadata to the output of ceph version and ceph versions. The release string is read from the file `/etc/ceph_version` and appends it to the version string as `release <value>`. If no value is supplied or the file is empty, the version output remains unchanged. Example: If the `/etc/ceph_version` file has "8.1.0" as string then, ceph version 8d7daada90 (98d7daa) tentacle (dev - Debug) release 8.1.0 Signed-off-by: Naveen Naidu <[email protected]> (cherry picked from commit 541439b)
read_vendor_release_file() reads /etc/ceph_version which may have a trailing newline, causing "ceph version" to produce invalid JSON output. Strip trailing \n and \r characters before returning the content. Signed-off-by: Naveen Naidu <[email protected]> (cherry picked from commit 5022557)
4eab0e4 to
a3356bd
Compare
|
A new tracker has been created here: https://tracker.ceph.com/issues/75954, which points out the next steps on how to proceed. TL:DR is we will be going with the |
From my perspective, it's just plain impossible to sufficiently "guardrail" any approach that is based on a file that is read at runtime, whether it's attempted to be done just once at startup or not. The version information needs to be physically baked into the binaries (such that it can be reconstructed from
|
If the desire is to be able to produce two differently versioned container images from the same set of binaries, wouldn't two container images need to be maintained no matter what? Assuming the file-based approach for the sake of argument, one would have a container image with a file with version tag A and another with a file with version tag B. Or am I completely misunderstanding the goal here? Separately, is it guaranteed that the set of binaries in question would always be the same? If there are two different container image flavors on the table it seems only natural that at some point the different version tags wouldn't be the only difference between them. |
|
@bigjust tagging you to help answer the pain points from build team POV and why we don't want to have a baked-in defaults |
Don't want to confuse maintaining two images with maintaining two rpm builds. Our goal is to build the Ceph RPMs once, and deploy them to separately maintained container images.
That is correct.
If we keep to our goal of only building the RPMs once, then they should be the same. I do believe that feature flagging between the two variants would be a very real need as well. |
|
the summary of the discussion of this PR has been documented here: https://tracker.ceph.com/issues/76134. The revert PR for the main commits are here: #68479 We will be closing this PR in favour of #66730 |
Revert "src/common/version: append vendor release to ceph version(s) output" This reverts commits 5022557 and 541439b. As discussed in ceph#67693, using a file-based approach to get the vendor version is not safe or correct. We are reverting this and will instead work on an approach where the version string is baked into the binary at build time. Fixes: https://tracker.ceph.com/issues/76134 Signed-off-by: Naveen Naidu <[email protected]>
Revert "src/common/version: append vendor release to ceph version(s) output" This reverts commits 5022557 and 541439b. As discussed in ceph#67693, using a file-based approach to get the vendor version is not safe or correct. We are reverting this and will instead work on an approach where the version string is baked into the binary at build time. Fixes: https://tracker.ceph.com/issues/76134 Signed-off-by: Naveen Naidu <[email protected]>
backport tracker: https://tracker.ceph.com/issues/75368
backport of #67299
parent tracker: https://tracker.ceph.com/issues/75366
this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh