Skip to content

Commit a3da160

Browse files
jlebondustymabe
authored andcommitted
jobs: run cosa push-container-manifest privileged
In a recent 4.16 z-stream release, a cri-o backport changed the default seccomp policy to by default block `clone(CLONE_NEW*)` syscalls: cri-o/cri-o#8514 This affects us in the FCOS pipeline which runs in a cluster that was recently updated. The `podman manifest` commands all AIUI also flow through the default path where it wants to enter a namespace if running rootless even though we don't strictly need root; we're not running containers, just creating manifest lists. Ideally podman would be less eager there. Anyway, work around this as necessary by running `cosa push-container-manifest` privileged. There are two general places where this command is used: in container image build jobs (e.g. `build-cosa`), and in the release job. In the former, just use one of the multi-arch builders to do this since we already have a session there. In the latter, just run it in supermin. This has some warts: we want to ideally keep uploading in parallel and while it'd be nice to parallelize *inside* the supermin VM, the tooling doesn't make that easy. Instead, we run multiple supermin VMs in parallel which means bumping the resource request.
1 parent 3e3b637 commit a3da160

File tree

4 files changed

+39
-22
lines changed

4 files changed

+39
-22
lines changed

jobs/build-cosa.Jenkinsfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,16 @@ lock(resource: "build-${containername}") {
134134
def arch = architecture
135135
images += " --image=docker://${params.CONTAINER_REGISTRY_STAGING_REPO}:${arch}-${shortcommit}"
136136
}
137-
shwrap("""
138-
export STORAGE_DRIVER=vfs # https://github.com/coreos/fedora-coreos-pipeline/issues/723#issuecomment-1297668507
139-
cosa push-container-manifest --v2s2 \
140-
--auth=\$REGISTRY_SECRET --tag ${gitref} \
141-
--repo ${params.CONTAINER_REGISTRY_REPO} ${images}
142-
""")
137+
// arbitrarily selecting the x86_64 builder; we don't run this
138+
// locally because podman wants user namespacing (yes, even just
139+
// to push a manifest...)
140+
pipeutils.withPodmanRemoteArchBuilder(arch: "x86_64") {
141+
shwrap("""
142+
cosa push-container-manifest --v2s2 \
143+
--auth=\$REGISTRY_SECRET --tag ${gitref} \
144+
--repo ${params.CONTAINER_REGISTRY_REPO} ${images}
145+
""")
146+
}
143147
// Specifically for the `main` branch let's also update the `latest` tag
144148
// If there was a way to alias/tie these two together in the Quay UI
145149
// that would be preferable.

jobs/build-fcos-buildroot.Jenkinsfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,16 @@ lock(resource: "build-${containername}") {
146146
def arch = architecture
147147
images += " --image=docker://${params.CONTAINER_REGISTRY_STAGING_REPO}:${arch}-${shortcommit}"
148148
}
149-
shwrap("""
150-
export STORAGE_DRIVER=vfs # https://github.com/coreos/fedora-coreos-pipeline/issues/723#issuecomment-1297668507
151-
cosa push-container-manifest \
152-
--auth=\$REGISTRY_SECRET --tag ${gitref} \
153-
--repo ${params.CONTAINER_REGISTRY_REPO} ${images}
154-
""")
149+
// arbitrarily selecting the x86_64 builder; we don't run this
150+
// locally because podman wants user namespacing (yes, even just
151+
// to push a manifest...)
152+
pipeutils.withPodmanRemoteArchBuilder(arch: "x86_64") {
153+
shwrap("""
154+
cosa push-container-manifest \
155+
--auth=\$REGISTRY_SECRET --tag ${gitref} \
156+
--repo ${params.CONTAINER_REGISTRY_REPO} ${images}
157+
""")
158+
}
155159
}
156160

157161
stage('Delete Intermediate Tags') {

jobs/build-kola-containers.Jenkinsfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,16 @@ lock(resource: "build-kola-containers") {
186186
images += " --image=docker://${params.CONTAINER_REGISTRY_STAGING_REPO}:${imageName}-${arch}-${shortcommit}"
187187
}
188188

189-
shwrap("""
190-
export STORAGE_DRIVER=vfs # https://github.com/coreos/fedora-coreos-pipeline/issues/723#issuecomment-1297668507
191-
cosa push-container-manifest --v2s2 \
192-
--auth=\$REGISTRY_SECRET --tag latest \
193-
--repo ${params.CONTAINER_REGISTRY_ORG}/${imageName} ${images}
194-
""")
189+
// arbitrarily selecting the x86_64 builder; we don't run this
190+
// locally because podman wants user namespacing (yes, even just
191+
// to push a manifest...)
192+
pipeutils.withPodmanRemoteArchBuilder(arch: "x86_64") {
193+
shwrap("""
194+
cosa push-container-manifest --v2s2 \
195+
--auth=\$REGISTRY_SECRET --tag latest \
196+
--repo ${params.CONTAINER_REGISTRY_ORG}/${imageName} ${images}
197+
""")
198+
}
195199
}
196200
}
197201

jobs/release.Jenkinsfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,12 @@ def locks = basearches.collect{[resource: "release-${params.VERSION}-${it}"]}
8888
lock(resource: "release-${params.STREAM}", extra: locks) {
8989
// We should probably try to change this behavior in the coreos-ci-lib
9090
// So we won't need to handle the secret case here.
91-
def cosaPodDefinition = [cpu: "1", memory: "1Gi", image: cosa_img,
91+
// Request 4.5Gi: in the worst case, we need to upload 4 container images in
92+
// parallel via supermin and each VM is 1G.
93+
def cosaPodDefinition = [cpu: "1", memory: "4608Mi", image: cosa_img,
9294
serviceAccount: "jenkins"]
9395
if (brew_profile) {
94-
cosaPodDefinition = [cpu: "1", memory: "1Gi", image: cosa_img,
96+
cosaPodDefinition = [cpu: "1", memory: "4608Mi", image: cosa_img,
9597
serviceAccount: "jenkins",
9698
secrets: ["brew-keytab", "brew-ca:ca.crt:/etc/pki/ca.crt",
9799
"koji-conf:koji.conf:/etc/koji.conf",
@@ -263,11 +265,14 @@ lock(resource: "release-${params.STREAM}", extra: locks) {
263265
def tag_args = registry_repos[configname].tags.collect{"--tag=$it"}
264266
def v2s2_arg = registry_repos.v2s2 ? "--v2s2" : ""
265267
shwrap("""
266-
export STORAGE_DRIVER=vfs # https://github.com/coreos/fedora-coreos-pipeline/issues/723#issuecomment-1297668507
267-
cosa push-container-manifest --auth=\${REGISTRY_SECRET} \
268+
export COSA_SUPERMIN_MEMORY=1024 # this really shouldn't require much RAM
269+
cp \${REGISTRY_SECRET} tmp/push-secret-${metajsonname}
270+
cosa supermin-run /usr/lib/coreos-assembler/cmd-push-container-manifest \
271+
--auth=tmp/push-secret-${metajsonname} \
268272
--repo=${repo} ${tag_args.join(' ')} \
269273
--artifact=${artifact} --metajsonname=${metajsonname} \
270274
--build=${params.VERSION} ${v2s2_arg}
275+
rm tmp/push-secret-${metajsonname}
271276
""")
272277
}
273278
}]}

0 commit comments

Comments
 (0)