Commit Graph

6180 Commits

Author SHA1 Message Date
Kir Kolyshkin 5b89027afc [1.1] ci/cirrus: switch from CentOS to Almalinux
(This is a backport of b18d052bb83cbf0a6ad79aa1e79d5c9f75eddda7.)

Remove CentOS 7 as it is EOL.

Add back RHEL 8 clone (CentOS Stream 8 was removed by commit
40bb9c468e).

Switch from CentOS Stream 9 to Almalinux 9.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2024-07-03 10:54:30 +10:00
Kir Kolyshkin ed406952fc Merge pull request #4318 from lifubang/release-1.1.13
Release 1.1.13
2024-06-13 08:05:44 -07:00
lifubang ec1bc45d46 VERSION: back to development
Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-06-13 18:23:57 +08:00
lifubang 58aa9203c1 VERSION: release 1.1.13
Signed-off-by: lifubang <lifubang@acmcoder.com>
v1.1.13
2024-06-13 18:23:48 +08:00
Kir Kolyshkin 2b3a2472d1 Merge pull request #4316 from lifubang/backport-4189
[1.1] script/*: fix gpg usage wrt keyboxd
2024-06-11 16:55:14 -07:00
Kir Kolyshkin 3507adac19 Merge pull request #4315 from lifubang/backport-4311
[1.1] fix a debug msg for user ns in nsexec
2024-06-11 16:54:55 -07:00
Kir Kolyshkin 0f7150ade8 script/*: fix gpg usage wrt keyboxd
I used script/keyring_validate.sh, which gave me this error:

> [*] User cyphar in runc.keyring is not a maintainer!

Apparently, when gnupg 2.4.1+ sees a fresh install (i.e. no ~/.gnupg
directory), it configures itself to use keyboxd instead of keyring
files, and when just silently ignores options like --keyring and
--no-default-keyring, working with keyboxd all the time.

The only way I found to make it not use keyboxd is to set --homedir.
Let's do that when we explicitly want a separate keyring.

Similar change is made to script/release_key.sh.

Also, change "--import --import-options=show-only" to "--show-keys"
which is a shortcut. When using this, there is no need to protect
the default keyring since this command does not read or modify it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 760105ab11)
Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-06-10 07:26:54 +08:00
lfbzhm 80186fec5c fix a debug msg for user ns in nsexec
Signed-off-by: lfbzhm <lifubang@acmcoder.com>
(cherry picked from commit 24c2d28d1f)
Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-06-10 07:18:53 +08:00
lfbzhm 8407d3c602 Merge pull request #4313 from kolyshkin/1.1-backport-4292
[1.1] Support Go 1.22, bump some CI deps
2024-06-10 06:46:19 +08:00
Kir Kolyshkin 7219e0afff Dockerfile: bump Debian to 12, Go to 1.21
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit b74b33c439)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 11:37:56 -07:00
Kir Kolyshkin c9beabc8d8 ci: switch to go 1.22 as main version
Now when Go 1.22.4 is out it should no longer be a problem.

Leave Go 1.21 for CentOS testing (CentOS 7 and 8 have older glibc)
and Dockerfile (Debian 11 have older glibc).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit a3302f2054)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 11:37:56 -07:00
Kir Kolyshkin 4578c6c5db libct/nsenter: stop blacklisting go 1.22+
Go 1.23 includes a fix (https://go.dev/cl/587919) so go1.23.x can be
used. This fix is also backported to 1.22.4, so go1.22.x can also be
used (when x >= 4). Finally, for glibc >= 2.32 it doesn't really matter.

Add a note about Go 1.22.x > 1.22.4 to README as well.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit e660ef61a5)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 11:37:56 -07:00
lifubang c488d13a53 use go mod instead of go get in spec.bats
Signed-off-by: lifubang <lifubang@acmcoder.com>
(cherry picked from commit 75e02193c2)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 11:37:54 -07:00
Kir Kolyshkin ae85f058cc ci/gha: bump golangci-lint to v1.57
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit d63018c252)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 11:33:03 -07:00
Kir Kolyshkin 327e07e968 ci/gha: bump golangci-lint to v1.54
Currently, it is at v1.54.2.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 17e7e230bd)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 11:33:03 -07:00
Kir Kolyshkin 65bdf604dd libct/user: gofumpt -w
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 11:32:50 -07:00
Kir Kolyshkin 4d097af534 ci/gha: bump golangci-lint-action from 5 to 6
Note that github-actions output format is deprecated and no longer supported,
and it is also no longer needed since setup-go problem matcher already
handles default golangci-lint output format ("colored-line-number").

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit f452f667c0)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 11:18:12 -07:00
Kir Kolyshkin fb23608437 ci/gha: bump golangci/golangci-lint-action to v5
Since v5 removes caching [1], re-enable setup-go cache.

[1] https://github.com/golangci/golangci-lint-action/pull/1024

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 6bcc736122)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 11:18:12 -07:00
Akihiro Suda 8bfc75a25d CI: run apt with -y
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit 30dc98f577)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 11:18:12 -07:00
Kir Kolyshkin e546ddeec8 ci/gha: switch some jobs to ubuntu-22.04
This is a partial backport of commits 953e1cc48 and b32655d2
from the main branch.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 11:18:12 -07:00
dependabot[bot] 0d19e78b84 build(deps): bump actions/setup-go from 4 to 5
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit e66ba70f50)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 11:18:12 -07:00
Kir Kolyshkin b36844518a build(deps): bump actions/checkout from 3 to 4
Same as commit 2d0cd0b3 in main branch.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 11:18:12 -07:00
dependabot[bot] cb2d85dcde build(deps): bump tim-actions/commit-message-checker-with-regex
Bumps [tim-actions/commit-message-checker-with-regex](https://github.com/tim-actions/commit-message-checker-with-regex) from 0.3.1 to 0.3.2.
- [Release notes](https://github.com/tim-actions/commit-message-checker-with-regex/releases)
- [Commits](https://github.com/tim-actions/commit-message-checker-with-regex/compare/v0.3.1...v0.3.2)

---
updated-dependencies:
- dependency-name: tim-actions/commit-message-checker-with-regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit fe6f33b2c0)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 11:18:12 -07:00
dependabot[bot] 25e27d7eef build(deps): bump actions/upload-artifact from 3 to 4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 7b655782bf)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 11:18:12 -07:00
dependabot[bot] 2ac8b11f48 build(deps): bump golangci/golangci-lint-action from 3 to 4
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3 to 4.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 27cbabd00d)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-07 11:18:12 -07:00
Kir Kolyshkin 7d86e7d9ec Merge pull request #4299 from kolyshkin/1.1-4290
[1.1] libct/system: ClearRlimitNofileCache for go 1.23
2024-06-06 14:34:04 -07:00
Kir Kolyshkin 096e6f88f0 [1.1] libct/system: ClearRlimitNofileCache for go 1.23
Go 1.23 tightens access to internal symbols, and even puts runc into
"hall of shame" for using an internal symbol (recently added by commit
da68c8e3). So, while not impossible, it becomes harder to access those
internal symbols, and it is a bad idea in general.

Since Go 1.23 includes https://go.dev/cl/588076, we can clean the
internal rlimit cache by setting the RLIMIT_NOFILE for ourselves,
essentially disabling the rlimit cache.

Once Go 1.22 is no longer supported, we will remove the go:linkname hack.

(cherry picked from commit 584afc6756)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-05 12:51:15 -07:00
lfbzhm 14181f438e Merge pull request #4308 from kolyshkin/1.1-rm-cs8
[1.1] ci/cirrus: rm centos stream 8
2024-06-05 18:29:42 +08:00
Kir Kolyshkin fc7af59a6b ci/cirrus: rm centos stream 8
It is past EOL and has been removed from GCE public images.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 40bb9c468e)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-04 23:09:46 -07:00
Kir Kolyshkin a1610b56a4 Merge pull request #4305 from lifubang/backport-cs8eol
[1.1] ci: workaround for centos stream 8 being EOLed
2024-06-04 10:44:40 -07:00
Kir Kolyshkin 9629fd9554 ci: workaround for centos stream 8 being EOLed
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 48c4e733f4)
Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-06-04 18:21:52 +08:00
Kir Kolyshkin 20ef9762da Merge pull request #4300 from lifubang/backport-codespell-2.3.0
[1.1] Fix codespell warnings
2024-06-03 17:02:16 -07:00
Kir Kolyshkin 3b7fcf76ef ci: pin codespell
CI should not fail and require attention every time a new codespell
version is released.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit b24fc9d2c4)
Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-06-03 09:04:41 +08:00
Kir Kolyshkin f8f7defa85 Fix codespell warnings
./features.go:30: tru ==> through, true
...
./utils_linux.go:147: infront ==> in front

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 177c7d4f59)
Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-06-02 06:51:39 +08:00
lfbzhm a12f444afb Merge pull request #4284 from kolyshkin/1.1-fix-4094
[1.1] libct/cg/fs: fix setting rt_period vs rt_runtime
2024-05-24 13:30:19 +08:00
Kir Kolyshkin 860f05f307 libct/cg/fs: fix setting rt_period vs rt_runtime
The issue is the same as in commit 1b2adcf but for RT scheduler;
the fix is also the same.

Test case by ls-ggg.

Co-authored-by: ls-ggg <335814617@qq.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit b60079e2e59670b8babd653002d8f469064fb244)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-21 09:54:44 -07:00
Kir Kolyshkin 9244703011 Merge pull request #4277 from lifubang/backport-4265-nofilerlimit
[1.1] Fix set nofile rlimit error
2024-05-20 14:20:11 -07:00
Akihiro Suda 51dc972864 Merge pull request #4231 from kolyshkin/1.1-3349
[1.1] runc list: fix race with runc delete
2024-05-18 02:47:23 +09:00
lifubang c918058bb7 fix comments for ClearRlimitNofileCache
Signed-off-by: lifubang <lifubang@acmcoder.com>
(cherry picked from commit a35f7d8093)
Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-05-17 18:18:29 +08:00
lifubang 2992049dc3 update/add some tests for rlimit
issues:
https://github.com/opencontainers/runc/issues/4195
https://github.com/opencontainers/runc/pull/4265#discussion_r1588599809

Signed-off-by: lifubang <lifubang@acmcoder.com>
(cherry picked from commit 4ea0bf88fd)
Signed-off-by: lfbzhm <lifubang@acmcoder.com>
2024-05-17 18:18:29 +08:00
ls-ggg d7a29a3b33 libct: clean cached rlimit nofile in go runtime
As reported in issue #4195, the new version(since 1.19) of go runtime
will cache rlimit-nofile. Before executing execve, the rlimit-nofile
of the process will be restored with the cache. In runc, this will
cause the rlimit-nofile set by the parent process for the container
to become invalid. It can be solved by clearing the cache.

Signed-off-by: ls-ggg <335814617@qq.com>
(cherry picked from commit f9f8abf310)
Signed-off-by: lifubang <lifubang@acmcoder.com>
(cherry picked from commit da68c8e37b)
Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-05-17 18:18:29 +08:00
lfbzhm 42c2ab2b7c use go 1.18 in go.mod
The complete generic features are supported since go 1.18

Signed-off-by: lfbzhm <lifubang@acmcoder.com>
2024-05-17 18:18:23 +08:00
lifubang 83ecd11c29 runc exec: setupRlimits after syscall.rlimit.init() completed
Issue: https://github.com/opencontainers/runc/issues/4195
Since https://go-review.googlesource.com/c/go/+/476097, there is
a get/set race between runc exec and syscall.rlimit.init, so we
need to call setupRlimits after syscall.rlimit.init() completed.

Signed-off-by: lifubang <lifubang@acmcoder.com>
(cherry picked from commit a853a82677)
Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-05-16 21:48:34 +08:00
Kir Kolyshkin fbddb715ed libct: fix a comment
Do not refer to the function which was removed.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit bac506463d)
Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-05-16 21:48:34 +08:00
Kir Kolyshkin debf52aa5b deprecate libct.system.Execv
This is not used since commit dac41717.
It will be removed in v1.2.0

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit dbd0c3349f)
Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-05-16 21:47:26 +08:00
Kir Kolyshkin 986edbe60f list: use Info(), fix race with delete
Since commit 551629417 we can (and should) use Info() to get access to
file stat. Do this.

While going over directory entries, a parallel runc delete can remove
an entry, and with the current code it results in a fatal error (which
was not observed in practice, but looks quite possible). To fix,
add a special case to continue on ErrNotExist.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 1a3ee4966c)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-10 11:22:11 -07:00
Kir Kolyshkin 09214f21da list: getContainers: less indentation
Instead of a huge if {} block, use continue.

Best reviewed with --ignore-all-space.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 095929b15e)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-10 11:22:11 -07:00
Akihiro Suda 007abf31f8 Merge pull request #4270 from akhilerm/backport-1.1-4269
[1.1] allow overriding VERSION value in Makefile
2024-05-08 07:22:52 +09:00
Akhil Mohan 6f4d975c40 allow overriding VERSION value in Makefile
this allows using a custom version string while building runc
without modifying the VERSION file

Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
(cherry picked from commit 9d9273c926)
Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
2024-05-06 22:18:04 +05:30
Mrunal Patel e8bb71e147 Merge pull request #4257 from sohankunkerkar/release-1.1
[1.1] libcontainer: force apps to think fips is enabled/disabled for testing
2024-04-26 10:31:35 -07:00