Commit Graph

47 Commits

Author SHA1 Message Date
David Moreau Simard 4a8711e73c
opendev: Remove content and leave an URL to the GitHub repository
Change-Id: I82a3238b6a8c21e6bb8056aca22ef71af9ea2538
2021-02-25 15:16:53 -05:00
David Moreau Simard f3da150e10 cli: Add 'ara playbook metrics'
This provides a first implementation in order to retrieve playbook
metrics through the CLI.

Change-Id: Id04359b798b86f5e2131aa772d4871c521acfc45
2020-12-18 21:36:29 +00:00
David Moreau Simard 4b5f09df87 cli: Add 'ara host metrics'
This provides a first implementation for retrieving host metrics through
the CLI.

Change-Id: Iaf2cb3960a60113b6068cc36c236b6ff733585b9
2020-12-18 21:36:21 +00:00
David Moreau Simard 7e6635da73 cli: Add 'ara task metrics'
This is a first implementation that provides a way to get metrics about
tasks.

Change-Id: Id0d14ab3c62a5c76fd8f7de1a447b8e16c80771a
2020-12-18 21:35:56 +00:00
David Moreau Simard c639f438de
CLI: Add "ara expire" to expire old running objects
This new command will allow to change the status of objects that have
been running for more than 24 hours (by default) without being updated
and so we are expecting these to never finish.

Change-Id: Iedbac84188fc4202f51e405d2fae0a35d34b3a1d
Related: https://github.com/ansible-community/ara/issues/26
2020-09-17 10:45:12 -04:00
David Moreau Simard df92d97507 setup.cfg: update classifiers
- ara isn't openstack specific
- ara is known to work and is tested with 3.8, add it
- definitely not beta software anymore, it's stable and used in production

Change-Id: I89445dc9febdd59da57fc7abb01ce89aa49ab3e7
2020-09-15 15:40:54 +00:00
David Moreau Simard 78a18088b4
CLI: Deprecate 'ara-manage prune' in favor of 'ara playbook prune'
Back when ara-manage prune was implemented, we didn't yet have a CLI
framework for running commands and so it was implemented using django.

Now that we have a CLI framework, move the command where it belongs.

Fixes: https://github.com/ansible-community/ara/issues/162
Change-Id: Ia3169f4966808611728bb7a70813a66423e54caf
2020-08-22 12:51:49 -04:00
David Moreau Simard 9e88f33c5e
Fix settings regression and unpin dynaconf
Settings were failing to load with dynaconf>=3.0 because there was a
breaking change that disabled environments loading [1].

Fixes: https://github.com/ansible-community/ara/issues/149

[1]: https://www.dynaconf.com/release_notes/#breaking-changes

Change-Id: Ia97ba4a7f10aedc3b3c30b58beed68baa329cad3
2020-08-10 20:09:57 -04:00
David Moreau Simard 8628be9c45
Temporarily pin dynaconf to <3.0
The new release of dynaconf has changed how settings are loaded and this
is causing issues. Pin it while we figure out the fix.

Change-Id: If0c25fbb207ec78ff30e62cafa7c077b10a3f90a
2020-08-02 19:39:16 -04:00
David Moreau Simard 81e3558fe2
CLI: Port "ara record delete" from 0.x
This provides the ability to delete a specified record.

Change-Id: Ib721fede4fb27f7b630830d8de38ce3ae52c8ec7
2020-08-01 19:03:12 -04:00
David Moreau Simard 6c78cf1151
CLI: Port "ara record show" from ara 0.x
This allows to display details for a specific record.

Change-Id: I33d0cd9b12be67939ba20f0f6351055dae8416b5
2020-08-01 18:59:40 -04:00
David Moreau Simard cabce63bae
CLI: Port "ara record list" from ara 0.x
This provides a list view of the records saved through ara_record.

Change-Id: I9c5bc84ee4716b65bfc11eef94291dad3616693f
2020-08-01 18:55:01 -04:00
David Moreau Simard 7f59a932f8
CLI: Port "ara play delete" from ara 0.x
This provides the ability to delete a specified play.

Change-Id: I06505785e7facdbb43ae62cd92cf40ae4db7d5af
2020-08-01 16:40:21 -04:00
David Moreau Simard b2fdd45c99
CLI: Port "ara play show" from ara 0.x
This allows to display details about a play.

Change-Id: Ibd1bb6824d6ee219bf525cf64b2aafb6e8df426a
2020-08-01 16:40:21 -04:00
David Moreau Simard 3b657e3fb0
CLI: Port "ara play list" from ara 0.x
This allows to list plays, optionally based on their name or playbook.

Change-Id: If26840cb0944d3b2a319b2a3f7405f2fca60c2f6
2020-08-01 16:40:18 -04:00
David Moreau Simard 96e26dc650 CLI: Port "ara task delete" command from ara 0.x
This provides support for deleting a specific task.

Change-Id: I3c9ea49b025e8d83a3702ddb9252084371fdc6ce
2020-07-22 02:46:17 +00:00
David Moreau Simard 9e54b26a34 CLI: Port "ara task show" command from ara 0.x
This command retrieves and returns details about a specific task.

Change-Id: I3f28c9eb46b5e13922f9a38de0eb7c98f961e8b9
2020-07-22 02:46:11 +00:00
David Moreau Simard 3720fee2f4
CLI: Port "ara task list" command from ara 0.x
This is a first iteration that allows to return a list of tasks
based on the provided arguments.

Change-Id: Ic318a39edf82cabfac21330960d57e468cd0b22d
2020-07-20 10:02:05 -04:00
David Moreau Simard 93b295a01c
CLI: Port "ara result delete" from 0.x
This provides support for deleting a specific result.

Change-Id: I8ff0f1211e77874b6ef797c238f516a06b3baaea
2020-07-18 23:13:20 -04:00
David Moreau Simard 05a1c912a2
CLI: Port "ara result show" command from 0.x
This provides a detailed view about a specific result.

The content isn't included by default but it can be by specifying
"--with-content" and it's recommended to use with
'-f json' or '-f yaml'.

Change-Id: Idc5227f9d92d6610a84665ee463be36c2e5a1fe8
2020-07-18 23:07:16 -04:00
David Moreau Simard 7614356dc6
CLI: Port "ara result list" command from 0.x
This allows to return a list of results based on provided arguments.
The provides the general framework that works but we'll iterate on
both the API and the command in the future.

Change-Id: I82228aec62d8eec3522b0c210c5bc9629d0338c7
2020-07-18 22:33:50 -04:00
David Moreau Simard 37113773b0
CLI: Port "ara host delete" command from 0.x
This allows to delete a specified host.

Change-Id: I952b81ec257bf53082be29a6f08d9969074ea728
2020-07-18 15:59:44 -04:00
David Moreau Simard 22c2043089
CLI: Port "ara host show" command from 0.x
This command returns stats for a specified host as well as a link to the
playbook report it is involved in.
Facts can also be returned optionally by specifying "--with-facts".

Change-Id: I2623381a1e15e665badd3cbd7e8a98852bd196f1
2020-07-18 15:55:52 -04:00
David Moreau Simard e6810454f9
CLI: Port "ara host list" command from 0.x
This allows to list all hosts, those matching a provided host name or
for a specific playbook.

Change-Id: I882903bf86658fc04ff5af521c7c9c7e282d945a
2020-07-18 15:30:58 -04:00
David Moreau Simard 01c2744a02
CLI: Port "ara playbook delete" command from 0.x
This allows users to delete playbooks with the CLI client.

Change-Id: I8aa41f67cd5ed540f67048153db60e7cc116b9c6
2020-07-15 22:33:21 -04:00
David Moreau Simard 6136246505
CLI: Port "ara playbook show" command from ara 0.x
The command is used to return details about a playbook.

Change-Id: Ib35863ab436c515120aa2435ad1024a8e1f2f516
2020-07-15 22:16:15 -04:00
David Moreau Simard 201a8d95f4
CLI: Port "ara playbook list" command from ara 0.x
This is the first command being ported and so it includes the base
framework for integrating other commands with cliff.

The docs are also re-arranged to include the new commands, some
examples, as well as the existing ara-manage commands.

Change-Id: Ia758e4b70ec0a6821e97b5b66d123dfe33cc63d3
2020-07-15 22:10:00 -04:00
David Moreau Simard 038d2494d9
api: Pin django to <3.0
Django released 3.0 and we're not quite ready yet to support it.
Pin it for now.

Change-Id: I305f29410baad20bd3f8913150289797f1ba98ef
2019-12-03 13:50:55 -05:00
David Moreau Simard d82857d4cb
Remove f-strings to remove requirement on py36
This is a small change that removes the hard requirement for python>=3.6.

We can reconsider it in the future but for now this makes it easier for
certain users to deploy for their environment.

This also fixes wrong indentation on the settings file comment.

Change-Id: Iab84818e5e50aa1e3a0951be154718be04fb53f5
2019-11-19 10:21:00 -05:00
Matt Bond 8d6b063dfc add django-healthcheck and /healthcheck/ endpoint
Change-Id: I900a64495d911bc116a800d6b04bcf237b2d7c45
2019-10-08 15:01:26 -04:00
David Moreau Simard 8ce14cb841
API: Use local timezone by default instead of UTC
Change-Id: I87c1313bcf474e8f8f70f48d0bd639a021158a62
2019-09-17 21:53:36 -04:00
David Moreau Simard 2072e86f08
UI: Add syntax highlighting to files, results, hosts and records
This implementation is mostly carried over from ara 0.x using
pygments.

Change-Id: I964a0410d088b53a28f55271b6610d8420ee8f8c
2019-07-24 18:02:35 -04:00
David Moreau Simard 942271a4a4
Move github references from openstack/ara to ansible-community/ara
Change-Id: I1942cbe9c6af51ade33168c12dbc3a7c59da3a14
2019-05-21 11:08:57 -04:00
David Moreau Simard e32333930a
role: Add support and integration tests for postgresql
This adds support for specifying the "django.db.backends.postgresql"
django database engine, installing the required dependencies and setting
up the necessary configuration.

We're also adding a new package extras [postgresql] which will take care
of installing psycopg2 automatically.

This is self tested by integration tests which creates a postgresql
Docker container and runs the ara_api role configured to run against the
postgresql container. The tests are designed to run either locally or on Zuul.

Change-Id: I9bb7166d01c96d8b39361a55b1c9952de8fa9798
2019-05-15 08:57:58 -04:00
David Moreau Simard 6d00938099
Make API server deps optional, move them to extras
This makes it so "pip install ara" would only install a minimal
amount of dependencies (pbr and requests as of this commit) required
for running the Ansible callback plugin as well as ara_record.

The server dependencies can be installed by running
"pip install ara[server]".

Fixes: https://github.com/ansible-community/ara/issues/36
Change-Id: I67769d28ec24cade7753230dffd0b049358af29a
2019-05-03 16:01:30 -04:00
David Moreau Simard b0d62ba7c4
Rename references to ara-{server,plugins,clients} back to ara
This follows the fusion of the ara-{server,plugins,clients} reporitories
into a branch of the ara repository.

There are other references to clean up that will require a bit more
work (e.g, documentation) so this is a first step.
2019-03-01 15:29:19 -05:00
Florian Apolloner fdcc003fd9 Made dynaconf integration more explicit.
Change-Id: I9557a0da5b1c643acc3581abc9e56b58f4df8bc9
2018-12-20 18:46:02 +01:00
David Moreau Simard 16aa41eaf8 Refactor configuration to use dynaconf
This changes the configuration engine from everett to dynaconf.
dynaconf allows loading configuration from files (json, ini, yaml, toml)
as well as environment variables prefixed by ARA_.

Our usage of dynaconf is similar to the use case from the Pulp [1]
project and they have documented an issue when loading database
parameters [2]. This issue is worked around by importing dynaconf in the
different entry points.

This introduces some other changes as well:
- We're now creating a default configuration and data directory at
  ~/.ara. The location of this directory is controlled with the
  ARA_BASE_DIR environment variable.
- We're now creating a default configuration template in
  ~/.ara/default_config.yaml.
- The default database is now located at ~/.ara/ara.sqlite. The location
  of this database can be customized with the ARA_DATABASE_NAME
  environment variable.
  Note that ARA 0.x used "~/.ara/ansible.sqlite" -- the file name change
  is deliberate in order to avoid user databases clashing between
  versions.

More documentation on this will be available in an upcoming patch.

[1]: https://github.com/pulp/pulp
[2]: https://github.com/rochacbruno/dynaconf/issues/89

Change-Id: I8178b4ca9f2b4d7f4c45c296c08391e84e8b990d
2018-12-20 17:53:11 +01:00
Zuul b93cf0d33d Merge "Move manage.py to ara.server.__main__ and add an entry point" 2018-12-13 18:46:19 +00:00
melissaml 4d0c3fc93d Change openstack-dev to openstack-discuss
Mailinglists have been updated. Openstack-discuss replaces openstack-dev.

Change-Id: I23eb17817cb0fc165fb80271111acf06896ad8aa
2018-12-07 20:33:35 +08:00
David Moreau Simard 90ac1acc51
Move manage.py to ara.server.__main__ and add an entry point
This moves manage.py inside the package and sets up an "ara-manage"
console entry point for doing something like "ara-manage runserver"
instead of "python manage.py runserver".

Putting this under __main__ also allows users to do "python -m
ara.server".

Change-Id: I86b57f11fed2fea0295b1980e2734e35289d84f3
2018-12-06 16:14:11 -05:00
Florian Apolloner 35d762c62b Increased isort max line length to match black/flake8.
Change-Id: I743b97f14d9f3cc576d46212d58607c039d19ed7
2018-11-04 15:18:47 +01:00
David Moreau Simard 9f29bd3bcf
Don't run isort on django database migrations
These are automatically generated, let's not lint them.

Change-Id: I9c2fce3b9f93e8b4cc0f393d3b32f75eeb6cc91a
2018-10-09 14:01:52 -04:00
Florian Apolloner c653d6a2c5
Added CI for black/isort.
Change-Id: Ib93e64fe1584210d1fe5dce6e0455f0ade0dacca
2018-10-02 09:50:15 -05:00
Florian Apolloner 0d556051a0 Only ara is a namespace package, subpackages are not.
Change-Id: I3cdb501da1380acf53eaf8facab01be4b7187c67
2018-09-28 08:31:09 +02:00
David Moreau Simard 1abe276bae
Refactor ara-server into namespaced python modules
This is a structure that will allow us to install everything under
"ara" as separate packages but inside the same module.

For example, installing ara-server will provide ara.server and
ara.api.
Installing ara-clients will provide ara.clients, ara-plugins will
supply ara.plugins, etc.

Change-Id: I27ee431c4e5d946f558befc12937ba2f3c0d020b
2018-06-20 08:38:49 -04:00
David Moreau Simard 5fbbdac265
Bootstrap the repository with the basic machinery (#1)
- Make the project installable with pbr
- Use tox to run tests, build docs, runserver
- Flesh out the README a little bit
- Real docs is WIP.

Change-Id: I3dc92250cd93add0cdf11c6a67d8f1081560d4e1
2018-03-29 12:36:22 -04:00