Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
biopet.biopet
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
biopet.biopet
Commits
059e8836
Commit
059e8836
authored
8 years ago
by
Peter van 't Hof
Browse files
Options
Downloads
Patches
Plain Diff
Added complete status to compress plots
parent
111adafc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/PipelineStatus.scala
+17
-9
17 additions, 9 deletions
.../main/scala/nl/lumc/sasc/biopet/core/PipelineStatus.scala
with
17 additions
and
9 deletions
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/PipelineStatus.scala
+
17
−
9
View file @
059e8836
...
...
@@ -148,16 +148,16 @@ object PipelineStatus extends ToolCommand {
val
numberRegex
=
"""(.*)_(\d*)$"""
.
r
def
compressOnType
(
jobs
:
Map
[
String
,
List
[
String
]])
:
Map
[
String
,
List
[
String
]]
=
{
val
set
=
for
((
job
,
deps
)
<-
jobs
.
toSet
;
dep
<-
deps
)
yield
{
job
match
{
case
numberRegex
(
name
,
number
)
=>
(
name
,
dep
match
{
case
numberRegex
(
name
,
number
)
=>
name
})
}
(
compressedName
(
job
).
_1
,
compressedName
(
dep
).
_1
)
}
// This will collapse a Set[(String, String)] to a Map[String, List[String]]
set
.
groupBy
(
_
.
_1
).
map
(
x
=>
x
.
_1
->
x
.
_2
.
map
(
_
.
_2
).
toList
)
}
def
compressedName
(
jobName
:
String
)
=
jobName
match
{
case
numberRegex
(
name
,
number
)
=>
(
name
,
number
.
toInt
)
}
def
writeGraphvizFile
(
jobsDeps
:
Map
[
String
,
List
[
String
]],
outputFile
:
File
,
jobDone
:
Set
[
String
],
...
...
@@ -171,12 +171,20 @@ object PipelineStatus extends ToolCommand {
graph
.
foreach
{
case
(
job
,
jobDeps
)
=>
// Writing color of node
if
(
jobDone
.
contains
(
job
))
writer
.
println
(
s
" $job [color = green]"
)
else
if
(
jobFailed
.
contains
(
job
))
writer
.
println
(
s
" $job [color = red]"
)
else
if
(
jobsStart
.
contains
(
job
))
writer
.
println
(
s
" $job [color = orange]"
)
val
compressTotal
=
if
(
compress
)
Some
(
deps
.
jobs
.
keys
.
count
(
compressedName
(
_
).
_1
==
job
))
else
None
val
compressDone
=
if
(
compress
)
Some
(
jobDone
.
count
(
compressedName
(
_
).
_1
==
job
))
else
None
val
compressFailed
=
if
(
compress
)
Some
(
jobFailed
.
count
(
compressedName
(
_
).
_1
==
job
))
else
None
val
compressStart
=
if
(
compress
)
Some
(
jobsStart
.
count
(
compressedName
(
_
).
_1
==
job
))
else
None
val
compressIntermediate
=
if
(
compress
)
Some
(
deps
.
jobs
.
filter
(
x
=>
x
.
_2
.
intermediate
)
.
count
(
x
=>
compressedName
(
x
.
_1
).
_1
==
job
))
else
None
if
(
jobDone
.
contains
(
job
)
||
compress
&&
compressTotal
==
compressDone
)
writer
.
println
(
s
" $job [color = green]"
)
else
if
(
jobFailed
.
contains
(
job
)
||
compress
&&
compressTotal
==
compressFailed
)
writer
.
println
(
s
" $job [color = red]"
)
else
if
(
jobsStart
.
contains
(
job
)
||
compress
&&
compressTotal
==
compressStart
)
writer
.
println
(
s
" $job [color = orange]"
)
// Dashed lined for intermediate jobs
if
(
deps
.
jobs
.
contains
(
job
)
&&
deps
.
jobs
(
job
).
intermediate
)
writer
.
println
(
s
" $job [style = dashed]"
)
if
((
deps
.
jobs
.
contains
(
job
)
&&
deps
.
jobs
(
job
).
intermediate
)
||
(
compress
&&
compressTotal
==
compressIntermediate
))
writer
.
println
(
s
" $job [style = dashed]"
)
// Writing Node deps
jobDeps
.
foreach
(
c
=>
writer
.
println
(
s
" $c -> $job;"
))
...
...
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