From 1364dfbc9db58541aaf5600bca61230f9eb4ecbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20K=C3=B6ster?= Date: Thu, 24 Mar 2022 19:12:11 +0100 Subject: [PATCH] fix: modify dag and workflow display in report to also work for big DAGs (#1517) * dbg * dbg * fix bucket name * delete kubernetes cluster if it cannot be setup properly --- .../report/template/components/content.js | 12 ++++++---- .../report/template/components/rule_graph.js | 2 +- tests/test_google_lifesciences.py | 2 +- tests/test_kubernetes.py | 22 +++++++++++++------ 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/snakemake/report/template/components/content.js b/snakemake/report/template/components/content.js index 081cc6f27..39d16bb68 100644 --- a/snakemake/report/template/components/content.js +++ b/snakemake/report/template/components/content.js @@ -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", { @@ -37,7 +40,8 @@ class ContentDisplay extends React.Component { "div", { id: "brand" } ) - ) + ), + e(RuleGraph, { setView: setView }) ); case "stats": return e( diff --git a/snakemake/report/template/components/rule_graph.js b/snakemake/report/template/components/rule_graph.js index 63ed76646..355def743 100644 --- a/snakemake/report/template/components/rule_graph.js +++ b/snakemake/report/template/components/rule_graph.js @@ -9,7 +9,7 @@ class RuleGraph extends React.Component { render() { return e( "div", - { id: "rulegraph" } + { id: "rulegraph", className: "overflow-auto max-h-screen" } ) } diff --git a/tests/test_google_lifesciences.py b/tests/test_google_lifesciences.py index 4c6366e95..dc735f8fc 100644 --- a/tests/test_google_lifesciences.py +++ b/tests/test_google_lifesciences.py @@ -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") diff --git a/tests/test_kubernetes.py b/tests/test_kubernetes.py index 6c2df5a9f..e6dd028fb 100644 --- a/tests/test_kubernetes.py +++ b/tests/test_kubernetes.py @@ -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(