Skip to content

Commit

Permalink
bib: use "legacy" build pipeline when doing a cross arch build
Browse files Browse the repository at this point in the history
This is a temporary measure to be able to move to
`bootc install to-filesystem` by default. Only for cross arch
builds we use the "legacy" pipeline to build an bootc image.

This should be removed once either:

- containers/bootc#462
or
- https://www.mail-archive.com/qemu-devel@nongnu.org/msg1034508.html

are released in the relevant places (centos/rhel).
  • Loading branch information
mvo5 authored and achilleas-k committed Apr 17, 2024
1 parent 1247011 commit e747aec
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
13 changes: 12 additions & 1 deletion bib/cmd/bootc-image-builder/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,18 @@ func manifestForDiskImage(c *ManifestConfig, rng *rand.Rand) (*manifest.Manifest
mf := manifest.New()
mf.Distro = manifest.DISTRO_FEDORA
runner := &runner.Linux{}
err = img.InstantiateManifestFromContainers(&mf, []container.SourceSpec{containerSource}, runner, rng)

// Remove the "NewBootcLegacyDiskImage" if part below and
// *only* use the "else" part of the code once either of the
// following is available in centos/rhel
// https://github.com/containers/bootc/pull/462
// https://www.mail-archive.com/qemu-devel@nongnu.org/msg1034508.html
if c.Architecture != arch.Current() {
legacyImg := image.NewBootcLegacyDiskImage(img)
err = legacyImg.InstantiateManifestFromContainers(&mf, []container.SourceSpec{containerSource}, runner, rng)
} else {
err = img.InstantiateManifestFromContainers(&mf, []container.SourceSpec{containerSource}, runner, rng)
}

return &mf, err
}
Expand Down
8 changes: 4 additions & 4 deletions bib/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module github.com/osbuild/bootc-image-builder/bib
go 1.20

require (
github.com/aws/aws-sdk-go v1.51.21
github.com/aws/aws-sdk-go v1.51.22
github.com/cheggaaa/pb/v3 v3.1.5
github.com/google/uuid v1.6.0
github.com/osbuild/images v0.55.1-0.20240415121712-d97682ef6dcf
github.com/osbuild/images v0.55.1-0.20240417075153-faefd5894ce1
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
Expand All @@ -26,7 +26,7 @@ require (
github.com/containerd/cgroups/v3 v3.0.2 // indirect
github.com/containerd/errdefs v0.1.0 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
github.com/containers/common v0.58.1 // indirect
github.com/containers/common v0.58.2 // indirect
github.com/containers/image/v5 v5.30.0 // indirect
github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect
github.com/containers/ocicrypt v1.1.9 // indirect
Expand Down Expand Up @@ -121,7 +121,7 @@ require (
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.19.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa // indirect
google.golang.org/grpc v1.62.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.1 // indirect
Expand Down
10 changes: 8 additions & 2 deletions bib/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3d
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/aws/aws-sdk-go v1.51.21 h1:UrT6JC9R9PkYYXDZBV0qDKTualMr+bfK2eboTknMgbs=
github.com/aws/aws-sdk-go v1.51.21/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/aws/aws-sdk-go v1.51.22 h1:VL2p2JgC32myt7DMEcbe1devdtgGSgMNvZpkcdvlxq4=
github.com/aws/aws-sdk-go v1.51.22/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
Expand All @@ -38,6 +40,8 @@ github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G
github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk=
github.com/containers/common v0.58.1 h1:E1DN9Lr7kgMVQy7AXLv1CYQCiqnweklMiYWbf0KOnqY=
github.com/containers/common v0.58.1/go.mod h1:l3vMqanJGj7tZ3W/i76gEJ128VXgFUO1tLaohJXPvdk=
github.com/containers/common v0.58.2 h1:5nu9lQz4QNSgovNk7NRk33SkqkVNKYoXh7L6gXmACow=
github.com/containers/common v0.58.2/go.mod h1:l3vMqanJGj7tZ3W/i76gEJ128VXgFUO1tLaohJXPvdk=
github.com/containers/image/v5 v5.30.0 h1:CmHeSwI6W2kTRWnUsxATDFY5TEX4b58gPkaQcEyrLIA=
github.com/containers/image/v5 v5.30.0/go.mod h1:gSD8MVOyqBspc0ynLsuiMR9qmt8UQ4jpVImjmK0uXfk=
github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 h1:Qzk5C6cYglewc+UyGf6lc8Mj2UaPTHy/iF2De0/77CA=
Expand Down Expand Up @@ -281,10 +285,10 @@ github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE
github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
github.com/osbuild/images v0.55.1-0.20240415090605-5ecb18e4ef9c h1:BB9AtMz9yJPW6P0Bes1xEEJEi1w928AFG73bKKAB7R8=
github.com/osbuild/images v0.55.1-0.20240415090605-5ecb18e4ef9c/go.mod h1:Lc5FckyU9YcKbSUdVSojYxp9nlvbnnrOzgH0jt+byvw=
github.com/osbuild/images v0.55.1-0.20240415121712-d97682ef6dcf h1:E2fAXNHpGmFSQeWoNTt0UmUIlsJpyeKcmKasmN99FRI=
github.com/osbuild/images v0.55.1-0.20240415121712-d97682ef6dcf/go.mod h1:Lc5FckyU9YcKbSUdVSojYxp9nlvbnnrOzgH0jt+byvw=
github.com/osbuild/images v0.55.1-0.20240417075153-faefd5894ce1 h1:fPpdj8T/YoYmixyiAFWjC74VU5ElpYBick6ktUE4IKU=
github.com/osbuild/images v0.55.1-0.20240417075153-faefd5894ce1/go.mod h1:dDIYbQe69f9Qp6yPWgQ5xrA2hBnP9KA9qnLI6a5wnZQ=
github.com/ostreedev/ostree-go v0.0.0-20210805093236-719684c64e4f h1:/UDgs8FGMqwnHagNDPGOlts35QkhAZ8by3DR7nMih7M=
github.com/ostreedev/ostree-go v0.0.0-20210805093236-719684c64e4f/go.mod h1:J6OG6YJVEWopen4avK3VNQSnALmmjvniMmni/YFYAwc=
github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU=
Expand Down Expand Up @@ -516,6 +520,8 @@ google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJ
google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c h1:kaI7oewGK5YnVwj+Y+EJBO/YN1ht8iTL9XkFHtVZLsc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa h1:RBgMaUMP+6soRkik4VoN8ojR2nex2TqZwjSSogic+eo=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
Expand Down

0 comments on commit e747aec

Please sign in to comment.