Skip to content

Commit 1364dfb

Browse files
fix: modify dag and workflow display in report to also work for big DAGs (snakemake#1517)
* dbg * dbg * fix bucket name * delete kubernetes cluster if it cannot be setup properly
1 parent f764dcd commit 1364dfb

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

snakemake/report/template/components/content.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@ class ContentDisplay extends React.Component {
2121
case "rulegraph":
2222
return e(
2323
"div",
24-
{ className: "flex gap-3 p-3 items-start" },
25-
e(RuleGraph, { setView: setView }),
24+
{ className: "flex gap-3 p-3 items-start w-screen" },
2625
e(
2726
"div",
28-
{},
27+
{ className: "w-1/5" }
28+
),
29+
e(
30+
"div",
31+
{ className: "overflow-auto max-h-screen" },
2932
e(
3033
"div",
3134
{
@@ -37,7 +40,8 @@ class ContentDisplay extends React.Component {
3740
"div",
3841
{ id: "brand" }
3942
)
40-
)
43+
),
44+
e(RuleGraph, { setView: setView })
4145
);
4246
case "stats":
4347
return e(

snakemake/report/template/components/rule_graph.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class RuleGraph extends React.Component {
99
render() {
1010
return e(
1111
"div",
12-
{ id: "rulegraph" }
12+
{ id: "rulegraph", className: "overflow-auto max-h-screen" }
1313
)
1414
}
1515

tests/test_google_lifesciences.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def test_google_lifesciences():
7676
)
7777
@google_credentials
7878
def test_touch_remote_prefix():
79-
bucket_name = "snakemake-testing-%s" % next(tempfile._get_candidate_names())
79+
bucket_name = "snakemake-testing-%s-bucket" % next(tempfile._get_candidate_names())
8080
create_google_storage(bucket_name)
8181
storage_prefix = "test_touch_remote_prefix"
8282
workdir = dpath("test_touch_remote_prefix")

tests/test_kubernetes.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,21 @@ def __init__(self):
1414
self.cluster = "t-{}".format(uuid.uuid4())
1515
self.bucket_name = self.cluster
1616

17-
shell(
18-
"""
19-
gcloud container clusters create {self.cluster} --num-nodes 3 --scopes storage-rw --zone us-central1-a --machine-type n1-standard-2
20-
gcloud container clusters get-credentials {self.cluster} --zone us-central1-a
21-
gsutil mb gs://{self.bucket_name}
22-
"""
23-
)
17+
try:
18+
shell(
19+
"""
20+
gcloud container clusters create {self.cluster} --num-nodes 3 --scopes storage-rw --zone us-central1-a --machine-type n1-standard-2
21+
gcloud container clusters get-credentials {self.cluster} --zone us-central1-a
22+
gsutil mb gs://{self.bucket_name}
23+
"""
24+
)
25+
except Exception as e:
26+
try:
27+
self.delete()
28+
except:
29+
# ignore errors during deletion
30+
pass
31+
raise e
2432

2533
def delete(self):
2634
shell(

0 commit comments

Comments
 (0)