mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 18:00:35 +00:00
commit
67720d9e4c
6 changed files with 74 additions and 2 deletions
14
bootstrapvz/plugins/pip3_install/README.rst
Normal file
14
bootstrapvz/plugins/pip3_install/README.rst
Normal file
|
@ -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``.
|
11
bootstrapvz/plugins/pip3_install/__init__.py
Normal file
11
bootstrapvz/plugins/pip3_install/__init__.py
Normal file
|
@ -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)
|
18
bootstrapvz/plugins/pip3_install/manifest-schema.yml
Normal file
18
bootstrapvz/plugins/pip3_install/manifest-schema.yml
Normal file
|
@ -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
|
25
bootstrapvz/plugins/pip3_install/tasks.py
Normal file
25
bootstrapvz/plugins/pip3_install/tasks.py
Normal file
|
@ -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)
|
|
@ -72,5 +72,6 @@ class EBSVolume(Volume):
|
||||||
self.snap_id = snapshot['SnapshotId']
|
self.snap_id = snapshot['SnapshotId']
|
||||||
waiter = self.conn.get_waiter('snapshot_completed')
|
waiter = self.conn.get_waiter('snapshot_completed')
|
||||||
waiter.wait(SnapshotIds=[self.snap_id],
|
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
|
return self.snap_id
|
||||||
|
|
|
@ -89,9 +89,12 @@ class InstallEnhancedNetworking(Task):
|
||||||
@classmethod
|
@classmethod
|
||||||
def run(cls, info):
|
def run(cls, info):
|
||||||
from bootstrapvz.common.releases import stretch
|
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:
|
if info.manifest.release >= stretch:
|
||||||
version = '4.3.4'
|
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:
|
else:
|
||||||
version = '3.2.2'
|
version = '3.2.2'
|
||||||
drivers_url = 'https://downloadmirror.intel.com/26561/eng/ixgbevf-3.2.2.tar.gz'
|
drivers_url = 'https://downloadmirror.intel.com/26561/eng/ixgbevf-3.2.2.tar.gz'
|
||||||
|
|
Loading…
Add table
Reference in a new issue