Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1793128: enable s390x bootimage support #2933

Merged
merged 6 commits into from
Jan 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 137 additions & 0 deletions data/data/rhcos-amd64.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
{
"amis": {
"ap-northeast-1": {
"hvm": "ami-0426ca3481a088c7b"
},
"ap-northeast-2": {
"hvm": "ami-014514ae47679721b"
},
"ap-south-1": {
"hvm": "ami-0bd772ba746948d9a"
},
"ap-southeast-1": {
"hvm": "ami-0d76ac0ebaac29e40"
},
"ap-southeast-2": {
"hvm": "ami-0391e92574fb09e08"
},
"ca-central-1": {
"hvm": "ami-04419691da69850cf"
},
"eu-central-1": {
"hvm": "ami-092b69120ecf915ed"
},
"eu-north-1": {
"hvm": "ami-0175e9c9d258cc11d"
},
"eu-west-1": {
"hvm": "ami-04370efd78434697b"
},
"eu-west-2": {
"hvm": "ami-00c74e593125e0096"
},
"eu-west-3": {
"hvm": "ami-058ad17da14ff4d0d"
},
"me-south-1": {
"hvm": "ami-04ab7423e63117ec0"
},
"sa-east-1": {
"hvm": "ami-03f6b71e93e630dab"
},
"us-east-1": {
"hvm": "ami-01e7fdcb66157b224"
},
"us-east-2": {
"hvm": "ami-0bc59aaa7363b805d"
},
"us-west-1": {
"hvm": "ami-0ba912f53c1fdcdf0"
},
"us-west-2": {
"hvm": "ami-08e10b201e19fd5e7"
}
},
"azure": {
"image": "rhcos-42.80.20191002.0.vhd",
"url": "https://rhcos.blob.core.windows.net/imagebucket/rhcos-42.80.20191002.0.vhd"
},
"baseURI": "https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/rhcos-4.2/42.80.20191002.0/",
"buildid": "42.80.20191002.0",
"gcp": {
"image": "rhcos-42-80-20191002-0",
"url": "https://storage.googleapis.com/rhcos/rhcos/42.80.20191002.0.tar.gz"
},
"images": {
"aws": {
"path": "rhcos-42.80.20191002.0-aws.vmdk",
"sha256": "f5dbf8b4721609214101cda353789557de28caffd496b90c62ace46b9f5e0b9f",
"size": 710720458,
"uncompressed-sha256": "63545c92997f487217541e128eee4aa81ab068840e2f988acbe5848ff711388f",
"uncompressed-size": 725895168
},
"azure": {
"path": "rhcos-42.80.20191002.0.vhd",
"sha256": "7336694bcb936b7c95912ba49f9432adbe547837574ccd3e7c4b97a969c95a8c",
"size": 698788031,
"uncompressed-sha256": "1d8c227ec4f22822dfb3a132a764f2e64616e2cb9dd34290e87ff9b805a467fd",
"uncompressed-size": 1900518912
},
"gcp": {
"path": "rhcos-42.80.20191002.0-gcp.tar",
"sha256": "15434ee2b7d32368315519357dd0a036f67c7f9e9b987027512099b6b6d66aaf",
"size": 698392984
},
"initramfs": {
"path": "rhcos-42.80.20191002.0-installer-initramfs.img",
"sha256": "a975a0e5ebdbbd186a94fd2a2fdb122c88b228fd5a44c3118cf0b29f52f58995"
},
"iso": {
"path": "rhcos-42.80.20191002.0-installer.iso",
"sha256": "649cdcf265bf39c0386331ec9b100da7c4800eae6c5aab4a8c28514b6efc5289"
},
"kernel": {
"path": "rhcos-42.80.20191002.0-installer-kernel",
"sha256": "a31a100ad4ad033240ad8547f55a803542f7a6212adb7df1d0fb4618383b9729"
},
"metal-bios": {
"path": "rhcos-42.80.20191002.0-metal-bios.raw.gz",
"sha256": "4de137e8e3e07f57fa6295b4f95be503f26835a782f9778607e12551669ee6bc",
"size": 700157452,
"uncompressed-sha256": "1ee6d0f9d931396ba089489646ad4a0046014cd59e08f38918ebe500b34e498a",
"uncompressed-size": 3182428160
},
"metal-uefi": {
"path": "rhcos-42.80.20191002.0-metal-uefi.raw.gz",
"sha256": "ee6c25c0eeb44e6016ed8604e2c302c7c8c940ef372277f62b23ccdad5a2225e",
"size": 699608952,
"uncompressed-sha256": "c1f2d7e12d5c2f96cd2d373111831e4aae85a6c2a1a9ce9ffb987678a11c39bd",
"uncompressed-size": 3182428160
},
"openstack": {
"path": "rhcos-42.80.20191002.0-openstack.qcow2",
"sha256": "b9225f67ae16ef38625c9669d556324d6422b29b5f6bfbd87e960062bfb37f70",
"size": 699870352,
"uncompressed-sha256": "414a90ca4fca60a7d25dee02f63d51ad5afc1a614e6a76135e26a1ec62ef40d1",
"uncompressed-size": 1911160832
},
"qemu": {
"path": "rhcos-42.80.20191002.0-qemu.qcow2",
"sha256": "ff8a785d749f5ef771f966e11c498e3eb214f9f82856e5f2d62e81f2f89062c9",
"size": 699873960,
"uncompressed-sha256": "3479ae1cdedc4dd983fba0e356ef2649d2c74bf97b71d818b1c4c31d16d6674b",
"uncompressed-size": 1911095296
},
"vmware": {
"path": "rhcos-42.80.20191002.0-vmware.ova",
"sha256": "91a729bde4512dd5d5a7ab060c482aea3ee48d56c7f5d8ce51f8596c8b7827bf",
"size": 725903360
}
},
"oscontainer": {
"digest": "sha256:cc71fbd134f063d9fc0ccc78933b89c8dd2b1418b7a7b85bb70de87bc80486d7",
"image": "quay.io/openshift-release-dev/ocp-v4.0-art-dev"
},
"ostree-commit": "3f772530680edb70ded914f213c07cfa740f1d0ca351941af8e7e5b3e40b8451",
"ostree-version": "42.80.20191002.0"
}
52 changes: 52 additions & 0 deletions data/data/rhcos-s390x.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"baseURI": "https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/rhcos-4.2-s390x/42s390x.81.20191224.0/",
"buildid": "42s390x.81.20191224.0",
"images": {
"initramfs": {
"path": "rhcos-42s390x.81.20191224.0-installer-initramfs.img",
"sha256": "ff9aa34dd37c43081b469529faf60d4ebc4cde396305634cdf8e480f7793b387"
},
"iso": {
"path": "rhcos-42s390x.81.20191224.0-installer.iso",
"sha256": "829864fee624cb3e99196b79d3818fa3ba01ce7bb061be82de99349a63732608"
},
"kernel": {
"path": "rhcos-42s390x.81.20191224.0-installer-kernel",
"sha256": "930921428eb3d815c698fb34a1d6203747558f591992461727a4973fb0f48547"
},
"metal-dasd": {
"path": "rhcos-42s390x.81.20191224.0-metal-dasd.raw.gz",
"sha256": "308bd932dd84359c92009ccc18eaab33934204aaea1f5dee7ee1e7c3c10b00d5",
"size": 630440448,
"uncompressed-sha256": "2604ff12b0e7bf7e6307c4383928024a8ecaface702a3fafe6650bd632c5e075",
"uncompressed-size": 3155165184
},
"metal-zfcp": {
"path": "rhcos-42s390x.81.20191224.0-metal-zfcp.raw.gz",
"sha256": "335d8cc1acb469e3e96f5425199b355afc4596d721abe1ed2b0e8f8cf2e7f78c",
"size": 630418089,
"uncompressed-sha256": "ea08f2bcfdefbbea0e318bc915e933a820951ba67b87b8dc330262f492aec074",
"uncompressed-size": 3155165184
},
"openstack": {
"path": "rhcos-42s390x.81.20191224.0-openstack.qcow2",
"sha256": "c28ec6a6c33074fe4f3daee565093dbc855b4d322ac4b03bc6d63e41311bcd64",
"size": 629819070,
"uncompressed-sha256": "2ecd3ab1d600c5a4c2cbd1abc272cfec81ef08deb9ba09d54d9011d8cae59a2d",
"uncompressed-size": 1864564736
},
"qemu": {
"path": "rhcos-42s390x.81.20191224.0-qemu.qcow2",
"sha256": "469605b08839339821524385c31022bacddeca67ae0206102910e335471c63f1",
"size": 629819608,
"uncompressed-sha256": "e6747945e805bc627a21a4f2d9ccc104b096410ed0d6256e27e91450a5bbe3d7",
"uncompressed-size": 1864499200
}
},
"oscontainer": {
"digest": "sha256:37498b2eae0f317a444ebb01c399e69c6571e845b008e51f52b4b45eeb2ee2df",
"image": "quay.io/openshift-release-dev/ocp-v4.0-art-dev"
},
"ostree-commit": "018c6d74da09e1bd34281bb2ccaea752f26f08db07af52e036374c13761067a7",
"ostree-version": "42s390x.81.20191224.0"
}
3 changes: 3 additions & 0 deletions data/data/rhcos.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
"eu-west-3": {
"hvm": "ami-058ad17da14ff4d0d"
},
"me-south-1": {
"hvm": "ami-04ab7423e63117ec0"
},
"sa-east-1": {
"hvm": "ami-03f6b71e93e630dab"
},
Expand Down
2 changes: 2 additions & 0 deletions docs/user/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ For example, 10.0.0.0/16 represents IP addresses 10.0.0.0 through 10.0.255.255.

The following machine-pool properties are available:

* `architecture` (optional string): Determines the instruction set architecture of the machines in the pool. Currently, heteregeneous clusters are not supported, so all pools must specify the same architecture.
Valid values are `amd64` (the default).
* `hyperthreading` (optional string): Determines the mode of hyperthreading that machines in the pool will utalize.
Valid values are `Enabled` (the default) and `Disabled`.
* `name` (required string): The name of the machine pool.
Expand Down
39 changes: 29 additions & 10 deletions hack/update-rhcos-bootimage.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,48 @@
#!/usr/bin/python3
# Usage: ./hack/update-rhcos-bootimage.py https://releases-rhcos.svc.ci.openshift.org/storage/releases/ootpa/410.8.20190401.0/meta.json
#!/usr/bin/env python3
# Usage: ./hack/update-rhcos-bootimage.py https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/rhcos-4.2/42.80.20191002.0/meta.json amd64
import codecs,os,sys,json,argparse
import urllib.parse
import urllib.request

dn = os.path.abspath(os.path.dirname(sys.argv[0]))
# An app running in the CI cluster exposes this public endpoint about ART RHCOS
# builds. Do not try to e.g. point to RHT-internal endpoints.
RHCOS_RELEASES_APP = 'https://releases-art-rhcos.svc.ci.openshift.org'

parser = argparse.ArgumentParser()
parser.add_argument("meta", action='store')
parser.add_argument("arch", action='store', choices=['amd64', 's390x'])
args = parser.parse_args()

metadata_dir = os.path.join(os.path.dirname(sys.argv[0]), "../data/data")

if not args.meta.startswith(RHCOS_RELEASES_APP):
raise SystemExit("URL must start with: " + RHCOS_RELEASES_APP)

with urllib.request.urlopen(args.meta) as f:
string_f = codecs.getreader('utf-8')(f) # support for Python < 3.6
meta = json.load(string_f)
newmeta = {}
for k in ['images', 'buildid', 'oscontainer',
'ostree-commit', 'ostree-version',
'azure', 'gcp']:
newmeta[k] = meta[k]
newmeta['amis'] = {
entry['name']: {
'hvm': entry['hvm'],
if meta.get(k):
newmeta[k] = meta[k]
if meta.get(k):
newmeta['amis'] = {
entry['name']: {
'hvm': entry['hvm'],
}
for entry in meta['amis']
}
for entry in meta['amis']
}
newmeta['baseURI'] = urllib.parse.urljoin(args.meta, '.')
with open(os.path.join(dn, "../data/data/rhcos.json"), 'w') as f:

with open(os.path.join(metadata_dir, f"rhcos-{args.arch}.json"), 'w') as f:
json.dump(newmeta, f, sort_keys=True, indent=4)

# Continue to populate the legacy metadata file because there are still
# processes consuming this file directly. This normally could just be a symlink
# but some of these processes reference raw.githubusercontent.com which doesn't
# follow symlinks.
if args.arch == 'amd64':
with open(os.path.join(metadata_dir, "rhcos.json"), 'w') as f:
json.dump(newmeta, f, sort_keys=True, indent=4)
6 changes: 6 additions & 0 deletions pkg/asset/installconfig/installconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,14 @@ func TestInstallConfigGenerate_FillsInDefaults(t *testing.T) {
Name: "master",
Replicas: pointer.Int64Ptr(3),
Hyperthreading: types.HyperthreadingEnabled,
Architecture: types.ArchitectureAMD64,
},
Compute: []types.MachinePool{
{
Name: "worker",
Replicas: pointer.Int64Ptr(3),
Hyperthreading: types.HyperthreadingEnabled,
Architecture: types.ArchitectureAMD64,
},
},
Platform: types.Platform{
Expand Down Expand Up @@ -140,12 +142,14 @@ pullSecret: "{\"auths\":{\"example.com\":{\"auth\":\"authorization value\"}}}"
Name: "master",
Replicas: pointer.Int64Ptr(3),
Hyperthreading: types.HyperthreadingEnabled,
Architecture: types.ArchitectureAMD64,
},
Compute: []types.MachinePool{
{
Name: "worker",
Replicas: pointer.Int64Ptr(3),
Hyperthreading: types.HyperthreadingEnabled,
Architecture: types.ArchitectureAMD64,
},
},
Platform: types.Platform{
Expand Down Expand Up @@ -221,12 +225,14 @@ network:
Name: "master",
Replicas: pointer.Int64Ptr(3),
Hyperthreading: types.HyperthreadingEnabled,
Architecture: types.ArchitectureAMD64,
},
Compute: []types.MachinePool{
{
Name: "worker",
Replicas: pointer.Int64Ptr(3),
Hyperthreading: types.HyperthreadingEnabled,
Architecture: types.ArchitectureAMD64,
},
},
Platform: types.Platform{
Expand Down
14 changes: 9 additions & 5 deletions pkg/asset/manifests/operators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ func TestRedactedInstallConfig(t *testing.T) {
ServiceNetwork: []ipnet.IPNet{*ipnet.MustParseCIDR("1.2.3.4/5")},
},
ControlPlane: &types.MachinePool{
Name: "control-plane",
Replicas: pointer.Int64Ptr(3),
Name: "control-plane",
Replicas: pointer.Int64Ptr(3),
Architecture: types.ArchitectureAMD64,
},
Compute: []types.MachinePool{
{
Name: "compute",
Replicas: pointer.Int64Ptr(3),
Name: "compute",
Replicas: pointer.Int64Ptr(3),
Architecture: types.ArchitectureAMD64,
},
},
Platform: types.Platform{
Expand All @@ -57,10 +59,12 @@ func TestRedactedInstallConfig(t *testing.T) {
expectedConfig := createInstallConfig()
expectedYaml := `baseDomain: test-domain
compute:
- name: compute
- architecture: amd64
name: compute
platform: {}
replicas: 3
controlPlane:
architecture: amd64
name: control-plane
platform: {}
replicas: 3
Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/rhcos/bootstrap_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (i *BootstrapImage) Generate(p asset.Parents) error {
case baremetal.Name:
// Baremetal IPI launches a local VM for the bootstrap node
// Hence requires the QEMU image to use the libvirt backend
osimage, err = rhcos.QEMU(ctx)
osimage, err = rhcos.QEMU(ctx, config.ControlPlane.Architecture)
default:
// other platforms use the same image for all nodes
osimage, err = osImage(config)
Expand Down
12 changes: 7 additions & 5 deletions pkg/asset/rhcos/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ func (i *Image) Generate(p asset.Parents) error {
}

func osImage(config *types.InstallConfig) (string, error) {
arch := config.ControlPlane.Architecture

var osimage string
var err error
ctx, cancel := context.WithTimeout(context.TODO(), 30*time.Second)
Expand All @@ -72,20 +74,20 @@ func osImage(config *types.InstallConfig) (string, error) {
osimage = config.Platform.AWS.AMIID
break
}
osimage, err = rhcos.AMI(ctx, config.Platform.AWS.Region)
osimage, err = rhcos.AMI(ctx, arch, config.Platform.AWS.Region)
case gcp.Name:
osimage, err = rhcos.GCP(ctx)
osimage, err = rhcos.GCP(ctx, arch)
case libvirt.Name:
osimage, err = rhcos.QEMU(ctx)
osimage, err = rhcos.QEMU(ctx, arch)
case openstack.Name:
osimage = "rhcos"
case azure.Name:
osimage, err = rhcos.VHD(ctx)
osimage, err = rhcos.VHD(ctx, arch)
case baremetal.Name:
// Note that baremetal IPI currently uses the OpenStack image
// because this contains the necessary ironic config drive
// ignition support, which isn't enabled in the UPI BM images
osimage, err = rhcos.OpenStack(ctx)
osimage, err = rhcos.OpenStack(ctx, arch)
case none.Name, vsphere.Name:
default:
return "", errors.New("invalid Platform")
Expand Down
Loading