Make AWS Images Work with CloudFormation
root device / block device needs full '/dev/...' for CloudFormation to work (individual instance launches worked just fine though). Also... * HOCON += introduces unwanted spaces in motd * minor log.debug fixes * update gen_releases.py --help note
This commit is contained in:
parent
c1469d6c31
commit
51cc63091f
4
build
4
build
|
@ -128,10 +128,10 @@ def install_overlay(overlay):
|
|||
if is_images_conf(overlay, src_x):
|
||||
rel_x = os.readlink(src_x)
|
||||
if os.path.islink(dest_x):
|
||||
print(f"\toverriding {dest_x}")
|
||||
log.debug('overriding %s', dest_x)
|
||||
os.unlink(dest_x)
|
||||
|
||||
print(f"\tln -s {rel_x} {dest_x}")
|
||||
log.debug('ln -s %s %s', rel_x, dest_x)
|
||||
os.symlink(rel_x, dest_x)
|
||||
continue
|
||||
|
||||
|
|
|
@ -204,13 +204,13 @@ class AWSCloudAdapter(CloudAdapterInterface):
|
|||
img = ec2c.register_image(
|
||||
Architecture=self.ARCH[ic.arch],
|
||||
BlockDeviceMappings=[{
|
||||
'DeviceName': 'xvda',
|
||||
'DeviceName': '/dev/xvda',
|
||||
'Ebs': {'SnapshotId': snapshot_id}
|
||||
}],
|
||||
Description=description,
|
||||
EnaSupport=True,
|
||||
Name=ic.image_name,
|
||||
RootDeviceName='xvda',
|
||||
RootDeviceName='/dev/xvda',
|
||||
SriovNetSupport='simple',
|
||||
VirtualizationType='hvm',
|
||||
BootMode=self.BOOT_MODE[ic.firmware],
|
||||
|
|
|
@ -18,13 +18,13 @@ Default {
|
|||
motd {
|
||||
welcome = "Welcome to Alpine!"
|
||||
|
||||
wiki = "The Alpine Wiki contains a large amount of how-to guides and general\n"
|
||||
wiki += "information about administrating Alpine systems.\n"
|
||||
wiki += "See <https://wiki.alpinelinux.org/>."
|
||||
wiki = "The Alpine Wiki contains a large amount of how-to guides and general\n"\
|
||||
"information about administrating Alpine systems.\n"\
|
||||
"See <https://wiki.alpinelinux.org/>."
|
||||
|
||||
version_notes = "Release Notes:\n"
|
||||
version_notes += "* <https://alpinelinux.org/posts/alpine-{version}.0/released.html>"
|
||||
release_notes = "* <https://alpinelinux.org/posts/{release}/released.html"
|
||||
version_notes = "Release Notes:\n"\
|
||||
"* <https://alpinelinux.org/posts/alpine-{version}.0/released.html>"
|
||||
release_notes = "* <https://alpinelinux.org/posts/{release}/released.html"
|
||||
}
|
||||
|
||||
# initial provisioning script and data directory
|
||||
|
|
|
@ -7,11 +7,13 @@ import sys
|
|||
import textwrap
|
||||
|
||||
NOTE = textwrap.dedent("""
|
||||
This script's output is meant to be compatible with alpine-ec2-ami's
|
||||
releases.yaml, in order to bridge the gap until https://alpinelinux.org/cloud
|
||||
can be updated to be generated from another source, or dynamically calls an
|
||||
published image metadata service. This script should only be run after
|
||||
the main 'build' script has been used successfully to publish all images.
|
||||
This script's output is compatible with the retired alpine-ec2-ami repo's
|
||||
releases/alpine.yaml, in order to bridge the gap until
|
||||
https://alpinelinux.org/cloud dynamically calls a published-image metadata
|
||||
service. This script should only be run after the main 'build' script has
|
||||
been used successfully to publish ALL images, and the STDOUT should be
|
||||
committed to the https://gitlab.alpinelinux.org/alpine/infra/alpine-mksite
|
||||
repo as 'cloud/releases-in.yaml'.
|
||||
""")
|
||||
|
||||
sys.pycache_prefix = 'work/__pycache__'
|
||||
|
|
|
@ -366,6 +366,7 @@ class ImageConfig():
|
|||
actions = {}
|
||||
revision = 0
|
||||
remote_image = clouds.latest_build_image(self)
|
||||
log.debug('\n%s', remote_image)
|
||||
step_state = step == 'state'
|
||||
|
||||
# enable actions based on the specified step
|
||||
|
@ -407,17 +408,17 @@ class ImageConfig():
|
|||
elif remote_image:
|
||||
if remote_image.imported:
|
||||
# already imported, don't build/import again
|
||||
log.info('%s - already imported', self.image_key)
|
||||
log.debug('%s - already imported', self.image_key)
|
||||
actions.pop('build', None)
|
||||
actions.pop('import', None)
|
||||
|
||||
if remote_image.published:
|
||||
# NOTE: re-publishing can update perms or push to new regions
|
||||
log.info('%s - already published', self.image_key)
|
||||
log.debug('%s - already published', self.image_key)
|
||||
|
||||
if self.local_path.exists():
|
||||
# local image's already built, don't rebuild
|
||||
log.info('%s - already locally built', self.image_key)
|
||||
log.debug('%s - already locally built', self.image_key)
|
||||
actions.pop('build', None)
|
||||
|
||||
# merge remote_image data into image state
|
||||
|
|
Loading…
Reference in New Issue