-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Adding OS version info to nodes' Info
struct and to the system info's API
#38349
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit concerned about using this for scheduling as we'll now end up with two vectors to schedule (image manifest / platform as advertised by engine info), which may not provide the same information (e.g. Architecture may also have to be taken into account, as well as isolation (hyper-v / process isolation).
In addition; we should consider having a different way to obtain this info, because the /info
endpoint is far from lightweight to call
Thanks for the quick review, @thaJeztah , much appreciated :)
That endpoint seems to be the one, central, place where we gather info on hosts (and is tied directly to the
Agreed that there is food for thought here, as there is a lot of info we could use to match images & nodes that we don't really make use of just yet (we pretty much only use the architecture for now); however, that seems to be a discussion more relevant on the upcoming swarmkit change. This patch here is only concerned with providing more info to swarmkit. |
Yes, and I think that's a problem, because the endpoint just about touches every subsystem of dockerd (gathering information about containers (and their state), images, which plugins are available, low-level information from the storage-driver). Some of those have caused issues in the past (e.g. due to locks when determining container state). I think we need a way to get more fine-grained information out of the daemon, especially if this endpoint is gonna be used more.
I think the key discussion here is (also see #34875) that we need to finish the standardisation of the "platform" information on images, and set the same information on the daemon. I think the last discussion ended with;
Related issues;
There was a lengthy discussion on the original PR that added the OS and Architecture; #13921
Correct; it's probably fine to show this information for informational purposes; in which case the field should carry a big disclaimer that it's meant as-such, and that its content (or format) is not part of the API specification. Similar to what we added to the Lines 3579 to 3592 in bb7de1f
however (glancing over the discussion on the swarmkit issue), IIUC, the purpose of this change is to influence scheduling decisions (manually or automatically). If the information used here does not match the direction that image-selection will use (the discussion on #34875), there is a risk;
Note that for scheduling, another approach would be to set up engine (or node-) labels, and set constraints based on those labels. |
@thaJeztah thanks for your very interesting & extensive explanation, I understand much better where you're coming from now. May I suggest then that while the specs solidify on the image manifest side of things as to how to normalize how to report arch & OS info, we still get this in with a big caveat in the doc pointing out this field is temporary and subject to change without notice? Then when that's normalized I'll come back and change both this and swarmkit accordingly.
Agreed on this, too. We should start doing this as part of the long-term fix too, when it's clear how we want to report host info. Addressing the rest of your comments ASAP. |
Codecov Report
@@ Coverage Diff @@
## master #38349 +/- ##
=========================================
Coverage ? 37.06%
=========================================
Files ? 611
Lines ? 45548
Branches ? 0
=========================================
Hits ? 16881
Misses ? 26384
Partials ? 2283 |
Discussing if we can come up with alternatives for this use-case, but will have to do a bit more thinking about that |
Discussing in the maintainers meeting (again 😅 );
Other than that, we're ok with this change |
Great, thanks @thaJeztah ! :) |
Please sign your commits following these rules: $ git clone -b "wk8/os_version" git@github.com:wk8/moby.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842354462472
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f Amending updates the existing PR. You DO NOT need to open a new one. |
aa4ff36
to
032df29
Compare
@thaJeztah : amended as requested, could you please have another look? Thanks! |
@thaJeztah : amended as requested per @cpuguy83 . Thanks. |
2a68360
to
ab5ec75
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
17723b8
to
9e663e2
Compare
This is needed so that we can add OS version constraints in Swarmkit, which does require the engine to report its host's OS version (see moby/swarmkit#2770). The OS version is parsed from the `os-release` file on Linux, and from the `ReleaseId` string value of the `SOFTWARE\Microsoft\Windows NT\CurrentVersion` registry key on Windows. Added unit tests when possible, as well as Prometheus metrics. Signed-off-by: Jean Rouge <rougej+github@gmail.com>
This was added in d363a18 (moby#38349), but not yet added to the API history. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This was added in d363a1881ec256e1be5a48a90046ff16e84ddc02 (moby/moby#38349), but not yet added to the API history. Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 53430f5fc14feb6d47d4bab740cf9d376e1c74aa Component: engine
This was added in d363a18 (moby#38349), but not yet added to the API history. Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Signed-off-by: zach <Zachary.Joyner@linux.com>
- What I did
This patch adds the OS' version to nodes'
Info
struct and to the system info's API.This is needed so that we can add OS version constraints in Swarmkit, which
does require the engine to report its host's OS version (see
moby/swarmkit#2770 (comment)).
- How I did it
The OS version is parsed from the
os-release
file on Linux, and from theReleaseId
string value of theSOFTWARE\Microsoft\Windows NT\CurrentVersion
registry key on Windows.
- How to verify it
Unit test included.
- Description for the changelog
Adding OS version info to the system info's API (
/info
)- A picture of a cute animal (not mandatory but encouraged)