diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-10-10 15:57:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-10 15:57:05 +0200 |
| commit | a832ea376e360f3029036a9570c244fb9080e91f (patch) | |
| tree | a54e3f9d3a44a0248ef1b17430eed9b5d47ff5de /opendc-web/opendc-web-server/src/main/resources | |
| parent | 7ba3b953300c46b4e3afcde17cd3dd14b1af8406 (diff) | |
| parent | 4ebe2f28ba940aabdaa1f57653fbe86a91582ebd (diff) | |
merge: Add support for accounting of user simulation time (#108)
This pull request adds support for tracking and limiting the simulation time consumed per user.
These changes allow users to consume 60 minutes of shared compute resources for simulations
in OpenDC per month.
Closes #103
## Implementation Notes :hammer_and_pick:
* Limit exception mapper to WebApplicationException
* Add support for accounting simulation time
* Add API for querying user accounting data
* Show monthly simulation budget in UI
## External Dependencies :four_leaf_clover:
* N/A
## Breaking API Changes :warning:
* The web runner now also sends the runtime of the simulation job to the server, in order to
update the consumed simulation time in the database.
Diffstat (limited to 'opendc-web/opendc-web-server/src/main/resources')
| -rw-r--r-- | opendc-web/opendc-web-server/src/main/resources/db/migration/V1.0.0__core.sql | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/opendc-web/opendc-web-server/src/main/resources/db/migration/V1.0.0__core.sql b/opendc-web/opendc-web-server/src/main/resources/db/migration/V1.0.0__core.sql index 183a70ea..1a0e4046 100644 --- a/opendc-web/opendc-web-server/src/main/resources/db/migration/V1.0.0__core.sql +++ b/opendc-web/opendc-web-server/src/main/resources/db/migration/V1.0.0__core.sql @@ -65,15 +65,27 @@ create table scenarios create table jobs ( - id bigint not null, - created_at timestamp not null, - repeats integer not null, + id bigint not null, + created_by varchar(255) not null, + created_at timestamp not null, + repeats integer not null, results jsonb, - state integer not null, - updated_at timestamp not null, + state integer not null, + runtime integer not null, + updated_at timestamp not null, primary key (id) ); +-- User accounting +create table user_accounting +( + user_id varchar(255) not null, + period_end date not null, + simulation_time integer not null, + simulation_time_budget integer not null, + primary key (user_id) +); + -- Workload traces available to the user. create table traces ( |
