Skip to content

pkg/utils: Support host operating systems without VERSION_ID#1303

Merged
debarshiray merged 2 commits intocontainers:mainfrom
debarshiray:wip/rishi/arch-distro
Jun 12, 2023
Merged

pkg/utils: Support host operating systems without VERSION_ID#1303
debarshiray merged 2 commits intocontainers:mainfrom
debarshiray:wip/rishi/arch-distro

Conversation

@debarshiray
Copy link
Copy Markdown
Member

The VERSION_ID field in os-release(5) is optional [1]. It's absent on Arch Linux, which follows a rolling-release model and uses the BUILD_ID field instead:
BUILD_ID=rolling

A subsequent commit will add built-in support for Arch Linux. Hence, the code to get the default release from the host operating system can no longer assume the presence of the VERSION_ID field in os-release(5).

[1] https://www.freedesktop.org/software/systemd/man/os-release.html

@debarshiray debarshiray requested a review from martymichal as a code owner June 7, 2023 11:23
debarshiray added a commit to debarshiray/toolbox that referenced this pull request Jun 7, 2023
The VERSION_ID field in os-release(5) is optional [1].  It's absent on
Arch Linux, which follows a rolling-release model and uses the BUILD_ID
field instead:
  BUILD_ID=rolling

A subsequent commit will add built-in support for Arch Linux.  Hence,
the code to get the default release from the host operating system can
no longer assume the presence of the VERSION_ID field in os-release(5).

[1] https://www.freedesktop.org/software/systemd/man/os-release.html

containers#1303
@debarshiray debarshiray force-pushed the wip/rishi/arch-distro branch from b50ae8c to a6c2990 Compare June 7, 2023 11:25
@softwarefactory-project-zuul
Copy link
Copy Markdown

Build failed.
https://softwarefactory-project.io/zuul/t/local/buildset/4834d0a3f30c456190eed068864002c4

unit-test FAILURE in 9m 00s
unit-test-migration-path-for-coreos-toolbox FAILURE in 2m 42s
unit-test-restricted FAILURE in 8m 01s
system-test-fedora-rawhide FAILURE in 8m 27s
system-test-fedora-38 FAILURE in 8m 50s
system-test-fedora-37 FAILURE in 8m 54s
system-test-fedora-36 FAILURE in 8m 34s

debarshiray added a commit to debarshiray/toolbox that referenced this pull request Jun 7, 2023
The VERSION_ID field in os-release(5) is optional [1].  It's absent on
Arch Linux, which follows a rolling-release model and uses the BUILD_ID
field instead:
  BUILD_ID=rolling

A subsequent commit will add built-in support for Arch Linux.  Hence,
the code to get the default release from the host operating system can
no longer assume the presence of the VERSION_ID field in os-release(5).

[1] https://www.freedesktop.org/software/systemd/man/os-release.html

containers#1303
@debarshiray debarshiray force-pushed the wip/rishi/arch-distro branch from a6c2990 to 506836e Compare June 7, 2023 12:35
@softwarefactory-project-zuul
Copy link
Copy Markdown

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/1b6e7997c7ed4a919a31596993e3995b

✔️ unit-test SUCCESS in 9m 26s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 2m 54s
✔️ unit-test-restricted SUCCESS in 8m 32s
✔️ system-test-fedora-rawhide SUCCESS in 22m 08s
✔️ system-test-fedora-38 SUCCESS in 21m 07s
✔️ system-test-fedora-37 SUCCESS in 20m 42s
✔️ system-test-fedora-36 SUCCESS in 21m 10s

if err == nil {
if distroObj, supportedDistro := supportedDistros[hostID]; supportedDistro {
release, err := GetHostVersionID()
release, err := getDefaultReleaseForDistro(hostID)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We can't define releaseDefault in terms of an os-release(5) field like BUILD_ID (set to rolling) on Arch Linux. The arch-toolbox image is tagged with latest, not rolling, and there's nothing in os-release(5) that's set to latest. We really must stick to latest.

Time for another iteration.

debarshiray added a commit to debarshiray/toolbox that referenced this pull request Jun 7, 2023
The VERSION_ID field in os-release(5) is optional [1].  It's absent on
Arch Linux, which follows a rolling-release model and uses the BUILD_ID
field instead:
  BUILD_ID=rolling

A subsequent commit will add built-in support for Arch Linux.  Hence,
the code to get the default release from the host operating system can
no longer assume the presence of the VERSION_ID field in os-release(5).

[1] https://www.freedesktop.org/software/systemd/man/os-release.html

containers#1303
@debarshiray debarshiray force-pushed the wip/rishi/arch-distro branch from 506836e to a39d373 Compare June 7, 2023 15:42
debarshiray added a commit to debarshiray/toolbox that referenced this pull request Jun 7, 2023
debarshiray added a commit to debarshiray/toolbox that referenced this pull request Jun 7, 2023
Operating system distributions like Arch Linux that follow a
rolling-release model don't have the concept of a release.  The latest
snapshot is the only available release.

A subsequent commit will add built-in support for Arch Linux.  Hence,
the code can no longer assume that every distribution will have a
matching release.

containers#1303
debarshiray added a commit to debarshiray/toolbox that referenced this pull request Jun 7, 2023
This allows using the --distro option to create and enter Arch Linux
containers.  Due to Arch's rolling-release model, the --release option
isn't required.  If --release is used, the accepted values are 'latest'
and 'rolling'.

containers#1303
@softwarefactory-project-zuul
Copy link
Copy Markdown

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/f062196d7ca3470294de03b907588559

✔️ unit-test SUCCESS in 9m 22s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 2m 48s
✔️ unit-test-restricted SUCCESS in 8m 23s
✔️ system-test-fedora-rawhide SUCCESS in 21m 17s
✔️ system-test-fedora-38 SUCCESS in 21m 03s
✔️ system-test-fedora-37 SUCCESS in 20m 15s
✔️ system-test-fedora-36 SUCCESS in 20m 33s

@softwarefactory-project-zuul
Copy link
Copy Markdown

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/d84f90c8e35c4a2dab139638fc7cf776

✔️ unit-test SUCCESS in 9m 18s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 2m 52s
✔️ unit-test-restricted SUCCESS in 8m 16s
✔️ system-test-fedora-rawhide SUCCESS in 20m 47s
✔️ system-test-fedora-38 SUCCESS in 20m 04s
✔️ system-test-fedora-37 SUCCESS in 19m 52s
✔️ system-test-fedora-36 SUCCESS in 20m 20s

@softwarefactory-project-zuul
Copy link
Copy Markdown

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/3d90b137cfbe486e8c597ba9761f8cf3

✔️ unit-test SUCCESS in 9m 17s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 2m 46s
✔️ unit-test-restricted SUCCESS in 8m 20s
✔️ system-test-fedora-rawhide SUCCESS in 20m 46s
✔️ system-test-fedora-38 SUCCESS in 20m 07s
✔️ system-test-fedora-37 SUCCESS in 19m 20s
✔️ system-test-fedora-36 SUCCESS in 19m 24s

@debarshiray debarshiray force-pushed the wip/rishi/arch-distro branch from e951ddc to b64e8c7 Compare June 8, 2023 12:13
@softwarefactory-project-zuul
Copy link
Copy Markdown

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/9a710a205dee4240b4bd20b36296f9d4

✔️ unit-test SUCCESS in 10m 23s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 4m 02s
✔️ unit-test-restricted SUCCESS in 9m 09s
✔️ system-test-fedora-rawhide SUCCESS in 22m 47s
✔️ system-test-fedora-38 SUCCESS in 20m 48s
✔️ system-test-fedora-37 SUCCESS in 22m 08s
✔️ system-test-fedora-36 SUCCESS in 21m 44s

debarshiray added a commit to debarshiray/toolbox that referenced this pull request Jun 8, 2023
The VERSION_ID field in os-release(5) is optional [1].  It's absent on
Arch Linux, which follows a rolling-release model and uses the BUILD_ID
field instead:
  BUILD_ID=rolling

A subsequent commit will add built-in support for Arch Linux.  Hence,
the code to get the default release from the host operating system can
no longer assume the presence of the VERSION_ID field in os-release(5).

[1] https://www.freedesktop.org/software/systemd/man/os-release.html

containers#1303
debarshiray added a commit to debarshiray/toolbox that referenced this pull request Jun 8, 2023
@debarshiray debarshiray force-pushed the wip/rishi/arch-distro branch from b64e8c7 to 5f5dbbf Compare June 8, 2023 18:09
@debarshiray
Copy link
Copy Markdown
Member Author

Rebased on top of #1308

@softwarefactory-project-zuul
Copy link
Copy Markdown

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/21e49b4ed73d4080bb09f15b63330465

✔️ unit-test SUCCESS in 10m 56s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 2m 56s
✔️ unit-test-restricted SUCCESS in 9m 02s
✔️ system-test-fedora-rawhide SUCCESS in 28m 44s
✔️ system-test-fedora-38 SUCCESS in 23m 59s
✔️ system-test-fedora-37 SUCCESS in 23m 04s
✔️ system-test-fedora-36 SUCCESS in 22m 40s

debarshiray added a commit to debarshiray/toolbox that referenced this pull request Jun 9, 2023
The VERSION_ID field in os-release(5) is optional [1].  It's absent on
Arch Linux, which follows a rolling-release model and uses the BUILD_ID
field instead:
  BUILD_ID=rolling

A subsequent commit will add built-in support for Arch Linux.  Hence,
the code to get the default release from the host operating system can
no longer assume the presence of the VERSION_ID field in os-release(5).

[1] https://www.freedesktop.org/software/systemd/man/os-release.html

containers#1303
debarshiray added a commit to debarshiray/toolbox that referenced this pull request Jun 9, 2023
@debarshiray debarshiray force-pushed the wip/rishi/arch-distro branch from 5f5dbbf to c3ed234 Compare June 9, 2023 12:04
@softwarefactory-project-zuul
Copy link
Copy Markdown

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/43e5539a68fb42bd9b9a91a1b89173ec

✔️ unit-test SUCCESS in 9m 56s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 4m 42s
✔️ unit-test-restricted SUCCESS in 8m 33s
✔️ system-test-fedora-rawhide SUCCESS in 22m 00s
✔️ system-test-fedora-38 SUCCESS in 21m 15s
✔️ system-test-fedora-37 SUCCESS in 24m 58s
✔️ system-test-fedora-36 SUCCESS in 21m 17s

The VERSION_ID field in os-release(5) is optional [1].  It's absent on
Arch Linux, which follows a rolling-release model and uses the BUILD_ID
field instead:
  BUILD_ID=rolling

A subsequent commit will add built-in support for Arch Linux.  Hence,
the code to get the default release from the host operating system can
no longer assume the presence of the VERSION_ID field in os-release(5).

Note that the arch-toolbox image is tagged with 'latest', in accordance
with OCI conventions, not 'rolling' [2,3], which is the os-release(5)
BUILD_ID.  Therefore, it will be wise to use 'latest' as the default
release on Arch Linux, to simplify how the default release matches with
the default image's tag.  This means that a os-release(5) field can't be
used for the default release on Arch.

[1] https://www.freedesktop.org/software/systemd/man/os-release.html

[2] Commit 2568528
    containers#861

[3] Commit a4e5861
    containers#1308

containers#1303
@debarshiray debarshiray force-pushed the wip/rishi/arch-distro branch from c3ed234 to 774ce8b Compare June 12, 2023 15:03
@softwarefactory-project-zuul
Copy link
Copy Markdown

Build succeeded.
https://softwarefactory-project.io/zuul/t/local/buildset/bd1f67cf508a4ebab1a34d0f5e5d7091

✔️ unit-test SUCCESS in 9m 59s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 2m 54s
✔️ unit-test-restricted SUCCESS in 8m 48s
✔️ system-test-fedora-rawhide SUCCESS in 20m 46s
✔️ system-test-fedora-38 SUCCESS in 20m 07s
✔️ system-test-fedora-37 SUCCESS in 20m 28s
✔️ system-test-fedora-36 SUCCESS in 20m 09s

@debarshiray debarshiray merged commit 774ce8b into containers:main Jun 12, 2023
@debarshiray debarshiray deleted the wip/rishi/arch-distro branch June 12, 2023 16:07
debarshiray added a commit to debarshiray/toolbox that referenced this pull request Jun 12, 2023
Operating system distributions like Arch Linux that follow a
rolling-release model don't have the concept of a release.  The latest
snapshot is the only available release.

A subsequent commit will add built-in support for Arch Linux.  Hence,
the code can no longer assume that every distribution will have a
matching release.

containers#1303
debarshiray added a commit to debarshiray/toolbox that referenced this pull request Jun 12, 2023
This allows using the --distro option to create and enter Arch Linux
containers.  Due to Arch's rolling-release model, the --release option
isn't required.  If --release is used, the accepted values are 'latest'
and 'rolling'.

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

Successfully merging this pull request may close these issues.

1 participant