Commit Graph

7095 Commits

Author SHA1 Message Date
Kir Kolyshkin 5c5ebe772b tests/int/scheduler: require smp
This test case fails when there's a single CPU. Fix this by adding
"require smp".

While at it, document the test case and add a FIXME to maybe remove
this test later.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-02 11:02:40 -07:00
Kir Kolyshkin b24fc9d2c4 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>
2024-06-02 10:51:43 -07:00
lfbzhm 854c4af3ba Merge pull request #4290 from kolyshkin/rlimit-rework
Rlimit cache rework for Go 1.23+
2024-06-02 06:03:44 +08:00
Kir Kolyshkin 584afc6756 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.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-01 13:02:29 -07:00
Akihiro Suda ba4b52d372 Merge pull request #4295 from kolyshkin/fix-setv1-panic
libct/cg/dev: fix TestSetV1Allow panic
2024-06-02 02:13:36 +09:00
Akihiro Suda 94d255bca4 Merge pull request #4296 from kolyshkin/bookworm
Dockerfile: bump Debian to 12, Go to 1.21
2024-06-02 02:12:48 +09:00
Kir Kolyshkin b74b33c439 Dockerfile: bump Debian to 12, Go to 1.21
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-30 11:23:03 -07:00
Kir Kolyshkin d697725a4d libct/cg/dev: fix TestSetV1Allow panic
This test panics if userns is detected (such as when run in a rootless
docker container) because SetV1 does nothing in this case.

We could fix the panic, but it doesn't make sense to run the test at
all.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-30 11:18:01 -07:00
Akihiro Suda 1aeefd9cbd Merge pull request #4291 from kolyshkin/codespell-2.3.0
Fix codespell warnings
2024-05-25 02:10:32 +09:00
Kir Kolyshkin 177c7d4f59 Fix codespell warnings
./features.go:30: tru ==> through, true
...
./utils_linux.go:147: infront ==> in front

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-23 22:02:45 -07:00
Akihiro Suda 68564eecde Merge pull request #4258 from kolyshkin/fix-4094
libct/cg/fs: fix setting rt_period vs rt_runtime
2024-05-21 11:21:53 +09:00
Akihiro Suda 492dc558cd Merge pull request #4276 from kolyshkin/arm-cpt-test-fixes
fix checkpoint/restore tests on actuated-arm64
2024-05-20 10:09:11 +09:00
Akihiro Suda 3d07cbc9a1 Merge pull request #4282 from lifubang/fix-comment-ClearRlimitNofileCache
Add a correct GoDoc format comment for ClearRlimitNofileCache
2024-05-16 22:16:53 +09:00
lifubang a35f7d8093 fix comments for ClearRlimitNofileCache
Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-05-16 20:34:43 +08:00
Sebastiaan van Stijn 4e8cf2793a Merge pull request #4280 from austinvazquez/vendor-x-net-0.24.0
vendor: golang.org/x/net@v0.24.0
2024-05-16 09:38:29 +02:00
Austin Vazquez 6ab3d8ad1e vendor: golang.org/x/net@v0.24.0
This change vendors golang.org/x/net@v0.24.0 to silence security
warnings for https://pkg.go.dev/vuln/GO-2024-2687.

runc takes a dependency on net/bpf only and would not be impacted by the
HTTP2 vulnerability reported.

Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-05-14 13:16:18 +00:00
lfbzhm 9d02c20df7 Merge pull request #4279 from kolyshkin/rm-fixme
.cirrus.yml: rm FIXME from rootless fs on CentOS 7
2024-05-14 17:57:55 +08:00
Kir Kolyshkin f805206611 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>
2024-05-13 17:47:39 -07:00
Kir Kolyshkin e5e8f33695 .cirrus.yml: rm FIXME from rootless fs on CentOS 7
I tried to fix it, but it looks like older CentOS 7 kernel is the
ultimate reason why it doesn't work.

So, remove FIXME and add some explanation.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-13 17:47:17 -07:00
Kir Kolyshkin 36be6d0510 libct/int: checkpoint test: skip pre-dump if not avail
Since we're now testing on ARM, the test case fails when trying to do
pre-dump since MemTrack is not available.

Skip the pre-dump part if so.

This also reverts part of commit 3f4a73d6 as it is no longer needed
(now, instead of skipping the whole test, we're just skipping the
pre-dump).

[Review with --ignore-all-space]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-10 11:04:58 -07:00
Kir Kolyshkin e42d981d67 libct/int: rm double logging in checkpoint_test
Since commit c77aaa3f the tail of criu log is printed by runc, so
there's no need to do the same thing in tests.

