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

subid ranges sourced from the network store #154

Closed
rhatdan opened this issue Feb 15, 2019 · 164 comments
Closed

subid ranges sourced from the network store #154

rhatdan opened this issue Feb 15, 2019 · 164 comments

Comments

@rhatdan
Copy link

rhatdan commented Feb 15, 2019

We are seeing a lot of excitement on the podman front running containers as not root.

We are taking advantage of User Namespace and specifically shadow-utils with /etc/subuid, /etc/subgid nad newuidmap and newgidmap.

But we are now being contacted by "enterprise" customers who use large databases of users and they want these files and UIDMap information to be handled via ldap or FreeIPA.

Has there been any thought into making this info available via nsswitch?

@giuseppe
Copy link
Contributor

I think there should be a way where we split the 32 bits uid/gid, so that a UID gets the additional UIDs/GIDs where the high 16 bits are equal the the UID itself.

i.e.
user 1000 -> 65536000-65601535,
user 1001 -> 65601536-65667071,

@vapier
Copy link
Contributor

vapier commented Feb 15, 2019

shadow shouldn't enforce any such policy decision like that when it comes to id space segmentation. it can make best practice recommendations, but that's it.

i'm not sure we can utilize nsswitch w/out coordinating with glibc. but if glibc did add support for new keywords (like "subuid" and "subgid"), then that seems like a design that would work.

@codonell
Copy link

The broader question is one about APIs. The existing glibc APIs that manage UIDs/GIDs trigger the NSS infrastructure to load and parse /etc/nsswitch.conf, this in turn loads plugins to respond to service requests in an authoritative fashion e.g. LDAP NSS module. There are no APIs that deal with subuid, subgid, or the concept of newuidmap and newgidmap setup for the guest namespace.

The existing infrastructure would require changes like this:

  • Create a new API for managing subuid/subgid information.
  • Convert newuidmap/newgidmap to use the new API.
  • Hook the new API into NSS.
  • Extend existing NSS plugins to provide the requisite information for the new API.
    • Start with files reading /etc/subuid and /etc/subgid.
    • Extend LDAP NSS plugins next.
      • Need to decide where the information lives in LDAP.
    • Add nscd cache to ameliorate loading long user files from the network.

Is that what everyone is thinking about?

@rhatdan
Copy link
Author

rhatdan commented Feb 20, 2019

Yes this is exactly what I was thinking.

@codonell
Copy link

I should note that when I said "new API for managing" I meant only that we provide functions that allow you to query the existing data, but not modify that data. We don't need dyanmic assignment to be baked into glibc, that has deeper policy implications, and shadow-utils and admins can do that themselves. Likewise the LDAP admin can setup the ranges as they wish without any need to have an API that does the assignment.

@lukasheinrich
Copy link

this is very interesting to academic environments as well, which use RH-based distros (CERN Scientific Linux 6 / CERN Centos 7) and have shared clusters to which users can login

@brauner
Copy link
Collaborator

brauner commented Feb 22, 2019

I have been talking about something like this with @poettering just a short while ago. On the @lxc side we allow for isolated idmaps, i.e. we have a way to give each container an idmap that is isolated from all other containers. For LXD it's easy to keep track what maps it has given away and how many it has left but it obviously becomes a problem when another container manager is using the same map. Having a central registry where we can - in a race free manner - record something along the lines of:

<container-identifier> <starting-host-uid> <range>

would be quite helpful.

I actually think we'd want something even better such that we can query:

  • has this idmap been given away already (does it overlap with an existing mapping) and if not register it right away (this whole process should be transactional)

@brauner
Copy link
Collaborator

brauner commented Feb 22, 2019

This should see input from all active people who co-maintain @shadow-maint with @hallyn and myself. Would also good to hear what @stgraber thinks.

@rhatdan
Copy link
Author

rhatdan commented Feb 22, 2019

Lets not confuse two different things though.

We have the UID's allocated to users to for their user namespace. Then we have UID Ranges allocated for root running services that want to use User Namespace for separation.

This Issue is more about the UID's allocated for Users.

@brauner
Copy link
Collaborator

brauner commented Feb 22, 2019

The two are conceptually identical only their permissions differ. If you use new{g,u}idmap for both user and root services than sub{g,i}id decides what you are allowed to map independent of whether you're root or not

@rhatdan
Copy link
Author

rhatdan commented Feb 22, 2019

Well I am not suggesting we use newuidmap for both. No reason to use this for a root running container engine.

@brauner
Copy link
Collaborator

brauner commented Feb 22, 2019

We should have a central way for all container engines to register their id allocations. If it works for unpriv users it works for root as well so there's no additional work associated with this.

@poettering
Copy link

poettering commented Feb 22, 2019

I must say I am not particularly convinced that /etc/subuid and /etc/subgid is such a great idea in the first place. Storing these registrations in /etc as if they were system configuration sounds wrong to me, we shouldn't do that anymore. Unless something is being reconfigured /etc should really be considered read-only, and range registration in /etc is something diametrically opposed to that, as it stores runtime information among the configuration in /etc.

In systemd we allocate user IDs dynamically at various places, including in nspawn's userns support and for DynamicUser=1 support for system services. But we never ever write this to /etc, as that's really not suitable for dynamically changing registrations. However, we do supply glibc NSS modules that make sure that whatever we register (regardless if individual uids or ranges of uids) shows up in the system's user database. And I think that's a general approach to follow when allocating user ranges: use NSS as registration database: make sure that the user and all other apps see that you own a range by making sure your users show up in NSS. This reuses existing concepts for maintaining registered ranges (as libc getpwuid() and getpwnam() will just report our entries), and is also friendly towards users, as for example "ps" will show all processes of a userns-using container as owned by your package. It also makes sure that classic user mgmt tools such as "adduser" automatically respect your uid range registrations, since they already check NSS before picking a UID anyway.

hence, from the systemd PoV: I am very sure we'll never begin using /etc/subuid and /etc/subgid, I think at this time we really shouldn't add any more static databases in /etc that need to be dynamically managed. Instead, we just pick a UID we consider suitable, check against NSS, and only use it if its not listed there yet (if it is, we pick a different UID). At the same time we make the UID we now took possession show up in NSS so that everybody else knows.

Or in other words: instead of trying to get everybody on board with sharing a new set of database files in /etc/, and then extending it for the network, just make everybody use the same (already existing) API instead (i.e. glibc NSS), and leave it up to the packages to register their ranges with it. Standardize on existing APIs rather than new files. The packages can then decide on their own how they manage their assignments and replicate them across the network.

(In case you wonder: yes, it's very easy to write an NSS module that returns for a UID x from some range a fixed user name "foobar-x", and vice versa)

@rhatdan
Copy link
Author

rhatdan commented Feb 22, 2019

Well that is exactly what this issue is about. Adding NSS support to newuidmap and newgidmap.

@brauner
Copy link
Collaborator

brauner commented Feb 22, 2019

I must say I am not particularly convinced that /etc/subuid and /etc/subgid is such a great idea in the first place. Storing these registrations in /etc as if they were system configuration sounds wrong to me, we shouldn't do that anymore. Unless something is being reconfigured /etc should really be considered read-only, and range registration in /etc is something diametrically opposed to that, as it stores runtime information among the configuration in /etc.

I think you misunderstand these files. No one intends to use them as databases and they aren't used as such now. They are config files that statically tell you what ids a user can use.

@poettering
Copy link

No. I say: don't bother with uidmap/gidmap. Just use the regular NSS user/group db, and fill it through your own NSS module. I would advise podman to simply not bother with uidmap/gidmap, but just provide an NSS module that exposes the ranges it took possession of.

@poettering
Copy link

I think you misunderstand these files. No one intends to use them as databases and they aren't used as such now. They are config files that statically tell you what ids a user can use.

so they are an extension of the usual user database. And I argue that the usual user database should not be considered configuration. I mean, there's a good reason while all those new OS approaches (such as Atomic and stuff) try hard to find alternatives to having to write every user into /etc.

@brauner
Copy link
Collaborator

brauner commented Feb 22, 2019

That's not orthogonal though, as you suggest. The idea is that you would want a way to allow a specific set of ids to be delegated to an unpriv user and these delegatable ranges are recorded in a central place: subid files. That's not opposing the db.

@brauner
Copy link
Collaborator

brauner commented Feb 22, 2019

don't bother with uidmap/gidmap

That's not possible without regressing the ability of unprivileged users to create complex id mappings that have been delegated to them by the system administrator. This has also worked independently of systemd and on other systems so I wouldn't want to make this systemd's job too.

@poettering
Copy link

Well, i mean, you can always keep the db if you really really like to, but what I am saying is: the db that everybody should check is the existing NSS user/group database, and not subuid/subgid.

I mean, if you want to use newuidmap/newgidmap as your SUID binary of choice to configure your /proc/$PID/uid_map then by all means, go ahead, but also: everything else is fine too, and I'd not bother with telling people the they have to reg there ranges there. Instead, just let people use any tool they want, as long as they reg the ranges in the NSS user/group databases.

or in other words, I'd suggest buildah/podman to just ship their own tool to acquire a uid range (possibly with a suid binary of their own, or through ipc-based privileged separation), and make sure to register what they acquire in NSS, instead of pushing everything down to /etc/subuid + /etc/subgid, which means you can never use buildah/podman in an environment with read-only /etc...

@poettering
Copy link

That's not possible without regressing the ability of unprivileged users to create complex id mappings that have been delegated to them by the system administrator. This has also worked independently of systemd and on other systems so I wouldn't want to make this systemd's job too.

I think I am repeating myself here: I am proposing to use the glibc NSS user/group db as place to make registrations show up, and as place to guarantee that every package uses its own range. Nothing systemd specific in that at all. glibc is not a systemd project, and by doing that you create a solution working on all general purpose Linux systems that support NSS, and there's nothing systemd-specific about that.

@brauner
Copy link
Collaborator

brauner commented Feb 22, 2019

or in other words, I'd suggest buildah/podman to just ship their own tool to acquire a uid range (possibly with a suid binary of their own, or through ipc-based privileged separation

You're not really suggesting that we start shipping custom suid idmap binaries alongside every runtime when we have newidmap to avoid just that?

@brauner
Copy link
Collaborator

brauner commented Feb 22, 2019

Well, i mean, you can always keep the db if you really really like to, but what I am saying is: the db that everybody should check is the existing NSS user/group database, and not subuid/subgid.

Now you're dancing around the problem: We currently have a mechanism to delegate id ranges to unpriv users. The db registration is about registering ranges and that proposal is fine. But we still need a way to delegate ranges.

@poettering
Copy link

You're not really suggesting that we start shipping custom suid idmap binaries alongside every runtime when we have newidmap to avoid just that?

Well, if you use a suid binary that's up to you. Major distros have the goal to minimize the number of suid binaries, and in that context it might be a much better idea to use something that uses some ipc priv separation instead. But the point I am making is this: secondary databases that noone but the tool owning it check are excercises in making UID collisions happen. The problem of dynamic UID registration is not specific to userns, and the tool newuidmap with another db in /etc might not be the ultimate solution to even the userns case.

@poettering
Copy link

Now you're dancing around the problem: We currently have a mechanism to delegate id ranges to unpriv users. The db registration is about registering ranges and that proposal is fine. But we still need a way to delegate ranges.

do we though? why do you want static delegation of ranges at all? i mean, podman could have a tiny ipc service (or suid binary if you want) that has one operation: "pick a free uid range that is currently not defined in the NSS user database, register it there, then chown these files with them and initialize uid_map of that process with them". and there you go: everything is properly registered, fully dynamic, without collisions, without maintaining a static database, without writing to /etc...

Why maintain a static database (and propagate them through the network) when you don't have to?

@brauner
Copy link
Collaborator

brauner commented Feb 22, 2019 via email

@brauner
Copy link
Collaborator

brauner commented Feb 22, 2019 via email

@hallyn
Copy link
Member

hallyn commented Apr 21, 2019

So what we could do is

  1. implement getuidmap and getgidmap binaries.
  2. consider adding a small libshadow which would define add_uidmap, add_gidmap, get_uidmap, and get_gidmap C library functions. All other languages could trivially add mappings. Of course the caller would have to be already privileged for the set functions

I'll refrain from commenting on the argument between adding functionality to existing baroque privileged programs versus adding small focused standalone privileged helpers.

@jamescassell
Copy link

The problem with dynamic mapping is that you could end up with unowned files on disk if the mapping does not persist, but the on-disk file do persist. Is there a distinction to be made between a "dynamic" mapping and an "ephemeral" mapping?

@rhatdan
Copy link
Author

rhatdan commented May 29, 2019

Don't we have this issue now? There is no tool like ls -l that figures out that UID=100000 is owned by dwalsh since their is an entry in /etc/subuid

dwalsh:100000:65536

This should be no different if this file is distributed from LDAP or ActiveDirectory or ...

@hallyn
Copy link
Member

hallyn commented Mar 30, 2021

I'll think it through a bit more, but I have an issue with the "if plugin A does not know the user, fall back to files". The problem is that files may assign to user2, who is unknown to plugin A, a range that plugin A assigned to user 1.

"Fall back to files" is a compromise between "single source" and "clean support of multiple plugins".
Perhaps it doesn't make much sense. If you don't comfortable with it - let's skip this in a first version (i.e. let's go with "single source only")

enum subid_status subid_$plugin_has_any_range(const char *owner, enum subid_type idtype, bool *result);
If we want this fallback support, then it should be as you suggested. If not, then I think it cleaner to roll them together as I had it.

"roll together" - result and operation status?

Yeah, but

I still thinks it's better to have them separated. They have different meaning.

Ok I'll go ahead and separate them.

This approach allows to provide more information (that you can ignore at the moment if not needed).
And I still don't understand what to return in your version in case "user is found but it doesn't have a range".

Btw, would you mind to open a PR? I think your version is mature and good enough and it would be easier to review/discuss that way...

I will make those final changes, actually read the whole patch and do some more cleanups, squash the commits, and put up a new pr.

@hallyn
Copy link
Member

hallyn commented Mar 30, 2021

Isn't the user of something like this coreutils? ls -lR ~/.local/share/containers/
Showing files are owned by you, even if they don't have your default UID?

What would it show in case find_subid_owners() returns several UIDs? (This possible according to currently proposed API)

Why not show each of the uids? If it turns out that a file belongs to a subid delegated to >1 user, it'd be good to know.

@hallyn
Copy link
Member

hallyn commented Mar 30, 2021

Another thing: can we drop find_subid_owners() from plugin API since you wrote "I'm not convinced there is a user."?

I'm ok dropping it. @rhatdan , what do you think?

@alexey-tikhonov
Copy link

Isn't the user of something like this coreutils? ls -lR ~/.local/share/containers/
Showing files are owned by you, even if they don't have your default UID?

What would it show in case find_subid_owners() returns several UIDs? (This possible according to currently proposed API)

Why not show each of the uids? If it turns out that a file belongs to a subid delegated to >1 user, it'd be good to know.

Ok, lets keep reverse lookup in API.

@rhatdan
Copy link
Author

rhatdan commented Mar 30, 2021

I think we should keep it. Unless there is some other way for coretutils to figure out what users own a specified file UID.

@alexey-tikhonov
Copy link

Hi @hallyn,

I will make those final changes, actually read the whole patch and do some more cleanups, squash the commits, and put up a new pr.

Do you need any help with it?
Even if code need some more polishing, it would be more convenient to discuss it within PR, imo...

@hallyn
Copy link
Member

hallyn commented Apr 9, 2021

#321 should be ready for comments.

@hallyn hallyn closed this as completed in 8492dee Apr 17, 2021
@rhatdan
Copy link
Author

rhatdan commented Apr 17, 2021

Awesome job @hallyn thanks a lot.

@rhatdan
Copy link
Author

rhatdan commented Jul 11, 2021

@hallyn any idea when you will release a new version of shadow-utils, with this feature?

@hallyn
Copy link
Member

hallyn commented Jul 13, 2021

I've been meaning to do that for awhile...

I'll plan on doing a release tomorrow afternoon (central time).

@rhatdan
Copy link
Author

rhatdan commented Jul 20, 2021

@hallyn Still waiting...

@hallyn
Copy link
Member

hallyn commented Jul 22, 2021 via email

@rhatdan
Copy link
Author

rhatdan commented Jul 22, 2021

Thanks

alexey-tikhonov added a commit to alexey-tikhonov/sssd that referenced this issue Jul 29, 2021
:feature: Basic support of user's 'subuid and subgid ranges' for IPA
provider and corresponding plugin for shadow-utils were introduced.
Limitations:
 - single subid interval pair (subuid+subgid) per user
 - idviews aren't supported
 - only forward lookup (user -> subid ranges)
Take a note, this is MVP of experimental feature. Significant changes
might be required later, after initial feedback.
Corresponding support in shadow-utils was merged upstream, but since there
is no upstream release available yet, SSSD feature isn't built by default.
Build can be enabled with `--with-subid` configure option.
Plugin's install path can be configured with `--with-subid-lib-path=`
("${libdir}" by default)

For additional details about support in shadow-utils please see discussion
in shadow-maint/shadow#154 and in related PRs.

:config: New IPA provider's option `ipa_subid_ranges_search_base` allows
configuration of search base for user's subid ranges.
Default: `cn=subids,%basedn`

Resolves: SSSD#5197
pbrezina pushed a commit to SSSD/sssd that referenced this issue Jul 29, 2021
:feature: Basic support of user's 'subuid and subgid ranges' for IPA
provider and corresponding plugin for shadow-utils were introduced.
Limitations:
 - single subid interval pair (subuid+subgid) per user
 - idviews aren't supported
 - only forward lookup (user -> subid ranges)
Take a note, this is MVP of experimental feature. Significant changes
might be required later, after initial feedback.
Corresponding support in shadow-utils was merged upstream, but since there
is no upstream release available yet, SSSD feature isn't built by default.
Build can be enabled with `--with-subid` configure option.
Plugin's install path can be configured with `--with-subid-lib-path=`
("${libdir}" by default)

For additional details about support in shadow-utils please see discussion
in shadow-maint/shadow#154 and in related PRs.

:config: New IPA provider's option `ipa_subid_ranges_search_base` allows
configuration of search base for user's subid ranges.
Default: `cn=subids,%basedn`

Resolves: #5197

Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
debarshiray pushed a commit to debarshiray/toolbox that referenced this issue Jan 28, 2023
On enterprise FreeIPA set-ups, the subordinate user and group IDs are
provided by SSSD's sss plugin for the GNU Name Service Switch (or NSS)
functionality of the GNU C Library.  They are not listed in /etc/subuid
and /etc/subgid.  Therefore, its necessary to use libsubid.so to check
the subordinate ID ranges.

The CGO interaction with libsubid.so is loosely based on 'readSubid' in
github.com/containers/storage/pkg/idtools [1].

However, unlike 'readSubid', this code considers the absence of any
range (ie., nRanges == 0) to be an error as well.

More importantly, this code uses dlopen(3) and friends to dynamically
load the symbols from libsubid.so, instead of linking to libsubid.so at
build-time and having the dependency noted in the /usr/bin/toolbox
binary.  This is done because libsubid.so itself depends on several
other shared libraries, and indirect dependencies can't be influenced
by the RUNPATH [2] embedded in the /usr/bin/toolbox binary [3].  Hence,
when the binary is used inside Toolbx containers (eg., as the entry
point), those indirect dependencies won't be picked from the host's
runtime against which the binary was built.  This can render the binary
useless due to ABI compatibility issues.  Using dlopen(3) avoids this
problem, especially because libsubid.so is only used when running on the
host.

Care was taken to not load and link libsubid.so twice to separately
validate the subordinate ID ranges for the user and the group.  Note
that libsubid_init() must be passed a FILE pointer for logging.
Otherwise, it will create it's own for logging, and there's no way to
close it during dlclose(3).

Version 4 of the libsubid.so API/ABI [4] was released in Shadow 4.10,
which is newer than the versions shipped on RHEL 8 and Debian 10 [5],
and even that newer version had some problems [6].  Therefore, support
for older versions, with the relevant workarounds, is necessary.
Fortunately, the oldest that needs to be support is Shadow 4.9 because
that's when libsubid.so was introduced [7].

Note that SUBID_ABI_VERSION was only introduced with version 4 of the
libsubid.so API/ABI released in Shadow 4.10 [8].  The first release of
libsubid.so in Shadow 4.9 already had an ABI version of 3.0.0 [9], since
it was bumped a few times during development, so that's what's assumed
when SUBID_ABI_VERSION is absent.

This code doesn't set the public variables Prog and shadow_logfd that
older Shadow versions used to expect for logging, because from Shadow
4.9 onwards there's a separate function [4,10] to specify these.  This
can be changed if there are libsubid.so versions in the wild that really
do need those public variables to be set.

Finally, ISO C99 is required because of the use of <stdbool.h> in the
libsubid.so API.

Some changes by Debarshi Ray.

[1] https://github.com/containers/storage/blob/main/pkg/idtools/idtools_supported.go

[2] https://man7.org/linux/man-pages/man8/ld.so.8.html

[3] Commit 6063eb2
    containers#821

[4] Shadow commit 32f641b207f6ddff
    shadow-maint/shadow@32f641b207f6ddff
    shadow-maint/shadow#443

[5] https://packages.debian.org/source/buster/shadow

[6] Shadow commit 79157cbad87f42cd
    shadow-maint/shadow@79157cbad87f42cd
    shadow-maint/shadow#465

[7] Shadow commit 0a7888b1fad613a0
    shadow-maint/shadow@0a7888b1fad613a0
    shadow-maint/shadow#154

[8] Shadow commit 0c9f64140852e8d5
    shadow-maint/shadow@0c9f64140852e8d5
    shadow-maint/shadow#449

[9] Shadow commit 3d670ba7ed58f910
    shadow-maint/shadow@3d670ba7ed58f910
    shadow-maint/shadow#339

[10] Shadow commit 2b22a6909dba60d
     shadow-maint/shadow@2b22a6909dba60d
     shadow-maint/shadow#325

containers#1074

Signed-off-by: Martin Jackson <martjack@redhat.com>
debarshiray added a commit to debarshiray/toolbox that referenced this issue Jan 29, 2023
The previous commit broke the golangci-lint test [1] because the GitHub
Action runs on Ubuntu 22.04, which only has Shadow 4.8 [2], whereas
libsubid.so was introduced in Shadow 4.9 [3].

However, that's not a big deal because 'go vet' was earlier added to the
set of tests run by 'meson test' [4], and 'go vet' is one of the linters
run by golangci-lint [5].  So, while it's not a proper replacement, it's
good enough.

[1] Commit ca8007c
    containers#1180

[2] https://packages.ubuntu.com/source/jammy/shadow
    https://packages.ubuntu.com/source/jammy-updates/shadow

[3] Shadow commit 0a7888b1fad613a0
    shadow-maint/shadow@0a7888b1fad613a0
    shadow-maint/shadow#154

[4] Commit f695012
    containers#1186

[5] https://golangci-lint.run/usage/linters/
    https://golangci-lint.run/usage/linters/#govet

This reverts commit 7c86f30.
debarshiray added a commit to debarshiray/toolbox that referenced this issue Jan 29, 2023
The previous commit broke the golangci-lint test [1] because the GitHub
Action runs on Ubuntu 22.04, which only has Shadow 4.8 [2], whereas
libsubid.so was introduced in Shadow 4.9 [3].

However, that's not a big deal because 'go vet' was earlier added to the
set of tests run by 'meson test' [4], and 'go vet' is one of the linters
run by golangci-lint [5].  So, while it's not a proper replacement, it's
good enough.

[1] Commit ca8007c
    containers#1180

[2] https://packages.ubuntu.com/source/jammy/shadow
    https://packages.ubuntu.com/source/jammy-updates/shadow

[3] Shadow commit 0a7888b1fad613a0
    shadow-maint/shadow@0a7888b1fad613a0
    shadow-maint/shadow#154

[4] Commit f695012
    containers#1186

[5] https://golangci-lint.run/usage/linters/
    https://golangci-lint.run/usage/linters/#govet

This reverts commit 7c86f30.

containers#1221
debarshiray added a commit to debarshiray/toolbox that referenced this issue Jun 23, 2023
Now that Toolbx offers built-in support for Ubuntu containers [1], it
makes sense to test that it works well on Ubuntu hosts.  Ubuntu 22.04 is
the latest long term support (or LTS) release [2] from Ubuntu, and
GitHub provides runners for GitHub workflows [3].

Ubuntu 22.04 only has Bats 1.2.1 [4], while Toolbx requires 1.7.0 [5];
and Shadow 4.8 [6], while libsubid.so was introduced in Shadow 4.9 [7].
Hence, newer versions of these dependencies need to be built to run the
tests.

Note that a separate sub-directory inside $GITHUB_WORKSPACE [8] is used
for Toolbx itself to prevent codespell from getting triggered by
problems in the dependencies themselves [9].

[1] Commit a84a358
    containers#483
    containers#1284

[2] https://wiki.ubuntu.com/Releases

[3] https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners

[4] https://packages.ubuntu.com/jammy/bats

[5] Commit e22a82f
    containers#1273

[6] https://packages.ubuntu.com/source/jammy/shadow
    https://packages.ubuntu.com/source/jammy-updates/shadow

[7] Shadow commit 0a7888b1fad613a0
    shadow-maint/shadow@0a7888b1fad613a0
    shadow-maint/shadow#154

[8] https://docs.github.com/en/actions/learn-github-actions/variables

[9] bats-core/bats-core#743

containers#1319
debarshiray added a commit to debarshiray/toolbox that referenced this issue Jun 23, 2023
Now that Toolbx offers built-in support for Ubuntu containers [1],
adding an Ubuntu host to the upstream CI will help ensure that Toolbx
continues to work well on Ubuntu.  Ubuntu 22.04 is the latest long term
support (or LTS) release [2] from Ubuntu, and GitHub provides runners
for GitHub workflows [3].

Ubuntu 22.04 only has Bats 1.2.1 [4], while Toolbx requires 1.7.0 [5];
and Shadow 4.8 [6], while libsubid.so was introduced in Shadow 4.9 [7].
Hence, newer versions of these dependencies need to be built to run the
tests.

Note that a separate sub-directory inside $GITHUB_WORKSPACE [8] is used
for Toolbx itself to prevent codespell from getting triggered by
problems in the dependencies themselves [9].

[1] Commit a84a358
    containers#483
    containers#1284

[2] https://wiki.ubuntu.com/Releases

[3] https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners

[4] https://packages.ubuntu.com/jammy/bats

[5] Commit e22a82f
    containers#1273

[6] https://packages.ubuntu.com/source/jammy/shadow
    https://packages.ubuntu.com/source/jammy-updates/shadow

[7] Shadow commit 0a7888b1fad613a0
    shadow-maint/shadow@0a7888b1fad613a0
    shadow-maint/shadow#154

[8] https://docs.github.com/en/actions/learn-github-actions/variables

[9] bats-core/bats-core#743

containers#1319
debarshiray added a commit to debarshiray/toolbox that referenced this issue Jun 23, 2023
Now that Toolbx offers built-in support for Ubuntu containers [1],
adding an Ubuntu host to the upstream CI will help ensure that Toolbx
continues to work well on Ubuntu.  Ubuntu 22.04 is the latest long term
support (or LTS) release [2] from Ubuntu, and GitHub provides runners
for GitHub workflows [3].

Ubuntu 22.04 only has Bats 1.2.1 [4], while Toolbx requires 1.7.0 [5];
and Shadow 4.8 [6], while libsubid.so was introduced in Shadow 4.9 [7].
Hence, newer versions of these dependencies need to be built to run the
tests.

Note that a separate sub-directory inside $GITHUB_WORKSPACE [8] is used
for Toolbx itself to prevent codespell from getting triggered by
problems in the dependencies themselves [9].

[1] Commit a84a358
    containers#483
    containers#1284

[2] https://wiki.ubuntu.com/Releases

[3] https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners

[4] https://packages.ubuntu.com/jammy/bats

