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

add label with ceph version string #1508

Closed
liewegas opened this issue Nov 6, 2019 · 14 comments
Closed

add label with ceph version string #1508

liewegas opened this issue Nov 6, 2019 · 14 comments

Comments

@liewegas
Copy link
Member

liewegas commented Nov 6, 2019

Right now the labels (as reported by podman inspect) look like:

            "Labels": {
                "CEPH_POINT_RELEASE": "",
                "GIT_BRANCH": "HEAD",
                "GIT_CLEAN": "True",
                "GIT_COMMIT": "3e4c74ab4205876cce4afd9c4051ac710a82973b",
                "GIT_REPO": "git@github.com:ceph/ceph-container.git",
                "RELEASE": "wip-cd-df40a49",
                "maintainer": "Dimitri Savineau \u003cdsavinea@redhat.com\u003e",
                "org.label-schema.build-date": "20190801",
                "org.label-schema.license": "GPLv2",
                "org.label-schema.name": "CentOS Base Image",
                "org.label-schema.schema-version": "1.0",
                "org.label-schema.vendor": "CentOS"
            },

For a ceph -v of ceph version 15.0.0-6884-gf0458b188a (d76dc026e8194928712f229afa002cf4005bb5df) octopus (dev), I'd like to add labels like the following:

  • CEPH_VERSION - 15.0.0-6884-gf0458b188a
  • CEPH_RELEASE - octopus
  • CEPH_RELEASE_TYPE` -- dev (orrcorstable``)

Currently ceph-daemon is executing ceph -v inside the container to get this information, but simply extracting it from the container image metadata would be much faster!

@liewegas
Copy link
Member Author

liewegas commented Nov 6, 2019

Also, not really sure what the purpose of CEPH_POINT_RELEASE is...

@sebastian-philipp
Copy link
Contributor

cc @krig

@dsavineau
Copy link
Contributor

Currently ceph-daemon is executing ceph -v inside the container to get this information, but simply extracting it from the container image metadata would be much faster!

The thing is that we probably can't do that during the container build (ie: install the package, run ceph -v and set the labels) otherwise it should have already been done. I'll try to take a look.
@leseb any thoughts on this ?

Also, not really sure what the purpose of CEPH_POINT_RELEASE is...

This variable is used when we want to build a specific ceph release (like: 14.2.3).

@liewegas
Copy link
Member Author

liewegas commented Nov 7, 2019

The important one is CEPH_VERSION which is also the git describe string (minus the leading 'v')

@leseb
Copy link
Member

leseb commented Nov 7, 2019

The problem is that LABELS are generated as part of the Dockerfile, then we execute it to build. So we don't quite know which version we are getting IIRC, so this happens at build time.

@liewegas
Copy link
Member Author

liewegas commented Nov 8, 2019

...but the get sha1 is there right? Or is that the commit for ceph-container (not ceph)?

@leseb
Copy link
Member

leseb commented Nov 12, 2019

...but the get sha1 is there right? Or is that the commit for ceph-container (not ceph)?

Yes, it's the sha1 of ceph-container (fetched at build time, since we build from that repo), not ceph.

@krig
Copy link

krig commented Jan 29, 2020

@leseb @liewegas @sebastian-philipp I have a tentative proposal for reading the ceph version from a io.ceph.version label if present on the container image here:

krig/ceph@782f0e0

What do you think? The idea is to use the label if set, but fall back to ceph -v if not.

It remains to set the label on the container image of course, with the openSUSE/SLE build chain we can do it quite easily but I'd have to look into how to do it on ceph-container (sounds non-trivial).

Right now the ceph version is the only label actually read by cephadm, so I thought it made sense to limit the initial work to just cover that one.

krig pushed a commit to krig/ceph that referenced this issue Jan 30, 2020
Having to run `ceph -v` in the container image to read the
ceph version number is expensive and slow. Instead, look
for a label (proposed: "io.ceph.version") on the container
image and use the value of that label if present.

See: ceph/ceph-container#1508
See: https://tracker.ceph.com/issues/43678

Signed-off-by: Kristoffer Grönlund <kgronlund@suse.com>
krig pushed a commit to krig/ceph that referenced this issue Jan 30, 2020
Having to run `ceph -v` in the container image to read the
ceph version number is expensive and slow. Instead, look
for a label (proposed: "io.ceph.version") on the container
image and use the value of that label if present.

See: ceph/ceph-container#1508
See: https://tracker.ceph.com/issues/43678

Signed-off-by: Kristoffer Grönlund <kgronlund@suse.com>
@liewegas
Copy link
Member Author

The cephadm change looks good. We need to sort out how to add this label to the image though... @dsavineau @leseb ideas?

krig pushed a commit to krig/ceph that referenced this issue Jan 31, 2020
Having to run `ceph -v` in the container image to read the
ceph version number is expensive and slow. Instead, look
for a label (proposed: "io.ceph.version") on the container
image and use the value of that label if present.

See: ceph/ceph-container#1508
See: https://tracker.ceph.com/issues/43678

Signed-off-by: Kristoffer Grönlund <kgronlund@suse.com>
krig pushed a commit to krig/ceph that referenced this issue Jan 31, 2020
Having to run `ceph -v` in the container image to read the
ceph version number is expensive and slow. Instead, look
for a label (proposed: "io.ceph.version") on the container
image and use the value of that label if present.

See: ceph/ceph-container#1508
See: https://tracker.ceph.com/issues/43678

Signed-off-by: Kristoffer Grönlund <kgronlund@suse.com>
@dsavineau
Copy link
Contributor

As mentioned earlier, getting those information (basically running ceph -v) before the build would require complexity and this isn't predictible.
The container file could be generated with information that don't reflect the ceph release installed in the container later.
As cephadm seems to support getting those information by running the ceph -v command (as ceph-ansible and rook) then I don't see the point to add this and add more complexity into the container build system.

guits pushed a commit to guits/ceph that referenced this issue Feb 7, 2020
Having to run `ceph -v` in the container image to read the
ceph version number is expensive and slow. Instead, look
for a label (proposed: "io.ceph.version") on the container
image and use the value of that label if present.

See: ceph/ceph-container#1508
See: https://tracker.ceph.com/issues/43678

Signed-off-by: Kristoffer Grönlund <kgronlund@suse.com>
@sebastian-philipp
Copy link
Contributor

@stale
Copy link

stale bot commented Apr 1, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 1, 2020
@stale stale bot closed this as completed Apr 8, 2020
@sebastian-philipp
Copy link
Contributor

reopen please

@dsavineau dsavineau reopened this Apr 9, 2020
@stale stale bot removed the wontfix label Apr 9, 2020
@stale
Copy link

stale bot commented May 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label May 9, 2020
@stale stale bot closed this as completed May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants