From 43678bf4c1a4fe507c7fe03b7ac285f5325ea0b6 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Tue, 15 Feb 2022 14:02:22 -0800 Subject: [PATCH] Update AWS driver to use statemachine framework This updates the aws driver to use the statemachine framework which should be able to scale to a much higher number of parallel operations than the standard thread-per-node model. It is also simpler and easier to maintain. Several new features are added to bring it to parity with other drivers. The unit tests are changed minimally so that they continue to serve as regression tests for the new framework. Following changes will revise the tests and add new tests for the additional functionality. Change-Id: I8968667f927c82641460debeccd04e0511eb86a9 --- doc/source/aws.rst | 209 +++++- nodepool/driver/aws/__init__.py | 11 +- nodepool/driver/aws/adapter.py | 637 ++++++++++++++++++ nodepool/driver/aws/config.py | 420 +++++++----- .../tests/fixtures/aws-bad-config-images.yaml | 37 + nodepool/tests/fixtures/aws.yaml | 12 - nodepool/tests/unit/test_driver_aws.py | 35 +- .../aws-statemachine-64fe9beeef9c24b1.yaml | 38 ++ 8 files changed, 1171 insertions(+), 228 deletions(-) create mode 100644 nodepool/driver/aws/adapter.py create mode 100644 nodepool/tests/fixtures/aws-bad-config-images.yaml create mode 100644 releasenotes/notes/aws-statemachine-64fe9beeef9c24b1.yaml diff --git a/doc/source/aws.rst b/doc/source/aws.rst index a45c0900c..4f0fe51f3 100644 --- a/doc/source/aws.rst +++ b/doc/source/aws.rst @@ -2,13 +2,16 @@ .. default-domain:: zuul -AWS EC2 Driver --------------- +AWS Driver +---------- -Selecting the aws driver adds the following options to the :attr:`providers` -section of the configuration. +If using the AWS driver to upload diskimages, see +`VM Import/Export service role`_ for information on configuring +the required permissions in AWS. You must also create an S3 Bucket +for use by Nodepool. -.. note:: Quota support is not implemented. +Selecting the ``aws`` driver adds the following options to the +:attr:`providers` section of the configuration. .. attr-overview:: :prefix: providers.[aws] @@ -86,17 +89,59 @@ section of the configuration. .. attr:: boot-timeout :type: int seconds - :default: 60 + :default: 180 Once an instance is active, how long to try connecting to the image via SSH. If the timeout is exceeded, the node launch is aborted and the instance deleted. + .. attr:: launch-timeout + :type: int seconds + :default: 3600 + + The time to wait from issuing the command to create a new instance + until that instance is reported as "active". If the timeout is + exceeded, the node launch is aborted and the instance deleted. + .. attr:: launch-retries :default: 3 The number of times to retry launching a node before considering - the job failed. + the request failed. + + .. attr:: post-upload-hook + :type: string + :default: None + + Filename of an optional script that can be called after an image has + been uploaded to a provider but before it is taken into use. This is + useful to perform last minute validation tests before an image is + really used for build nodes. The script will be called as follows: + + ``