Skip to content

Commit

Permalink
fix: modify dag and workflow display in report to also work for big D…
Browse files Browse the repository at this point in the history
…AGs (#1517)

* dbg

* dbg

* fix bucket name

* delete kubernetes cluster if it cannot be setup properly
  • Loading branch information
johanneskoester committed Mar 24, 2022
1 parent f764dcd commit 1364dfb
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
12 changes: 8 additions & 4 deletions snakemake/report/template/components/content.js
Expand Up @@ -21,11 +21,14 @@ class ContentDisplay extends React.Component {
case "rulegraph":
return e(
"div",
{ className: "flex gap-3 p-3 items-start" },
e(RuleGraph, { setView: setView }),
{ className: "flex gap-3 p-3 items-start w-screen" },
e(
"div",
{},
{ className: "w-1/5" }
),
e(
"div",
{ className: "overflow-auto max-h-screen" },
e(
"div",
{
Expand All @@ -37,7 +40,8 @@ class ContentDisplay extends React.Component {
"div",
{ id: "brand" }
)
)
),
e(RuleGraph, { setView: setView })
);
case "stats":
return e(
Expand Down
2 changes: 1 addition & 1 deletion snakemake/report/template/components/rule_graph.js
Expand Up @@ -9,7 +9,7 @@ class RuleGraph extends React.Component {
render() {
return e(
"div",
{ id: "rulegraph" }
{ id: "rulegraph", className: "overflow-auto max-h-screen" }
)
}

Expand Down
2 changes: 1 addition & 1 deletion tests/test_google_lifesciences.py
Expand Up @@ -76,7 +76,7 @@ def test_google_lifesciences():
)
@google_credentials
def test_touch_remote_prefix():
bucket_name = "snakemake-testing-%s" % next(tempfile._get_candidate_names())
bucket_name = "snakemake-testing-%s-bucket" % next(tempfile._get_candidate_names())
create_google_storage(bucket_name)
storage_prefix = "test_touch_remote_prefix"
workdir = dpath("test_touch_remote_prefix")
Expand Down
22 changes: 15 additions & 7 deletions tests/test_kubernetes.py
Expand Up @@ -14,13 +14,21 @@ def __init__(self):
self.cluster = "t-{}".format(uuid.uuid4())
self.bucket_name = self.cluster

shell(
"""
gcloud container clusters create {self.cluster} --num-nodes 3 --scopes storage-rw --zone us-central1-a --machine-type n1-standard-2
gcloud container clusters get-credentials {self.cluster} --zone us-central1-a
gsutil mb gs://{self.bucket_name}
"""
)
try:
shell(
"""
gcloud container clusters create {self.cluster} --num-nodes 3 --scopes storage-rw --zone us-central1-a --machine-type n1-standard-2
gcloud container clusters get-credentials {self.cluster} --zone us-central1-a
gsutil mb gs://{self.bucket_name}
"""
)
except Exception as e:
try:
self.delete()
except:
# ignore errors during deletion
pass
raise e

def delete(self):
shell(
Expand Down

0 comments on commit 1364dfb

Please sign in to comment.