Commit 2df4262b authored by SIMONIN Matthieu's avatar SIMONIN Matthieu
Browse files

g5k.py: infer site, add walltime

parent f37c1657
Pipeline #197956 skipped
...@@ -5,6 +5,7 @@ from pathlib import Path ...@@ -5,6 +5,7 @@ from pathlib import Path
import traceback import traceback
from enoslib import * from enoslib import *
from enoslib.infra.enos_g5k.g5k_api_utils import get_cluster_site
from enoslib.types import Host, Roles from enoslib.types import Host, Roles
...@@ -89,13 +90,16 @@ def deploy(args, env=None): ...@@ -89,13 +90,16 @@ def deploy(args, env=None):
cluster = args.cluster cluster = args.cluster
platform = args.platform platform = args.platform
deployment = args.deployment deployment = args.deployment
walltime = args.walltime
queue = args.queue queue = args.queue
prod = G5kNetworkConf(id="id", roles=["prod"], site="nancy", type="prod") prod = G5kNetworkConf(
id="id", roles=["prod"], site=get_cluster_site(cluster), type="prod"
)
conf = ( conf = (
G5kConf.from_settings( G5kConf.from_settings(
job_name="tansiv", job_name="tansiv",
job_type="allow_classic_ssh", job_type="allow_classic_ssh",
walltime="01:00:00", walltime=walltime,
queue=queue, queue=queue,
) )
.add_machine(cluster=cluster, roles=["tansiv"], nodes=1, primary_network=prod) .add_machine(cluster=cluster, roles=["tansiv"], nodes=1, primary_network=prod)
...@@ -184,7 +188,7 @@ def deploy(args, env=None): ...@@ -184,7 +188,7 @@ def deploy(args, env=None):
@enostask() @enostask()
def validate(args, env=None): def fping(args, env=None):
"""Validates the deployment. """Validates the deployment.
Idempotent. Idempotent.
...@@ -216,6 +220,13 @@ def validate(args, env=None): ...@@ -216,6 +220,13 @@ def validate(args, env=None):
print(f"host that fails = {hostname}") print(f"host that fails = {hostname}")
@enostask()
def flent(args, env=None):
"""Runs flent."""
print(args.remaining)
pass
@enostask() @enostask()
def destroy(args, env=None): def destroy(args, env=None):
force = args.force force = args.force
...@@ -257,14 +268,23 @@ if __name__ == "__main__": ...@@ -257,14 +268,23 @@ if __name__ == "__main__":
parser_deploy.add_argument( parser_deploy.add_argument(
"--cluster", help="Cluster where to get the node", default="parapluie" "--cluster", help="Cluster where to get the node", default="parapluie"
) )
parser_deploy.add_argument(
"--walltime", help="Walltime for the reservation", default="02:00:00"
)
parser_deploy.add_argument("--queue", help="Qeueue to use", default="default") parser_deploy.add_argument("--queue", help="Qeueue to use", default="default")
parser_deploy.set_defaults(func=deploy) parser_deploy.set_defaults(func=deploy)
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# ----------------------------------------------------------------- VALIDATE # -------------------------------------------------------------------- FPING
parser_validate = subparsers.add_parser("validate", help="Validate the deployment") parser_fping = subparsers.add_parser("fping", help="Run a fping in full mesh")
parser_validate.set_defaults(func=validate) parser_fping.set_defaults(func=fping)
# --------------------------------------------------------------------------
# -------------------------------------------------------------------- FLENT
parser_flent = subparsers.add_parser("flent", help="Run flent")
parser_flent.set_defaults(func=flent)
parser_flent.add_argument("remaining", nargs=argparse.REMAINDER)
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# ------------------------------------------------------------------ DESTROY # ------------------------------------------------------------------ DESTROY
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment