From 84f258e74816bdcc844950fdf5f7443849ab675f Mon Sep 17 00:00:00 2001 From: Zach Marano Date: Tue, 10 Jan 2017 10:30:07 -0800 Subject: [PATCH] Fixes to create stretch images. Add stretch manifest for GCE. --- bootstrapvz/common/tasks/apt.py | 3 ++ bootstrapvz/providers/gce/__init__.py | 11 ++++- manifests/official/gce/README.rst | 12 +++++- manifests/official/gce/stretch-minimal.yml | 37 +++++++++++++++++ manifests/official/gce/stretch.yml | 48 ++++++++++++++++++++++ 5 files changed, 107 insertions(+), 4 deletions(-) create mode 100644 manifests/official/gce/stretch-minimal.yml create mode 100644 manifests/official/gce/stretch.yml diff --git a/bootstrapvz/common/tasks/apt.py b/bootstrapvz/common/tasks/apt.py index 7a296ff..1e37ccf 100644 --- a/bootstrapvz/common/tasks/apt.py +++ b/bootstrapvz/common/tasks/apt.py @@ -77,10 +77,13 @@ class AddBackports(Task): @classmethod def run(cls, info): + from bootstrapvz.common.releases import testing from bootstrapvz.common.releases import unstable if info.source_lists.target_exists('{system.release}-backports'): msg = ('{system.release}-backports target already exists').format(**info.manifest_vars) logging.getLogger(__name__).info(msg) + elif info.manifest.release == testing: + logging.getLogger(__name__).info('There are no backports for stretch/testing') elif info.manifest.release == unstable: logging.getLogger(__name__).info('There are no backports for sid/unstable') else: diff --git a/bootstrapvz/providers/gce/__init__.py b/bootstrapvz/providers/gce/__init__.py index d635f00..56140fc 100644 --- a/bootstrapvz/providers/gce/__init__.py +++ b/bootstrapvz/providers/gce/__init__.py @@ -16,8 +16,8 @@ def validate_manifest(data, validator, error): def resolve_tasks(taskset, manifest): + from bootstrapvz.common.releases import stretch taskset.update(task_groups.get_standard_groups(manifest)) - taskset.update([apt.AddBackports, apt.AddDefaultSources, loopback.AddRequiredCommands, @@ -26,10 +26,10 @@ def resolve_tasks(taskset, manifest): tasks.configuration.GatherReleaseInformation, tasks.host.DisableIPv6, tasks.boot.ConfigureGrub, + initd.InstallInitScripts, initd.AddExpandRoot, initd.AdjustExpandRootScript, tasks.initd.AdjustExpandRootDev, - initd.InstallInitScripts, boot.BlackListModules, boot.UpdateInitramfs, ssh.AddSSHKeyGeneration, @@ -42,6 +42,13 @@ def resolve_tasks(taskset, manifest): ]) taskset.discard(grub.SetGrubConsolOutputDeviceToSerial) + # Temporary fix for Stretch + if manifest.release == stretch: + taskset.discard(initd.InstallInitScripts) + taskset.discard(initd.AddExpandRoot) + taskset.discard(initd.AdjustExpandRootScript) + taskset.discard(tasks.initd.AdjustExpandRootDev) + if 'gcs_destination' in manifest.provider: taskset.add(tasks.image.UploadImage) if 'gce_project' in manifest.provider: diff --git a/manifests/official/gce/README.rst b/manifests/official/gce/README.rst index b13a601..bb7a986 100644 --- a/manifests/official/gce/README.rst +++ b/manifests/official/gce/README.rst @@ -7,6 +7,7 @@ The included packages and configuration changes are necessary for Debian to run Included GCE software is published on github: [Google Compute Engine guest environment](https://github.com/GoogleCloudPlatform/compute-image-packages) Debian 8 Jessie Package Notes: + * python-crcmod is pulled in from backports as it provides a compiled crcmod required for the Google Cloud Storage CLI (gsutil). * cloud-utils and cloud-guest-utils are pulled in from backports as they provide a fixed version of growpart to safely grow the root partition on disks >2TB. * google-cloud-sdk is pulled from a Google Cloud repository. @@ -14,8 +15,15 @@ Debian 8 Jessie Package Notes: * google-compute-engine-init is pulled from a Google Cloud repository. * google-config is pulled from a Google Cloud repository. -jessie-minimal Notes: +jessie-minimal: + The only additions are the necessary google-compute-engine, google-compute-engine-init, and google-config packages. This image is not published on GCE however the manifest is provided here for those wishing a minimal GCE Debian image. -Note: Debian 7 Wheezy and Backports Debian 7 Wheezy are deprecated images on GCE and are no longer supported. +stretch and stretch-minimal: + +These manifests are provided for testing. Debian 9 Stretch is not yet stable. + +Deprecated manifests: + +Debian 7 Wheezy and Backports Debian 7 Wheezy are deprecated images on GCE and are no longer supported. These manifests are provided here for historic purposes. diff --git a/manifests/official/gce/stretch-minimal.yml b/manifests/official/gce/stretch-minimal.yml new file mode 100644 index 0000000..dad36aa --- /dev/null +++ b/manifests/official/gce/stretch-minimal.yml @@ -0,0 +1,37 @@ +--- +name: disk +provider: + name: gce + description: Debian {system.release} {system.architecture} +bootstrapper: + workspace: /target +system: + release: stretch + architecture: amd64 + bootloader: grub + charmap: UTF-8 + locale: en_US + timezone: UTC +volume: + backing: raw + partitions: + type: msdos + root: + filesystem: ext4 + size: 10GiB +packages: + include-source-type: true + sources: + google-cloud: + - deb http://packages.cloud.google.com/apt google-cloud-compute-{system.release} main + install: + - google-compute-engine-{system.release} + - google-compute-engine-init-{system.release} + - google-config-{system.release} +plugins: + google_cloud_repo: + cleanup_bootstrap_key: true + enable_keyring_repo: true + ntp: + servers: + - metadata.google.internal diff --git a/manifests/official/gce/stretch.yml b/manifests/official/gce/stretch.yml new file mode 100644 index 0000000..7920b54 --- /dev/null +++ b/manifests/official/gce/stretch.yml @@ -0,0 +1,48 @@ +--- +name: disk +provider: + name: gce + description: Debian {system.release} {system.architecture} +bootstrapper: + workspace: /target +system: + release: stretch + architecture: amd64 + bootloader: grub + charmap: UTF-8 + locale: en_US + timezone: UTC +volume: + backing: raw + partitions: + type: msdos + root: + filesystem: ext4 + size: 10GiB +packages: + include-source-type: true + sources: + google-cloud: + - deb http://packages.cloud.google.com/apt cloud-sdk-{system.release} main + - deb http://packages.cloud.google.com/apt google-cloud-compute-{system.release} main + install: + - cloud-initramfs-growroot + - cloud-utils + - google-cloud-sdk + - google-compute-engine-{system.release} + - google-compute-engine-init-{system.release} + - google-config-{system.release} + - python-crcmod + - screen + - vim +plugins: + google_cloud_repo: + cleanup_bootstrap_key: true + enable_keyring_repo: true + ntp: + servers: + - metadata.google.internal + unattended_upgrades: + download_interval: 1 + update_interval: 1 + upgrade_interval: 1