distro: introduce PackageSetsChains() method to ImageType

Introduce a new method `PackageSetsChains()` to the `ImageType`
interface, which returns a named lists of package sets, which should be
depolved together in a chain.

Extend all distro implementations with the new method.

Add a unit test ensuring that if an image type defines some package set
name chains, that all of the listed package set names are present in the
package set map returned by the image type.

The method is currently not used anywhere. This is a preparation for
switching from current way of depsolving to the chain depsolving.
This commit is contained in:
Tomas Hozza 2022-04-21 15:42:00 +02:00 committed by Ondřej Budai
parent 04d45a0fce
commit fee529cd0a
12 changed files with 219 additions and 0 deletions

View file

@ -116,6 +116,9 @@ type ImageType interface {
// Returns the package set names safe to install custom packages via custom repositories. // Returns the package set names safe to install custom packages via custom repositories.
PayloadPackageSets() []string PayloadPackageSets() []string
// Returns named arrays of package set names which should be depsolved in a chain.
PackageSetsChains() map[string][]string
// Returns the names of the stages that will produce the build output. // Returns the names of the stages that will produce the build output.
Exports() []string Exports() []string

View file

@ -99,3 +99,10 @@ func TestDistro_Version(t *testing.T) {
require.Error(err, "Invalid manifest did not return an error") require.Error(err, "Invalid manifest did not return an error")
} }
} }
func TestDistro_ImageType_PackageSetsChains(t *testing.T) {
dr := distroregistry.NewDefault()
for _, distroName := range dr.List() {
distro_test_common.TestImageType_PackageSetsChains(t, dr.GetDistro(distroName))
}
}

View file

@ -226,3 +226,26 @@ func GetTestingPackageSpecSets(packageName, arch string, pkgSetNames []string) m
} }
return testPackageSpecSets return testPackageSpecSets
} }
// Ensure that all package sets defined in the package set chains are defined for the image type
func TestImageType_PackageSetsChains(t *testing.T, d distro.Distro) {
distroName := d.Name()
for _, archName := range d.ListArches() {
arch, err := d.GetArch(archName)
require.Nil(t, err)
for _, imageTypeName := range arch.ListImageTypes() {
t.Run(fmt.Sprintf("%s/%s/%s", distroName, archName, imageTypeName), func(t *testing.T) {
imageType, err := arch.GetImageType(imageTypeName)
require.Nil(t, err)
imagePkgSets := imageType.PackageSets(blueprint.Blueprint{})
for _, pkgSetsChain := range imageType.PackageSetsChains() {
for _, packageSetName := range pkgSetsChain {
_, ok := imagePkgSets[packageSetName]
assert.Truef(t, ok, "package set %q defined in a package set chain is not present in the image package sets", packageSetName)
}
}
})
}
}
}

View file

@ -253,6 +253,10 @@ func (t *imageType) PayloadPackageSets() []string {
return []string{"packages"} return []string{"packages"}
} }
func (t *imageType) PackageSetsChains() map[string][]string {
return map[string][]string{}
}
func (t *imageType) Exports() []string { func (t *imageType) Exports() []string {
return distro.ExportsFallback() return distro.ExportsFallback()
} }

View file

@ -244,6 +244,10 @@ func (t *imageType) PayloadPackageSets() []string {
return []string{"packages"} return []string{"packages"}
} }
func (t *imageType) PackageSetsChains() map[string][]string {
return map[string][]string{}
}
func (t *imageType) Exports() []string { func (t *imageType) Exports() []string {
return distro.ExportsFallback() return distro.ExportsFallback()
} }

View file

