manifest: don't stutter
Replace `pipeline.OSPipeline` with `pipeline.OS`, etc. Also rename `LiveImg` to `RawImage`.
This commit is contained in:
parent
529bc803db
commit
d00b98c134
16 changed files with 286 additions and 286 deletions
|
|
@ -40,10 +40,10 @@ func (img *MyImage) InstantiateManifest(m *manifest.Manifest, repos []rpmmd.Repo
|
||||||
// Let's create a simple OCI container!
|
// Let's create a simple OCI container!
|
||||||
|
|
||||||
// configure a build pipeline
|
// configure a build pipeline
|
||||||
build := manifest.NewBuildPipeline(m, runner, repos)
|
build := manifest.NewBuild(m, runner, repos)
|
||||||
|
|
||||||
// create a non-bootable OS tree containing the `core` comps group
|
// create a non-bootable OS tree containing the `core` comps group
|
||||||
os := manifest.NewOSPipeline(m, build, &platform.X86{}, repos)
|
os := manifest.NewOS(m, build, &platform.X86{}, repos)
|
||||||
os.ExtraBasePackages = []string{
|
os.ExtraBasePackages = []string{
|
||||||
"@core",
|
"@core",
|
||||||
}
|
}
|
||||||
|
|
@ -53,7 +53,7 @@ func (img *MyImage) InstantiateManifest(m *manifest.Manifest, repos []rpmmd.Repo
|
||||||
filename = img.Filename
|
filename = img.Filename
|
||||||
}
|
}
|
||||||
// create an OCI container containing the OS tree created above
|
// create an OCI container containing the OS tree created above
|
||||||
manifest.NewOCIContainerPipeline(m, build, &os.BasePipeline, "x86_64", filename)
|
manifest.NewOCIContainer(m, build, &os.Base, "x86_64", filename)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,13 +19,13 @@ func qcow2Manifest(m *manifest.Manifest,
|
||||||
packageSets map[string]rpmmd.PackageSet,
|
packageSets map[string]rpmmd.PackageSet,
|
||||||
rng *rand.Rand) error {
|
rng *rand.Rand) error {
|
||||||
|
|
||||||
buildPipeline := manifest.NewBuildPipeline(m, t.arch.distro.runner, repos)
|
buildPipeline := manifest.NewBuild(m, t.arch.distro.runner, repos)
|
||||||
treePipeline, err := osPipeline(m, buildPipeline, workload, t, repos, packageSets[osPkgsKey], customizations, options, rng)
|
treePipeline, err := osPipeline(m, buildPipeline, workload, t, repos, packageSets[osPkgsKey], customizations, options, rng)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
imagePipeline := manifest.NewLiveImgPipeline(m, buildPipeline, treePipeline, "disk.img")
|
imagePipeline := manifest.NewRawImage(m, buildPipeline, treePipeline, "disk.img")
|
||||||
qcow2Pipeline := manifest.NewQCOW2Pipeline(m, buildPipeline, imagePipeline, t.filename)
|
qcow2Pipeline := manifest.NewQCOW2(m, buildPipeline, imagePipeline, t.filename)
|
||||||
qcow2Pipeline.Compat = "1.1"
|
qcow2Pipeline.Compat = "1.1"
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -40,13 +40,13 @@ func vhdManifest(m *manifest.Manifest,
|
||||||
packageSets map[string]rpmmd.PackageSet,
|
packageSets map[string]rpmmd.PackageSet,
|
||||||
rng *rand.Rand) error {
|
rng *rand.Rand) error {
|
||||||
|
|
||||||
buildPipeline := manifest.NewBuildPipeline(m, t.arch.distro.runner, repos)
|
buildPipeline := manifest.NewBuild(m, t.arch.distro.runner, repos)
|
||||||
treePipeline, err := osPipeline(m, buildPipeline, workload, t, repos, packageSets[osPkgsKey], customizations, options, rng)
|
treePipeline, err := osPipeline(m, buildPipeline, workload, t, repos, packageSets[osPkgsKey], customizations, options, rng)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
imagePipeline := manifest.NewLiveImgPipeline(m, buildPipeline, treePipeline, "disk.img")
|
imagePipeline := manifest.NewRawImage(m, buildPipeline, treePipeline, "disk.img")
|
||||||
manifest.NewVPCPipeline(m, buildPipeline, imagePipeline, t.filename)
|
manifest.NewVPC(m, buildPipeline, imagePipeline, t.filename)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -60,13 +60,13 @@ func vmdkManifest(m *manifest.Manifest,
|
||||||
packageSets map[string]rpmmd.PackageSet,
|
packageSets map[string]rpmmd.PackageSet,
|
||||||
rng *rand.Rand) error {
|
rng *rand.Rand) error {
|
||||||
|
|
||||||
buildPipeline := manifest.NewBuildPipeline(m, t.arch.distro.runner, repos)
|
buildPipeline := manifest.NewBuild(m, t.arch.distro.runner, repos)
|
||||||
treePipeline, err := osPipeline(m, buildPipeline, workload, t, repos, packageSets[osPkgsKey], customizations, options, rng)
|
treePipeline, err := osPipeline(m, buildPipeline, workload, t, repos, packageSets[osPkgsKey], customizations, options, rng)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
imagePipeline := manifest.NewLiveImgPipeline(m, buildPipeline, treePipeline, "disk.img")
|
imagePipeline := manifest.NewRawImage(m, buildPipeline, treePipeline, "disk.img")
|
||||||
manifest.NewVMDKPipeline(m, buildPipeline, imagePipeline, t.filename)
|
manifest.NewVMDK(m, buildPipeline, imagePipeline, t.filename)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -80,13 +80,13 @@ func openstackManifest(m *manifest.Manifest,
|
||||||
packageSets map[string]rpmmd.PackageSet,
|
packageSets map[string]rpmmd.PackageSet,
|
||||||
rng *rand.Rand) error {
|
rng *rand.Rand) error {
|
||||||
|
|
||||||
buildPipeline := manifest.NewBuildPipeline(m, t.arch.distro.runner, repos)
|
buildPipeline := manifest.NewBuild(m, t.arch.distro.runner, repos)
|
||||||
treePipeline, err := osPipeline(m, buildPipeline, workload, t, repos, packageSets[osPkgsKey], customizations, options, rng)
|
treePipeline, err := osPipeline(m, buildPipeline, workload, t, repos, packageSets[osPkgsKey], customizations, options, rng)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
imagePipeline := manifest.NewLiveImgPipeline(m, buildPipeline, treePipeline, "disk.img")
|
imagePipeline := manifest.NewRawImage(m, buildPipeline, treePipeline, "disk.img")
|
||||||
manifest.NewQCOW2Pipeline(m, buildPipeline, imagePipeline, t.filename)
|
manifest.NewQCOW2(m, buildPipeline, imagePipeline, t.filename)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -101,12 +101,12 @@ func ec2CommonManifest(m *manifest.Manifest,
|
||||||
rng *rand.Rand,
|
rng *rand.Rand,
|
||||||
diskfile string) error {
|
diskfile string) error {
|
||||||
|
|
||||||
buildPipeline := manifest.NewBuildPipeline(m, t.arch.distro.runner, repos)
|
buildPipeline := manifest.NewBuild(m, t.arch.distro.runner, repos)
|
||||||
treePipeline, err := osPipeline(m, buildPipeline, workload, t, repos, packageSets[osPkgsKey], customizations, options, rng)
|
treePipeline, err := osPipeline(m, buildPipeline, workload, t, repos, packageSets[osPkgsKey], customizations, options, rng)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
manifest.NewLiveImgPipeline(m, buildPipeline, treePipeline, diskfile)
|
manifest.NewRawImage(m, buildPipeline, treePipeline, diskfile)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -132,7 +132,7 @@ func iotInstallerManifest(m *manifest.Manifest,
|
||||||
packageSets map[string]rpmmd.PackageSet,
|
packageSets map[string]rpmmd.PackageSet,
|
||||||
rng *rand.Rand) error {
|
rng *rand.Rand) error {
|
||||||
|
|
||||||
buildPipeline := manifest.NewBuildPipeline(m, t.arch.distro.runner, repos)
|
buildPipeline := manifest.NewBuild(m, t.arch.distro.runner, repos)
|
||||||
|
|
||||||
d := t.arch.distro
|
d := t.arch.distro
|
||||||
ksUsers := len(customizations.GetUsers())+len(customizations.GetGroups()) > 0
|
ksUsers := len(customizations.GetUsers())+len(customizations.GetGroups()) > 0
|
||||||
|
|
@ -150,10 +150,10 @@ func iotCorePipelines(m *manifest.Manifest,
|
||||||
customizations *blueprint.Customizations,
|
customizations *blueprint.Customizations,
|
||||||
options distro.ImageOptions,
|
options distro.ImageOptions,
|
||||||
repos []rpmmd.RepoConfig,
|
repos []rpmmd.RepoConfig,
|
||||||
packageSets map[string]rpmmd.PackageSet) (*manifest.BuildPipeline,
|
packageSets map[string]rpmmd.PackageSet) (*manifest.Build,
|
||||||
*manifest.OSTreeCommitPipeline,
|
*manifest.OSTreeCommit,
|
||||||
error) {
|
error) {
|
||||||
buildPipeline := manifest.NewBuildPipeline(m, t.arch.distro.runner, repos)
|
buildPipeline := manifest.NewBuild(m, t.arch.distro.runner, repos)
|
||||||
treePipeline, err := osPipeline(m, buildPipeline, workload, t, repos, packageSets[osPkgsKey], customizations, options, nil)
|
treePipeline, err := osPipeline(m, buildPipeline, workload, t, repos, packageSets[osPkgsKey], customizations, options, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
|
|
@ -176,7 +176,7 @@ func iotCommitManifest(m *manifest.Manifest,
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
manifest.NewTarPipeline(m, buildPipeline, &commitPipeline.BasePipeline, "commit-archive", t.Filename())
|
manifest.NewTar(m, buildPipeline, &commitPipeline.Base, "commit-archive", t.Filename())
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -197,7 +197,7 @@ func iotContainerManifest(m *manifest.Manifest,
|
||||||
nginxConfigPath := "/etc/nginx.conf"
|
nginxConfigPath := "/etc/nginx.conf"
|
||||||
httpPort := "8080"
|
httpPort := "8080"
|
||||||
containerTreePipeline := containerTreePipeline(m, buildPipeline, commitPipeline, repos, packageSets[containerPkgsKey], options, customizations, nginxConfigPath, httpPort)
|
containerTreePipeline := containerTreePipeline(m, buildPipeline, commitPipeline, repos, packageSets[containerPkgsKey], options, customizations, nginxConfigPath, httpPort)
|
||||||
containerPipeline(m, buildPipeline, &containerTreePipeline.BasePipeline, t, nginxConfigPath, httpPort)
|
containerPipeline(m, buildPipeline, &containerTreePipeline.Base, t, nginxConfigPath, httpPort)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -211,29 +211,29 @@ func containerManifest(m *manifest.Manifest,
|
||||||
packageSets map[string]rpmmd.PackageSet,
|
packageSets map[string]rpmmd.PackageSet,
|
||||||
rng *rand.Rand) error {
|
rng *rand.Rand) error {
|
||||||
|
|
||||||
buildPipeline := manifest.NewBuildPipeline(m, t.arch.distro.runner, repos)
|
buildPipeline := manifest.NewBuild(m, t.arch.distro.runner, repos)
|
||||||
treePipeline, err := osPipeline(m, buildPipeline, workload, t, repos, packageSets[osPkgsKey], customizations, options, rng)
|
treePipeline, err := osPipeline(m, buildPipeline, workload, t, repos, packageSets[osPkgsKey], customizations, options, rng)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
manifest.NewOCIContainerPipeline(m, buildPipeline, &treePipeline.BasePipeline, t.Arch().Name(), t.Filename())
|
manifest.NewOCIContainer(m, buildPipeline, &treePipeline.Base, t.Arch().Name(), t.Filename())
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func osPipeline(m *manifest.Manifest,
|
func osPipeline(m *manifest.Manifest,
|
||||||
buildPipeline *manifest.BuildPipeline,
|
buildPipeline *manifest.Build,
|
||||||
workload workload.Workload,
|
workload workload.Workload,
|
||||||
t *imageType,
|
t *imageType,
|
||||||
repos []rpmmd.RepoConfig,
|
repos []rpmmd.RepoConfig,
|
||||||
osPackageSet rpmmd.PackageSet,
|
osPackageSet rpmmd.PackageSet,
|
||||||
c *blueprint.Customizations,
|
c *blueprint.Customizations,
|
||||||
options distro.ImageOptions,
|
options distro.ImageOptions,
|
||||||
rng *rand.Rand) (*manifest.OSPipeline, error) {
|
rng *rand.Rand) (*manifest.OS, error) {
|
||||||
|
|
||||||
imageConfig := t.getDefaultImageConfig()
|
imageConfig := t.getDefaultImageConfig()
|
||||||
|
|
||||||
pl := manifest.NewOSPipeline(m, buildPipeline, t.platform, repos)
|
pl := manifest.NewOS(m, buildPipeline, t.platform, repos)
|
||||||
pl.Environment = t.environment
|
pl.Environment = t.environment
|
||||||
pl.Workload = workload
|
pl.Workload = workload
|
||||||
|
|
||||||
|
|
@ -347,25 +347,25 @@ func osPipeline(m *manifest.Manifest,
|
||||||
}
|
}
|
||||||
|
|
||||||
func ostreeCommitPipeline(m *manifest.Manifest,
|
func ostreeCommitPipeline(m *manifest.Manifest,
|
||||||
buildPipeline *manifest.BuildPipeline,
|
buildPipeline *manifest.Build,
|
||||||
treePipeline *manifest.OSPipeline,
|
treePipeline *manifest.OS,
|
||||||
options distro.ImageOptions,
|
options distro.ImageOptions,
|
||||||
osVersion string) *manifest.OSTreeCommitPipeline {
|
osVersion string) *manifest.OSTreeCommit {
|
||||||
p := manifest.NewOSTreeCommitPipeline(m, buildPipeline, treePipeline, options.OSTree.Ref)
|
p := manifest.NewOSTreeCommit(m, buildPipeline, treePipeline, options.OSTree.Ref)
|
||||||
p.OSVersion = osVersion
|
p.OSVersion = osVersion
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
func containerTreePipeline(m *manifest.Manifest,
|
func containerTreePipeline(m *manifest.Manifest,
|
||||||
buildPipeline *manifest.BuildPipeline,
|
buildPipeline *manifest.Build,
|
||||||
commitPipeline *manifest.OSTreeCommitPipeline,
|
commitPipeline *manifest.OSTreeCommit,
|
||||||
repos []rpmmd.RepoConfig,
|
repos []rpmmd.RepoConfig,
|
||||||
containerPackageSet rpmmd.PackageSet,
|
containerPackageSet rpmmd.PackageSet,
|
||||||
options distro.ImageOptions,
|
options distro.ImageOptions,
|
||||||
c *blueprint.Customizations,
|
c *blueprint.Customizations,
|
||||||
nginxConfigPath,
|
nginxConfigPath,
|
||||||
listenPort string) *manifest.OSTreeCommitServerTreePipeline {
|
listenPort string) *manifest.OSTreeCommitServer {
|
||||||
p := manifest.NewOSTreeCommitServerTreePipeline(m, buildPipeline, repos, commitPipeline, nginxConfigPath, listenPort)
|
p := manifest.NewOSTreeCommitServer(m, buildPipeline, repos, commitPipeline, nginxConfigPath, listenPort)
|
||||||
p.ExtraPackages = containerPackageSet.Include
|
p.ExtraPackages = containerPackageSet.Include
|
||||||
p.ExtraRepos = containerPackageSet.Repositories
|
p.ExtraRepos = containerPackageSet.Repositories
|
||||||
language, _ := c.GetPrimaryLocale()
|
language, _ := c.GetPrimaryLocale()
|
||||||
|
|
@ -376,24 +376,24 @@ func containerTreePipeline(m *manifest.Manifest,
|
||||||
}
|
}
|
||||||
|
|
||||||
func containerPipeline(m *manifest.Manifest,
|
func containerPipeline(m *manifest.Manifest,
|
||||||
buildPipeline *manifest.BuildPipeline,
|
buildPipeline *manifest.Build,
|
||||||
treePipeline *manifest.BasePipeline,
|
treePipeline *manifest.Base,
|
||||||
t *imageType,
|
t *imageType,
|
||||||
nginxConfigPath,
|
nginxConfigPath,
|
||||||
listenPort string) *manifest.OCIContainerPipeline {
|
listenPort string) *manifest.OCIContainer {
|
||||||
p := manifest.NewOCIContainerPipeline(m, buildPipeline, treePipeline, t.Arch().Name(), t.Filename())
|
p := manifest.NewOCIContainer(m, buildPipeline, treePipeline, t.Arch().Name(), t.Filename())
|
||||||
p.Cmd = []string{"nginx", "-c", nginxConfigPath}
|
p.Cmd = []string{"nginx", "-c", nginxConfigPath}
|
||||||
p.ExposedPorts = []string{listenPort}
|
p.ExposedPorts = []string{listenPort}
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
func anacondaTreePipeline(m *manifest.Manifest,
|
func anacondaTreePipeline(m *manifest.Manifest,
|
||||||
buildPipeline *manifest.BuildPipeline,
|
buildPipeline *manifest.Build,
|
||||||
repos []rpmmd.RepoConfig,
|
repos []rpmmd.RepoConfig,
|
||||||
installerPackageSet rpmmd.PackageSet,
|
installerPackageSet rpmmd.PackageSet,
|
||||||
arch, product, osVersion, variant string,
|
arch, product, osVersion, variant string,
|
||||||
users bool) *manifest.AnacondaPipeline {
|
users bool) *manifest.Anaconda {
|
||||||
p := manifest.NewAnacondaPipeline(m, buildPipeline, repos, "kernel", arch, product, osVersion)
|
p := manifest.NewAnaconda(m, buildPipeline, repos, "kernel", arch, product, osVersion)
|
||||||
p.ExtraPackages = installerPackageSet.Include
|
p.ExtraPackages = installerPackageSet.Include
|
||||||
p.ExtraRepos = installerPackageSet.Repositories
|
p.ExtraRepos = installerPackageSet.Repositories
|
||||||
|
|
||||||
|
|
@ -404,14 +404,14 @@ func anacondaTreePipeline(m *manifest.Manifest,
|
||||||
}
|
}
|
||||||
|
|
||||||
func bootISOTreePipeline(m *manifest.Manifest,
|
func bootISOTreePipeline(m *manifest.Manifest,
|
||||||
buildPipeline *manifest.BuildPipeline,
|
buildPipeline *manifest.Build,
|
||||||
anacondaPipeline *manifest.AnacondaPipeline,
|
anacondaPipeline *manifest.Anaconda,
|
||||||
options distro.ImageOptions,
|
options distro.ImageOptions,
|
||||||
vendor,
|
vendor,
|
||||||
isoLabelTempl string,
|
isoLabelTempl string,
|
||||||
users []blueprint.UserCustomization,
|
users []blueprint.UserCustomization,
|
||||||
groups []blueprint.GroupCustomization) *manifest.ISOTreePipeline {
|
groups []blueprint.GroupCustomization) *manifest.ISOTree {
|
||||||
p := manifest.NewISOTreePipeline(m, buildPipeline, anacondaPipeline, options.OSTree.Parent, options.OSTree.URL, options.OSTree.Ref, isoLabelTempl)
|
p := manifest.NewISOTree(m, buildPipeline, anacondaPipeline, options.OSTree.Parent, options.OSTree.URL, options.OSTree.Ref, isoLabelTempl)
|
||||||
p.Release = "202010217.n.0"
|
p.Release = "202010217.n.0"
|
||||||
p.OSName = "fedora"
|
p.OSName = "fedora"
|
||||||
p.UEFIVendor = vendor
|
p.UEFIVendor = vendor
|
||||||
|
|
@ -422,11 +422,11 @@ func bootISOTreePipeline(m *manifest.Manifest,
|
||||||
}
|
}
|
||||||
|
|
||||||
func bootISOPipeline(m *manifest.Manifest,
|
func bootISOPipeline(m *manifest.Manifest,
|
||||||
buildPipeline *manifest.BuildPipeline,
|
buildPipeline *manifest.Build,
|
||||||
treePipeline *manifest.ISOTreePipeline,
|
treePipeline *manifest.ISOTree,
|
||||||
filename string,
|
filename string,
|
||||||
isolinux bool) *manifest.ISOPipeline {
|
isolinux bool) *manifest.ISO {
|
||||||
p := manifest.NewISOPipeline(m, buildPipeline, treePipeline, filename)
|
p := manifest.NewISO(m, buildPipeline, treePipeline, filename)
|
||||||
p.ISOLinux = isolinux
|
p.ISOLinux = isolinux
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@ import (
|
||||||
"github.com/osbuild/osbuild-composer/internal/rpmmd"
|
"github.com/osbuild/osbuild-composer/internal/rpmmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
// An AnacondaPipeline represents the installer tree as found on an ISO.
|
// An Anaconda represents the installer tree as found on an ISO.
|
||||||
type AnacondaPipeline struct {
|
type Anaconda struct {
|
||||||
BasePipeline
|
Base
|
||||||
// Packages to install in addition to the ones required by the
|
// Packages to install in addition to the ones required by the
|
||||||
// pipeline.
|
// pipeline.
|
||||||
ExtraPackages []string
|
ExtraPackages []string
|
||||||
|
|
@ -38,26 +38,26 @@ type AnacondaPipeline struct {
|
||||||
version string
|
version string
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewAnacondaPipeline creates an anaconda pipeline object. repos and packages
|
// NewAnaconda creates an anaconda pipeline object. repos and packages
|
||||||
// indicate the content to build the installer from, which is distinct from the
|
// indicate the content to build the installer from, which is distinct from the
|
||||||
// packages the installer will install on the target system. kernelName is the
|
// packages the installer will install on the target system. kernelName is the
|
||||||
// name of the kernel package the intsaller will use. arch is the supported
|
// name of the kernel package the intsaller will use. arch is the supported
|
||||||
// architecture. Product and version refers to the product the installer is the
|
// architecture. Product and version refers to the product the installer is the
|
||||||
// installer for.
|
// installer for.
|
||||||
func NewAnacondaPipeline(m *Manifest,
|
func NewAnaconda(m *Manifest,
|
||||||
buildPipeline *BuildPipeline,
|
buildPipeline *Build,
|
||||||
repos []rpmmd.RepoConfig,
|
repos []rpmmd.RepoConfig,
|
||||||
kernelName,
|
kernelName,
|
||||||
arch,
|
arch,
|
||||||
product,
|
product,
|
||||||
version string) *AnacondaPipeline {
|
version string) *Anaconda {
|
||||||
p := &AnacondaPipeline{
|
p := &Anaconda{
|
||||||
BasePipeline: NewBasePipeline(m, "anaconda-tree", buildPipeline),
|
Base: NewBase(m, "anaconda-tree", buildPipeline),
|
||||||
repos: repos,
|
repos: repos,
|
||||||
kernelName: kernelName,
|
kernelName: kernelName,
|
||||||
arch: arch,
|
arch: arch,
|
||||||
product: product,
|
product: product,
|
||||||
version: version,
|
version: version,
|
||||||
}
|
}
|
||||||
buildPipeline.addDependent(p)
|
buildPipeline.addDependent(p)
|
||||||
m.addPipeline(p)
|
m.addPipeline(p)
|
||||||
|
|
@ -66,7 +66,7 @@ func NewAnacondaPipeline(m *Manifest,
|
||||||
|
|
||||||
// TODO: refactor - what is required to boot and what to build, and
|
// TODO: refactor - what is required to boot and what to build, and
|
||||||
// do they all belong in this pipeline?
|
// do they all belong in this pipeline?
|
||||||
func (p *AnacondaPipeline) anacondaBootPackageSet() []string {
|
func (p *Anaconda) anacondaBootPackageSet() []string {
|
||||||
packages := []string{
|
packages := []string{
|
||||||
"grub2-tools",
|
"grub2-tools",
|
||||||
"grub2-tools-extra",
|
"grub2-tools-extra",
|
||||||
|
|
@ -99,7 +99,7 @@ func (p *AnacondaPipeline) anacondaBootPackageSet() []string {
|
||||||
return packages
|
return packages
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *AnacondaPipeline) getBuildPackages() []string {
|
func (p *Anaconda) getBuildPackages() []string {
|
||||||
packages := p.anacondaBootPackageSet()
|
packages := p.anacondaBootPackageSet()
|
||||||
packages = append(packages,
|
packages = append(packages,
|
||||||
"rpm",
|
"rpm",
|
||||||
|
|
@ -108,7 +108,7 @@ func (p *AnacondaPipeline) getBuildPackages() []string {
|
||||||
return packages
|
return packages
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *AnacondaPipeline) getPackageSetChain() []rpmmd.PackageSet {
|
func (p *Anaconda) getPackageSetChain() []rpmmd.PackageSet {
|
||||||
packages := p.anacondaBootPackageSet()
|
packages := p.anacondaBootPackageSet()
|
||||||
return []rpmmd.PackageSet{
|
return []rpmmd.PackageSet{
|
||||||
{
|
{
|
||||||
|
|
@ -118,11 +118,11 @@ func (p *AnacondaPipeline) getPackageSetChain() []rpmmd.PackageSet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *AnacondaPipeline) getPackageSpecs() []rpmmd.PackageSpec {
|
func (p *Anaconda) getPackageSpecs() []rpmmd.PackageSpec {
|
||||||
return p.packageSpecs
|
return p.packageSpecs
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *AnacondaPipeline) serializeStart(packages []rpmmd.PackageSpec) {
|
func (p *Anaconda) serializeStart(packages []rpmmd.PackageSpec) {
|
||||||
if len(p.packageSpecs) > 0 {
|
if len(p.packageSpecs) > 0 {
|
||||||
panic("double call to serializeStart()")
|
panic("double call to serializeStart()")
|
||||||
}
|
}
|
||||||
|
|
@ -132,7 +132,7 @@ func (p *AnacondaPipeline) serializeStart(packages []rpmmd.PackageSpec) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *AnacondaPipeline) serializeEnd() {
|
func (p *Anaconda) serializeEnd() {
|
||||||
if len(p.packageSpecs) == 0 {
|
if len(p.packageSpecs) == 0 {
|
||||||
panic("serializeEnd() call when serialization not in progress")
|
panic("serializeEnd() call when serialization not in progress")
|
||||||
}
|
}
|
||||||
|
|
@ -140,11 +140,11 @@ func (p *AnacondaPipeline) serializeEnd() {
|
||||||
p.packageSpecs = nil
|
p.packageSpecs = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *AnacondaPipeline) serialize() osbuild2.Pipeline {
|
func (p *Anaconda) serialize() osbuild2.Pipeline {
|
||||||
if len(p.packageSpecs) == 0 {
|
if len(p.packageSpecs) == 0 {
|
||||||
panic("serialization not started")
|
panic("serialization not started")
|
||||||
}
|
}
|
||||||
pipeline := p.BasePipeline.serialize()
|
pipeline := p.Base.serialize()
|
||||||
|
|
||||||
pipeline.AddStage(osbuild2.NewRPMStage(osbuild2.NewRPMStageOptions(p.repos), osbuild2.NewRpmStageSourceFilesInputs(p.packageSpecs)))
|
pipeline.AddStage(osbuild2.NewRPMStage(osbuild2.NewRPMStageOptions(p.repos), osbuild2.NewRpmStageSourceFilesInputs(p.packageSpecs)))
|
||||||
pipeline.AddStage(osbuild2.NewBuildstampStage(&osbuild2.BuildstampStageOptions{
|
pipeline.AddStage(osbuild2.NewBuildstampStage(&osbuild2.BuildstampStageOptions{
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,15 @@ import (
|
||||||
"github.com/osbuild/osbuild-composer/internal/runner"
|
"github.com/osbuild/osbuild-composer/internal/runner"
|
||||||
)
|
)
|
||||||
|
|
||||||
// A BuildPipeline represents the build environment for other pipelines. As a
|
// A Build represents the build environment for other pipelines. As a
|
||||||
// general rule, tools required to build pipelines are used from the build
|
// general rule, tools required to build pipelines are used from the build
|
||||||
// environment, rather than from the pipeline itself. Without a specified
|
// environment, rather than from the pipeline itself. Without a specified
|
||||||
// build environment, the build host's root filesystem would be used, which
|
// build environment, the build host's root filesystem would be used, which
|
||||||
// is not predictable nor reproducible. For the purposes of building the
|
// is not predictable nor reproducible. For the purposes of building the
|
||||||
// build pipeline, we do use the build host's filesystem, this means we should
|
// build pipeline, we do use the build host's filesystem, this means we should
|
||||||
// make minimal assumptions about what's available there.
|
// make minimal assumptions about what's available there.
|
||||||
type BuildPipeline struct {
|
type Build struct {
|
||||||
BasePipeline
|
Base
|
||||||
|
|
||||||
runner runner.Runner
|
runner runner.Runner
|
||||||
dependents []Pipeline
|
dependents []Pipeline
|
||||||
|
|
@ -22,24 +22,24 @@ type BuildPipeline struct {
|
||||||
packageSpecs []rpmmd.PackageSpec
|
packageSpecs []rpmmd.PackageSpec
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBuildPipeline creates a new build pipeline from the repositories in repos
|
// NewBuild creates a new build pipeline from the repositories in repos
|
||||||
// and the specified packages.
|
// and the specified packages.
|
||||||
func NewBuildPipeline(m *Manifest, runner runner.Runner, repos []rpmmd.RepoConfig) *BuildPipeline {
|
func NewBuild(m *Manifest, runner runner.Runner, repos []rpmmd.RepoConfig) *Build {
|
||||||
pipeline := &BuildPipeline{
|
pipeline := &Build{
|
||||||
BasePipeline: NewBasePipeline(m, "build", nil),
|
Base: NewBase(m, "build", nil),
|
||||||
runner: runner,
|
runner: runner,
|
||||||
dependents: make([]Pipeline, 0),
|
dependents: make([]Pipeline, 0),
|
||||||
repos: repos,
|
repos: repos,
|
||||||
}
|
}
|
||||||
m.addPipeline(pipeline)
|
m.addPipeline(pipeline)
|
||||||
return pipeline
|
return pipeline
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *BuildPipeline) addDependent(dep Pipeline) {
|
func (p *Build) addDependent(dep Pipeline) {
|
||||||
p.dependents = append(p.dependents, dep)
|
p.dependents = append(p.dependents, dep)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *BuildPipeline) getPackageSetChain() []rpmmd.PackageSet {
|
func (p *Build) getPackageSetChain() []rpmmd.PackageSet {
|
||||||
// TODO: make the /usr/bin/cp dependency conditional
|
// TODO: make the /usr/bin/cp dependency conditional
|
||||||
// TODO: make the /usr/bin/xz dependency conditional
|
// TODO: make the /usr/bin/xz dependency conditional
|
||||||
packages := []string{
|
packages := []string{
|
||||||
|
|
@ -62,29 +62,29 @@ func (p *BuildPipeline) getPackageSetChain() []rpmmd.PackageSet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *BuildPipeline) getPackageSpecs() []rpmmd.PackageSpec {
|
func (p *Build) getPackageSpecs() []rpmmd.PackageSpec {
|
||||||
return p.packageSpecs
|
return p.packageSpecs
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *BuildPipeline) serializeStart(packages []rpmmd.PackageSpec) {
|
func (p *Build) serializeStart(packages []rpmmd.PackageSpec) {
|
||||||
if len(p.packageSpecs) > 0 {
|
if len(p.packageSpecs) > 0 {
|
||||||
panic("double call to serializeStart()")
|
panic("double call to serializeStart()")
|
||||||
}
|
}
|
||||||
p.packageSpecs = packages
|
p.packageSpecs = packages
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *BuildPipeline) serializeEnd() {
|
func (p *Build) serializeEnd() {
|
||||||
if len(p.packageSpecs) == 0 {
|
if len(p.packageSpecs) == 0 {
|
||||||
panic("serializeEnd() call when serialization not in progress")
|
panic("serializeEnd() call when serialization not in progress")
|
||||||
}
|
}
|
||||||
p.packageSpecs = nil
|
p.packageSpecs = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *BuildPipeline) serialize() osbuild2.Pipeline {
|
func (p *Build) serialize() osbuild2.Pipeline {
|
||||||
if len(p.packageSpecs) == 0 {
|
if len(p.packageSpecs) == 0 {
|
||||||
panic("serialization not started")
|
panic("serialization not started")
|
||||||
}
|
}
|
||||||
pipeline := p.BasePipeline.serialize()
|
pipeline := p.Base.serialize()
|
||||||
pipeline.Runner = p.runner.String()
|
pipeline.Runner = p.runner.String()
|
||||||
|
|
||||||
pipeline.AddStage(osbuild2.NewRPMStage(osbuild2.NewRPMStageOptions(p.repos), osbuild2.NewRpmStageSourceFilesInputs(p.packageSpecs)))
|
pipeline.AddStage(osbuild2.NewRPMStage(osbuild2.NewRPMStageOptions(p.repos), osbuild2.NewRpmStageSourceFilesInputs(p.packageSpecs)))
|
||||||
|
|
|
||||||
|
|
@ -4,28 +4,28 @@ import (
|
||||||
"github.com/osbuild/osbuild-composer/internal/osbuild2"
|
"github.com/osbuild/osbuild-composer/internal/osbuild2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// OSTreeCommitPipeline represents an ostree with one commit.
|
// OSTreeCommit represents an ostree with one commit.
|
||||||
type OSTreeCommitPipeline struct {
|
type OSTreeCommit struct {
|
||||||
BasePipeline
|
Base
|
||||||
OSVersion string
|
OSVersion string
|
||||||
|
|
||||||
treePipeline *OSPipeline
|
treePipeline *OS
|
||||||
ref string
|
ref string
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewOSTreeCommitPipeline creates a new OSTree commit pipeline. The
|
// NewOSTreeCommit creates a new OSTree commit pipeline. The
|
||||||
// treePipeline is the tree representing the content of the commit.
|
// treePipeline is the tree representing the content of the commit.
|
||||||
// ref is the ref to create the commit under.
|
// ref is the ref to create the commit under.
|
||||||
func NewOSTreeCommitPipeline(m *Manifest,
|
func NewOSTreeCommit(m *Manifest,
|
||||||
buildPipeline *BuildPipeline,
|
buildPipeline *Build,
|
||||||
treePipeline *OSPipeline,
|
treePipeline *OS,
|
||||||
ref string) *OSTreeCommitPipeline {
|
ref string) *OSTreeCommit {
|
||||||
p := &OSTreeCommitPipeline{
|
p := &OSTreeCommit{
|
||||||
BasePipeline: NewBasePipeline(m, "ostree-commit", buildPipeline),
|
Base: NewBase(m, "ostree-commit", buildPipeline),
|
||||||
treePipeline: treePipeline,
|
treePipeline: treePipeline,
|
||||||
ref: ref,
|
ref: ref,
|
||||||
}
|
}
|
||||||
if treePipeline.BasePipeline.manifest != m {
|
if treePipeline.Base.manifest != m {
|
||||||
panic("tree pipeline from different manifest")
|
panic("tree pipeline from different manifest")
|
||||||
}
|
}
|
||||||
buildPipeline.addDependent(p)
|
buildPipeline.addDependent(p)
|
||||||
|
|
@ -33,15 +33,15 @@ func NewOSTreeCommitPipeline(m *Manifest,
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OSTreeCommitPipeline) getBuildPackages() []string {
|
func (p *OSTreeCommit) getBuildPackages() []string {
|
||||||
packages := []string{
|
packages := []string{
|
||||||
"rpm-ostree",
|
"rpm-ostree",
|
||||||
}
|
}
|
||||||
return packages
|
return packages
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OSTreeCommitPipeline) serialize() osbuild2.Pipeline {
|
func (p *OSTreeCommit) serialize() osbuild2.Pipeline {
|
||||||
pipeline := p.BasePipeline.serialize()
|
pipeline := p.Base.serialize()
|
||||||
|
|
||||||
if p.treePipeline.OSTree == nil {
|
if p.treePipeline.OSTree == nil {
|
||||||
panic("tree is not ostree")
|
panic("tree is not ostree")
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@ import (
|
||||||
"github.com/osbuild/osbuild-composer/internal/rpmmd"
|
"github.com/osbuild/osbuild-composer/internal/rpmmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
// An OSTreeCommitServerTreePipeline contains an nginx server serving
|
// An OSTreeCommitServer contains an nginx server serving
|
||||||
// an embedded ostree commit.
|
// an embedded ostree commit.
|
||||||
type OSTreeCommitServerTreePipeline struct {
|
type OSTreeCommitServer struct {
|
||||||
BasePipeline
|
Base
|
||||||
// Packages to install in addition to the ones required by the
|
// Packages to install in addition to the ones required by the
|
||||||
// pipeline.
|
// pipeline.
|
||||||
ExtraPackages []string
|
ExtraPackages []string
|
||||||
|
|
@ -22,31 +22,31 @@ type OSTreeCommitServerTreePipeline struct {
|
||||||
|
|
||||||
repos []rpmmd.RepoConfig
|
repos []rpmmd.RepoConfig
|
||||||
packageSpecs []rpmmd.PackageSpec
|
packageSpecs []rpmmd.PackageSpec
|
||||||
commitPipeline *OSTreeCommitPipeline
|
commitPipeline *OSTreeCommit
|
||||||
nginxConfigPath string
|
nginxConfigPath string
|
||||||
listenPort string
|
listenPort string
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewOSTreeCommitServerTreePipeline creates a new pipeline. The content
|
// NewOSTreeCommitServer creates a new pipeline. The content
|
||||||
// is built from repos and packages, which must contain nginx. commitPipeline
|
// is built from repos and packages, which must contain nginx. commitPipeline
|
||||||
// is a pipeline producing an ostree commit to be served. nginxConfigPath
|
// is a pipeline producing an ostree commit to be served. nginxConfigPath
|
||||||
// is the path to the main nginx config file and listenPort is the port
|
// is the path to the main nginx config file and listenPort is the port
|
||||||
// nginx will be listening on.
|
// nginx will be listening on.
|
||||||
func NewOSTreeCommitServerTreePipeline(m *Manifest,
|
func NewOSTreeCommitServer(m *Manifest,
|
||||||
buildPipeline *BuildPipeline,
|
buildPipeline *Build,
|
||||||
repos []rpmmd.RepoConfig,
|
repos []rpmmd.RepoConfig,
|
||||||
commitPipeline *OSTreeCommitPipeline,
|
commitPipeline *OSTreeCommit,
|
||||||
nginxConfigPath,
|
nginxConfigPath,
|
||||||
listenPort string) *OSTreeCommitServerTreePipeline {
|
listenPort string) *OSTreeCommitServer {
|
||||||
p := &OSTreeCommitServerTreePipeline{
|
p := &OSTreeCommitServer{
|
||||||
BasePipeline: NewBasePipeline(m, "container-tree", buildPipeline),
|
Base: NewBase(m, "container-tree", buildPipeline),
|
||||||
repos: repos,
|
repos: repos,
|
||||||
commitPipeline: commitPipeline,
|
commitPipeline: commitPipeline,
|
||||||
nginxConfigPath: nginxConfigPath,
|
nginxConfigPath: nginxConfigPath,
|
||||||
listenPort: listenPort,
|
listenPort: listenPort,
|
||||||
Language: "en_US",
|
Language: "en_US",
|
||||||
}
|
}
|
||||||
if commitPipeline.BasePipeline.manifest != m {
|
if commitPipeline.Base.manifest != m {
|
||||||
panic("commit pipeline from different manifest")
|
panic("commit pipeline from different manifest")
|
||||||
}
|
}
|
||||||
buildPipeline.addDependent(p)
|
buildPipeline.addDependent(p)
|
||||||
|
|
@ -54,7 +54,7 @@ func NewOSTreeCommitServerTreePipeline(m *Manifest,
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OSTreeCommitServerTreePipeline) getPackageSetChain() []rpmmd.PackageSet {
|
func (p *OSTreeCommitServer) getPackageSetChain() []rpmmd.PackageSet {
|
||||||
packages := []string{"nginx"}
|
packages := []string{"nginx"}
|
||||||
return []rpmmd.PackageSet{
|
return []rpmmd.PackageSet{
|
||||||
{
|
{
|
||||||
|
|
@ -64,7 +64,7 @@ func (p *OSTreeCommitServerTreePipeline) getPackageSetChain() []rpmmd.PackageSet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OSTreeCommitServerTreePipeline) getBuildPackages() []string {
|
func (p *OSTreeCommitServer) getBuildPackages() []string {
|
||||||
packages := []string{
|
packages := []string{
|
||||||
"rpm",
|
"rpm",
|
||||||
"rpm-ostree",
|
"rpm-ostree",
|
||||||
|
|
@ -72,29 +72,29 @@ func (p *OSTreeCommitServerTreePipeline) getBuildPackages() []string {
|
||||||
return packages
|
return packages
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OSTreeCommitServerTreePipeline) getPackageSpecs() []rpmmd.PackageSpec {
|
func (p *OSTreeCommitServer) getPackageSpecs() []rpmmd.PackageSpec {
|
||||||
return p.packageSpecs
|
return p.packageSpecs
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OSTreeCommitServerTreePipeline) serializeStart(packages []rpmmd.PackageSpec) {
|
func (p *OSTreeCommitServer) serializeStart(packages []rpmmd.PackageSpec) {
|
||||||
if len(p.packageSpecs) > 0 {
|
if len(p.packageSpecs) > 0 {
|
||||||
panic("double call to serializeStart()")
|
panic("double call to serializeStart()")
|
||||||
}
|
}
|
||||||
p.packageSpecs = packages
|
p.packageSpecs = packages
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OSTreeCommitServerTreePipeline) serializeEnd() {
|
func (p *OSTreeCommitServer) serializeEnd() {
|
||||||
if len(p.packageSpecs) == 0 {
|
if len(p.packageSpecs) == 0 {
|
||||||
panic("serializeEnd() call when serialization not in progress")
|
panic("serializeEnd() call when serialization not in progress")
|
||||||
}
|
}
|
||||||
p.packageSpecs = nil
|
p.packageSpecs = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OSTreeCommitServerTreePipeline) serialize() osbuild2.Pipeline {
|
func (p *OSTreeCommitServer) serialize() osbuild2.Pipeline {
|
||||||
if len(p.packageSpecs) == 0 {
|
if len(p.packageSpecs) == 0 {
|
||||||
panic("serialization not started")
|
panic("serialization not started")
|
||||||
}
|
}
|
||||||
pipeline := p.BasePipeline.serialize()
|
pipeline := p.Base.serialize()
|
||||||
|
|
||||||
pipeline.AddStage(osbuild2.NewRPMStage(osbuild2.NewRPMStageOptions(p.repos), osbuild2.NewRpmStageSourceFilesInputs(p.packageSpecs)))
|
pipeline.AddStage(osbuild2.NewRPMStage(osbuild2.NewRPMStageOptions(p.repos), osbuild2.NewRpmStageSourceFilesInputs(p.packageSpecs)))
|
||||||
pipeline.AddStage(osbuild2.NewLocaleStage(&osbuild2.LocaleStageOptions{Language: p.Language}))
|
pipeline.AddStage(osbuild2.NewLocaleStage(&osbuild2.LocaleStageOptions{Language: p.Language}))
|
||||||
|
|
|
||||||
|
|
@ -4,42 +4,42 @@ import (
|
||||||
"github.com/osbuild/osbuild-composer/internal/osbuild2"
|
"github.com/osbuild/osbuild-composer/internal/osbuild2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// An ISOPipeline represents a bootable ISO file created from an
|
// An ISO represents a bootable ISO file created from an
|
||||||
// an existing ISOTreePipeline.
|
// an existing ISOTreePipeline.
|
||||||
type ISOPipeline struct {
|
type ISO struct {
|
||||||
BasePipeline
|
Base
|
||||||
ISOLinux bool
|
ISOLinux bool
|
||||||
|
|
||||||
treePipeline *ISOTreePipeline
|
treePipeline *ISOTree
|
||||||
filename string
|
filename string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewISOPipeline(m *Manifest,
|
func NewISO(m *Manifest,
|
||||||
buildPipeline *BuildPipeline,
|
buildPipeline *Build,
|
||||||
treePipeline *ISOTreePipeline,
|
treePipeline *ISOTree,
|
||||||
filename string) *ISOPipeline {
|
filename string) *ISO {
|
||||||
p := &ISOPipeline{
|
p := &ISO{
|
||||||
BasePipeline: NewBasePipeline(m, "bootiso", buildPipeline),
|
Base: NewBase(m, "bootiso", buildPipeline),
|
||||||
treePipeline: treePipeline,
|
treePipeline: treePipeline,
|
||||||
filename: filename,
|
filename: filename,
|
||||||
}
|
}
|
||||||
buildPipeline.addDependent(p)
|
buildPipeline.addDependent(p)
|
||||||
if treePipeline.BasePipeline.manifest != m {
|
if treePipeline.Base.manifest != m {
|
||||||
panic("tree pipeline from different manifest")
|
panic("tree pipeline from different manifest")
|
||||||
}
|
}
|
||||||
m.addPipeline(p)
|
m.addPipeline(p)
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ISOPipeline) getBuildPackages() []string {
|
func (p *ISO) getBuildPackages() []string {
|
||||||
return []string{
|
return []string{
|
||||||
"isomd5sum",
|
"isomd5sum",
|
||||||
"xorriso",
|
"xorriso",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ISOPipeline) serialize() osbuild2.Pipeline {
|
func (p *ISO) serialize() osbuild2.Pipeline {
|
||||||
pipeline := p.BasePipeline.serialize()
|
pipeline := p.Base.serialize()
|
||||||
|
|
||||||
pipeline.AddStage(osbuild2.NewXorrisofsStage(xorrisofsStageOptions(p.filename, p.treePipeline.isoLabel, p.ISOLinux), osbuild2.NewXorrisofsStagePipelineTreeInputs(p.treePipeline.Name())))
|
pipeline.AddStage(osbuild2.NewXorrisofsStage(xorrisofsStageOptions(p.filename, p.treePipeline.isoLabel, p.ISOLinux), osbuild2.NewXorrisofsStagePipelineTreeInputs(p.treePipeline.Name())))
|
||||||
pipeline.AddStage(osbuild2.NewImplantisomd5Stage(&osbuild2.Implantisomd5StageOptions{Filename: p.filename}))
|
pipeline.AddStage(osbuild2.NewImplantisomd5Stage(&osbuild2.Implantisomd5StageOptions{Filename: p.filename}))
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,11 @@ import (
|
||||||
"github.com/osbuild/osbuild-composer/internal/osbuild2"
|
"github.com/osbuild/osbuild-composer/internal/osbuild2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// An ISOTreePipeline represents a tree containing the anaconda installer,
|
// An ISOTree represents a tree containing the anaconda installer,
|
||||||
// configuration in terms of a kickstart file, as well as an embedded
|
// configuration in terms of a kickstart file, as well as an embedded
|
||||||
// payload to be installed.
|
// payload to be installed.
|
||||||
type ISOTreePipeline struct {
|
type ISOTree struct {
|
||||||
BasePipeline
|
Base
|
||||||
// TODO: review optional and mandatory fields and their meaning
|
// TODO: review optional and mandatory fields and their meaning
|
||||||
UEFIVendor string
|
UEFIVendor string
|
||||||
OSName string
|
OSName string
|
||||||
|
|
@ -21,25 +21,25 @@ type ISOTreePipeline struct {
|
||||||
Users []blueprint.UserCustomization
|
Users []blueprint.UserCustomization
|
||||||
Groups []blueprint.GroupCustomization
|
Groups []blueprint.GroupCustomization
|
||||||
|
|
||||||
anacondaPipeline *AnacondaPipeline
|
anacondaPipeline *Anaconda
|
||||||
isoLabel string
|
isoLabel string
|
||||||
osTreeCommit string
|
osTreeCommit string
|
||||||
osTreeURL string
|
osTreeURL string
|
||||||
osTreeRef string
|
osTreeRef string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewISOTreePipeline(m *Manifest,
|
func NewISOTree(m *Manifest,
|
||||||
buildPipeline *BuildPipeline,
|
buildPipeline *Build,
|
||||||
anacondaPipeline *AnacondaPipeline,
|
anacondaPipeline *Anaconda,
|
||||||
osTreeCommit,
|
osTreeCommit,
|
||||||
osTreeURL,
|
osTreeURL,
|
||||||
osTreeRef,
|
osTreeRef,
|
||||||
isoLabelTmpl string) *ISOTreePipeline {
|
isoLabelTmpl string) *ISOTree {
|
||||||
// TODO: replace isoLabelTmpl with more high-level properties
|
// TODO: replace isoLabelTmpl with more high-level properties
|
||||||
isoLabel := fmt.Sprintf(isoLabelTmpl, anacondaPipeline.arch)
|
isoLabel := fmt.Sprintf(isoLabelTmpl, anacondaPipeline.arch)
|
||||||
|
|
||||||
p := &ISOTreePipeline{
|
p := &ISOTree{
|
||||||
BasePipeline: NewBasePipeline(m, "bootiso-tree", buildPipeline),
|
Base: NewBase(m, "bootiso-tree", buildPipeline),
|
||||||
anacondaPipeline: anacondaPipeline,
|
anacondaPipeline: anacondaPipeline,
|
||||||
isoLabel: isoLabel,
|
isoLabel: isoLabel,
|
||||||
osTreeCommit: osTreeCommit,
|
osTreeCommit: osTreeCommit,
|
||||||
|
|
@ -47,14 +47,14 @@ func NewISOTreePipeline(m *Manifest,
|
||||||
osTreeRef: osTreeRef,
|
osTreeRef: osTreeRef,
|
||||||
}
|
}
|
||||||
buildPipeline.addDependent(p)
|
buildPipeline.addDependent(p)
|
||||||
if anacondaPipeline.BasePipeline.manifest != m {
|
if anacondaPipeline.Base.manifest != m {
|
||||||
panic("anaconda pipeline from different manifest")
|
panic("anaconda pipeline from different manifest")
|
||||||
}
|
}
|
||||||
m.addPipeline(p)
|
m.addPipeline(p)
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ISOTreePipeline) getOSTreeCommits() []osTreeCommit {
|
func (p *ISOTree) getOSTreeCommits() []osTreeCommit {
|
||||||
return []osTreeCommit{
|
return []osTreeCommit{
|
||||||
{
|
{
|
||||||
checksum: p.osTreeCommit,
|
checksum: p.osTreeCommit,
|
||||||
|
|
@ -63,7 +63,7 @@ func (p *ISOTreePipeline) getOSTreeCommits() []osTreeCommit {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ISOTreePipeline) getBuildPackages() []string {
|
func (p *ISOTree) getBuildPackages() []string {
|
||||||
packages := []string{
|
packages := []string{
|
||||||
"rpm-ostree",
|
"rpm-ostree",
|
||||||
"squashfs-tools",
|
"squashfs-tools",
|
||||||
|
|
@ -71,8 +71,8 @@ func (p *ISOTreePipeline) getBuildPackages() []string {
|
||||||
return packages
|
return packages
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ISOTreePipeline) serialize() osbuild2.Pipeline {
|
func (p *ISOTree) serialize() osbuild2.Pipeline {
|
||||||
pipeline := p.BasePipeline.serialize()
|
pipeline := p.Base.serialize()
|
||||||
|
|
||||||
kspath := "/osbuild.ks"
|
kspath := "/osbuild.ks"
|
||||||
ostreeRepoPath := "/ostree/repo"
|
ostreeRepoPath := "/ostree/repo"
|
||||||
|
|
|
||||||
|
|
@ -4,30 +4,30 @@ import (
|
||||||
"github.com/osbuild/osbuild-composer/internal/osbuild2"
|
"github.com/osbuild/osbuild-composer/internal/osbuild2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// An OCIContainerPipeline represents an OCI container, containing a filesystem
|
// An OCIContainer represents an OCI container, containing a filesystem
|
||||||
// tree created by another Pipeline.
|
// tree created by another Pipeline.
|
||||||
type OCIContainerPipeline struct {
|
type OCIContainer struct {
|
||||||
BasePipeline
|
Base
|
||||||
Cmd []string
|
Cmd []string
|
||||||
ExposedPorts []string
|
ExposedPorts []string
|
||||||
|
|
||||||
treePipeline *BasePipeline
|
treePipeline *Base
|
||||||
architecture string
|
architecture string
|
||||||
filename string
|
filename string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewOCIContainerPipeline(m *Manifest,
|
func NewOCIContainer(m *Manifest,
|
||||||
buildPipeline *BuildPipeline,
|
buildPipeline *Build,
|
||||||
treePipeline *BasePipeline,
|
treePipeline *Base,
|
||||||
architecture,
|
architecture,
|
||||||
filename string) *OCIContainerPipeline {
|
filename string) *OCIContainer {
|
||||||
p := &OCIContainerPipeline{
|
p := &OCIContainer{
|
||||||
BasePipeline: NewBasePipeline(m, "container", buildPipeline),
|
Base: NewBase(m, "container", buildPipeline),
|
||||||
treePipeline: treePipeline,
|
treePipeline: treePipeline,
|
||||||
architecture: architecture,
|
architecture: architecture,
|
||||||
filename: filename,
|
filename: filename,
|
||||||
}
|
}
|
||||||
if treePipeline.build.BasePipeline.manifest != m {
|
if treePipeline.build.Base.manifest != m {
|
||||||
panic("tree pipeline from different manifest")
|
panic("tree pipeline from different manifest")
|
||||||
}
|
}
|
||||||
buildPipeline.addDependent(p)
|
buildPipeline.addDependent(p)
|
||||||
|
|
@ -35,8 +35,8 @@ func NewOCIContainerPipeline(m *Manifest,
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OCIContainerPipeline) serialize() osbuild2.Pipeline {
|
func (p *OCIContainer) serialize() osbuild2.Pipeline {
|
||||||
pipeline := p.BasePipeline.serialize()
|
pipeline := p.Base.serialize()
|
||||||
|
|
||||||
options := &osbuild2.OCIArchiveStageOptions{
|
options := &osbuild2.OCIArchiveStageOptions{
|
||||||
Architecture: p.architecture,
|
Architecture: p.architecture,
|
||||||
|
|
@ -56,6 +56,6 @@ func (p *OCIContainerPipeline) serialize() osbuild2.Pipeline {
|
||||||
return pipeline
|
return pipeline
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OCIContainerPipeline) getBuildPackages() []string {
|
func (p *OCIContainer) getBuildPackages() []string {
|
||||||
return []string{"tar"}
|
return []string{"tar"}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,10 @@ type OSPipelineOSTreeParent struct {
|
||||||
URL string
|
URL string
|
||||||
}
|
}
|
||||||
|
|
||||||
// OSPipeline represents the filesystem tree of the target image. This roughly
|
// OS represents the filesystem tree of the target image. This roughly
|
||||||
// correpsonds to the root filesystem once an instance of the image is running.
|
// correpsonds to the root filesystem once an instance of the image is running.
|
||||||
type OSPipeline struct {
|
type OS struct {
|
||||||
BasePipeline
|
Base
|
||||||
// Packages to install in addition to the ones required by the
|
// Packages to install in addition to the ones required by the
|
||||||
// pipeline.
|
// pipeline.
|
||||||
ExtraBasePackages []string
|
ExtraBasePackages []string
|
||||||
|
|
@ -99,31 +99,31 @@ type OSPipeline struct {
|
||||||
kernelVer string
|
kernelVer string
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewOSPipeline creates a new OS pipeline. osTree indicates whether or not the
|
// NewOS creates a new OS pipeline. osTree indicates whether or not the
|
||||||
// system is ostree based. osTreeParent indicates (for ostree systems) what the
|
// system is ostree based. osTreeParent indicates (for ostree systems) what the
|
||||||
// parent commit is. repos are the reposotories to install RPMs from. packages
|
// parent commit is. repos are the reposotories to install RPMs from. packages
|
||||||
// are the depsolved pacakges to be installed into the tree. partitionTable
|
// are the depsolved pacakges to be installed into the tree. partitionTable
|
||||||
// represents the disk layout of the target system. kernelName is the name of the
|
// represents the disk layout of the target system. kernelName is the name of the
|
||||||
// kernel package that will be used on the target system.
|
// kernel package that will be used on the target system.
|
||||||
func NewOSPipeline(m *Manifest,
|
func NewOS(m *Manifest,
|
||||||
buildPipeline *BuildPipeline,
|
buildPipeline *Build,
|
||||||
platform platform.Platform,
|
platform platform.Platform,
|
||||||
repos []rpmmd.RepoConfig) *OSPipeline {
|
repos []rpmmd.RepoConfig) *OS {
|
||||||
p := &OSPipeline{
|
p := &OS{
|
||||||
BasePipeline: NewBasePipeline(m, "os", buildPipeline),
|
Base: NewBase(m, "os", buildPipeline),
|
||||||
repos: repos,
|
repos: repos,
|
||||||
platform: platform,
|
platform: platform,
|
||||||
Language: "C.UTF-8",
|
Language: "C.UTF-8",
|
||||||
Hostname: "localhost.localdomain",
|
Hostname: "localhost.localdomain",
|
||||||
Timezone: "UTC",
|
Timezone: "UTC",
|
||||||
SElinux: "targeted",
|
SElinux: "targeted",
|
||||||
}
|
}
|
||||||
buildPipeline.addDependent(p)
|
buildPipeline.addDependent(p)
|
||||||
m.addPipeline(p)
|
m.addPipeline(p)
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OSPipeline) getPackageSetChain() []rpmmd.PackageSet {
|
func (p *OS) getPackageSetChain() []rpmmd.PackageSet {
|
||||||
packages := p.platform.GetPackages()
|
packages := p.platform.GetPackages()
|
||||||
|
|
||||||
if p.KernelName != "" {
|
if p.KernelName != "" {
|
||||||
|
|
@ -165,7 +165,7 @@ func (p *OSPipeline) getPackageSetChain() []rpmmd.PackageSet {
|
||||||
return chain
|
return chain
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OSPipeline) getBuildPackages() []string {
|
func (p *OS) getBuildPackages() []string {
|
||||||
packages := p.platform.GetBuildPackages()
|
packages := p.platform.GetBuildPackages()
|
||||||
packages = append(packages, "rpm")
|
packages = append(packages, "rpm")
|
||||||
if p.OSTree != nil {
|
if p.OSTree != nil {
|
||||||
|
|
@ -178,7 +178,7 @@ func (p *OSPipeline) getBuildPackages() []string {
|
||||||
return packages
|
return packages
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OSPipeline) getOSTreeCommits() []osTreeCommit {
|
func (p *OS) getOSTreeCommits() []osTreeCommit {
|
||||||
commits := []osTreeCommit{}
|
commits := []osTreeCommit{}
|
||||||
if p.OSTree != nil && p.OSTree.Parent != nil {
|
if p.OSTree != nil && p.OSTree.Parent != nil {
|
||||||
commits = append(commits, osTreeCommit{
|
commits = append(commits, osTreeCommit{
|
||||||
|
|
@ -189,11 +189,11 @@ func (p *OSPipeline) getOSTreeCommits() []osTreeCommit {
|
||||||
return commits
|
return commits
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OSPipeline) getPackageSpecs() []rpmmd.PackageSpec {
|
func (p *OS) getPackageSpecs() []rpmmd.PackageSpec {
|
||||||
return p.packageSpecs
|
return p.packageSpecs
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OSPipeline) serializeStart(packages []rpmmd.PackageSpec) {
|
func (p *OS) serializeStart(packages []rpmmd.PackageSpec) {
|
||||||
if len(p.packageSpecs) > 0 {
|
if len(p.packageSpecs) > 0 {
|
||||||
panic("double call to serializeStart()")
|
panic("double call to serializeStart()")
|
||||||
}
|
}
|
||||||
|
|
@ -203,7 +203,7 @@ func (p *OSPipeline) serializeStart(packages []rpmmd.PackageSpec) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OSPipeline) serializeEnd() {
|
func (p *OS) serializeEnd() {
|
||||||
if len(p.packageSpecs) == 0 {
|
if len(p.packageSpecs) == 0 {
|
||||||
panic("serializeEnd() call when serialization not in progress")
|
panic("serializeEnd() call when serialization not in progress")
|
||||||
}
|
}
|
||||||
|
|
@ -211,12 +211,12 @@ func (p *OSPipeline) serializeEnd() {
|
||||||
p.packageSpecs = nil
|
p.packageSpecs = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *OSPipeline) serialize() osbuild2.Pipeline {
|
func (p *OS) serialize() osbuild2.Pipeline {
|
||||||
if len(p.packageSpecs) == 0 {
|
if len(p.packageSpecs) == 0 {
|
||||||
panic("serialization not started")
|
panic("serialization not started")
|
||||||
}
|
}
|
||||||
|
|
||||||
pipeline := p.BasePipeline.serialize()
|
pipeline := p.Base.serialize()
|
||||||
|
|
||||||
if p.OSTree != nil && p.OSTree.Parent != nil {
|
if p.OSTree != nil && p.OSTree.Parent != nil {
|
||||||
pipeline.AddStage(osbuild2.NewOSTreePasswdStage("org.osbuild.source", p.OSTree.Parent.Checksum))
|
pipeline.AddStage(osbuild2.NewOSTreePasswdStage("org.osbuild.source", p.OSTree.Parent.Checksum))
|
||||||
|
|
|
||||||
|
|
@ -23,42 +23,42 @@ type Pipeline interface {
|
||||||
getInline() []string
|
getInline() []string
|
||||||
}
|
}
|
||||||
|
|
||||||
// A BasePipeline represents the core functionality shared between each of the pipeline
|
// A Base represents the core functionality shared between each of the pipeline
|
||||||
// implementations, and the BasePipeline struct must be embedded in each of them.
|
// implementations, and the Base struct must be embedded in each of them.
|
||||||
type BasePipeline struct {
|
type Base struct {
|
||||||
manifest *Manifest
|
manifest *Manifest
|
||||||
name string
|
name string
|
||||||
build *BuildPipeline
|
build *Build
|
||||||
}
|
}
|
||||||
|
|
||||||
// Name returns the name of the pipeline. The name must be unique for a given manifest.
|
// Name returns the name of the pipeline. The name must be unique for a given manifest.
|
||||||
// Pipeline names are used to refer to pipelines either as dependencies between pipelines
|
// Pipeline names are used to refer to pipelines either as dependencies between pipelines
|
||||||
// or for exporting them.
|
// or for exporting them.
|
||||||
func (p BasePipeline) Name() string {
|
func (p Base) Name() string {
|
||||||
return p.name
|
return p.name
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p BasePipeline) getBuildPackages() []string {
|
func (p Base) getBuildPackages() []string {
|
||||||
return []string{}
|
return []string{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p BasePipeline) getPackageSetChain() []rpmmd.PackageSet {
|
func (p Base) getPackageSetChain() []rpmmd.PackageSet {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p BasePipeline) getPackageSpecs() []rpmmd.PackageSpec {
|
func (p Base) getPackageSpecs() []rpmmd.PackageSpec {
|
||||||
return []rpmmd.PackageSpec{}
|
return []rpmmd.PackageSpec{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p BasePipeline) getOSTreeCommits() []osTreeCommit {
|
func (p Base) getOSTreeCommits() []osTreeCommit {
|
||||||
return []osTreeCommit{}
|
return []osTreeCommit{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p BasePipeline) getInline() []string {
|
func (p Base) getInline() []string {
|
||||||
return []string{}
|
return []string{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBasePipeline returns a generic Pipeline object. The name is mandatory, immutable and must
|
// NewBase returns a generic Pipeline object. The name is mandatory, immutable and must
|
||||||
// be unique among all the pipelines used in a manifest, which is currently not enforced.
|
// be unique among all the pipelines used in a manifest, which is currently not enforced.
|
||||||
// The build argument is a pipeline representing a build root in which the rest of the
|
// The build argument is a pipeline representing a build root in which the rest of the
|
||||||
// pipeline is built. In order to ensure reproducibility a build pipeline must always be
|
// pipeline is built. In order to ensure reproducibility a build pipeline must always be
|
||||||
|
|
@ -66,14 +66,14 @@ func (p BasePipeline) getInline() []string {
|
||||||
// the build host's filesystem is used as the build root. The runner specifies how to use this
|
// the build host's filesystem is used as the build root. The runner specifies how to use this
|
||||||
// pipeline as a build pipeline, by naming the distro it contains. When the host system is used
|
// pipeline as a build pipeline, by naming the distro it contains. When the host system is used
|
||||||
// as a build root, then the necessary runner is autodetected.
|
// as a build root, then the necessary runner is autodetected.
|
||||||
func NewBasePipeline(m *Manifest, name string, build *BuildPipeline) BasePipeline {
|
func NewBase(m *Manifest, name string, build *Build) Base {
|
||||||
p := BasePipeline{
|
p := Base{
|
||||||
manifest: m,
|
manifest: m,
|
||||||
name: name,
|
name: name,
|
||||||
build: build,
|
build: build,
|
||||||
}
|
}
|
||||||
if build != nil {
|
if build != nil {
|
||||||
if build.BasePipeline.manifest != m {
|
if build.Base.manifest != m {
|
||||||
panic("build pipeline from a different manifest")
|
panic("build pipeline from a different manifest")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -82,18 +82,18 @@ func NewBasePipeline(m *Manifest, name string, build *BuildPipeline) BasePipelin
|
||||||
|
|
||||||
// serializeStart must be called exactly once before each call
|
// serializeStart must be called exactly once before each call
|
||||||
// to serialize().
|
// to serialize().
|
||||||
func (p BasePipeline) serializeStart([]rpmmd.PackageSpec) {
|
func (p Base) serializeStart([]rpmmd.PackageSpec) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// serializeEnd must be called exactly once after each call to
|
// serializeEnd must be called exactly once after each call to
|
||||||
// serialize().
|
// serialize().
|
||||||
func (p BasePipeline) serializeEnd() {
|
func (p Base) serializeEnd() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Serialize turns a given pipeline into an osbuild2.Pipeline object. This object is
|
// Serialize turns a given pipeline into an osbuild2.Pipeline object. This object is
|
||||||
// meant to be treated as opaque and not to be modified further outside of the pipeline
|
// meant to be treated as opaque and not to be modified further outside of the pipeline
|
||||||
// package.
|
// package.
|
||||||
func (p BasePipeline) serialize() osbuild2.Pipeline {
|
func (p Base) serialize() osbuild2.Pipeline {
|
||||||
pipeline := osbuild2.Pipeline{
|
pipeline := osbuild2.Pipeline{
|
||||||
Name: p.name,
|
Name: p.name,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,28 +4,28 @@ import (
|
||||||
"github.com/osbuild/osbuild-composer/internal/osbuild2"
|
"github.com/osbuild/osbuild-composer/internal/osbuild2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// A QCOW2Pipeline turns a raw image file into qcow2 image.
|
// A QCOW2 turns a raw image file into qcow2 image.
|
||||||
type QCOW2Pipeline struct {
|
type QCOW2 struct {
|
||||||
BasePipeline
|
Base
|
||||||
Compat string
|
Compat string
|
||||||
|
|
||||||
imgPipeline *LiveImgPipeline
|
imgPipeline *RawImage
|
||||||
filename string
|
filename string
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewQCOW2Pipeline createsa new QCOW2 pipeline. imgPipeline is the pipeline producing the
|
// NewQCOW2 createsa new QCOW2 pipeline. imgPipeline is the pipeline producing the
|
||||||
// raw image. The pipeline name is the name of the new pipeline. Filename is the name
|
// raw image. The pipeline name is the name of the new pipeline. Filename is the name
|
||||||
// of the produced qcow2 image.
|
// of the produced qcow2 image.
|
||||||
func NewQCOW2Pipeline(m *Manifest,
|
func NewQCOW2(m *Manifest,
|
||||||
buildPipeline *BuildPipeline,
|
buildPipeline *Build,
|
||||||
imgPipeline *LiveImgPipeline,
|
imgPipeline *RawImage,
|
||||||
filename string) *QCOW2Pipeline {
|
filename string) *QCOW2 {
|
||||||
p := &QCOW2Pipeline{
|
p := &QCOW2{
|
||||||
BasePipeline: NewBasePipeline(m, "qcow2", buildPipeline),
|
Base: NewBase(m, "qcow2", buildPipeline),
|
||||||
imgPipeline: imgPipeline,
|
imgPipeline: imgPipeline,
|
||||||
filename: filename,
|
filename: filename,
|
||||||
}
|
}
|
||||||
if imgPipeline.BasePipeline.manifest != m {
|
if imgPipeline.Base.manifest != m {
|
||||||
panic("live image pipeline from different manifest")
|
panic("live image pipeline from different manifest")
|
||||||
}
|
}
|
||||||
buildPipeline.addDependent(p)
|
buildPipeline.addDependent(p)
|
||||||
|
|
@ -33,8 +33,8 @@ func NewQCOW2Pipeline(m *Manifest,
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *QCOW2Pipeline) serialize() osbuild2.Pipeline {
|
func (p *QCOW2) serialize() osbuild2.Pipeline {
|
||||||
pipeline := p.BasePipeline.serialize()
|
pipeline := p.Base.serialize()
|
||||||
|
|
||||||
pipeline.AddStage(osbuild2.NewQEMUStage(
|
pipeline.AddStage(osbuild2.NewQEMUStage(
|
||||||
osbuild2.NewQEMUStageOptions(p.filename,
|
osbuild2.NewQEMUStageOptions(p.filename,
|
||||||
|
|
@ -48,6 +48,6 @@ func (p *QCOW2Pipeline) serialize() osbuild2.Pipeline {
|
||||||
return pipeline
|
return pipeline
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *QCOW2Pipeline) getBuildPackages() []string {
|
func (p *QCOW2) getBuildPackages() []string {
|
||||||
return []string{"qemu-img"}
|
return []string{"qemu-img"}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,38 +5,38 @@ import (
|
||||||
"github.com/osbuild/osbuild-composer/internal/platform"
|
"github.com/osbuild/osbuild-composer/internal/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
// A LiveImgPipeline represents a raw image file which can be booted in a
|
// A RawImage represents a raw image file which can be booted in a
|
||||||
// hypervisor. It is created from an existing OSPipeline.
|
// hypervisor. It is created from an existing OSPipeline.
|
||||||
type LiveImgPipeline struct {
|
type RawImage struct {
|
||||||
BasePipeline
|
Base
|
||||||
treePipeline *OSPipeline
|
treePipeline *OS
|
||||||
|
|
||||||
filename string
|
filename string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewLiveImgPipeline(m *Manifest,
|
func NewRawImage(m *Manifest,
|
||||||
buildPipeline *BuildPipeline,
|
buildPipeline *Build,
|
||||||
treePipeline *OSPipeline,
|
treePipeline *OS,
|
||||||
filename string) *LiveImgPipeline {
|
filename string) *RawImage {
|
||||||
p := &LiveImgPipeline{
|
p := &RawImage{
|
||||||
BasePipeline: NewBasePipeline(m, "image", buildPipeline),
|
Base: NewBase(m, "image", buildPipeline),
|
||||||
treePipeline: treePipeline,
|
treePipeline: treePipeline,
|
||||||
filename: filename,
|
filename: filename,
|
||||||
}
|
}
|
||||||
buildPipeline.addDependent(p)
|
buildPipeline.addDependent(p)
|
||||||
if treePipeline.BasePipeline.manifest != m {
|
if treePipeline.Base.manifest != m {
|
||||||
panic("tree pipeline from different manifest")
|
panic("tree pipeline from different manifest")
|
||||||
}
|
}
|
||||||
m.addPipeline(p)
|
m.addPipeline(p)
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *LiveImgPipeline) getBuildPackages() []string {
|
func (p *RawImage) getBuildPackages() []string {
|
||||||
return p.treePipeline.PartitionTable.GetBuildPackages()
|
return p.treePipeline.PartitionTable.GetBuildPackages()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *LiveImgPipeline) serialize() osbuild2.Pipeline {
|
func (p *RawImage) serialize() osbuild2.Pipeline {
|
||||||
pipeline := p.BasePipeline.serialize()
|
pipeline := p.Base.serialize()
|
||||||
|
|
||||||
pt := p.treePipeline.PartitionTable
|
pt := p.treePipeline.PartitionTable
|
||||||
if pt == nil {
|
if pt == nil {
|
||||||
|
|
@ -4,23 +4,23 @@ import (
|
||||||
"github.com/osbuild/osbuild-composer/internal/osbuild2"
|
"github.com/osbuild/osbuild-composer/internal/osbuild2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// A TarPipeline represents the contents of another pipeline in a tar file
|
// A Tar represents the contents of another pipeline in a tar file
|
||||||
type TarPipeline struct {
|
type Tar struct {
|
||||||
BasePipeline
|
Base
|
||||||
inputPipeline *BasePipeline
|
inputPipeline *Base
|
||||||
filename string
|
filename string
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewTarPipeline creates a new TarPipeline. The inputPipeline represents the
|
// NewTar creates a new TarPipeline. The inputPipeline represents the
|
||||||
// filesystem tree which will be the contents of the tar file. The pipelinename
|
// filesystem tree which will be the contents of the tar file. The pipelinename
|
||||||
// is the name of the pipeline. The filename is the name of the output tar file.
|
// is the name of the pipeline. The filename is the name of the output tar file.
|
||||||
func NewTarPipeline(m *Manifest,
|
func NewTar(m *Manifest,
|
||||||
buildPipeline *BuildPipeline,
|
buildPipeline *Build,
|
||||||
inputPipeline *BasePipeline,
|
inputPipeline *Base,
|
||||||
pipelinename,
|
pipelinename,
|
||||||
filename string) *TarPipeline {
|
filename string) *Tar {
|
||||||
p := &TarPipeline{
|
p := &Tar{
|
||||||
BasePipeline: NewBasePipeline(m, pipelinename, buildPipeline),
|
Base: NewBase(m, pipelinename, buildPipeline),
|
||||||
inputPipeline: inputPipeline,
|
inputPipeline: inputPipeline,
|
||||||
filename: filename,
|
filename: filename,
|
||||||
}
|
}
|
||||||
|
|
@ -32,8 +32,8 @@ func NewTarPipeline(m *Manifest,
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *TarPipeline) serialize() osbuild2.Pipeline {
|
func (p *Tar) serialize() osbuild2.Pipeline {
|
||||||
pipeline := p.BasePipeline.serialize()
|
pipeline := p.Base.serialize()
|
||||||
|
|
||||||
tree := new(osbuild2.TarStageInput)
|
tree := new(osbuild2.TarStageInput)
|
||||||
tree.Type = "org.osbuild.tree"
|
tree.Type = "org.osbuild.tree"
|
||||||
|
|
@ -46,6 +46,6 @@ func (p *TarPipeline) serialize() osbuild2.Pipeline {
|
||||||
return pipeline
|
return pipeline
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *TarPipeline) getBuildPackages() []string {
|
func (p *Tar) getBuildPackages() []string {
|
||||||
return []string{"tar"}
|
return []string{"tar"}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,26 +4,26 @@ import (
|
||||||
"github.com/osbuild/osbuild-composer/internal/osbuild2"
|
"github.com/osbuild/osbuild-composer/internal/osbuild2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// A VMDKPipeline turns a raw image file into vmdk image.
|
// A VMDK turns a raw image file into vmdk image.
|
||||||
type VMDKPipeline struct {
|
type VMDK struct {
|
||||||
BasePipeline
|
Base
|
||||||
|
|
||||||
imgPipeline *LiveImgPipeline
|
imgPipeline *RawImage
|
||||||
filename string
|
filename string
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewVMDKPipeline creates a new VMDK pipeline. imgPipeline is the pipeline producing the
|
// NewVMDK creates a new VMDK pipeline. imgPipeline is the pipeline producing the
|
||||||
// raw image. Filename is the name of the produced image.
|
// raw image. Filename is the name of the produced image.
|
||||||
func NewVMDKPipeline(m *Manifest,
|
func NewVMDK(m *Manifest,
|
||||||
buildPipeline *BuildPipeline,
|
buildPipeline *Build,
|
||||||
imgPipeline *LiveImgPipeline,
|
imgPipeline *RawImage,
|
||||||
filename string) *VMDKPipeline {
|
filename string) *VMDK {
|
||||||
p := &VMDKPipeline{
|
p := &VMDK{
|
||||||
BasePipeline: NewBasePipeline(m, "vmdk", buildPipeline),
|
Base: NewBase(m, "vmdk", buildPipeline),
|
||||||
imgPipeline: imgPipeline,
|
imgPipeline: imgPipeline,
|
||||||
filename: filename,
|
filename: filename,
|
||||||
}
|
}
|
||||||
if imgPipeline.BasePipeline.manifest != m {
|
if imgPipeline.Base.manifest != m {
|
||||||
panic("live image pipeline from different manifest")
|
panic("live image pipeline from different manifest")
|
||||||
}
|
}
|
||||||
buildPipeline.addDependent(p)
|
buildPipeline.addDependent(p)
|
||||||
|
|
@ -31,8 +31,8 @@ func NewVMDKPipeline(m *Manifest,
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *VMDKPipeline) serialize() osbuild2.Pipeline {
|
func (p *VMDK) serialize() osbuild2.Pipeline {
|
||||||
pipeline := p.BasePipeline.serialize()
|
pipeline := p.Base.serialize()
|
||||||
|
|
||||||
pipeline.AddStage(osbuild2.NewQEMUStage(
|
pipeline.AddStage(osbuild2.NewQEMUStage(
|
||||||
osbuild2.NewQEMUStageOptions(p.filename, osbuild2.QEMUFormatVMDK, osbuild2.VMDKOptions{
|
osbuild2.NewQEMUStageOptions(p.filename, osbuild2.QEMUFormatVMDK, osbuild2.VMDKOptions{
|
||||||
|
|
@ -44,6 +44,6 @@ func (p *VMDKPipeline) serialize() osbuild2.Pipeline {
|
||||||
return pipeline
|
return pipeline
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *VMDKPipeline) getBuildPackages() []string {
|
func (p *VMDK) getBuildPackages() []string {
|
||||||
return []string{"qemu-img"}
|
return []string{"qemu-img"}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,27 +4,27 @@ import (
|
||||||
"github.com/osbuild/osbuild-composer/internal/osbuild2"
|
"github.com/osbuild/osbuild-composer/internal/osbuild2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// A VPCPipeline turns a raw image file into qemu-based image format, such as qcow2.
|
// A VPC turns a raw image file into qemu-based image format, such as qcow2.
|
||||||
type VPCPipeline struct {
|
type VPC struct {
|
||||||
BasePipeline
|
Base
|
||||||
|
|
||||||
imgPipeline *LiveImgPipeline
|
imgPipeline *RawImage
|
||||||
filename string
|
filename string
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewVPCPipeline createsa new Qemu pipeline. imgPipeline is the pipeline producing the
|
// NewVPC createsa new Qemu pipeline. imgPipeline is the pipeline producing the
|
||||||
// raw image. The pipeline name is the name of the new pipeline. Filename is the name
|
// raw image. The pipeline name is the name of the new pipeline. Filename is the name
|
||||||
// of the produced image.
|
// of the produced image.
|
||||||
func NewVPCPipeline(m *Manifest,
|
func NewVPC(m *Manifest,
|
||||||
buildPipeline *BuildPipeline,
|
buildPipeline *Build,
|
||||||
imgPipeline *LiveImgPipeline,
|
imgPipeline *RawImage,
|
||||||
filename string) *VPCPipeline {
|
filename string) *VPC {
|
||||||
p := &VPCPipeline{
|
p := &VPC{
|
||||||
BasePipeline: NewBasePipeline(m, "vpc", buildPipeline),
|
Base: NewBase(m, "vpc", buildPipeline),
|
||||||
imgPipeline: imgPipeline,
|
imgPipeline: imgPipeline,
|
||||||
filename: filename,
|
filename: filename,
|
||||||
}
|
}
|
||||||
if imgPipeline.BasePipeline.manifest != m {
|
if imgPipeline.Base.manifest != m {
|
||||||
panic("live image pipeline from different manifest")
|
panic("live image pipeline from different manifest")
|
||||||
}
|
}
|
||||||
buildPipeline.addDependent(p)
|
buildPipeline.addDependent(p)
|
||||||
|
|
@ -32,8 +32,8 @@ func NewVPCPipeline(m *Manifest,
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *VPCPipeline) serialize() osbuild2.Pipeline {
|
func (p *VPC) serialize() osbuild2.Pipeline {
|
||||||
pipeline := p.BasePipeline.serialize()
|
pipeline := p.Base.serialize()
|
||||||
|
|
||||||
pipeline.AddStage(osbuild2.NewQEMUStage(
|
pipeline.AddStage(osbuild2.NewQEMUStage(
|
||||||
osbuild2.NewQEMUStageOptions(p.filename, osbuild2.QEMUFormatVPC, nil),
|
osbuild2.NewQEMUStageOptions(p.filename, osbuild2.QEMUFormatVPC, nil),
|
||||||
|
|
@ -43,6 +43,6 @@ func (p *VPCPipeline) serialize() osbuild2.Pipeline {
|
||||||
return pipeline
|
return pipeline
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *VPCPipeline) getBuildPackages() []string {
|
func (p *VPC) getBuildPackages() []string {
|
||||||
return []string{"qemu-img"}
|
return []string{"qemu-img"}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue