Commit Graph

14 Commits

Author SHA1 Message Date
James E. Blair 8806e83383 Remove unused AWS implementation
These files have been replaced by adapter.py.

Change-Id: Ibbf0577f06a633183ce336ad5b322e10123bcdc0
2022-03-16 16:12:50 -07:00
James E. Blair 9bcc046ffc Add QuotaSupport to drivers that don't have it
This adds QuotaSupport to all the drivers that don't have it, and
also updates their tests so there is at least one test which exercises
the new tenant quota feature.

Since this is expected to work across all drivers/providers/etc, we
should start including at least rudimentary quota support in every
driver.

Change-Id: I891ade226ba588ecdda835b143b7897bb4425bd8
2022-01-27 10:11:01 -08:00
James E. Blair 63f38dfd6c Support threadless deletes
The launcher implements deletes using threads, and unlike with
launches, does not give drivers an opportunity to override that
and handle them without threads (as we want to do in the state
machine driver).

To correct this, we move the NodeDeleter class from the launcher
to driver utils, and add a new driver Provider method that returns
the NodeDeleter thread.  This is added in the base Provider class
so all drivers get this behavior by default.

In the state machine driver, we override the method so that instead
of returning a thread, we start a state machine and add it to a list
of state machines that our internal state machine runner thread
should drive.

Change-Id: Iddb7ed23c741824b5727fe2d89c9ddbfc01cd7d7
2021-03-21 14:39:01 -07:00
Benoit Bayszczak 455d9ad620 [provider][aws] fix exception when instance not found during cleanup
When an instance is not found by AWS API during cleanup, this leads
to an infinite error loop because the execption raised is not catched
correctly
```
"2020-08-19 15:33:05,893 ERROR nodepool.NodeDeleter: Exception deleting instance i-xxxxxxxxxxxxxxxxx from XXXXXXXXXXXXXX:"
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/nodepool/launcher.py", line 78, in delete
    manager.cleanupNode(node.external_id)
  File "/usr/local/lib/python3.7/dist-packages/nodepool/driver/aws/provider.py", line 157, in cleanupNode
    instance.terminate()
  File "/usr/local/lib/python3.7/dist-packages/boto3/resources/factory.py", line 520, in do_action
    response = action(self, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/boto3/resources/action.py", line 83, in __call__
    response = getattr(parent.meta.client, operation_name)(**params)
  File "/usr/local/lib/python3.7/dist-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python3.7/dist-packages/botocore/client.py", line 661, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidInstanceID.NotFound) when calling the TerminateInstances operation: The instance ID 'i-xxxxxxxxxxxxxxxxx' does not exist

```

Change-Id: I776f2d32d7b07b665f90cb71e9dbc018775e1062
2020-08-19 16:07:41 +02:00
Albin Vass 2d59dc461c aws: add support for attaching instance profiles
Change-Id: Ie338f5f9c8f88c7e5584bce02c9b0d081f068da7
2020-06-12 12:22:50 +02:00
Albin Vass 2ce664ec14 Enable setting label and instance name separately
At the moment nodepools aws driver uses the label to set the instance
name in aws and fails to launch the instance if "Name" is supplied
as a tag.
This makes it possible to supply name as a tag.

Change-Id: I9585db8fe4b4ad6f5b588fb67a7201296c2fc954
2020-03-12 17:15:32 +01:00
Andy Ladjadj 5bae6272f4 add ebs-optimized support for aws provider
Change-Id: I1f6330a71b85f23e6fbe3abd636764e5f3b8a61d
2020-02-04 18:59:24 +01:00
Clément Mondion 49482e157c add tags support for aws provider
Change-Id: Ib871bfda41192a74ee02b0b3d2e422fde21f2801
2020-01-23 10:32:08 +01:00
Tobias Henkel 52f7d4fb62
Make public ip configurable in aws
When running nodepool against private cloud rooms it can be desirable
that the nodes don't get a public ip address. Let the user specify
this on pool level.

Change-Id: I3d636517837fd8a6593c12e4309372da5c062b06
2019-12-21 13:47:08 +01:00
Tobias Henkel 761a9ee00e
Support userdata for instances in aws
In some cases we need to be able to launch instances with custom
userdata also in aws.

Change-Id: I0891961f16bb3bd728622d3413bd185978d79324
2019-12-21 13:35:00 +01:00
Kerby Ferris 661b40a4b7 AWS driver: add ability to determine AMI id using filters
Change-Id: I99263a5907f72d7993d7549ff8adf1dfeedd3b69
2019-10-08 12:06:46 -07:00
Clint Byrum da21971e9b Implement max-servers for AWS driver
Max-servers has been ignored up until now. This implements the basic
checks so that AWS users can limit the number of instances they launch.

Change-Id: I73296bde1cdde80c52b6b5b725f268a17562060d
2019-04-11 18:12:12 -07:00
Monty Taylor 516e8cd176 Rename aws flavor-name to instance-type
The AWS term is instance-type, not flavor-name. Rename this while
we don't have a huge userbase.

While we're in there, rename a variable from image_name to image_id
since we use image_id everywhere else.

Change-Id: I1f7f16d2873982626d2434cf5ca1f6280adf739c
2019-02-06 17:09:36 +00:00
Tristan Cacqueray aa16b8b891 Amazon EC2 driver
This change adds an experimental AWS driver. It lacks some of the deeper
features of the openstack driver, such as quota management and image
building, but is highly functional for running tests on a static AMI.

Note that the test base had to be refactored to allow fixtures to be
customized in a more flexible way.

Change-Id: I313f9da435dfeb35591e37ad0bec921c8b5bc2b5
Co-Authored-By: Tristan Cacqueray <tdecacqu@redhat.com>
Co-Authored-By: David Moreau-Simard <dmsimard@redhat.com>
Co-AUthored-By: Clint Byrum <clint@fewbar.com>
2019-01-28 12:08:36 -08:00