Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Poulpe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
octobus
Poulpe
Commits
6e55c428
Commit
6e55c428
authored
1 year ago
by
Pierre-Yves David
Browse files
Options
Downloads
Patches
Plain Diff
scheduling: add a --all-variants flag to generate-tasks
Lets stop generating hundreds of task by default.
parent
137d25cd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
python-libs/poulpe/cli.py
+7
-2
7 additions, 2 deletions
python-libs/poulpe/cli.py
python-libs/poulpe/scheduling.py
+4
-4
4 additions, 4 deletions
python-libs/poulpe/scheduling.py
tests/test-tasks-generation.t
+22
-1
22 additions, 1 deletion
tests/test-tasks-generation.t
with
33 additions
and
7 deletions
python-libs/poulpe/cli.py
+
7
−
2
View file @
6e55c428
...
...
@@ -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
))
...
...
This diff is collapsed.
Click to expand it.
python-libs/poulpe/scheduling.py
+
4
−
4
View file @
6e55c428
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
tests/test-tasks-generation.t
+
22
−
1
View file @
6e55c428
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment