Skip to content

Commit

Permalink
pkg/rhcos: use fcos-<arch>.json in OKD and update to 33.20201201.3.0
Browse files Browse the repository at this point in the history
Some platforms are not supported by OKD installer, so these should be skipped. initramfs, iso and kernel have different formats in fcos meta file.
Official Azure image is not yet uploaded to the Marketplace
  • Loading branch information
vrutkovs committed Jan 12, 2021
1 parent 9143f0f commit 806cab8
Show file tree
Hide file tree
Showing 13 changed files with 394 additions and 27 deletions.
142 changes: 142 additions & 0 deletions data/data/fcos-amd64.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"amis": {
"af-south-1": {
"hvm": "ami-0143dd9f52feec33a"
},
"ap-east-1": {
"hvm": "ami-080c665cf884428ce"
},
"ap-northeast-1": {
"hvm": "ami-0da7393d67be9a7f5"
},
"ap-northeast-2": {
"hvm": "ami-05839a6dd0ee5c9d8"
},
"ap-south-1": {
"hvm": "ami-095a0755f68aeb003"
},
"ap-southeast-1": {
"hvm": "ami-018fee3925b7d96b8"
},
"ap-southeast-2": {
"hvm": "ami-0882bb3b32c27b64f"
},
"ca-central-1": {
"hvm": "ami-07778882bf5fd216a"
},
"eu-central-1": {
"hvm": "ami-0c94affa248a89395"
},
"eu-north-1": {
"hvm": "ami-053ecd1ca26ed1284"
},
"eu-south-1": {
"hvm": "ami-0617bb7a81e1235c7"
},
"eu-west-1": {
"hvm": "ami-090ddacbb95925bb2"
},
"eu-west-2": {
"hvm": "ami-0b6daf74280e396a9"
},
"eu-west-3": {
"hvm": "ami-017cdd3245445103b"
},
"me-south-1": {
"hvm": "ami-0ad4cfe95cca8bbd8"
},
"sa-east-1": {
"hvm": "ami-01e208f38effc6f9e"
},
"us-east-1": {
"hvm": "ami-08ff6cb186e1d6db9"
},
"us-east-2": {
"hvm": "ami-04e2b4a367c475231"
},
"us-west-1": {
"hvm": "ami-0c4db5d37123ec37a"
},
"us-west-2": {
"hvm": "ami-0ee91ee478fedbb3c"
}
},
"azure": {
"image": "fedora-coreos-33.20201214.3.1-azure.x86_64.vhd",
"url": "https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/33.20201214.3.1/x86_64/fedora-coreos-33.20201214.3.1-azure.x86_64.vhd.xz"
},
"baseURI": "https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/33.20201214.3.1/x86_64/",
"buildid": "33.20201214.3.1",
"gcp": {
"family": "fedora-coreos-stable",
"image": "fedora-coreos-33-20201214-3-1-gcp-x86-64",
"project": "fedora-coreos-cloud",
"url": "https://storage.googleapis.com/fedora-coreos-cloud-image-uploads/image-import/fedora-coreos-33-20201214-3-1-gcp-x86-64.tar.gz"
},
"images": {
"aws": {
"path": "fedora-coreos-33.20201214.3.1-aws.x86_64.vmdk.xz",
"sha256": "c008d852615c5f86ecc2aa94e1d7c9a8093d820d6c0e836e24dc5ac2ef64c4a4",
"size": 784942640,
"uncompressed-sha256": "821843e4a24d18ab21cdb196fa178231ca53cd19d3d1e19493f2add50c7253b1",
"uncompressed-size": 831476224
},
"azure": {
"path": "fedora-coreos-33.20201214.3.1-azure.x86_64.vhd.xz",
"sha256": "80be79442de7ae513a9514bca8fe7ade86d905f97995eb98afaa2f1573f6ea70",
"size": 551716928,
"uncompressed-sha256": "0d6a2277607c10370665155fd97b65925eb5b863b1f5fd87b5134c475289927f",
"uncompressed-size": 8589935104
},
"gcp": {
"path": "fedora-coreos-33.20201214.3.1-gcp.x86_64.tar.gz",
"sha256": "28f20e907b876a12947f963e0242314f2118d1de3a7f4d2d1bca962d50998808",
"size": 813364345
},
"initramfs": {
"path": "fedora-coreos-33.20201214.3.1-live-initramfs.x86_64.img",
"sha256": "3e41ea047c8fe1dfc421b5b08ba8e1c9773f4be54825697995ca8bb5d0b74d67"
},
"iso": {
"path": "fedora-coreos-33.20201214.3.1-live.x86_64.iso",
"sha256": "da56437799418eec47bacfa52ba811a0393602d8d6580bbbb9687952c8e35db9"
},
"kernel": {
"path": "fedora-coreos-33.20201214.3.1-live-kernel-x86_64",
"sha256": "d83df46764f1678f06f421c4ca16d8717ff59e8ca2e9014663b204be0e38ff5e"
},
"metal": {
"path": "fedora-coreos-33.20201214.3.1-metal.x86_64.raw.xz",
"sha256": "4314a3cc7302a19ecda5445b92dc91d74fa60abfadf31b628d05ded0a2bbc4f8",
"size": 551645884,
"uncompressed-sha256": "4b89bb58cfce2e0908d2afdbed81828ee3659d6a1820e98b9979e11dc6153464",
"uncompressed-size": 3006267392
},
"openstack": {
"path": "fedora-coreos-33.20201214.3.1-openstack.x86_64.qcow2.xz",
"sha256": "7e85359555467da934d5396b2431d6cf0a369be396c3725a26b1acd4aecd5890",
"size": 548781024,
"uncompressed-sha256": "e78e2f9e89732ce8e7bbed05a44083028718bfebe783ec1eec404059b506a69c",
"uncompressed-size": 1869152256
},
"ostree": {
"path": "fedora-coreos-33.20201214.3.1-ostree.x86_64.tar",
"sha256": "149213897e03290b372a6994e2596860a7d0f97534a372c4eb1f0f987c77055a",
"size": 739604480
},
"qemu": {
"path": "fedora-coreos-33.20201214.3.1-qemu.x86_64.qcow2.xz",
"sha256": "6b102444b997ef38f1fe39ec1f1e2e618b434704048c342b07ae81529a56f048",
"size": 556057140,
"uncompressed-sha256": "546086d63aa635831cb6681a6d4e8a401fb8fc150c498b32d8b1693cd79bbb12",
"uncompressed-size": 1879965696
},
"vmware": {
"path": "fedora-coreos-33.20201214.3.1-vmware.x86_64.ova",
"sha256": "73ab21ae06f63e8d1831983627a998296c7beb2e65556f2632cfd7b6dfa6f517",
"size": 831488000
}
},
"ostree-commit": "a64854cbcec13e1c3b3ccbfd3802e377e23c0c136d384c32736addf77e0e2a03",
"ostree-version": "33.20201214.3.1"
}
142 changes: 142 additions & 0 deletions data/data/fcos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"amis": {
"af-south-1": {
"hvm": "ami-0143dd9f52feec33a"
},
"ap-east-1": {
"hvm": "ami-080c665cf884428ce"
},
"ap-northeast-1": {
"hvm": "ami-0da7393d67be9a7f5"
},
"ap-northeast-2": {
"hvm": "ami-05839a6dd0ee5c9d8"
},
"ap-south-1": {
"hvm": "ami-095a0755f68aeb003"
},
"ap-southeast-1": {
"hvm": "ami-018fee3925b7d96b8"
},
"ap-southeast-2": {
"hvm": "ami-0882bb3b32c27b64f"
},
"ca-central-1": {
"hvm": "ami-07778882bf5fd216a"
},
"eu-central-1": {
"hvm": "ami-0c94affa248a89395"
},
"eu-north-1": {
"hvm": "ami-053ecd1ca26ed1284"
},
"eu-south-1": {
"hvm": "ami-0617bb7a81e1235c7"
},
"eu-west-1": {
"hvm": "ami-090ddacbb95925bb2"
},
"eu-west-2": {
"hvm": "ami-0b6daf74280e396a9"
},
"eu-west-3": {
"hvm": "ami-017cdd3245445103b"
},
"me-south-1": {
"hvm": "ami-0ad4cfe95cca8bbd8"
},
"sa-east-1": {
"hvm": "ami-01e208f38effc6f9e"
},
"us-east-1": {
"hvm": "ami-08ff6cb186e1d6db9"
},
"us-east-2": {
"hvm": "ami-04e2b4a367c475231"
},
"us-west-1": {
"hvm": "ami-0c4db5d37123ec37a"
},
"us-west-2": {
"hvm": "ami-0ee91ee478fedbb3c"
}
},
"azure": {
"image": "fedora-coreos-33.20201214.3.1-azure.x86_64.vhd",
"url": "https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/33.20201214.3.1/x86_64/fedora-coreos-33.20201214.3.1-azure.x86_64.vhd.xz"
},
"baseURI": "https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/33.20201214.3.1/x86_64/",
"buildid": "33.20201214.3.1",
"gcp": {
"family": "fedora-coreos-stable",
"image": "fedora-coreos-33-20201214-3-1-gcp-x86-64",
"project": "fedora-coreos-cloud",
"url": "https://storage.googleapis.com/fedora-coreos-cloud-image-uploads/image-import/fedora-coreos-33-20201214-3-1-gcp-x86-64.tar.gz"
},
"images": {
"aws": {
"path": "fedora-coreos-33.20201214.3.1-aws.x86_64.vmdk.xz",
"sha256": "c008d852615c5f86ecc2aa94e1d7c9a8093d820d6c0e836e24dc5ac2ef64c4a4",
"size": 784942640,
"uncompressed-sha256": "821843e4a24d18ab21cdb196fa178231ca53cd19d3d1e19493f2add50c7253b1",
"uncompressed-size": 831476224
},
"azure": {
"path": "fedora-coreos-33.20201214.3.1-azure.x86_64.vhd.xz",
"sha256": "80be79442de7ae513a9514bca8fe7ade86d905f97995eb98afaa2f1573f6ea70",
"size": 551716928,
"uncompressed-sha256": "0d6a2277607c10370665155fd97b65925eb5b863b1f5fd87b5134c475289927f",
"uncompressed-size": 8589935104
},
"gcp": {
"path": "fedora-coreos-33.20201214.3.1-gcp.x86_64.tar.gz",
"sha256": "28f20e907b876a12947f963e0242314f2118d1de3a7f4d2d1bca962d50998808",
"size": 813364345
},
"initramfs": {
"path": "fedora-coreos-33.20201214.3.1-live-initramfs.x86_64.img",
"sha256": "3e41ea047c8fe1dfc421b5b08ba8e1c9773f4be54825697995ca8bb5d0b74d67"
},
"iso": {
"path": "fedora-coreos-33.20201214.3.1-live.x86_64.iso",
"sha256": "da56437799418eec47bacfa52ba811a0393602d8d6580bbbb9687952c8e35db9"
},
"kernel": {
"path": "fedora-coreos-33.20201214.3.1-live-kernel-x86_64",
"sha256": "d83df46764f1678f06f421c4ca16d8717ff59e8ca2e9014663b204be0e38ff5e"
},
"metal": {
"path": "fedora-coreos-33.20201214.3.1-metal.x86_64.raw.xz",
"sha256": "4314a3cc7302a19ecda5445b92dc91d74fa60abfadf31b628d05ded0a2bbc4f8",
"size": 551645884,
"uncompressed-sha256": "4b89bb58cfce2e0908d2afdbed81828ee3659d6a1820e98b9979e11dc6153464",
"uncompressed-size": 3006267392
},
"openstack": {
"path": "fedora-coreos-33.20201214.3.1-openstack.x86_64.qcow2.xz",
"sha256": "7e85359555467da934d5396b2431d6cf0a369be396c3725a26b1acd4aecd5890",
"size": 548781024,
"uncompressed-sha256": "e78e2f9e89732ce8e7bbed05a44083028718bfebe783ec1eec404059b506a69c",
"uncompressed-size": 1869152256
},
"ostree": {
"path": "fedora-coreos-33.20201214.3.1-ostree.x86_64.tar",
"sha256": "149213897e03290b372a6994e2596860a7d0f97534a372c4eb1f0f987c77055a",
"size": 739604480
},
"qemu": {
"path": "fedora-coreos-33.20201214.3.1-qemu.x86_64.qcow2.xz",
"sha256": "6b102444b997ef38f1fe39ec1f1e2e618b434704048c342b07ae81529a56f048",
"size": 556057140,
"uncompressed-sha256": "546086d63aa635831cb6681a6d4e8a401fb8fc150c498b32d8b1693cd79bbb12",
"uncompressed-size": 1879965696
},
"vmware": {
"path": "fedora-coreos-33.20201214.3.1-vmware.x86_64.ova",
"sha256": "73ab21ae06f63e8d1831983627a998296c7beb2e65556f2632cfd7b6dfa6f517",
"size": 831488000
}
},
"ostree-commit": "a64854cbcec13e1c3b3ccbfd3802e377e23c0c136d384c32736addf77e0e2a03",
"ostree-version": "33.20201214.3.1"
}
76 changes: 76 additions & 0 deletions hack/update-fcos-bootimage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/usr/bin/env python3
# Usage: ./hack/update-fcos-bootimage.py https://builds.coreos.fedoraproject.org/prod/streams/next/builds/32.20200517.1.0/x86_64/meta.json amd64
import codecs,os,sys,json,argparse
import urllib.parse
import urllib.request

