From 8287a64d3a31aa7de4ac2142161cf4b54e1a4a68 Mon Sep 17 00:00:00 2001 From: Kirk Hansen Date: Thu, 14 Jun 2018 10:16:22 -0500 Subject: [PATCH 1/3] Update ebsvolume snapshot_created waiter Sometimes AWS takes longer than 10 minutes to create the snapshot. This gives them 30 minutes to do it. --- bootstrapvz/providers/ec2/ebsvolume.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bootstrapvz/providers/ec2/ebsvolume.py b/bootstrapvz/providers/ec2/ebsvolume.py index a4b4332..376cb7b 100644 --- a/bootstrapvz/providers/ec2/ebsvolume.py +++ b/bootstrapvz/providers/ec2/ebsvolume.py @@ -72,5 +72,6 @@ class EBSVolume(Volume): self.snap_id = snapshot['SnapshotId'] waiter = self.conn.get_waiter('snapshot_completed') waiter.wait(SnapshotIds=[self.snap_id], - Filters=[{'Name': 'status', 'Values': ['completed']}]) + Filters=[{'Name': 'status', 'Values': ['completed']}], + WaiterConfig={'Delay': 15, 'MaxAttempts': 120}) return self.snap_id From ad02412b96bd41bb792206c1f0f1660589de909c Mon Sep 17 00:00:00 2001 From: Kirk Hansen Date: Thu, 14 Jun 2018 10:18:47 -0500 Subject: [PATCH 2/3] Fix stretch ENA install Intel broke the 4.3.4 URL version with their latest push of 4.3.5 --- bootstrapvz/providers/ec2/tasks/network.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bootstrapvz/providers/ec2/tasks/network.py b/bootstrapvz/providers/ec2/tasks/network.py index ccea04f..b90004c 100644 --- a/bootstrapvz/providers/ec2/tasks/network.py +++ b/bootstrapvz/providers/ec2/tasks/network.py @@ -89,9 +89,12 @@ class InstallEnhancedNetworking(Task): @classmethod def run(cls, info): from bootstrapvz.common.releases import stretch + # It appears the latest version will always get a prefix of 18700. + # Once a new version is released, the url int prefix will change (no redirects) + # to something above the 2nd most recent release. You've been warned. if info.manifest.release >= stretch: version = '4.3.4' - drivers_url = 'https://downloadmirror.intel.com/18700/eng/ixgbevf-4.3.4.tar.gz' + drivers_url = 'https://downloadmirror.intel.com/27874/eng/ixgbevf-4.3.4.tar.gz' else: version = '3.2.2' drivers_url = 'https://downloadmirror.intel.com/26561/eng/ixgbevf-3.2.2.tar.gz' From ba263e475db1005655d734491ceda887af79b22f Mon Sep 17 00:00:00 2001 From: Kirk Hansen Date: Thu, 14 Jun 2018 10:19:55 -0500 Subject: [PATCH 3/3] Added pip3_plugin --- bootstrapvz/plugins/pip3_install/README.rst | 14 +++++++++++ bootstrapvz/plugins/pip3_install/__init__.py | 11 ++++++++ .../plugins/pip3_install/manifest-schema.yml | 18 +++++++++++++ bootstrapvz/plugins/pip3_install/tasks.py | 25 +++++++++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 bootstrapvz/plugins/pip3_install/README.rst create mode 100644 bootstrapvz/plugins/pip3_install/__init__.py create mode 100644 bootstrapvz/plugins/pip3_install/manifest-schema.yml create mode 100644 bootstrapvz/plugins/pip3_install/tasks.py diff --git a/bootstrapvz/plugins/pip3_install/README.rst b/bootstrapvz/plugins/pip3_install/README.rst new file mode 100644 index 0000000..9a0d160 --- /dev/null +++ b/bootstrapvz/plugins/pip3_install/README.rst @@ -0,0 +1,14 @@ +Pip3 install +------------ + +Install packages from the Python Package Index via pip for python3 + +Installs ``build-essential`` and ``python3-dev`` debian packages, so +Python extension modules can be built. + +Settings +~~~~~~~~ + +- ``packages``: Python packages to install, a list of strings. The list + can contain anything that ``pip install`` would accept as an + argument, for example ``awscli==1.3.13``. diff --git a/bootstrapvz/plugins/pip3_install/__init__.py b/bootstrapvz/plugins/pip3_install/__init__.py new file mode 100644 index 0000000..4330d4d --- /dev/null +++ b/bootstrapvz/plugins/pip3_install/__init__.py @@ -0,0 +1,11 @@ +from . import tasks + + +def validate_manifest(data, validator, error): + from bootstrapvz.common.tools import rel_path + validator(data, rel_path(__file__, 'manifest-schema.yml')) + + +def resolve_tasks(taskset, manifest): + taskset.add(tasks.AddPip3Package) + taskset.add(tasks.Pip3InstallCommand) diff --git a/bootstrapvz/plugins/pip3_install/manifest-schema.yml b/bootstrapvz/plugins/pip3_install/manifest-schema.yml new file mode 100644 index 0000000..dd80c1e --- /dev/null +++ b/bootstrapvz/plugins/pip3_install/manifest-schema.yml @@ -0,0 +1,18 @@ +--- +$schema: http://json-schema.org/draft-04/schema# +title: Pip3 install plugin manifest +type: object +properties: + plugins: + type: object + properties: + pip_install: + type: object + properties: + packages: + type: array + items: + type: string + minItems: 1 + uniqueItems: true + additionalProperties: false diff --git a/bootstrapvz/plugins/pip3_install/tasks.py b/bootstrapvz/plugins/pip3_install/tasks.py new file mode 100644 index 0000000..b8d854b --- /dev/null +++ b/bootstrapvz/plugins/pip3_install/tasks.py @@ -0,0 +1,25 @@ +from bootstrapvz.base import Task +from bootstrapvz.common import phases + + +class AddPip3Package(Task): + description = 'Adding `pip\' and Co. to the image packages' + phase = phases.preparation + + @classmethod + def run(cls, info): + for package_name in ('build-essential', 'python3-dev', 'python3-pip'): + info.packages.add(package_name) + + +class Pip3InstallCommand(Task): + description = 'Install python packages from pypi with pip' + phase = phases.system_modification + + @classmethod + def run(cls, info): + from bootstrapvz.common.tools import log_check_call + packages = info.manifest.plugins['pip3_install']['packages'] + pip_install_command = ['chroot', info.root, 'pip3', 'install'] + pip_install_command.extend(packages) + log_check_call(pip_install_command)