Skip to content

Commit 5743205

Browse files
committed
investigate devicemapping failures
Signed-off-by: Arjun Raja Yogidas <[email protected]>
1 parent f4d4dcf commit 5743205

File tree

4 files changed

+33
-26
lines changed

4 files changed

+33
-26
lines changed

.github/workflows/test.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ jobs:
3333
- runner: ubuntu-24.04
3434
containerd: v2.0.2
3535
arch: amd64
36-
- runner: arm64-8core-32gb
37-
containerd: v2.0.2
38-
arch: arm64
36+
# - runner: arm64-8core-32gb
37+
# containerd: v2.0.2
38+
# arch: arm64
3939
env:
4040
CONTAINERD_VERSION: "${{ matrix.containerd }}"
4141
ARCH: "${{ matrix.arch }}"
@@ -108,18 +108,18 @@ jobs:
108108
containerd: v1.6.36
109109
runner: "ubuntu-20.04"
110110
arch: amd64
111-
- ubuntu: 22.04
112-
containerd: v1.7.25
113-
runner: "ubuntu-22.04"
114-
arch: amd64
111+
# - ubuntu: 22.04
112+
# containerd: v1.7.25
113+
# runner: "ubuntu-22.04"
114+
# arch: amd64
115115
- ubuntu: 24.04
116116
containerd: v2.0.2
117117
runner: "ubuntu-24.04"
118118
arch: amd64
119-
- ubuntu: 24.04
120-
containerd: v2.0.2
121-
runner: arm64-8core-32gb
122-
arch: arm64
119+
# - ubuntu: 24.04
120+
# containerd: v2.0.2
121+
# runner: arm64-8core-32gb
122+
# arch: arm64
123123
env:
124124
CONTAINERD_VERSION: "${{ matrix.containerd }}"
125125
ARCH: "${{ matrix.arch }}"
@@ -233,21 +233,21 @@ jobs:
233233
rootlesskit: v1.1.1 # Deprecated
234234
target: rootless
235235
arch: amd64
236-
- ubuntu: 22.04
237-
containerd: v1.7.25
238-
rootlesskit: v2.3.2
239-
target: rootless
240-
arch: amd64
241-
- ubuntu: 24.04
242-
containerd: v2.0.2
243-
rootlesskit: v2.3.2
244-
target: rootless
245-
arch: amd64
246-
- ubuntu: 24.04
247-
containerd: v1.7.25
248-
rootlesskit: v2.3.2
249-
target: rootless-port-slirp4netns
250-
arch: amd64
236+
# - ubuntu: 22.04
237+
# containerd: v1.7.25
238+
# rootlesskit: v2.3.2
239+
# target: rootless
240+
# arch: amd64
241+
# - ubuntu: 24.04
242+
# containerd: v2.0.2
243+
# rootlesskit: v2.3.2
244+
# target: rootless
245+
# arch: amd64
246+
# - ubuntu: 24.04
247+
# containerd: v1.7.25
248+
# rootlesskit: v2.3.2
249+
# target: rootless-port-slirp4netns
250+
# arch: amd64
251251
env:
252252
CONTAINERD_VERSION: "${{ matrix.containerd }}"
253253
ARCH: "${{ matrix.arch }}"

pkg/cmd/container/create.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ func Create(ctx context.Context, client *containerd.Client, args []string, netMa
118118
oci.WithDefaultSpec(),
119119
)
120120

121+
log.L.Infof("(TestContainerInspectDevices INFO) Calling setPlatformOptions with options.device = %v", options.Device)
122+
121123
platformOpts, err := setPlatformOptions(ctx, client, id, netManager.NetworkOptions().UTSNamespace, &internalLabels, options)
122124
if err != nil {
123125
return nil, generateRemoveStateDirFunc(ctx, id, internalLabels), err
@@ -772,7 +774,9 @@ func withInternalLabels(internalLabels internalLabels) (containerd.NewContainerO
772774
dnsSettings.DNSResolvConfOptions = internalLabels.dnsResolvConfOptions
773775
}
774776

777+
log.L.Infof("(TestContainerInspectDevices INFO) before len(internalLabels.deviceMapping) = %v", len(internalLabels.deviceMapping))
775778
if len(internalLabels.deviceMapping) > 0 {
779+
log.L.Warn("(TestContainerInspectDevices INFO) pulling deviceMapping from internal labels ")
776780
hostConfigLabel.Devices = append(hostConfigLabel.Devices, internalLabels.deviceMapping...)
777781
}
778782

pkg/cmd/container/run_cgroup_linux.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ func generateCgroupOpts(id string, options types.ContainerCreateOptions, interna
201201
return nil, fmt.Errorf("unknown cgroupns mode %q", options.Cgroupns)
202202
}
203203

204+
log.L.Info("(TestContainerInspectDevices INFO) before for loop")
204205
for _, f := range options.Device {
205206
devPath, conPath, mode, err := ParseDevice(f)
206207
if err != nil {
@@ -212,6 +213,7 @@ func generateCgroupOpts(id string, options types.ContainerCreateOptions, interna
212213
deviceMap.PathInContainer = conPath
213214
deviceMap.CgroupPermissions = mode
214215
internalLabels.deviceMapping = append(internalLabels.deviceMapping, deviceMap)
216+
log.L.Warnf("(TestContainerInspectDevices INFO) setting the device mapping info %v", deviceMap)
215217
}
216218

217219
return opts, nil

pkg/cmd/container/run_linux.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func setPlatformOptions(ctx context.Context, client *containerd.Client, id, uts
5656
{Type: "cgroup", Source: "cgroup", Destination: "/sys/fs/cgroup", Options: []string{"ro", "nosuid", "noexec", "nodev"}},
5757
}))
5858

59+
log.L.Infof("(TestContainerInspectDevices INFO) Calling generateCgroupOpts with options.device = %v", options.Device)
5960
cgOpts, err := generateCgroupOpts(id, options, internalLabels)
6061
if err != nil {
6162
return nil, err

0 commit comments

Comments
 (0)