@ -291,6 +291,10 @@ func (t *imageType) PayloadPackageSets() []string {
return []string{"packages"} return []string{"packages"}
} }
func (t *imageType) PackageSetsChains() map[string][]string {
return map[string][]string{}
}
func (t *imageType) Exports() []string { func (t *imageType) Exports() []string {
if len(t.exports) > 0 { if len(t.exports) > 0 {
return t.exports return t.exports

View file

@ -144,6 +144,10 @@ func (t *imageTypeS2) PayloadPackageSets() []string {
return []string{"packages"} return []string{"packages"}
} }
func (t *imageTypeS2) PackageSetsChains() map[string][]string {
return map[string][]string{}
}
func (t *imageTypeS2) Exports() []string { func (t *imageTypeS2) Exports() []string {
return t.exports return t.exports
} }

View file

@ -291,6 +291,10 @@ func (t *imageType) PayloadPackageSets() []string {
return []string{blueprintPkgsKey} return []string{blueprintPkgsKey}
} }
func (t *imageType) PackageSetsChains() map[string][]string {
return map[string][]string{osPkgsKey: {osPkgsKey, blueprintPkgsKey}}
}
func (t *imageType) Exports() []string { func (t *imageType) Exports() []string {
return t.exports return t.exports
} }

View file

@ -238,6 +238,7 @@ type imageType struct {
filename string filename string
mimeType string mimeType string
packageSets map[string]packageSetFunc packageSets map[string]packageSetFunc
packageSetChains map[string][]string
defaultImageConfig *distro.ImageConfig defaultImageConfig *distro.ImageConfig
kernelOptions string kernelOptions string
defaultSize uint64 defaultSize uint64
@ -372,6 +373,10 @@ func (t *imageType) PayloadPackageSets() []string {
return []string{blueprintPkgsKey} return []string{blueprintPkgsKey}
} }
func (t *imageType) PackageSetsChains() map[string][]string {
return t.packageSetChains
}
func (t *imageType) Exports() []string { func (t *imageType) Exports() []string {
if len(t.exports) > 0 { if len(t.exports) > 0 {
return t.exports return t.exports
@ -697,6 +702,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: edgeBuildPackageSet, buildPkgsKey: edgeBuildPackageSet,
osPkgsKey: edgeCommitPackageSet, osPkgsKey: edgeCommitPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: &distro.ImageConfig{ defaultImageConfig: &distro.ImageConfig{
EnabledServices: edgeServices, EnabledServices: edgeServices,
}, },
@ -721,6 +729,9 @@ func newDistro(distroName string) distro.Distro {
} }
}, },
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: &distro.ImageConfig{ defaultImageConfig: &distro.ImageConfig{
EnabledServices: edgeServices, EnabledServices: edgeServices,
}, },
@ -768,6 +779,9 @@ func newDistro(distroName string) distro.Distro {
osPkgsKey: edgeCommitPackageSet, osPkgsKey: edgeCommitPackageSet,
installerPkgsKey: edgeInstallerPackageSet, installerPkgsKey: edgeInstallerPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: &distro.ImageConfig{ defaultImageConfig: &distro.ImageConfig{
EnabledServices: edgeServices, EnabledServices: edgeServices,
}, },
@ -818,6 +832,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: distroBuildPackageSet, buildPkgsKey: distroBuildPackageSet,
osPkgsKey: qcow2CommonPackageSet, osPkgsKey: qcow2CommonPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: &distro.ImageConfig{ defaultImageConfig: &distro.ImageConfig{
DefaultTarget: "multi-user.target", DefaultTarget: "multi-user.target",
RHSMConfig: map[distro.RHSMSubscriptionStatus]*osbuild.RHSMStageOptions{ RHSMConfig: map[distro.RHSMSubscriptionStatus]*osbuild.RHSMStageOptions{
@ -850,6 +867,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: distroBuildPackageSet, buildPkgsKey: distroBuildPackageSet,
osPkgsKey: vhdCommonPackageSet, osPkgsKey: vhdCommonPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: &distro.ImageConfig{ defaultImageConfig: &distro.ImageConfig{
EnabledServices: []string{ EnabledServices: []string{
"sshd", "sshd",
@ -875,6 +895,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet, buildPkgsKey: ec2BuildPackageSet,
osPkgsKey: azureRhuiCommonPackageSet, osPkgsKey: azureRhuiCommonPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: &distro.ImageConfig{ defaultImageConfig: &distro.ImageConfig{
Timezone: "Etc/UTC", Timezone: "Etc/UTC",
Locale: "en_US.UTF-8", Locale: "en_US.UTF-8",
@ -1022,6 +1045,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: distroBuildPackageSet, buildPkgsKey: distroBuildPackageSet,
osPkgsKey: vmdkCommonPackageSet, osPkgsKey: vmdkCommonPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
kernelOptions: "ro net.ifnames=0", kernelOptions: "ro net.ifnames=0",
bootable: true, bootable: true,
defaultSize: 4 * GigaByte, defaultSize: 4 * GigaByte,
@ -1040,6 +1066,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: distroBuildPackageSet, buildPkgsKey: distroBuildPackageSet,
osPkgsKey: openstackCommonPackageSet, osPkgsKey: openstackCommonPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
kernelOptions: "ro net.ifnames=0", kernelOptions: "ro net.ifnames=0",
bootable: true, bootable: true,
defaultSize: 4 * GigaByte, defaultSize: 4 * GigaByte,
@ -1249,6 +1278,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet, buildPkgsKey: ec2BuildPackageSet,
osPkgsKey: ec2CommonPackageSet, osPkgsKey: ec2CommonPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: defaultAMIImageConfigX86_64, defaultImageConfig: defaultAMIImageConfigX86_64,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto",
bootable: true, bootable: true,
@ -1269,6 +1301,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet, buildPkgsKey: ec2BuildPackageSet,
osPkgsKey: ec2CommonPackageSet, osPkgsKey: ec2CommonPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: defaultAMIImageConfig, defaultImageConfig: defaultAMIImageConfig,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0 crashkernel=auto", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0 crashkernel=auto",
bootable: true, bootable: true,
@ -1288,6 +1323,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet, buildPkgsKey: ec2BuildPackageSet,
osPkgsKey: rhelEc2PackageSet, osPkgsKey: rhelEc2PackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: defaultEc2ImageConfigX86_64, defaultImageConfig: defaultEc2ImageConfigX86_64,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto",
bootable: true, bootable: true,
@ -1308,6 +1346,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet, buildPkgsKey: ec2BuildPackageSet,
osPkgsKey: rhelEc2PackageSet, osPkgsKey: rhelEc2PackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: defaultEc2ImageConfig, defaultImageConfig: defaultEc2ImageConfig,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0 crashkernel=auto", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0 crashkernel=auto",
bootable: true, bootable: true,
@ -1327,6 +1368,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet, buildPkgsKey: ec2BuildPackageSet,
osPkgsKey: rhelEc2HaPackageSet, osPkgsKey: rhelEc2HaPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: defaultEc2ImageConfigX86_64, defaultImageConfig: defaultEc2ImageConfigX86_64,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto",
bootable: true, bootable: true,
@ -1458,6 +1502,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet, buildPkgsKey: ec2BuildPackageSet,
osPkgsKey: rhelEc2SapPackageSet, osPkgsKey: rhelEc2SapPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: defaultEc2SapImageConfigX86_64, defaultImageConfig: defaultEc2SapImageConfigX86_64,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto processor.max_cstate=1 intel_idle.max_cstate=1", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto processor.max_cstate=1 intel_idle.max_cstate=1",
bootable: true, bootable: true,
@ -1599,6 +1646,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: distroBuildPackageSet, buildPkgsKey: distroBuildPackageSet,
osPkgsKey: gcePackageSet, osPkgsKey: gcePackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: defaultGceByosImageConfig, defaultImageConfig: defaultGceByosImageConfig,
kernelOptions: "net.ifnames=0 biosdevname=0 scsi_mod.use_blk_mq=Y crashkernel=auto console=ttyS0,38400n8d", kernelOptions: "net.ifnames=0 biosdevname=0 scsi_mod.use_blk_mq=Y crashkernel=auto console=ttyS0,38400n8d",
bootable: true, bootable: true,
@ -1644,6 +1694,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: distroBuildPackageSet, buildPkgsKey: distroBuildPackageSet,
osPkgsKey: gceRhuiPackageSet, osPkgsKey: gceRhuiPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: defaultGceRhuiImageConfig, defaultImageConfig: defaultGceRhuiImageConfig,
kernelOptions: "net.ifnames=0 biosdevname=0 scsi_mod.use_blk_mq=Y crashkernel=auto console=ttyS0,38400n8d", kernelOptions: "net.ifnames=0 biosdevname=0 scsi_mod.use_blk_mq=Y crashkernel=auto console=ttyS0,38400n8d",
bootable: true, bootable: true,
@ -1669,6 +1722,9 @@ func newDistro(distroName string) distro.Distro {
} }
}, },
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
pipelines: tarPipelines, pipelines: tarPipelines,
buildPipelines: []string{"build"}, buildPipelines: []string{"build"},
payloadPipelines: []string{"os", "root-tar"}, payloadPipelines: []string{"os", "root-tar"},
@ -1683,6 +1739,9 @@ func newDistro(distroName string) distro.Distro {
osPkgsKey: bareMetalPackageSet, osPkgsKey: bareMetalPackageSet,
installerPkgsKey: anacondaPackageSet, installerPkgsKey: anacondaPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
rpmOstree: false, rpmOstree: false,
bootISO: true, bootISO: true,
bootable: true, bootable: true,

View file

@ -226,6 +226,7 @@ type imageType struct {
filename string filename string
mimeType string mimeType string
packageSets map[string]packageSetFunc packageSets map[string]packageSetFunc
packageSetChains map[string][]string
defaultImageConfig *distro.ImageConfig defaultImageConfig *distro.ImageConfig
kernelOptions string kernelOptions string
defaultSize uint64 defaultSize uint64
@ -360,6 +361,10 @@ func (t *imageType) PayloadPackageSets() []string {
return []string{blueprintPkgsKey} return []string{blueprintPkgsKey}
} }
func (t *imageType) PackageSetsChains() map[string][]string {
return t.packageSetChains
}
func (t *imageType) Exports() []string { func (t *imageType) Exports() []string {
if len(t.exports) > 0 { if len(t.exports) > 0 {
return t.exports return t.exports
@ -676,6 +681,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: edgeBuildPackageSet, buildPkgsKey: edgeBuildPackageSet,
osPkgsKey: edgeCommitPackageSet, osPkgsKey: edgeCommitPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: &distro.ImageConfig{ defaultImageConfig: &distro.ImageConfig{
EnabledServices: edgeServices, EnabledServices: edgeServices,
}, },
@ -700,6 +708,9 @@ func newDistro(distroName string) distro.Distro {
} }
}, },
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: &distro.ImageConfig{ defaultImageConfig: &distro.ImageConfig{
EnabledServices: edgeServices, EnabledServices: edgeServices,
}, },
@ -750,6 +761,9 @@ func newDistro(distroName string) distro.Distro {
osPkgsKey: edgeCommitPackageSet, osPkgsKey: edgeCommitPackageSet,
installerPkgsKey: edgeInstallerPackageSet, installerPkgsKey: edgeInstallerPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: &distro.ImageConfig{ defaultImageConfig: &distro.ImageConfig{
Locale: "en_US.UTF-8", Locale: "en_US.UTF-8",
EnabledServices: edgeServices, EnabledServices: edgeServices,
@ -801,6 +815,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: distroBuildPackageSet, buildPkgsKey: distroBuildPackageSet,
osPkgsKey: qcow2CommonPackageSet, osPkgsKey: qcow2CommonPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: &distro.ImageConfig{ defaultImageConfig: &distro.ImageConfig{
DefaultTarget: "multi-user.target", DefaultTarget: "multi-user.target",
RHSMConfig: map[distro.RHSMSubscriptionStatus]*osbuild.RHSMStageOptions{ RHSMConfig: map[distro.RHSMSubscriptionStatus]*osbuild.RHSMStageOptions{
@ -833,6 +850,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: distroBuildPackageSet, buildPkgsKey: distroBuildPackageSet,
osPkgsKey: vhdCommonPackageSet, osPkgsKey: vhdCommonPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: &distro.ImageConfig{ defaultImageConfig: &distro.ImageConfig{
Locale: "en_US.UTF-8", Locale: "en_US.UTF-8",
EnabledServices: []string{ EnabledServices: []string{
@ -859,6 +879,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: distroBuildPackageSet, buildPkgsKey: distroBuildPackageSet,
osPkgsKey: vmdkCommonPackageSet, osPkgsKey: vmdkCommonPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: &distro.ImageConfig{ defaultImageConfig: &distro.ImageConfig{
Locale: "en_US.UTF-8", Locale: "en_US.UTF-8",
}, },
@ -880,6 +903,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: distroBuildPackageSet, buildPkgsKey: distroBuildPackageSet,
osPkgsKey: openstackCommonPackageSet, osPkgsKey: openstackCommonPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: &distro.ImageConfig{ defaultImageConfig: &distro.ImageConfig{
Locale: "en_US.UTF-8", Locale: "en_US.UTF-8",
}, },
@ -1094,6 +1120,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet, buildPkgsKey: ec2BuildPackageSet,
osPkgsKey: ec2CommonPackageSet, osPkgsKey: ec2CommonPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: defaultAMIImageConfigX86_64, defaultImageConfig: defaultAMIImageConfigX86_64,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295",
bootable: true, bootable: true,
@ -1114,6 +1143,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet, buildPkgsKey: ec2BuildPackageSet,
osPkgsKey: ec2CommonPackageSet, osPkgsKey: ec2CommonPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: defaultAMIImageConfig, defaultImageConfig: defaultAMIImageConfig,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0",
bootable: true, bootable: true,
@ -1133,6 +1165,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet, buildPkgsKey: ec2BuildPackageSet,
osPkgsKey: rhelEc2PackageSet, osPkgsKey: rhelEc2PackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: defaultEc2ImageConfigX86_64, defaultImageConfig: defaultEc2ImageConfigX86_64,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295",
bootable: true, bootable: true,
@ -1153,6 +1188,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet, buildPkgsKey: ec2BuildPackageSet,
osPkgsKey: rhelEc2PackageSet, osPkgsKey: rhelEc2PackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: defaultEc2ImageConfig, defaultImageConfig: defaultEc2ImageConfig,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0",
bootable: true, bootable: true,
@ -1172,6 +1210,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet, buildPkgsKey: ec2BuildPackageSet,
osPkgsKey: rhelEc2HaPackageSet, osPkgsKey: rhelEc2HaPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: defaultEc2ImageConfigX86_64, defaultImageConfig: defaultEc2ImageConfigX86_64,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295",
bootable: true, bootable: true,
@ -1303,6 +1344,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet, buildPkgsKey: ec2BuildPackageSet,
osPkgsKey: rhelEc2SapPackageSet, osPkgsKey: rhelEc2SapPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: defaultEc2SapImageConfigX86_64, defaultImageConfig: defaultEc2SapImageConfigX86_64,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 processor.max_cstate=1 intel_idle.max_cstate=1", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 processor.max_cstate=1 intel_idle.max_cstate=1",
bootable: true, bootable: true,
@ -1443,6 +1487,9 @@ func newDistro(distroName string) distro.Distro {
buildPkgsKey: distroBuildPackageSet, buildPkgsKey: distroBuildPackageSet,
osPkgsKey: gcePackageSet, osPkgsKey: gcePackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: defaultGceImageConfig, defaultImageConfig: defaultGceImageConfig,
kernelOptions: "net.ifnames=0 biosdevname=0 scsi_mod.use_blk_mq=Y console=ttyS0,38400n8d", kernelOptions: "net.ifnames=0 biosdevname=0 scsi_mod.use_blk_mq=Y console=ttyS0,38400n8d",
bootable: true, bootable: true,
@ -1468,6 +1515,9 @@ func newDistro(distroName string) distro.Distro {
} }
}, },
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
pipelines: tarPipelines, pipelines: tarPipelines,
buildPipelines: []string{"build"}, buildPipelines: []string{"build"},
payloadPipelines: []string{"os", "root-tar"}, payloadPipelines: []string{"os", "root-tar"},
@ -1482,6 +1532,9 @@ func newDistro(distroName string) distro.Distro {
osPkgsKey: bareMetalPackageSet, osPkgsKey: bareMetalPackageSet,
installerPkgsKey: anacondaPackageSet, installerPkgsKey: anacondaPackageSet,
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
rpmOstree: false, rpmOstree: false,
bootISO: true, bootISO: true,
bootable: true, bootable: true,

View file

@ -182,6 +182,7 @@ type imageType struct {
filename string filename string
mimeType string mimeType string
packageSets map[string]rpmmd.PackageSet packageSets map[string]rpmmd.PackageSet
packageSetChains map[string][]string
enabledServices []string enabledServices []string
disabledServices []string disabledServices []string
defaultTarget string defaultTarget string
@ -322,6 +323,10 @@ func (t *imageType) PayloadPackageSets() []string {
return []string{blueprintPkgsKey} return []string{blueprintPkgsKey}
} }
func (t *imageType) PackageSetsChains() map[string][]string {
return t.packageSetChains
}
func (t *imageType) Exports() []string { func (t *imageType) Exports() []string {
return t.exports return t.exports
} }
@ -590,6 +595,9 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
buildPkgsKey: edgeBuildPackageSet(), buildPkgsKey: edgeBuildPackageSet(),
osPkgsKey: edgeCommitPackageSet(), osPkgsKey: edgeCommitPackageSet(),
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
enabledServices: edgeServices, enabledServices: edgeServices,
rpmOstree: true, rpmOstree: true,
pipelines: edgeCommitPipelines, pipelines: edgeCommitPipelines,
@ -607,6 +615,9 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
osPkgsKey: edgeCommitPackageSet(), osPkgsKey: edgeCommitPackageSet(),
containerPkgsKey: {Include: []string{"httpd"}}, containerPkgsKey: {Include: []string{"httpd"}},
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
enabledServices: edgeServices, enabledServices: edgeServices,
rpmOstree: true, rpmOstree: true,
bootISO: false, bootISO: false,
@ -632,6 +643,9 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
osPkgsKey: edgeCommitPackageSet(), osPkgsKey: edgeCommitPackageSet(),
installerPkgsKey: edgeInstallerPackageSet(), installerPkgsKey: edgeInstallerPackageSet(),
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
enabledServices: edgeServices, enabledServices: edgeServices,
rpmOstree: true, rpmOstree: true,
bootISO: true, bootISO: true,
@ -650,6 +664,9 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
packageSets: map[string]rpmmd.PackageSet{ packageSets: map[string]rpmmd.PackageSet{
osPkgsKey: qcow2CommonPackageSet(), osPkgsKey: qcow2CommonPackageSet(),
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
bootable: true, bootable: true,
defaultSize: 10 * GigaByte, defaultSize: 10 * GigaByte,
pipelines: qcow2Pipelines, pipelines: qcow2Pipelines,
@ -666,6 +683,9 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
packageSets: map[string]rpmmd.PackageSet{ packageSets: map[string]rpmmd.PackageSet{
osPkgsKey: vhdCommonPackageSet(), osPkgsKey: vhdCommonPackageSet(),
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
enabledServices: []string{ enabledServices: []string{
"sshd", "sshd",
"waagent", "waagent",
@ -688,6 +708,9 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
packageSets: map[string]rpmmd.PackageSet{ packageSets: map[string]rpmmd.PackageSet{
osPkgsKey: vmdkCommonPackageSet(), osPkgsKey: vmdkCommonPackageSet(),
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
kernelOptions: "ro net.ifnames=0", kernelOptions: "ro net.ifnames=0",
bootable: true, bootable: true,
defaultSize: 4 * GigaByte, defaultSize: 4 * GigaByte,
@ -705,6 +728,9 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
packageSets: map[string]rpmmd.PackageSet{ packageSets: map[string]rpmmd.PackageSet{
osPkgsKey: openstackCommonPackageSet(), osPkgsKey: openstackCommonPackageSet(),
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
kernelOptions: "ro net.ifnames=0", kernelOptions: "ro net.ifnames=0",
bootable: true, bootable: true,
defaultSize: 4 * GigaByte, defaultSize: 4 * GigaByte,
@ -736,6 +762,9 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet(), buildPkgsKey: ec2BuildPackageSet(),
osPkgsKey: ec2CommonPackageSet(), osPkgsKey: ec2CommonPackageSet(),
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultTarget: "multi-user.target", defaultTarget: "multi-user.target",
enabledServices: ec2EnabledServices, enabledServices: ec2EnabledServices,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto",
@ -757,6 +786,9 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet(), buildPkgsKey: ec2BuildPackageSet(),
osPkgsKey: ec2CommonPackageSet(), osPkgsKey: ec2CommonPackageSet(),
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultTarget: "multi-user.target", defaultTarget: "multi-user.target",
enabledServices: ec2EnabledServices, enabledServices: ec2EnabledServices,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0 crashkernel=auto", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0 crashkernel=auto",
@ -777,6 +809,9 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet(), buildPkgsKey: ec2BuildPackageSet(),
osPkgsKey: rhelEc2PackageSet(), osPkgsKey: rhelEc2PackageSet(),
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultTarget: "multi-user.target", defaultTarget: "multi-user.target",
enabledServices: ec2EnabledServices, enabledServices: ec2EnabledServices,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto",
@ -798,6 +833,9 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet(), buildPkgsKey: ec2BuildPackageSet(),
osPkgsKey: rhelEc2PackageSet(), osPkgsKey: rhelEc2PackageSet(),
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultTarget: "multi-user.target", defaultTarget: "multi-user.target",
enabledServices: ec2EnabledServices, enabledServices: ec2EnabledServices,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0 crashkernel=auto", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0 crashkernel=auto",
@ -818,6 +856,9 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet(), buildPkgsKey: ec2BuildPackageSet(),
osPkgsKey: rhelEc2HaPackageSet(), osPkgsKey: rhelEc2HaPackageSet(),
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultTarget: "multi-user.target", defaultTarget: "multi-user.target",
enabledServices: ec2EnabledServices, enabledServices: ec2EnabledServices,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto",
@ -839,6 +880,9 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
buildPkgsKey: ec2BuildPackageSet(), buildPkgsKey: ec2BuildPackageSet(),
osPkgsKey: rhelEc2SapPackageSet(), osPkgsKey: rhelEc2SapPackageSet(),
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultTarget: "multi-user.target", defaultTarget: "multi-user.target",
enabledServices: ec2EnabledServices, enabledServices: ec2EnabledServices,
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto processor.max_cstate=1 intel_idle.max_cstate=1", kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto processor.max_cstate=1 intel_idle.max_cstate=1",
@ -860,6 +904,9 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
Exclude: []string{"rng-tools"}, Exclude: []string{"rng-tools"},
}, },
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
pipelines: tarPipelines, pipelines: tarPipelines,
buildPipelines: []string{"build"}, buildPipelines: []string{"build"},
payloadPipelines: []string{"os", "root-tar"}, payloadPipelines: []string{"os", "root-tar"},
@ -874,6 +921,9 @@ func newDistro(name, modulePlatformID, ostreeRef string) distro.Distro {
osPkgsKey: bareMetalPackageSet(), osPkgsKey: bareMetalPackageSet(),
installerPkgsKey: installerPackageSet(), installerPkgsKey: installerPackageSet(),
}, },
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
rpmOstree: false, rpmOstree: false,
bootISO: true, bootISO: true,
bootable: true, bootable: true,

View file

@ -196,6 +196,10 @@ func (t *TestImageType) PayloadPackageSets() []string {
return []string{} return []string{}
} }
func (t *TestImageType) PackageSetsChains() map[string][]string {
return map[string][]string{}
}
func (t *TestImageType) Exports() []string { func (t *TestImageType) Exports() []string {
return distro.ExportsFallback() return distro.ExportsFallback()
} }