# 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://builds.coreos.fedoraproject.org'

parser = argparse.ArgumentParser()
parser.add_argument("meta", action='store')
parser.add_argument("arch", action='store', choices=['amd64', 's390x', 'ppc64le'])
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 = {}

# OKD doesn't yet support several platforms, so some image metadata should be skipped
include_images = ['aws', 'azure', 'gcp', 'metal', 'openstack', 'ostree', 'qemu', 'vmware']
rename_images = {
"live-initramfs": "initramfs",
"live-iso": "iso",
"live-kernel": "kernel",
}

for k in ['images', 'buildid', 'oscontainer',
'ostree-commit', 'ostree-version',
'azure', 'gcp']:
if meta.get(k):
newmeta[k] = meta[k]
if meta.get(k):
newmeta['amis'] = {
entry['name']: {
'hvm': entry['hvm'],
}
for entry in meta['amis']
}
newmeta['baseURI'] = urllib.parse.urljoin(args.meta, '.')

# Filter images
imgs = meta['images']
for k in list(imgs):
if k in rename_images.keys():
imgs[rename_images[k]] = imgs[k]
del imgs[k]
continue
if k not in include_images:
del imgs[k]

newmeta['images'] = imgs

# There are no official Azure images yet (https://github.com/coreos/fedora-coreos-tracker/issues/148)
# Installer has a workaround for that, so this section can be synthetized
newmeta['azure'] = {
'image': newmeta['images']['azure']['path'].strip(".xz"),
'url': '{}{}'.format(newmeta['baseURI'], newmeta['images']['azure']['path']),
}

with open(os.path.join(metadata_dir, 'fcos-amd64.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, "fcos.json"), 'w') as f:
json.dump(newmeta, f, sort_keys=True, indent=4)
2 changes: 1 addition & 1 deletion pkg/asset/cluster/tfvars.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error {
}
preexistingnetwork := installConfig.Config.GCP.Network != ""

imageRaw, err := rhcospkg.GCPRaw(ctx, installConfig.Config.ControlPlane.Architecture)
imageRaw, err := rhcospkg.GCPRaw(ctx, installConfig.Config.ControlPlane.Architecture, installConfig.Config.IsOKD())
if err != nil {
return errors.Wrap(err, "failed to find Raw GCP image URL")
}
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 @@ -51,7 +51,7 @@ func (i *BootstrapImage) Generate(p asset.Parents) error {

// 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, config.ControlPlane.Architecture)
osimage, err = rhcos.QEMU(ctx, config.ControlPlane.Architecture, config.IsOKD())
default:
// other platforms use the same image for all nodes
osimage, err = osImage(config)
Expand Down
Loading

0 comments on commit 806cab8

Please sign in to comment.