Skip to content

Commit

Permalink
IdM-CI: add option to set host lifetime
Browse files Browse the repository at this point in the history
By default hosts provided by IdM-CI have a lifetime of 8 hours. With
this option we can expand the lifetime to up to 720 hours.

Signed-off-by: Antonio Torres <antorres@redhat.com>
  • Loading branch information
antoniotorresm authored and rcritten committed Jun 24, 2022
1 parent a3f122a commit 5fc34c5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ Options:
--private-key TEXT Private key needed to access VMs in case the
default is not enough.
--sequential Run APITest commands sequentially from a
single client. [default: False]
--help Show this message and exit. [default: False]
single client.
--idmci-lifetime INTEGER Lifetime in hours of IdM-CI hosts. [default:
8]
--help Show this message and exit.
```

## Capturing results
Expand Down
4 changes: 3 additions & 1 deletion src/ipaperftest/core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def getLevelName(level):
- playbook: init/testrunner-dir.yaml
- name: provision
steps:
- playbook: provision/mrack-up.yaml
- extra_vars:
lifetime: {lifetime}
playbook: provision/mrack-up.yaml
- name: prep
steps:
- playbook: prep/redhat-base.yaml
Expand Down
8 changes: 7 additions & 1 deletion src/ipaperftest/core/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ def run(self, ctx):
help="Run APITest commands sequentially from a single client.",
is_flag=True
)
@click.option(
"--idmci-lifetime",
help="Lifetime in hours of IdM-CI hosts.",
default=8,
)
@click.pass_context
def main(
ctx,
Expand All @@ -170,7 +175,8 @@ def main(
results_format="json",
results_output_file=None,
custom_repo_url="",
provider="idmci"
provider="idmci",
idmci_lifetime=8,
):

tests = RunTest(['ipaperftest.registry'])
Expand Down
3 changes: 2 additions & 1 deletion src/ipaperftest/providers/idmci.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ def generate_metadata(self, ctx, machine_configs, domain):

file_contents = IDMCI_METADATA_TEMPLATE.format(
domain=domain.lower(),
hosts=hosts_metadata
hosts=hosts_metadata,
lifetime=ctx.params['idmci_lifetime']
)
with open("runner_metadata/metadata.yaml", "w") as f:
f.write(file_contents)
Expand Down

0 comments on commit 5fc34c5

Please sign in to comment.