Commit Graph

8016 Commits

Author SHA1 Message Date
Avi Deitcher
5f3856c94c
Merge pull request #3823 from giggsoff/clean_builder_cache
Builder disk usage and clean
2022-09-13 14:47:09 +03:00
Petr Fedchenkov
45a5c97931
Builder disk usage and clean
We use dedicated docker container as builder and we are able to clean
data inside only by re-creating of it. Let's add disk usage and clean
commands for builder.

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
2022-09-13 13:33:46 +03:00
Avi Deitcher
3008215556
Merge pull request #3824 from giggsoff/fix-push
Fix bug: when request to build multiple arches, if one already found, it skips the others
2022-09-13 13:21:48 +03:00
Petr Fedchenkov
57148029cd
Fix consistently building of multiple arch
We cannot build for another arch after building for one arch because of
setting skipBuild to true if one arch found. In other words "linuxkit
pkg build --platforms linux/riscv64,linux/amd64 ..." after "linuxkit pkg
 build --platforms linux/amd64 ..." will not build for linux/riscv64
 which is not expected.

In general when we check for available images and able to found part of
platforms we do not want to rebuild all of them. So this PR includes
platformsToBuild slice which we fill with platforms we want to build for
.

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
2022-09-13 11:58:23 +03:00
Avi Deitcher
86cc42bf79
Merge pull request #3822 from giggsoff/allow_build_without_cgo
Allow build for darwin without CGO
2022-09-12 14:49:01 +03:00
Petr Fedchenkov
a46e6af650
Allow build for darwin without CGO
It is not easy to use cross-platform build with CGO enabled so lets
allow build without cgo for darwin and use virtualization framework only
 if we built with CGO.

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
2022-09-12 11:41:37 +03:00
Avi Deitcher
ceaeac88b6
Merge pull request #3818 from deitch/optional-tag
add option to override tag name when exporting
2022-09-12 09:48:52 +03:00
Avi Deitcher
7c4e89b652
Merge pull request #3821 from giggsoff/do-not-calculate-broken-symlinks
Skip files in contentHash()
2022-09-08 20:58:13 +03:00
Petr Fedchenkov
49f8faffe0
Skip files in contentHash()
If we cannot open file for some reason it is better to skip it instead
of exit. Also we should skip symlinks and directories.

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
2022-09-08 17:34:21 +03:00
Avi Deitcher
9b636cbf25
Merge pull request #3820 from giggsoff/fix-riscv64-arch
Add all valid arches to ImageLoad
2022-09-08 14:16:03 +03:00
Petr Fedchenkov
3699177d1a
Add all valid arches to ImageLoad
We should expand the list of supported arches to be able to build them if we want. Without this we will stuck on sending tarball during build for riscv64.

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
2022-09-08 12:14:49 +03:00
Avi Deitcher
fc060cac15
Merge pull request #3819 from giggsoff/dirty-fix
Append dirty tag with content hash
2022-09-07 12:49:48 +03:00
Petr Fedchenkov
8217737525
Append dirty tag with content hash
To be able to identify successive file changes without commit, we should
 use their hash in tag alongside with dirty flag
 (<ls-tree>-dirty-<content hash>).

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
2022-09-07 11:29:43 +03:00
Avi Deitcher
3a2ecfc6d5 add option to override tag name when exporting
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2022-09-06 14:18:49 +03:00
Avi Deitcher
5f37332f4a
Merge pull request #3816 from deitch/cache-export-filesystem
add ability to export filesystem
2022-09-05 11:08:28 +03:00
Avi Deitcher
7e65df33be add ability to export filesystem
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2022-08-29 18:23:43 +03:00
Avi Deitcher
1303ae4e73
Merge pull request #3810 from giggsoff/do-not-pull-another-arch
Do not pull another arch and index cleanup
2022-08-25 15:27:12 +03:00
Petr Fedchenkov
fe46d9bf05
Do not pull another arch
We pull all arches for the image which is suboptimal in terms of storage
 consumption. Let's pull only required platforms.

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
2022-08-25 12:29:35 +03:00
Avi Deitcher
6d65e39e0a
Merge pull request #3815 from giggsoff/enable-tpm-uefi-aws
Enable uefi mode and tpm support for aws
2022-08-23 11:37:15 -04:00
Petr Fedchenkov
82681c0333
uefi and tpm flags for aws push
Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
2022-08-23 10:58:24 +03:00
Petr Fedchenkov
364f66a5b8
Update aws vendoring and mod tidy
Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
2022-08-23 10:23:45 +03:00
Avi Deitcher
1cf22ed0ac
Merge pull request #3812 from deitch/safer-cache-write
verbosity for pkg build and error catching
2022-08-22 11:32:55 -04:00
Avi Deitcher
bc5084df99 verbosity for pkg build and error catching
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2022-08-14 11:06:02 -07:00
Avi Deitcher
56a05f628f
Merge pull request #3808 from deitch/push-manifest-only
add ability to just update manifest
2022-08-07 01:26:18 -08:00
Avi Deitcher
acdfb911ac bump manifest-tool to support OCI index media-type and consume it
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2022-07-29 00:18:13 +03:00
Avi Deitcher
b28621b95a add ability to just update manifest
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2022-07-28 10:46:45 +03:00
Avi Deitcher
239d4d9502
Merge pull request #3764 from deitch/virtualization-framework
add support for virtualization framework
2022-07-28 10:46:13 +03:00
Avi Deitcher
9c149a61b5
Merge pull request #3809 from giggsoff/fix-start-of-builder
Restart of the builder container
2022-07-27 20:23:52 +03:00
Petr Fedchenkov
2fd7ff7ff0
Restart of the builder container
We check only for existence of builder container and do not start it in
case of not running state. We should start it for example after reboot
of node to be able to build something.

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
2022-07-27 19:01:47 +03:00
David Scott
4bb25bda97 Fix Makefile
Before:
```
djs55@m1 linuxkit % make
make -C ./src/cmd/linuxkit
tar cf - -C . . | docker run --rm --net=none --log-driver=none -i -e GOOS= -e GOARCH= linuxkit/go-compile:7b1f5a37d2a93cd4a9aa2a87db264d8145944006 --package github.com/linuxkit/linuxkit/src/cmd/linuxkit --ldflags "-X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.GitCommit=a201652e0dabfc7f62b14ac1a43b5572a8ecae9a -X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.Version="v0.8+"" -o linuxkit > tmp_linuxkit_bin.tar
gofmt...
govet...
golint...
ineffassign...
go build...

djs55@m1 linuxkit % file bin/linuxkit
bin/linuxkit: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), static-pie linked, Go BuildID=alxJ_URcsHKe5NnzKTgb/kT7Da_wy0_5L3jkAxzZ7/jVuNyKW2yhIE_wT0QFHL/g86-fS2la_qumeAPHD40, stripped

djs55@m1 linuxkit % ./bin/linuxkit
zsh: exec format error: ./bin/linuxkit
```

After:
```
djs55@m1 linuxkit % make
make -C ./src/cmd/linuxkit
CGO_ENABLED=1 go build -o /Users/djs55/github.com/djs55/linuxkit/bin/linuxkit  --ldflags "-X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.GitCommit=df47d22bce0a1767e6e0c967d9b516cc656d7db4 -X github.com/linuxkit/linuxkit/src/cmd/linuxkit/version.Version="v0.8+""
codesign --entitlements linuxkit.entitlements --force -s - /Users/djs55/github.com/djs55/linuxkit/bin/linuxkit
/Users/djs55/github.com/djs55/linuxkit/bin/linuxkit: replacing existing signature

djs55@m1 linuxkit % file ./bin/linuxkit
./bin/linuxkit: Mach-O 64-bit executable arm64

djs55@m1 linuxkit % ./bin/linuxkit
Please specify a command.

USAGE: linuxkit [options] COMMAND
```

Signed-off-by: David Scott <dave@recoil.org>
2022-07-25 08:01:32 +01:00
David Scott
e97dda48c5
Merge pull request #3807 from dgageot/memlogd-json
Write log entries as json
2022-07-25 07:48:11 +01:00
Avi Deitcher
de1d8cdeda add support for virtualization framework
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2022-07-22 16:55:47 +03:00
David Scott
2bf3726a81
Merge pull request #3778 from NeilGerring/fix-bad-rebase
Fix a merge conflict in openstack.yml example
2022-07-22 06:06:57 -07:00
David Gageot
acbef4424a
Make the linter happy
Signed-off-by: David Gageot <david.gageot@docker.com>
2022-07-22 15:02:19 +02:00
David Gageot
0b136bf80d
Write log entries as json
Signed-off-by: David Gageot <david.gageot@docker.com>
2022-07-22 14:41:23 +02:00
Avi Deitcher
ea61ff95ce
Merge pull request #3806 from giggsoff/update-buildkit
Update buildkit to have platform fix
2022-07-22 07:36:07 -04:00
Petr Fedchenkov
3540a1bc34
Update buildkit to have platform fix
We noticed that we use host arch when we want to use previously build
image in oci-layout. Let's use fix on buildkit side and improve test.

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
2022-07-22 12:25:39 +03:00
Avi Deitcher
3f25e09ab5
Merge pull request #3805 from giggsoff/fixes-for-chained
Ability to parse args from Dockerfile
2022-07-20 16:11:47 -04:00
Petr Fedchenkov
5763c4f4bc
Ability to parse args from Dockerfile
We should check if we have args in "FROM" and replace them:

ARG IMAGE=linuxkit/img
FROM ${IMAGE} as src

will be parsed as

FROM linuxkit/img as src

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
2022-07-20 17:07:43 +03:00
Avi Deitcher
403e8f9353
Merge pull request #3797 from deitch/use-images-from-cache
add support for building from cached images
2022-07-20 09:19:47 -04:00
Avi Deitcher
4e7f87e1ea
Merge pull request #3804 from giggsoff/allow-docker-multiarch
Allow store to docker multiarch builds
2022-07-18 19:08:26 +03:00
David Scott
8070434cad
Merge pull request #3542 from thaJeztah/configurable_socket
pkg/trim-after-delete: make docker socket path configurable
2022-07-17 03:26:52 -07:00
David Scott
a3327ef377
Merge pull request #3794 from giggsoff/net-admin-sysctl
Add CAP_NET_ADMIN capability to sysctl
2022-07-17 03:25:19 -07:00
Petr Fedchenkov
39f1649995
Allow store to docker multiarch builds
We do not allow to load into docker images that are targets another
platform differ from current arch. Assume this is because of no support
of manifest. But we can keep all images in place by adding arch suffix
and using tag without arch suffix to point onto current system arch. It
will help to use images from docker for another arch.

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
2022-07-15 16:51:18 +03:00
Avi Deitcher
a90ff542cd add support for building from cached images
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2022-07-14 12:53:34 +03:00
Avi Deitcher
44dfac2725
Merge pull request #3801 from waldner/master
New output format: iso-efi-initrd
2022-07-12 12:03:11 +03:00
Davide Brini
860934d5d9 New output format: iso-efi-initrd
This option was previously not available and required postprocessing of a `tar-kernel-initrd` output.

Comparison with `iso-efi`:

`iso-efi` only loads the kernel at boot, and the root filesystem is mounted from the actual boot media (eg, a CD-ROM - physical or emulated). This can often cause trouble (it has for us) for multiple reasons:
- the linuxkit kernel might not have the correct drivers built-in for the hardware (see #3154)
- especially with virtual or emulated CD-ROMs, performance can be abysmal: we saw the case where the server IPMI allowed using a ISO stored in AWS S3 over HTTP...you can imagine what happens when you start doing random I/O on the root fs in that case.
- The ISO image has the root device name baked in (ie, `/dev/sr0`) which fails if for some reason the CD-ROM we're running from doesn't end up using that device, so manual tweaking is required (see #2375)

`iso-efi-initrd`, on the other hand, packs the root filesystem as an initramfs (ie similar to what the raw output does, except that in this case we're preparing an ISO image), so both the kernel and the initramfs are loaded in memory by the boot loader and, once running, we don't need to worry about root devices or kernel drivers (and the speed is good, as everything runs in RAM).

Also, the generated ISO can be copied verbatim (eg with `dd`) onto a USB media and it still works.

Finally, the image size is much smaller compared to `iso-efi`.

IMHO, `iso-efi-initrd` could be used almost anywhere `iso-efi` would be used, or might even supersede it. I can't think of a scenario where one might explicitly want to use `iso-efi`.

Points to consider:

- Not tested under aarch64 as I don't have access to that arch. If the automated CI tests also test that, then it should be fine.
- I'm not sure what to put inside `images.yaml` for the `iso-efi-initrd` image. As it is it works of course (my personal image on docker hub), but I guess it'll have to be some more "official" image. However, that cannot be until this PR is merged, so it's kind of a chicken and egg situation. Please advise.
- I can look into adding the corresponding `iso-bios-initrd` builder if there is interest.

![cute seal](https://sites.psu.edu/siowfa16/files/2016/09/baby-seal-29vsgyf-288x300.jpg)

Signed-off-by: Davide Brini <waldner@katamail.com>
2022-07-11 20:26:14 +02:00
Avi Deitcher
ad3d8bdac0
Merge pull request #3800 from waldner/master
Fix: #3799 golint requires comments on non-main package for blank import
2022-07-10 17:58:49 +03:00
Davide Brini
9edeba42d7 Fix: #3799 golint requires comments on non-main package for blank import
Signed-off-by: Davide Brini <waldner@katamail.com>
2022-07-10 11:55:51 +02:00
Rolf Neugebauer
806c5c418d
Merge pull request #3796 from deitch/document-cache
add docs to the cache spec
2022-07-06 10:10:10 +01:00