Commit Graph

194 Commits

Author SHA1 Message Date
Nalin Dahyabhai 27c40b3dbe Reap stray processes
run: after we've picked up the exit status of the "main" process that
we're running, reap anything that was reparented to us before returning.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-08-01 13:30:47 -04:00
flouthoc af210ea877
buildah: move passwd command to tests
https://github.com/containers/buildah/issues/6182

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2025-07-09 06:31:04 -07:00
Rahil Bhimjiani 7a482acebc
Remove BUILDTAG btrfs_noversion as no longer effective
https://github.com/containers/storage/pull/2308

Signed-off-by: Rahil Bhimjiani <me@rahil.rocks>
2025-07-07 19:30:09 +05:30
Nalin Dahyabhai df36bb835a commit: exclude parents of mount targets, too
When RUN requires us to create the target for a mountpoint, make note of
it and any parent directories that needed to be created, and filter them
out when generating a layer diff or --output data.

The exceptions will be directories that the conformance tests confirm
that BuildKit also leaves behind, though for compatibility with the
classic builder, we have to make that conditional.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-06-20 11:19:27 -04:00
Paul Holzinger e5b876571b
Makefile: use libsqlite3 build when possible
Dynamically link sqlite3 when installed, the main motivation is that we
reduce the podman binary size with that. I see about 3.2 MB savings.

But also dynamically linking it means if there a vulnerabilities only
the sqlite3 distro package needs updating and we don't have to make a
new podman release with the vendored update.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-11 10:31:53 +02:00
Paul Holzinger 56cfd2fdfc
remove static nix build
It is no longer working and no maintainer is using it.

Fixes: #6086

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-05-30 18:53:28 +02:00
Nalin Dahyabhai 4ea64c3871 Add a dummy "runtime" that just dumps its config file
Add a dummy "runtime" that just dumps its runtime config, either the
entirety of it, or a section of it corresponding to each command line
argument.  Tests can use it to ensure that we set the right thing in the
configuration without also depending on the runtime to do as its asked,
which isn't always something we have control over.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-05-29 14:17:37 -04:00
renovate[bot] d2e334df97
chore(deps): update dependency golangci/golangci-lint to v2.1.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-12 18:13:55 +00:00
Kir Kolyshkin d9978eb2fa ci: add golangci-lint run with --tests=false
This helps to find out code which is unused except in its own self
tests. For example, see PR 6101.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-04-07 13:02:39 -07:00
Kir Kolyshkin e8a5d77b09 ci: switch to golangci-lint v2
Also, add a way to update golangci-lint locally, if an old version is
installed.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-04-07 13:01:56 -07:00
Kir Kolyshkin ea1baab2c3 tests/tools: install lint from binary, use renovate
This way is recommended by golangci-lint developers, plus we'll save
some build time.

In addition, add GOLANGCI_LINT_VERSION to the top-level Makefile,
so it can be updated by renovate.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-04-07 13:01:56 -07:00
flouthoc 147a3ca916
.cirrus: run -race only on non-PR branch
Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2025-02-05 06:57:14 -08:00
flouthoc 1879f3dc65
Makefile: use -parallel for go test
Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2025-02-04 11:07:27 -08:00
Nalin Dahyabhai 4adca286fe chroot: on Linux, try to pivot_root before falling back to chroot
Unless --no-pivot or the equivalent API flag is set, try to pivot_root()
to enter the rootfs during Run().  Fall back to using chroot() as before
if that fails for any reason.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-12-12 14:33:12 -05:00
Danish Prakash 17ee51d753
Makefile: use `find` to detect source files
The current list of sources doesn't list vendor sources and some other
.go files, requiring manual modifications to the Makefile to build
binaries. This change uses `find` (from Podman's Makefile) to detect .go
files across the repo.

Removes the validation script since we're no longer specifying sources
manually. And removes explicit *.go files as binary sources.

Signed-off-by: Danish Prakash <contact@danishpraka.sh>
2024-11-20 22:14:18 +05:30
openshift-merge-bot[bot] a65fd39480
Merge pull request #5832 from kolyshkin/makefile-cleanups
(not just) Makefile cleanups
2024-11-12 22:55:43 +00:00
Kir Kolyshkin 135431f8d5 Makefile: mv codespell config to .codespellrc
It is cleaner that way.

While at it, let's try to minimize it.

[NO NEW TESTS NEEDED]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-11-11 10:49:04 -08:00
Kir Kolyshkin f0361414de Makefile,install.md: rm gopath stuff
For quite some time (Go 1.16? To be honest, I don't remember) placing
sources in a specific directory under $GOPATH is no longer required.

[NO NEW TESTS NEEDED]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-11-11 10:49:04 -08:00
Kir Kolyshkin c07a5eb567 Makefile: rm targets working on ..
It looks like those were added to aim in CI, and is no longer required.
As it is quite unexpected to have make targets operate on directories such
as ../../, let's remove those.

Fix Ubuntu build instructions accordingly (runc binary package is
available in those distros).

[NO NEW TESTS NEEDED]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-11-11 10:49:04 -08:00
Kir Kolyshkin 5adb14cbfe build: rm exclude_graphdriver_devicemapper tag
Since commit c7937cd1d it is no longer necessary to have it.

[NO NEW TESTS NEEDED]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-11-11 10:49:04 -08:00
Kir Kolyshkin 967fb5ec12 Makefile: rm unused var
This is no longer used since commit 3a122aa3c.

[NO NEW TESTS NEEDED]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-11-11 10:49:04 -08:00
Nalin Dahyabhai f4d4bb240f Finish updating to go 1.22
Update references to specific versions of golang in the Makefile and the
Cirrus CI configuration to match go.mod, and add a check in the 'vendor'
target that CI runs that the image it's run inside is a close-enough
match to the version listed in go.mod.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-11-11 11:03:11 -05:00
Nalin Dahyabhai 5abf038ddc Integration tests: run git daemon on a random-but-bind()able port
Use a listener helper to bind to an available-according-to-the-kernel
listening port and run a command with its stdio more or less tied to the
connection instead of trying to launch a git daemon directly using a
port number that we can only guess is available.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-10-21 14:39:55 -04:00
Nalin Dahyabhai baf91f2b00 In a container, try to register binfmt_misc
If we're running a command in a working container whose platform doesn't
match our own, attempt to register any emulators for which we find
configurations of the type included in Fedora's qemu-user-static
packages.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-09-12 11:55:33 -04:00
Nalin Dahyabhai 09c231f830 Add a validation script for Makefile $(SOURCES)
Add a validation script that checks that we haven't forgotten to add any
new packages to the SOURCES definition in the top-level Makefile.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-08-22 17:29:26 -04:00
Nalin Dahyabhai d01e4ede36 Drop the e2e test suite
They largely duplicate other integration tests.  Add an integration test
to cover the "output from inspect is valid JSON" case.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-08-07 10:10:33 -04:00
Nalin Dahyabhai 277d40a2e4 `make vendor-in-container`: use the caller's Go cache if it exists
If the $(go env GOCACHE) directory exists and is writeable, bind-mount
it into the container that we're running to do the vendoring.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-08-06 09:46:38 -04:00
Nalin Dahyabhai f6d49125a7 Don't set GOTOOLCHAIN=local
We can't set it all of the time because the renovate bot doesn't allow
us to set this in its configuration unless we're hosting the bot
ourselves, and I don't think that we are.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-05-03 10:45:56 -04:00
Nalin Dahyabhai 53f2dc231b Makefile: set GOTOOLCHAIN=local
Set GOTOOLCHAIN=local for all make targets, and for renovate.

Have the "vendor" target (and by extension, "vendor-in-container", which
our validation in CI uses) clear any "toolchain" directive that might
have been added to go.mod through manual invocations of the compiler.

At this point, we probably don't need to be checking for Go module
support, so switch to assuming it's available.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-05-02 17:41:25 -04:00
Nalin Dahyabhai 7425f6f8f1 Makefile: add missing files to $(SOURCES)
Some source files were not included in $(SOURCES); add them.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-04-30 15:59:14 -04:00
Rahil Bhimjiani 2cd31a0698
Makefile: softcode `strip`, use it from env var
Signed-off-by: Rahil Bhimjiani <me@rahil.rocks>
2024-04-01 09:25:21 +05:30
Rahil Bhimjiani c1b43b57bb
Makefile - instead of calling `as` directly, use it from env var
Signed-off-by: Rahil Bhimjiani <me@rahil.rocks>
2024-03-27 14:33:52 +05:30
Lokesh Mandvekar e53e50f7a1
[skip-ci] Makefile: update rpm target
rpkg is now deprecated. This commit makes the rpm target consistent with
the one in Podman.

Using skip-ci as we don't need to run cirrus tests for this change.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2024-03-13 19:36:45 +05:30
Daniel J Walsh bbea3eb544
Update vendor of containers/(common,image)
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-03-01 09:45:50 -05:00
Doug Rabson eb6269d8cc Build with CNI support on FreeBSD
This is needed until there is netavark support on FreeBSD

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2024-02-15 08:27:23 +00:00
Nalin Dahyabhai e202d62cc5 Disable loong64 again
github.com/cilium/ebpf v0.12.3 (the latest tag as of this moment) won't
build on linux/loong64, but the tip of its main branch does.  When
v0.12.4 is released, and we're using that or a later version, we can
turn it back on.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-02-07 11:50:09 -05:00
Nalin Dahyabhai 5d58b88c7d Update github.com/openshift/imagebuilder and containers/common
Update github.com/openshift/imagebuilder to the v1.2.6 release
Update github.com/containers/common to the current tip of the main branch

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-02-07 11:47:28 -05:00
Daniel J Walsh 34dff20dae
Run codespell on code
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-01-28 07:25:10 -05:00
Nalin Dahyabhai cf69e8a187 build,commit: add --sbom to scan and produce SBOMs when committing
Add a --sbom flag to `buildah build` and `buildah commit` which will
scan the rootfs and specified context directories to build SPDX or
CycloneDX SBOMs and lists of package URLs.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2024-01-19 13:55:57 -05:00
Nalin Dahyabhai 3b795dd4bc internal/mkcw/embed/entrypoint.gz: rename to include the arch
Include the arch in the name of the static entrypoint binary, in case we
find ourselves needing to support other architectures in the same area
in the future.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-11-28 16:43:44 -05:00
Nalin Dahyabhai 7788160cbb internal/mkcw/embed/entrypoint.gz: compress with -n9
Compress the unencrypted entry point binary for confidential workload
images using gzip's `-n` flag, to omit the original file's timestamp
from the compressed copy.  Add a -f and -9 to always overwrite the
output file and sacrifice speed to shave off a few more bytes.

[NO NEW TESTS NEEDED]

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-11-28 16:43:44 -05:00
Dan Čermák 12b205f698
Remove makefile targets entrypoint{,.gz} for non x86_64
The target internal/mkcw/embed/entrypoint is only built on x86_64, but
internal/mkcw/embed/entrypoint.gz is run on all arches. This causes build
failures on anything non x86_64 as internal/mkcw/embed/entrypoint is not build.

Signed-off-by: Dan Čermák <dcermak@suse.com>
2023-11-21 08:18:45 +01:00
Nalin Dahyabhai 3a61cc0996 Add OverrideChanges and OverrideConfig to CommitOptions
Add an OverrideChanges and an OverrideConfig field to CommitOptions,
both of which can be used to make last-minute edits to the configuration
of an image that we're committing.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-11-17 12:54:23 -05:00
Miloslav Trmač 4cf16730b1 Increase a copier+chroot test timeout
Warning: I don't know what I'm doing, I just don't care
to deal with this now.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-11-16 18:51:11 +01:00
Giuseppe Scrivano fe9bdce869
build: downgrade to go 1.20
go 1.21 breaks the Podman CI since it is not available on Fedora 38.

[NO NEW TESTS NEEDED]

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-11-16 16:27:47 +01:00
Daniel J Walsh 8f86c5784f
Update cirrus and version of golang
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-11-09 14:12:30 -06:00
Daniel J Walsh ccac7ca0bf
Run codespell on code
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-09-14 06:05:57 -04:00
Nalin Dahyabhai e89fac6c9b Add `buildah mkcw`, add `--cw` to `buildah commit` and `buildah build`
Add a --cw option to `buildah build` and `buildah commit`, which takes a
comma-separated list of arguments and produces an image laid out for use
as a confidential workload:
  type: sev or snp
  attestation_url: location of a key broker server
  cpus: expected number of virtual CPUs to run with
  memory: expected megabytes of memory to run with
  workload_id: a distinguishing identifier for the key broker server
  ignore_attestation_errors: ignore errors registering the workload
  passphrase: for encrypting the disk image
  slop: extra space to allocate for the disk image

At least one of attestation_url and passphrase must be specified in
order for the encrypted disk image to be decryptable at run-time.  Other
arguments can be omitted.  ignore_attestation_errors is intentionally
undocumented, as it's mainly used to permit some amount of testing on
systems which don't have the required hardware.

Add an `mkcw` top-level command, for converting directly from an image
to a confidential workload.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-09-07 14:05:10 -04:00
Michal Biesek 8428dee36c
make,cross: restore loong64
Ref: 50a4acb, 5d50a73

Signed-off-by: Michal Biesek <michalbiesek@gmail.com>
2023-08-17 09:09:36 +02:00
Nalin Dahyabhai c4d2a85207
Run unit tests for copier and chroot without -cover
The chrooting causes testing with coverage counting enabled to output a
warning message which interferes with how they communicate with child
processes.  Disable -cover for those modules by testing them separately
without it.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-29 14:21:17 -04:00