Skip to content
Snippets Groups Projects
Commit 6e55c428 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

scheduling: add a --all-variants flag to generate-tasks

Lets stop generating hundreds of task by default.
parent 137d25cd
No related branches found
No related tags found
No related merge requests found
......@@ -189,4 +189,5 @@
@poulpe_cli.command(no_args_is_help=True)
@click.option("--den-path", type=click.Path(exists=True), default=".")
@click.option("--all-variants", is_flag=True)
@click.argument("bin-env-spec", nargs=-1)
......@@ -192,5 +193,5 @@
@click.argument("bin-env-spec", nargs=-1)
def den_generate_tasks(bin_env_spec, den_path="."):
def den_generate_tasks(bin_env_spec, den_path=".", all_variants=False):
"""Generate a tasks list from parameters.
Currently, only bin-env options can be used, more choices will be
......@@ -207,7 +208,11 @@
"""
den_root = Path(den_path)
den = den_mod.PoulpeDen(den_root)
tasks = scheduling.generate_tasks(den, bin_env_spec)
tasks = scheduling.generate_tasks(
den,
bin_env_spec,
all_variants=all_variants,
)
for t in tasks:
click.echo(" ".join(t))
......
......@@ -22,7 +22,7 @@
)
def generate_tasks(den, bin_setup_specs):
def generate_tasks(den, bin_setup_specs, all_variants=False):
binaries = list_binary_variants(den, bin_setup_specs)
data_envs = den.find_data_envs()
datas = [d.path.relative_to(den.data_env_dir) for d in data_envs]
......@@ -26,7 +26,7 @@
binaries = list_binary_variants(den, bin_setup_specs)
data_envs = den.find_data_envs()
datas = [d.path.relative_to(den.data_env_dir) for d in data_envs]
benchmarks = list(list_benchmarks_variants(den))
benchmarks = list(list_benchmarks_variants(den, all_variants=all_variants))
for bin in binaries:
for d in datas:
for b in benchmarks:
......@@ -52,8 +52,8 @@
return variants
def list_benchmarks_variants(den):
def list_benchmarks_variants(den, all_variants=True):
benchmarks = den.find_benchmarks()
for bench_path, bench in benchmarks:
rel_path = bench_path.relative_to(den.benchmark_dir)
all_dimensions = sorted(bench.all_dimensions.items())
......@@ -56,8 +56,8 @@
benchmarks = den.find_benchmarks()
for bench_path, bench in benchmarks:
rel_path = bench_path.relative_to(den.benchmark_dir)
all_dimensions = sorted(bench.all_dimensions.items())
if not all_dimensions:
if not all_dimensions or not all_variants:
yield rel_path
else:
for kv in combine_dimensions(all_dimensions):
......
......@@ -49,6 +49,26 @@
$ poulpe den-generate-tasks hg:MERCURIAL_VERSION=6.5.3 > tasks
$ wc -l < tasks
4? (glob)
$ sort --unique < tasks | wc -l
4? (glob)
$ head tasks
RUN hg:MERCURIAL_VERSION=6.5.3 bar hg/cat.pbd
RUN hg:MERCURIAL_VERSION=6.5.3 bar hg/commit.pbd
RUN hg:MERCURIAL_VERSION=6.5.3 bar hg/files.pbd
RUN hg:MERCURIAL_VERSION=6.5.3 bar hg/log.pbd
RUN hg:MERCURIAL_VERSION=6.5.3 bar hg/pull.pbd
RUN hg:MERCURIAL_VERSION=6.5.3 bar hg/status.pbd
RUN hg:MERCURIAL_VERSION=6.5.3 bar hg/update.pbd
RUN hg:MERCURIAL_VERSION=6.5.3 bar hg/convert.pbd
RUN hg:MERCURIAL_VERSION=6.5.3 bar hg/debug-delta-chain.pbd
RUN hg:MERCURIAL_VERSION=6.5.3 bar hg/debug-revlog-index.pbd
no-filter-run using all variants
--------------------------------
$ poulpe den-generate-tasks --all-variants hg:MERCURIAL_VERSION=6.5.3 > tasks
$ wc -l < tasks
4?? (glob)
$ sort --unique < tasks | wc -l
4?? (glob)
......@@ -68,7 +88,8 @@
Test that the generated tasks are usable
========================================
$ poulpe den-generate-tasks hg:MERCURIAL_VERSION=6.5.2 hg:MERCURIAL_VERSION=6.5.1 \
$ poulpe den-generate-tasks --all-variants \
> hg:MERCURIAL_VERSION=6.5.2 hg:MERCURIAL_VERSION=6.5.1 \
> | sort | head -n 3 > tasks
(Filter output until "clone done" since it varies a lot and is not that useful)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment