Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for openstack application credentials #274

Merged
merged 5 commits into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions docs/source/adapters/site.rst
Original file line number Diff line number Diff line change
Expand Up @@ -447,19 +447,28 @@ Available adapter configuration options

.. content-tabs:: left-col

+---------------------+---------------------------------------------------------------------+-----------------+
| Option | Short Description | Requirement |
+=====================+=====================================================================+=================+
| auth_url | The end point of the OpenStack API to contact. | **Required** |
+---------------------+---------------------------------------------------------------------+-----------------+
| username | Your OpenStack API username to authenticate yourself. | **Required** |
+---------------------+---------------------------------------------------------------------+-----------------+
| password | Your OpenStack API password to authenticate yourself. | **Required** |
+---------------------+---------------------------------------------------------------------+-----------------+
| user_domain_name | The name of the OpenStack user domain. | **Required** |
+---------------------+---------------------------------------------------------------------+-----------------+
| project_domain_name | The name of the OpenStack project domain. | **Required** |
+---------------------+---------------------------------------------------------------------+-----------------+
+-------------------------------+---------------------------------------------------------------------+-----------------+
| Option | Short Description | Requirement |
+===============================+=====================================================================+=================+
| auth_url | The end point of the OpenStack API to contact. | **Required** |
+-------------------------------+---------------------------------------------------------------------+-----------------+
| username | Your OpenStack API username to authenticate yourself. | **Optional** |
+-------------------------------+---------------------------------------------------------------------+-----------------+
| password | Your OpenStack API password to authenticate yourself. | **Optional** |
+-------------------------------+---------------------------------------------------------------------+-----------------+
| user_domain_name | The name of the OpenStack user domain. | **Optional** |
+-------------------------------+---------------------------------------------------------------------+-----------------+
| project_domain_name | The name of the OpenStack project domain. | **Optional** |
+-------------------------------+---------------------------------------------------------------------+-----------------+
| application_credential_id | Your application credential ID to authenticate yourself. | **Optional** |
+-------------------------------+---------------------------------------------------------------------+-----------------+
| application_credential_secret | Your application credential secret to authenticate yourself. | **Optional** |
+-------------------------------+---------------------------------------------------------------------+-----------------+

.. note::
Either ``username``, ``password`` , ``user_domain_name`` and ``project_domain_name`` or
``application_credential_id`` and ``application_credential_secret`` are mandatory to authenticate against the
OpenStack endpoint.

All configuration entries in the `MachineTypeConfiguration` section of the machine types are
directly added as keyword arguments to the OpenStack API `create-server` call. All available options are
Expand Down
1 change: 1 addition & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Added
* Introduce a TARDIS REST API to query the state of resources from SqlRegistry
* Added support for manual draining of drones using the REST API
* Add support for passing environment variables as executable arguments to support HTCondor grid universe
* Added support for application credentials of the OpenStack site adapter
* Added a new site adapter to use Lancium compute as resource provider

Changed
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
category: added
summary: "Added support for application credentials of the OpenStack site adapter"
description: |
Newer versions of OpenStack support the creation of application credentials for specific projects. So, the pair of
application_credential_id and application_credential_secret is only valid of a specific project. The OpenStack site
adapter now fully supports the utilization of application credentials to authenticate against the OpenStack API
endpoint.
pull requests:
- 274
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def get_cryptography_version():
get_cryptography_version(),
"CloudStackAIO>=0.0.8",
"PyYAML",
"AsyncOpenStackClient",
"AsyncOpenStackClient>=0.9.0",
"cobald>=0.12.3",
"asyncssh",
"aiotelegraf",
Expand Down
2 changes: 2 additions & 0 deletions tardis/adapters/sites/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def __init__(self, machine_type: str, site_name: str):
project_name=self.configuration.project_name,
user_domain_name=self.configuration.user_domain_name,
project_domain_name=self.configuration.project_domain_name,
application_credential_id=self.configuration.application_credential_id,
application_credential_secret=self.configuration.application_credential_secret, # noqa B950
)

self.nova = NovaClient(session=auth)
Expand Down