This also fixes a test failure on ARM where showLog fails (because
there's no log file) and thus the conditional t.Skip is not called.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-09 15:18:29 -07:00
Kir Kolyshkin 62a314656a libct/int/cpt: simplify test pre-check
criu check --feature userns also tests for the /proc/self/ns/user
presense, so remove the redundant check, and simplify the error message.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-09 15:18:29 -07:00
Kir Kolyshkin e676dac523 libct/criu: simplify checkCriuFeatures
Since criu 2.12, rpcOpts is not needed when checking criu features.
As we requires criu >= 3.0 in Checkpoint, we can remove rpcOpts.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-09 15:18:29 -07:00
Kir Kolyshkin f6a8c9b816 libct: checkCriuFeatures: return underlying error
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-09 15:18:29 -07:00
Akihiro Suda e8bec1ba40 Merge pull request #4265 from lifubang/fix-set-RLIMIT_NOFILE-race
Fix set nofile rlimit error
2024-05-09 09:44:53 +09:00
lifubang 4ea0bf88fd 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>
2024-05-08 10:57:10 +00:00
ls-ggg da68c8e37b 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>
2024-05-08 10:40:13 +00:00
lifubang a853a82677 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>
2024-05-08 10:40:07 +00:00
Aleksa Sarai 151f480cc0 merge #4268 into opencontainers/runc:main
Kir Kolyshkin (2):
  libct: fix a comment
  libct/system: rm Execv

LGTMs: AkihiroSuda cyphar
2024-05-08 16:34:13 +10:00
lfbzhm 6cf790cc94 Merge pull request #4275 from kolyshkin/bump-golangci-lint-action
ci/gha: bump golangci-lint-action from 5 to 6
2024-05-08 12:56:32 +08:00
Kir Kolyshkin f452f667c0 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>
2024-05-07 14:26:41 -07:00
Kir Kolyshkin bac506463d libct: fix a comment
Do not refer to the function which was removed.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-07 14:10:16 -07:00
Kir Kolyshkin dbd0c3349f libct/system: rm Execv
This is not used since commit dac41717.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-05-07 14:09:22 -07:00
lfbzhm 83ea9e5f62 Merge pull request #4251 from kolyshkin/test-cr
tests/int/checkpoint: rm double logging
2024-05-07 23:07:34 +08:00
Aleksa Sarai 0d37745e61 merge #4269 into opencontainers/runc:main
Akhil Mohan (1):
  allow overriding VERSION value in Makefile

LGTMs: AkihiroSuda cyphar
2024-05-07 02:32:43 +10:00
Akhil Mohan 9d9273c926 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>
2024-05-05 16:52:37 +05:30
Akihiro Suda 7a017af5e4 Merge pull request #4264 from lifubang/upgrade-spec.bat
[ci] use go mod instead of go get in spec.bats
2024-04-30 15:12:27 +09:00
lifubang 75e02193c2 use go mod instead of go get in spec.bats
Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-04-30 05:20:54 +00:00
Akihiro Suda 03db4d633d Merge pull request #4259 from kolyshkin/fix-cpu-burst
libct/cg/fs: don't write cpu_burst twice on ENOENT
2024-04-27 12:22:24 +09:00
Akihiro Suda 488c077bcc Merge pull request #4260 from kolyshkin/tty-timeout
tests/int/tty: increase the timeout
2024-04-27 04:46:41 +09:00
lfbzhm c9f624eafe Merge pull request #4255 from kolyshkin/golangci-lint-action
ci/gha: bump golangci-lint[-action]
2024-04-26 22:04:57 +08:00
Kir Kolyshkin b032fead22 libct/cg/fs: don't write cpu_burst twice on ENOENT
If CPU burst knob is non-existent, the current implementation (added in
commit e1584831) still tries to set it again after setting the new CPU
quota, which is useless (and we have to ignore ENOENT again).

Fix this.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-04-25 18:27:28 -07:00
lfbzhm 426c04b6db Merge pull request #4248 from kolyshkin/mv-dev
libct: decouple libct/cg/devices
2024-04-26 09:18:52 +08:00
Kir Kolyshkin 6bf1d3adbe tests/int/tty: increase the timeout
Earlier, commit fce8dd4d already increased this timeout from 1 to 5 seconds.
Yet, I just saw this timeout being hit in actuated-arm CI.

Increase the timeout again, this time from 5 to 50 (100 * 0.5) seconds.

Also, use wait_pids_gone, and improve some comments.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-04-25 18:17:37 -07:00
lfbzhm 57d01a791d Merge pull request #4256 from kolyshkin/f39
Vagrantfile.fedora: bump Fedora to 39
2024-04-26 08:44:36 +08:00
Kir Kolyshkin 8732eada62 Vagrantfile.fedora: bump Fedora to 39
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-04-25 10:49:02 -07:00
Kir Kolyshkin d63018c252 ci/gha: bump golangci-lint to v1.57
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-04-25 08:39:26 -07:00
Kir Kolyshkin 0eb8bb5f66 Format sources with gofumpt v0.6
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-04-25 08:39:26 -07:00
Kir Kolyshkin 6bcc736122 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>
2024-04-25 08:25:02 -07:00
lfbzhm e74ff0f4c1 Merge pull request #4252 from kolyshkin/test-actuated-cr
ci/actuated: re-enable CRIU tests
2024-04-25 11:39:00 +08:00