Skip to content

Commit cace7b1

Browse files
committed
cri-o: upgrade to 1.16.3
This involves: - Separating out the conmon build (following the upstream change) and giving it its own bazel build file patch. - Removing the conmon tests since they require additional build dependencies that we don't need. - Regenerating the CRI-O build file patch. - Updating the CRI-O upstream config file. - Updating deps.bzl.
1 parent 475b6bc commit cace7b1

File tree

6 files changed

+216
-118
lines changed

6 files changed

+216
-118
lines changed

platform/cri-o/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ homeworld_deb(
1010
name = "package",
1111
bin = {
1212
"@com_github_cri_o_cri_o//cmd/crio": "/usr/bin/crio",
13-
"@com_github_cri_o_cri_o//conmon": "/usr/libexec/crio/conmon",
13+
"@com_github_containers_conmon//:conmon": "/usr/libexec/crio/conmon",
1414
},
1515
data = {
1616
":crio.conf": "/etc/crio/crio.conf",

platform/cri-o/build.patch

+36-82
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
diff --git a/BUILD.bazel b/BUILD.bazel
22
new file mode 100644
3-
index 0000000..bf0a685
3+
index 000000000..a79f430ae
44
--- /dev/null
55
+++ b/BUILD.bazel
66
@@ -0,0 +1,15 @@
@@ -19,68 +19,8 @@ index 0000000..bf0a685
1919
+ cmd = "\"$(location //cmd/crio)\" --root=\"/nonexistent\" --runroot \"/nonexistent\" --storage-driver=\"\" --config=\"\" config >\"$@\"",
2020
+ visibility = ["//visibility:public"],
2121
+)
22-
diff --git a/conmon/BUILD.bazel b/conmon/BUILD.bazel
23-
new file mode 100644
24-
index 0000000..9b97598
25-
--- /dev/null
26-
+++ b/conmon/BUILD.bazel
27-
@@ -0,0 +1,46 @@
28-
+# TODO: include -std=c99 in C builds
29-
+
30-
+genrule(
31-
+ name = "config.h-genrule",
32-
+ outs = [":conf/config.h"],
33-
+ tools = ["//cmd/crio-config"],
34-
+ cmd = """
35-
+ REL="$$(realpath "$(location //cmd/crio-config)")"
36-
+ cd \"$(@D)\"
37-
+ "$${REL}"
38-
+ """,
39-
+)
40-
+
41-
+cc_library(
42-
+ name = "glibinc",
43-
+ hdrs = [":glibobject-include/glibconfig.h"],
44-
+ includes = ["glibobject-include"],
45-
+ linkopts = ["-lglib-2.0"],
46-
+)
47-
+
48-
+cc_library(
49-
+ name = "configinc",
50-
+ hdrs = [":conf/config.h"],
51-
+ includes = ["conf"],
52-
+)
53-
+
54-
+cc_binary(
55-
+ name = "conmon",
56-
+ srcs = [
57-
+ ":conmon.c",
58-
+ ":cmsg.c",
59-
+ ":cmsg.h",
60-
+ ":utils.c",
61-
+ ":utils.h",
62-
+ ":ctr_logging.c",
63-
+ ":ctr_logging.h",
64-
+ ],
65-
+ # TODO: get these dynamically, not statically
66-
+ defines = [
67-
+ "VERSION='\"1.10.7-dev\"'",
68-
+ "GIT_COMMIT='\"210d46c717c5dcb6d11302723eb9d20575ee7a78\"'",
69-
+ ],
70-
+ deps = [":glibinc", ":configinc"],
71-
+ copts = ["-I/usr/include/glib-2.0"],
72-
+ visibility = ["//visibility:public"],
73-
+)
74-
diff --git a/conmon/glibobject-include b/conmon/glibobject-include
75-
new file mode 120000
76-
index 0000000..3638b19
77-
--- /dev/null
78-
+++ b/conmon/glibobject-include
79-
@@ -0,0 +1 @@
80-
+/usr/lib/x86_64-linux-gnu/glib-2.0/include
81-
\ No newline at end of file
8222
diff --git a/vendor/github.com/containers/storage/pkg/devicemapper/BUILD.bazel b/vendor/github.com/containers/storage/pkg/devicemapper/BUILD.bazel
83-
index bd64ed0..a12b9f5 100644
23+
index c8f3bf6be..495ea30a4 100644
8424
--- a/vendor/github.com/containers/storage/pkg/devicemapper/BUILD.bazel
8525
+++ b/vendor/github.com/containers/storage/pkg/devicemapper/BUILD.bazel
8626
@@ -12,6 +12,7 @@ go_library(
@@ -92,7 +32,7 @@ index bd64ed0..a12b9f5 100644
9232
importpath = "github.com/containers/storage/pkg/devicemapper",
9333
visibility = ["//visibility:public"],
9434
diff --git a/vendor/github.com/seccomp/libseccomp-golang/BUILD.bazel b/vendor/github.com/seccomp/libseccomp-golang/BUILD.bazel
95-
index 3a0a989..9e0efbe 100644
35+
index 6cd7977bd..c51281f0d 100644
9636
--- a/vendor/github.com/seccomp/libseccomp-golang/BUILD.bazel
9737
+++ b/vendor/github.com/seccomp/libseccomp-golang/BUILD.bazel
9838
@@ -7,6 +7,7 @@ go_library(
@@ -103,20 +43,37 @@ index 3a0a989..9e0efbe 100644
10343
importmap = "github.com/cri-o/cri-o/vendor/github.com/seccomp/libseccomp-golang",
10444
importpath = "github.com/seccomp/libseccomp-golang",
10545
visibility = ["//visibility:public"],
106-
--- a/vendor/k8s.io/apimachinery/pkg/util/sets/BUILD 2019-09-29 15:55:01.213000000 -0400
107-
+++ b/vendor/k8s.io/apimachinery/pkg/util/sets/BUILD 2019-09-29 15:36:54.915000000 -0400
46+
diff --git a/vendor/golang.org/x/crypto/ed25519/BUILD.bazel b/vendor/golang.org/x/crypto/ed25519/BUILD.bazel
47+
index 36055b042..1e3c1c9a5 100644
48+
--- a/vendor/golang.org/x/crypto/ed25519/BUILD.bazel
49+
+++ b/vendor/golang.org/x/crypto/ed25519/BUILD.bazel
50+
@@ -2,10 +2,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
51+
52+
go_library(
53+
name = "go_default_library",
54+
- srcs = [
55+
- "ed25519.go",
56+
- "ed25519_go113.go",
57+
- ],
58+
+ srcs = ["ed25519.go"],
59+
importmap = "github.com/cri-o/cri-o/vendor/golang.org/x/crypto/ed25519",
60+
importpath = "golang.org/x/crypto/ed25519",
61+
visibility = ["//visibility:public"],
62+
diff --git a/vendor/k8s.io/apimachinery/pkg/util/sets/BUILD b/vendor/k8s.io/apimachinery/pkg/util/sets/BUILD
63+
index 4d61ac5ba..784db97c9 100644
64+
--- a/vendor/k8s.io/apimachinery/pkg/util/sets/BUILD
65+
+++ b/vendor/k8s.io/apimachinery/pkg/util/sets/BUILD
10866
@@ -1,6 +1,5 @@
10967
package(default_visibility = ["//visibility:public"])
11068

11169
-load("@io_k8s_repo_infra//defs:go.bzl", "go_genrule")
11270
load(
11371
"@io_bazel_rules_go//go:def.bzl",
11472
"go_library",
115-
@@ -19,35 +13,6 @@
116-
importmap = "github.com/cri-o/cri-o/vendor/k8s.io/apimachinery/pkg/util/sets",
73+
@@ -21,35 +20,6 @@ go_library(
11774
importpath = "k8s.io/apimachinery/pkg/util/sets",
11875
)
119-
-
76+
12077
-# This rule makes all sorts of terrible assumptions that it's running inside k8s.io/kubernetes, even though it's part of k8s.io/apimachinery. :\
12178
-go_genrule(
12279
- name = "set-gen",
@@ -145,22 +102,19 @@ index 3a0a989..9e0efbe 100644
145102
- "//vendor/k8s.io/code-generator/cmd/set-gen",
146103
- ],
147104
-)
148-
105+
-
149106
filegroup(
150107
name = "package-srcs",
151-
--- a/vendor/golang.org/x/crypto/ed25519/BUILD.bazel 2019-09-29 15:57:46.980000000 -0400
152-
+++ b/vendor/golang.org/x/crypto/ed25519/BUILD.bazel 2019-09-29 15:36:54.862000000 -0400
153-
@@ -2,12 +2,9 @@
108+
srcs = glob(["**"]),
109+
diff --git a/vendor/k8s.io/component-base/metrics/BUILD b/vendor/k8s.io/component-base/metrics/BUILD
110+
index 06398d377..9feb27b0c 100644
111+
--- a/vendor/k8s.io/component-base/metrics/BUILD
112+
+++ b/vendor/k8s.io/component-base/metrics/BUILD
113+
@@ -4,7 +4,6 @@ load(
114+
"@io_bazel_rules_go//go:def.bzl",
115+
"go_library",
116+
)
117+
-load("//staging/src/k8s.io/component-base/version:def.bzl", "version_x_defs")
154118

155119
go_library(
156120
name = "go_default_library",
157-
- srcs = [
158-
- "ed25519.go",
159-
- "ed25519_go113.go",
160-
- ],
161-
+ srcs = ["ed25519.go"],
162-
importmap = "github.com/cri-o/cri-o/vendor/golang.org/x/crypto/ed25519",
163-
importpath = "golang.org/x/crypto/ed25519",
164-
visibility = ["//visibility:public"],
165-
deps = ["//vendor/golang.org/x/crypto/ed25519/internal/edwards25519:go_default_library"],
166-
)

platform/cri-o/conmon.patch

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
diff --git a/BUILD.bazel b/BUILD.bazel
2+
new file mode 100644
3+
index 0000000..94a1f5c
4+
--- /dev/null
5+
+++ b/BUILD.bazel
6+
@@ -0,0 +1,24 @@
7+
+# TODO: include -std=c99 in C builds
8+
+
9+
+cc_library(
10+
+ name = "glibinc",
11+
+ hdrs = [":glibobject-include/glibconfig.h"],
12+
+ includes = ["glibobject-include"],
13+
+ linkopts = ["-lglib-2.0"],
14+
+)
15+
+
16+
+cc_binary(
17+
+ name = "conmon",
18+
+ srcs = glob([
19+
+ "src/*.c",
20+
+ "src/*.h",
21+
+ ]),
22+
+ # TODO: get these dynamically, not statically
23+
+ defines = [
24+
+ "VERSION='\"2.0.16-dev\"'",
25+
+ "GIT_COMMIT='\"e34c6d60f06d48d293e747d2b59e601137e650dd\"'",
26+
+ ],
27+
+ deps = [":glibinc"],
28+
+ copts = ["-I/usr/include/glib-2.0"],
29+
+ visibility = ["//visibility:public"],
30+
+)
31+
diff --git a/glibobject-include b/glibobject-include
32+
new file mode 120000
33+
index 0000000..3638b19
34+
--- /dev/null
35+
+++ b/glibobject-include
36+
@@ -0,0 +1 @@
37+
+/usr/lib/x86_64-linux-gnu/glib-2.0/include
38+
\ No newline at end of file

platform/cri-o/crio.conf.in

100755100644
+63-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# The CRI-O configuration file specifies all of the available configuration
32
# options and command-line flags for the crio(8) OCI Kubernetes Container Runtime
43
# daemon, but in a TOML format that can be more easily modified and versioned.
@@ -32,21 +31,22 @@ storage_driver = ""
3231
storage_option = [
3332
]
3433

35-
# If set to false, in-memory locking will be used instead of file-based locking.
36-
# **Deprecated** this option will be removed in the future.
37-
file_locking = false
38-
39-
# Path to the lock file.
40-
# **Deprecated** this option will be removed in the future.
41-
file_locking_path = "/run/crio.lock"
34+
# The default log directory where all logs will go unless directly specified by
35+
# the kubelet. The log directory specified must be an absolute directory.
36+
log_dir = "/var/log/crio/pods"
4237

38+
# Location for CRI-O to lay down the version file
39+
version_file = "/var/lib/crio/version"
4340

4441
# The crio.api table contains settings for the kubelet/gRPC interface.
4542
[crio.api]
4643

4744
# Path to AF_LOCAL socket on which CRI-O will listen.
4845
listen = "/var/run/crio/crio.sock"
4946

47+
# Host IP considered as the primary IP to use by CRI-O for things such as host network IP.
48+
host_ip = ""
49+
5050
# IP address on which the stream server will listen.
5151
stream_address = "127.0.0.1"
5252

@@ -62,11 +62,11 @@ stream_enable_tls = false
6262
stream_tls_cert = ""
6363

6464
# Path to the key file used to serve the encrypted stream. This file can
65-
# change, and CRI-O will automatically pick up the changes within 5 minutes.
65+
# change and CRI-O will automatically pick up the changes within 5 minutes.
6666
stream_tls_key = ""
6767

6868
# Path to the x509 CA(s) file used to verify and authenticate client
69-
# communication with the encrypted stream. This file can change, and CRI-O will
69+
# communication with the encrypted stream. This file can change and CRI-O will
7070
# automatically pick up the changes within 5 minutes.
7171
stream_tls_ca = ""
7272

@@ -95,6 +95,7 @@ default_runtime = "runc"
9595
no_pivot = false
9696

9797
# Path to the conmon binary, used for monitoring the OCI runtime.
98+
# Will be searched for using $PATH if empty.
9899
conmon = "/usr/libexec/crio/conmon"
99100

100101
# Cgroup setting for conmon
@@ -116,7 +117,7 @@ seccomp_profile = ""
116117

117118
# Used to change the name of the default AppArmor profile of CRI-O. The default
118119
# profile name is "crio-default-" followed by the version string of CRI-O.
119-
apparmor_profile = "crio-default-1.15.2"
120+
apparmor_profile = "crio-default-1.16.3"
120121

121122
# Cgroup management implementation used for the runtime.
122123
cgroup_manager = "cgroupfs"
@@ -192,6 +193,9 @@ container_exits_dir = "/var/run/crio/exits"
192193
# Path to directory for container attach sockets.
193194
container_attach_socket_dir = "/var/run/crio"
194195

196+
# The prefix to use for the source of the bind mounts.
197+
bind_mount_prefix = ""
198+
195199
# If set to true, all containers will run in read-only mode.
196200
read_only = false
197201

@@ -200,9 +204,6 @@ read_only = false
200204
# configuration reload.
201205
log_level = "error"
202206

203-
# The default log directory where all logs will go unless directly specified by the kubelet
204-
log_dir = "/var/log/crio/pods"
205-
206207
# The UID mappings for the user namespace of each container. A range is
207208
# specified in the form containerUID:HostUID:Size. Multiple ranges must be
208209
# separated by comma.
@@ -224,14 +225,44 @@ manage_network_ns_lifecycle = false
224225
# The "crio.runtime.runtimes" table defines a list of OCI compatible runtimes.
225226
# The runtime to use is picked based on the runtime_handler provided by the CRI.
226227
# If no runtime_handler is provided, the runtime will be picked based on the level
227-
# of trust of the workload.
228+
# of trust of the workload. Each entry in the table should follow the format:
229+
#
230+
#[crio.runtime.runtimes.runtime-handler]
231+
# runtime_path = "/path/to/the/executable"
232+
# runtime_type = "oci"
233+
# runtime_root = "/path/to/the/root"
234+
#
235+
# Where:
236+
# - runtime-handler: name used to identify the runtime
237+
# - runtime_path (optional, string): absolute path to the runtime executable in
238+
# the host filesystem. If omitted, the runtime-handler identifier should match
239+
# the runtime executable name, and the runtime executable should be placed
240+
# in $PATH.
241+
# - runtime_type (optional, string): type of runtime, one of: "oci", "vm". If
242+
# omitted, an "oci" runtime is assumed.
243+
# - runtime_root (optional, string): root directory for storage of containers
244+
# state.
245+
228246

229247
[crio.runtime.runtimes.runc]
230248
runtime_path = "/usr/bin/runc"
231249
runtime_type = "oci"
232250
runtime_root = "/run/runc"
233251

234252

253+
# Kata Containers is an OCI runtime, where containers are run inside lightweight
254+
# VMs. Kata provides additional isolation towards the host, minimizing the host attack
255+
# surface and mitigating the consequences of containers breakout.
256+
257+
# Kata Containers with the default configured VMM
258+
#[crio.runtime.runtimes.kata-runtime]
259+
260+
# Kata Containers with the QEMU VMM
261+
#[crio.runtime.runtimes.kata-qemu]
262+
263+
# Kata Containers with the Firecracker VMM
264+
#[crio.runtime.runtimes.kata-fc]
265+
235266
# The crio.image table contains settings pertaining to the management of OCI images.
236267
#
237268
# CRI-O reads its configured registries defaults from the system wide
@@ -258,7 +289,9 @@ pause_image = "homeworld.private/pause@{PAUSE_DIGEST}"
258289
pause_image_auth_file = ""
259290

260291
# The command to run to have a container stay in the paused state.
261-
# This option supports live configuration reload.
292+
# When explicitly set to "", it will fallback to the entrypoint and command
293+
# specified in the pause image. When commented out, it will fallback to the
294+
# default: "/pause". This option supports live configuration reload.
262295
pause_command = "/pause"
263296

264297
# Path to the file which decides what sort of policy we use when deciding
@@ -268,6 +301,11 @@ pause_command = "/pause"
268301
# refer to containers-policy.json(5) for more details.
269302
signature_policy = ""
270303

304+
# List of registries to skip TLS verification for pulling images. Please
305+
# consider configuring the registries via /etc/containers/registries.conf before
306+
# changing them here.
307+
#insecure_registries = "[]"
308+
271309
# Controls how image volumes are handled. The valid values are mkdir, bind and
272310
# ignore; the latter will ignore volumes entirely.
273311
image_volumes = "mkdir"
@@ -292,3 +330,12 @@ network_dir = "/etc/cni/net.d/"
292330
plugin_dirs = [
293331
"/opt/cni/bin/",
294332
]
333+
334+
# A necessary configuration for Prometheus based metrics retrieval
335+
[crio.metrics]
336+
337+
# Globally enable or disable metrics support.
338+
enable_metrics = false
339+
340+
# The port on which the metrics server will listen.
341+
metrics_port = 9090

0 commit comments

Comments
 (0)