[5] Commit e22a82f
    containers#1273

[6] https://packages.ubuntu.com/source/jammy/shadow
    https://packages.ubuntu.com/source/jammy-updates/shadow

[7] Shadow commit 0a7888b1fad613a0
    shadow-maint/shadow@0a7888b1fad613a0
    shadow-maint/shadow#154

[8] https://docs.github.com/en/actions/learn-github-actions/variables

[9] bats-core/bats-core#743

containers#1319
debarshiray added a commit to debarshiray/toolbox that referenced this issue Jun 27, 2023
Now that Toolbx offers built-in support for Ubuntu containers [1],
adding an Ubuntu host to the upstream CI will help ensure that Toolbx
continues to work well on Ubuntu.  Ubuntu 22.04 is the latest long term
support (or LTS) release [2] from Ubuntu, and GitHub provides runners
for GitHub workflows [3].

Ubuntu 22.04 only has Bats 1.2.1 [4], while Toolbx requires 1.7.0 [5];
and Shadow 4.8 [6], while libsubid.so was introduced in Shadow 4.9 [7].
Hence, newer versions of these dependencies need to be built to run the
tests.

Note that a separate sub-directory inside $GITHUB_WORKSPACE [8] is used
for Toolbx itself to prevent codespell from getting triggered by
problems in the dependencies themselves [9].

[1] Commit a84a358
    containers#483
    containers#1284

[2] https://wiki.ubuntu.com/Releases

[3] https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners

[4] https://packages.ubuntu.com/jammy/bats

[5] Commit e22a82f
    containers#1273

[6] https://packages.ubuntu.com/source/jammy/shadow
    https://packages.ubuntu.com/source/jammy-updates/shadow

[7] Shadow commit 0a7888b1fad613a0
    shadow-maint/shadow@0a7888b1fad613a0
    shadow-maint/shadow#154

[8] https://docs.github.com/en/actions/learn-github-actions/variables

[9] bats-core/bats-core#743

containers#1319
debarshiray added a commit to debarshiray/toolbox that referenced this issue Jun 27, 2023
Now that Toolbx offers built-in support for Ubuntu containers [1],
adding an Ubuntu host to the upstream CI will help ensure that Toolbx
continues to work well on Ubuntu.  Ubuntu 22.04 is the latest long term
support (or LTS) release [2] from Ubuntu, and is the latest Ubuntu
version that GitHub provides runners for [3].

Ubuntu 22.04 only has Bats 1.2.1 [4], while Toolbx requires 1.7.0 [5];
and Shadow 4.8 [6], while Toolbx requires 4.9 because it needs
libsubid.so [7,8].  Hence, newer versions of these dependencies need to
be built to run the tests.  The build flags for Shadow were taken from
the Debian package [9].

A separate sub-directory inside $GITHUB_WORKSPACE [10] is used for
Toolbx itself to prevent codespell from getting triggered by spelling
mistakes in these dependencies themselves [11].

Unfortunately, the SHELL environment variable goes mysteriously missing
from the runtime environment of the GitHub Actions workflow [12].  This
breaks the 'create' and 'enter' commands, and therefore tests involving
them can't be run until this is resolved.  Meanwhile, running the CI on
Ubuntu with a subset of the tests, is still better than not running the
CI on Ubuntu at all.

[1] Commit a84a358
    containers#483
    containers#1284

[2] https://wiki.ubuntu.com/Releases

[3] https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners

[4] https://packages.ubuntu.com/jammy/bats

[5] Commit e22a82f
    containers#1273

[6] https://packages.ubuntu.com/source/jammy/shadow
    https://packages.ubuntu.com/source/jammy-updates/shadow

[7] Shadow commit 0a7888b1fad613a0
    shadow-maint/shadow@0a7888b1fad613a0
    shadow-maint/shadow#154

[8] Commit ca8007c
    containers#1074

[9] https://salsa.debian.org/debian/shadow/

[10] https://docs.github.com/en/actions/learn-github-actions/variables

[11] bats-core/bats-core#743

[12] https://github.com/orgs/community/discussions/59413

containers#1319
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

No branches or pull requests