From caff1a53a79fd800eaa32f2532ddf7c2f0ca5bf3 Mon Sep 17 00:00:00 2001 From: Elise Chavez Date: Fri, 3 Nov 2023 17:01:49 +0000 Subject: [PATCH 01/14] Updated Code to allow custom images --- src/htcdaskgateway/Untitled.ipynb | 57 ++++++++++++++++++ .../__pycache__/__init__.cpython-39.pyc | Bin 0 -> 307 bytes .../__pycache__/cluster.cpython-39.pyc | Bin 0 -> 7257 bytes .../__pycache__/gateway.cpython-39.pyc | Bin 0 -> 3766 bytes src/htcdaskgateway/cluster.py | 13 +++- 5 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 src/htcdaskgateway/Untitled.ipynb create mode 100644 src/htcdaskgateway/__pycache__/__init__.cpython-39.pyc create mode 100644 src/htcdaskgateway/__pycache__/cluster.cpython-39.pyc create mode 100644 src/htcdaskgateway/__pycache__/gateway.cpython-39.pyc diff --git a/src/htcdaskgateway/Untitled.ipynb b/src/htcdaskgateway/Untitled.ipynb new file mode 100644 index 0000000..782496c --- /dev/null +++ b/src/htcdaskgateway/Untitled.ipynb @@ -0,0 +1,57 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "6e0c9f55-3bc0-4983-9cdd-4f073ea3220c", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Python version: 3.8\n", + "Image Test: /cvmfs/unpacked.cern.ch/registry.hub.docker.com/coffeateam/coffea-dask-cc7-gateway:latest-py3.8\n" + ] + } + ], + "source": [ + "python_vers = \"{0}.{1}\".format(sys.version_info[0],sys.version_info[1])\n", + "print(\"Python version:\",python_vers)\n", + "image_test = f\"/cvmfs/unpacked.cern.ch/registry.hub.docker.com/coffeateam/coffea-dask-cc7-gateway:latest-py\"+python_vers\n", + "print(\"Image Test: \",image_test)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b6190998-9045-4a4d-ae5f-b2cbf98981c7", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "py3-preamble" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.15" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/src/htcdaskgateway/__pycache__/__init__.cpython-39.pyc b/src/htcdaskgateway/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c093224d0e9ffdfa4af2d56abbce886a18181284 GIT binary patch literal 307 zcmYe~<>g`k0=|mxDSLtRV-N=!FabFZKwPW>BvKes7;_kM8KW2(L2RZRrd;MIW+0n6 zg(aOSiY0|Lm_d{6B~T@UCgUwZj}T|~#FEtV#7gI!(&CcTBA_4_La+#Ab`dj>@Y7_y zB~@IMtd~)eoRV0aoet5ZmkiMcR)|#rR3X@qTkP@ii8(p(@hcgM*g+8fp5hAJ~wMwMABtIC{} zQ)S-DtFmAfR9Uo&svNS0P#O)hIcyE<1T)hZX^vW>x+e6EF_GOEM>)Z>zci?4carD! zbZcr+<9S~ALgNK7`XXbU;`)kKD*hg))0RtmoL>o@uoIv*w&;Xn%jw>3bb?UGk`d>F zPzt9R=NjU3cQFi&xg2)vcQM=2+ATKmi~6v_S*6IniIO~kA1l*9N-t8>CyeOr6E3n3(518Ye?)6S!Cj=_*T}fOlL@t5 zP&_nxnHTz5Z4dN~Hh89&d9KNSQXD`tvOJ3!I?dp@WL8hx$n55TjeJkv!yg#Yb_+b; zuhBTwQ5H9bkefZdW`K(f;-bgE(_^i5P6y`H%3)rh*-tcHT+wDUJ_J0P(Z8;^PD8M8 zU9c2sEcDsar>&#4pGZOu3B*h+$c#^$62pc^W(hJZi^O=PpP}69Gc=b z&T+BUsmFy>vst6bq?8tMwgrU8IU%JlOIgLTvEGtnfNl*ZFcfkU79Q|1WS{W*9Co8C?17)TeqP&w zKHJFdWRT}}vfSt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NCEo;!_2t3d0saUJ+X8)sio4prSyj??H!WNB7P$KEW}bhwhjRlW%{U4gq~2L3PH-6J9RJ@UPD;`3KBAtOxs4dSk5Ex<)gzJl z@+qX_wD^W}T8;)>5DzPhh^10nTr9*xB!7q8s@4MivIex*&@NEj+QFn%nW3|!AER4@>IFT11LFdL`7NxpG*Da_6-; zw_ei;;3}zzjF4Of(NA?33p!!bqgE9o zre}X;5Xv~((d8KZKVn%~DCg Date: Mon, 5 Feb 2024 17:56:24 +0000 Subject: [PATCH 02/14] Updating and Testing Image Selection Working to allow user to input their own image, trying to test how the cluster options object works --- src/htcdaskgateway/cluster.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/htcdaskgateway/cluster.py b/src/htcdaskgateway/cluster.py index 7c188b2..85ce1d0 100644 --- a/src/htcdaskgateway/cluster.py +++ b/src/htcdaskgateway/cluster.py @@ -24,6 +24,8 @@ def __init__(self, **kwargs): self.batchWorkerJobs = [] super().__init__(**kwargs) self.cluster_options = kwargs.pop('cluster_options','image') + if(hasattr(self.cluster_options,"image")): + print("Has an image") if(self.cluster_options != None): print("Selected Image: ", self.cluster_options.image) @@ -70,11 +72,16 @@ def scale_batch_workers(self, n, **kwargs): condor_logdir = f"{tmproot}/condor" credentials_dir = f"{tmproot}/dask-credentials" worker_space_dir = f"{tmproot}/dask-worker-space" + python_vers = "{0}.{1}".format(sys.version_info[0],sys.version_info[1]) if self.cluster_options != None: image_name = f"/cvmfs/unpacked.cern.ch/registry.hub.docker.com/" + self.cluster_options.image + logger.info("Creating with option image " + image_name) + elif python_vers == "3.10": + print("python version" + python_vers) + image_name = f"/cvmfs/unpacked.cern.ch/registry.hub.docker.com/coffeateam/coffea-dask-cc7-gateway:latest-py"+python_vers + logger.info("Creating with image " + image_name) else: - python_vers = "{0}.{1}".format(sys.version_info[0],sys.version_info[1]) image_name = f"/cvmfs/unpacked.cern.ch/registry.hub.docker.com/coffeateam/coffea-dask-cc7-gateway:0.7.21-fastjet-3.4.0.1-g6238ea8" os.makedirs(tmproot, exist_ok=True) From aab4129c597c5f0e2a322a5cbc265507841325b0 Mon Sep 17 00:00:00 2001 From: Elise Chavez Date: Fri, 8 Mar 2024 22:37:22 +0000 Subject: [PATCH 03/14] Adding the correct images for coffea 0.7.21 and py3.10 --- src/htcdaskgateway/cluster.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/htcdaskgateway/cluster.py b/src/htcdaskgateway/cluster.py index 85ce1d0..78a9b63 100644 --- a/src/htcdaskgateway/cluster.py +++ b/src/htcdaskgateway/cluster.py @@ -24,9 +24,7 @@ def __init__(self, **kwargs): self.batchWorkerJobs = [] super().__init__(**kwargs) self.cluster_options = kwargs.pop('cluster_options','image') - if(hasattr(self.cluster_options,"image")): - print("Has an image") - if(self.cluster_options != None): + if hasattr(self.cluster_options,"image"): print("Selected Image: ", self.cluster_options.image) # We only want to override what's strictly necessary, scaling and adapting are the most important ones @@ -74,16 +72,17 @@ def scale_batch_workers(self, n, **kwargs): worker_space_dir = f"{tmproot}/dask-worker-space" python_vers = "{0}.{1}".format(sys.version_info[0],sys.version_info[1]) - if self.cluster_options != None: + if hasattr(self.cluster_options,"image"): image_name = f"/cvmfs/unpacked.cern.ch/registry.hub.docker.com/" + self.cluster_options.image - logger.info("Creating with option image " + image_name) elif python_vers == "3.10": print("python version" + python_vers) - image_name = f"/cvmfs/unpacked.cern.ch/registry.hub.docker.com/coffeateam/coffea-dask-cc7-gateway:latest-py"+python_vers - logger.info("Creating with image " + image_name) + image_name = f"/cvmfs/unpacked.cern.ch/registry.hub.docker.com/coffeateam/coffea-dask-cc7-gateway:0.7.21-py3.10-g7cbcc" else: image_name = f"/cvmfs/unpacked.cern.ch/registry.hub.docker.com/coffeateam/coffea-dask-cc7-gateway:0.7.21-fastjet-3.4.0.1-g6238ea8" + + logger.info("Creating with image " + image_name) + os.makedirs(tmproot, exist_ok=True) os.makedirs(condor_logdir, exist_ok=True) os.makedirs(credentials_dir, exist_ok=True) From 6f1ce8a0e9d5d2b44d606977129d6470ab2d5078 Mon Sep 17 00:00:00 2001 From: elisec Date: Thu, 14 Mar 2024 20:07:22 +0000 Subject: [PATCH 04/14] Updated the ip --- src/htcdaskgateway/cluster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/htcdaskgateway/cluster.py b/src/htcdaskgateway/cluster.py index 78a9b63..b1531a2 100644 --- a/src/htcdaskgateway/cluster.py +++ b/src/htcdaskgateway/cluster.py @@ -20,7 +20,7 @@ class HTCGatewayCluster(GatewayCluster): def __init__(self, **kwargs): - self.scheduler_proxy_ip = kwargs.pop('', '131.225.219.43') + self.scheduler_proxy_ip = kwargs.pop('', '131.225.218.222') self.batchWorkerJobs = [] super().__init__(**kwargs) self.cluster_options = kwargs.pop('cluster_options','image') From 4657310f20254ba5b77cbabd6207935493486c10 Mon Sep 17 00:00:00 2001 From: elisec Date: Thu, 14 Mar 2024 22:55:06 +0000 Subject: [PATCH 05/14] Changed how the images are obtained from the user --- src/htcdaskgateway/cluster.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/htcdaskgateway/cluster.py b/src/htcdaskgateway/cluster.py index b1531a2..b2a00b9 100644 --- a/src/htcdaskgateway/cluster.py +++ b/src/htcdaskgateway/cluster.py @@ -24,7 +24,10 @@ def __init__(self, **kwargs): self.batchWorkerJobs = [] super().__init__(**kwargs) self.cluster_options = kwargs.pop('cluster_options','image') - if hasattr(self.cluster_options,"image"): + if self.cluster_options.image == None: + self.cluster_options.image = 'coffeateam/coffea-dask-cc7-gateway:0.7.21-py3.10-g7cbcc' + print("Selected Image: ", self.cluster_options.image) + else: print("Selected Image: ", self.cluster_options.image) # We only want to override what's strictly necessary, scaling and adapting are the most important ones @@ -70,17 +73,12 @@ def scale_batch_workers(self, n, **kwargs): condor_logdir = f"{tmproot}/condor" credentials_dir = f"{tmproot}/dask-credentials" worker_space_dir = f"{tmproot}/dask-worker-space" - python_vers = "{0}.{1}".format(sys.version_info[0],sys.version_info[1]) if hasattr(self.cluster_options,"image"): - image_name = f"/cvmfs/unpacked.cern.ch/registry.hub.docker.com/" + self.cluster_options.image - elif python_vers == "3.10": - print("python version" + python_vers) - image_name = f"/cvmfs/unpacked.cern.ch/registry.hub.docker.com/coffeateam/coffea-dask-cc7-gateway:0.7.21-py3.10-g7cbcc" - else: - image_name = f"/cvmfs/unpacked.cern.ch/registry.hub.docker.com/coffeateam/coffea-dask-cc7-gateway:0.7.21-fastjet-3.4.0.1-g6238ea8" - - + print("has the image") + + image_name = f"/cvmfs/unpacked.cern.ch/registry.hub.docker.com/" + self.cluster_options.image + logger.info("Creating with image " + image_name) os.makedirs(tmproot, exist_ok=True) @@ -116,7 +114,7 @@ def scale_batch_workers(self, n, **kwargs): error = condor/htcdask-worker$(Cluster)_$(Process).err log = condor/htcdask-worker$(Cluster)_$(Process).log request_cpus = 4 -request_memory = 2100 +request_memory = 3000 should_transfer_files = yes transfer_input_files = """+credentials_dir+""", """+worker_space_dir+""" , """+condor_logdir+""" Queue """+str(n)+"" From 5d2439164ad4e5640b7fc0ce133e463532aa9692 Mon Sep 17 00:00:00 2001 From: elisec Date: Tue, 23 Apr 2024 18:36:10 +0000 Subject: [PATCH 06/14] Changed pop to get, allows for scheduler image to change --- src/htcdaskgateway/cluster.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/htcdaskgateway/cluster.py b/src/htcdaskgateway/cluster.py index b2a00b9..45427ec 100644 --- a/src/htcdaskgateway/cluster.py +++ b/src/htcdaskgateway/cluster.py @@ -22,13 +22,13 @@ class HTCGatewayCluster(GatewayCluster): def __init__(self, **kwargs): self.scheduler_proxy_ip = kwargs.pop('', '131.225.218.222') self.batchWorkerJobs = [] - super().__init__(**kwargs) - self.cluster_options = kwargs.pop('cluster_options','image') + self.cluster_options = kwargs.get('cluster_options','image') if self.cluster_options.image == None: self.cluster_options.image = 'coffeateam/coffea-dask-cc7-gateway:0.7.21-py3.10-g7cbcc' print("Selected Image: ", self.cluster_options.image) else: print("Selected Image: ", self.cluster_options.image) + super().__init__(**kwargs) # We only want to override what's strictly necessary, scaling and adapting are the most important ones From 0614129de3ca3d7b70f30e0b8f1679ecb7602cd8 Mon Sep 17 00:00:00 2001 From: elisec Date: Tue, 23 Apr 2024 19:52:19 +0000 Subject: [PATCH 07/14] Fixed issue with the image not being picked up by the object --- src/htcdaskgateway/cluster.py | 3 ++- src/htcdaskgateway/gateway.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/htcdaskgateway/cluster.py b/src/htcdaskgateway/cluster.py index 88b5693..6df21df 100644 --- a/src/htcdaskgateway/cluster.py +++ b/src/htcdaskgateway/cluster.py @@ -23,7 +23,8 @@ class HTCGatewayCluster(GatewayCluster): def __init__(self, **kwargs): self.scheduler_proxy_ip = kwargs.pop('', '131.225.218.222') self.batchWorkerJobs = [] - self.cluster_options = kwargs.get('cluster_options','image') + self.cluster_options = kwargs.get('cluster_options', 'image') + print(self.cluster_options.image) if self.cluster_options.image == None: self.cluster_options.image = 'coffeateam/coffea-dask-cc7-gateway:0.7.21-py3.10-g7cbcc' print("Selected Image: ", self.cluster_options.image) diff --git a/src/htcdaskgateway/gateway.py b/src/htcdaskgateway/gateway.py index c80f655..0a34243 100644 --- a/src/htcdaskgateway/gateway.py +++ b/src/htcdaskgateway/gateway.py @@ -59,6 +59,7 @@ def new_cluster(self, cluster_options=None, shutdown_on_close=True, **kwargs): asynchronous=self.asynchronous, loop=self.loop, shutdown_on_close=shutdown_on_close, + cluster_options = cluster_options, **kwargs, ) From 53fa57f1ca86d6058dcd6f42ad81fbd4a1f4be36 Mon Sep 17 00:00:00 2001 From: elisec Date: Tue, 23 Apr 2024 20:34:47 +0000 Subject: [PATCH 08/14] Fixed the default image option --- src/htcdaskgateway/cluster.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/htcdaskgateway/cluster.py b/src/htcdaskgateway/cluster.py index 6df21df..42d0cdc 100644 --- a/src/htcdaskgateway/cluster.py +++ b/src/htcdaskgateway/cluster.py @@ -24,8 +24,7 @@ def __init__(self, **kwargs): self.scheduler_proxy_ip = kwargs.pop('', '131.225.218.222') self.batchWorkerJobs = [] self.cluster_options = kwargs.get('cluster_options', 'image') - print(self.cluster_options.image) - if self.cluster_options.image == None: + if self.cluster_options.image == "default": self.cluster_options.image = 'coffeateam/coffea-dask-cc7-gateway:0.7.21-py3.10-g7cbcc' print("Selected Image: ", self.cluster_options.image) else: From fe622c29c2139de2cb27d1a1f8a6a4e7ef758806 Mon Sep 17 00:00:00 2001 From: Elise Chavez <59752274+Nanoemc@users.noreply.github.com> Date: Wed, 1 May 2024 15:44:27 -0500 Subject: [PATCH 09/14] Changing default image for cluster --- src/htcdaskgateway/cluster.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/htcdaskgateway/cluster.py b/src/htcdaskgateway/cluster.py index 42d0cdc..d77bf55 100644 --- a/src/htcdaskgateway/cluster.py +++ b/src/htcdaskgateway/cluster.py @@ -25,7 +25,7 @@ def __init__(self, **kwargs): self.batchWorkerJobs = [] self.cluster_options = kwargs.get('cluster_options', 'image') if self.cluster_options.image == "default": - self.cluster_options.image = 'coffeateam/coffea-dask-cc7-gateway:0.7.21-py3.10-g7cbcc' + self.cluster_options.image = 'coffeateam/coffea-dask-almalinux8:2024.4.0-py3.10' print("Selected Image: ", self.cluster_options.image) else: print("Selected Image: ", self.cluster_options.image) @@ -76,9 +76,6 @@ def scale_batch_workers(self, n, **kwargs): credentials_dir = f"{tmproot}/dask-credentials" worker_space_dir = f"{tmproot}/dask-worker-space" - if hasattr(self.cluster_options,"image"): - print("has the image") - image_name = f"/cvmfs/unpacked.cern.ch/registry.hub.docker.com/" + self.cluster_options.image logger.info("Creating with image " + image_name) From 631eaf20807c04fe0bd4091ca7f9b404c4602c96 Mon Sep 17 00:00:00 2001 From: Elise Chavez <59752274+Nanoemc@users.noreply.github.com> Date: Wed, 1 May 2024 16:19:24 -0500 Subject: [PATCH 10/14] Delete src/htcdaskgateway/Untitled.ipynb --- src/htcdaskgateway/Untitled.ipynb | 57 ------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 src/htcdaskgateway/Untitled.ipynb diff --git a/src/htcdaskgateway/Untitled.ipynb b/src/htcdaskgateway/Untitled.ipynb deleted file mode 100644 index 782496c..0000000 --- a/src/htcdaskgateway/Untitled.ipynb +++ /dev/null @@ -1,57 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "id": "6e0c9f55-3bc0-4983-9cdd-4f073ea3220c", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Python version: 3.8\n", - "Image Test: /cvmfs/unpacked.cern.ch/registry.hub.docker.com/coffeateam/coffea-dask-cc7-gateway:latest-py3.8\n" - ] - } - ], - "source": [ - "python_vers = \"{0}.{1}\".format(sys.version_info[0],sys.version_info[1])\n", - "print(\"Python version:\",python_vers)\n", - "image_test = f\"/cvmfs/unpacked.cern.ch/registry.hub.docker.com/coffeateam/coffea-dask-cc7-gateway:latest-py\"+python_vers\n", - "print(\"Image Test: \",image_test)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "b6190998-9045-4a4d-ae5f-b2cbf98981c7", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "py3-preamble" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.15" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} From 57c3a7cdcc58d3404ee007be3ce3a35e46c33e7d Mon Sep 17 00:00:00 2001 From: Elise Chavez <59752274+Nanoemc@users.noreply.github.com> Date: Wed, 1 May 2024 16:20:17 -0500 Subject: [PATCH 11/14] Delete src/htcdaskgateway/__pycache__ directory --- .../__pycache__/__init__.cpython-39.pyc | Bin 307 -> 0 bytes .../__pycache__/cluster.cpython-39.pyc | Bin 7257 -> 0 bytes .../__pycache__/gateway.cpython-39.pyc | Bin 3766 -> 0 bytes 3 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/htcdaskgateway/__pycache__/__init__.cpython-39.pyc delete mode 100644 src/htcdaskgateway/__pycache__/cluster.cpython-39.pyc delete mode 100644 src/htcdaskgateway/__pycache__/gateway.cpython-39.pyc diff --git a/src/htcdaskgateway/__pycache__/__init__.cpython-39.pyc b/src/htcdaskgateway/__pycache__/__init__.cpython-39.pyc deleted file mode 100644 index c093224d0e9ffdfa4af2d56abbce886a18181284..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 307 zcmYe~<>g`k0=|mxDSLtRV-N=!FabFZKwPW>BvKes7;_kM8KW2(L2RZRrd;MIW+0n6 zg(aOSiY0|Lm_d{6B~T@UCgUwZj}T|~#FEtV#7gI!(&CcTBA_4_La+#Ab`dj>@Y7_y zB~@IMtd~)eoRV0aoet5ZmkiMcR)|#rR3X@qTkP@ii8(p(@hcgM*g+8fp5hAJ~wMwMABtIC{} zQ)S-DtFmAfR9Uo&svNS0P#O)hIcyE<1T)hZX^vW>x+e6EF_GOEM>)Z>zci?4carD! zbZcr+<9S~ALgNK7`XXbU;`)kKD*hg))0RtmoL>o@uoIv*w&;Xn%jw>3bb?UGk`d>F zPzt9R=NjU3cQFi&xg2)vcQM=2+ATKmi~6v_S*6IniIO~kA1l*9N-t8>CyeOr6E3n3(518Ye?)6S!Cj=_*T}fOlL@t5 zP&_nxnHTz5Z4dN~Hh89&d9KNSQXD`tvOJ3!I?dp@WL8hx$n55TjeJkv!yg#Yb_+b; zuhBTwQ5H9bkefZdW`K(f;-bgE(_^i5P6y`H%3)rh*-tcHT+wDUJ_J0P(Z8;^PD8M8 zU9c2sEcDsar>&#4pGZOu3B*h+$c#^$62pc^W(hJZi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zZ7evOfdb=)@nI=KQam?X9+d^l&e9-DL5oasm^8?;PWHWNxr<$o6IKSk1`k+rY7o|w&JF93rGq3jUeedx! zZtqNSnF*Y~?d>4U7sS1J1gNCEo;!_2t3d0saUJ+X8)sio4prSyj??H!WNB7P$KEW}bhwhjRlW%{U4gq~2L3PH-6J9RJ@UPD;`3KBAtOxs4dSk5Ex<)gzJl z@+qX_wD^W}T8;)>5DzPhh^10nTr9*xB!7q8s@4MivIex*&@NEj+QFn%nW3|!AER4@>IFT11LFdL`7NxpG*Da_6-; zw_ei;;3}zzjF4Of(NA?33p!!bqgE9o zre}X;5Xv~((d8KZKVn%~DCg Date: Tue, 14 May 2024 18:55:15 +0000 Subject: [PATCH 12/14] Modified image selection code Options object no longer needed, using kwargs to change the image. Also fixed problem with the scale batch workers code, it needed access to the image. --- src/htcdaskgateway/cluster.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/htcdaskgateway/cluster.py b/src/htcdaskgateway/cluster.py index d77bf55..47a0299 100644 --- a/src/htcdaskgateway/cluster.py +++ b/src/htcdaskgateway/cluster.py @@ -23,12 +23,17 @@ class HTCGatewayCluster(GatewayCluster): def __init__(self, **kwargs): self.scheduler_proxy_ip = kwargs.pop('', '131.225.218.222') self.batchWorkerJobs = [] - self.cluster_options = kwargs.get('cluster_options', 'image') - if self.cluster_options.image == "default": - self.cluster_options.image = 'coffeateam/coffea-dask-almalinux8:2024.4.0-py3.10' - print("Selected Image: ", self.cluster_options.image) + self.defaultImage = 'coffeateam/coffea-dask-almalinux8:2024.4.0-py3.10' + self.cluster_options = kwargs.get('cluster_options') + + #set default image if the image is not specified by user + if not kwargs.get('image') and (not self.cluster_options or not self.cluster_options.image): + kwargs['image'] = self.defaultImage + print("Selected Image: ", kwargs['image']) + self.condor_image = self.defaultImage else: - print("Selected Image: ", self.cluster_options.image) + self.condor_image = kwargs.get('image') + super().__init__(**kwargs) # We only want to override what's strictly necessary, scaling and adapting are the most important ones @@ -39,7 +44,7 @@ async def _stop_async(self): self.status = "closed" - def scale(self, n, **kwargs): + def scale(self, n): """Scale the cluster to ``n`` workers. Parameters ---------- @@ -60,14 +65,14 @@ def scale(self, n, **kwargs): self.batchWorkerJobs.append(self.scale_batch_workers(n)) logger.debug(" New Cluster state ") logger.debug(self.batchWorkerJobs) - return self.gateway.scale_cluster(self.name, n, **kwargs) + return self.gateway.scale_cluster(self.name, n) except: print(traceback.format_exc()) logger.error("A problem has occurred while scaling via HTCondor, please check your proxy credentials") return False - def scale_batch_workers(self, n, **kwargs): + def scale_batch_workers(self, n): username = pwd.getpwuid( os.getuid() )[ 0 ] security = self.security cluster_name = self.name @@ -76,7 +81,7 @@ def scale_batch_workers(self, n, **kwargs): credentials_dir = f"{tmproot}/dask-credentials" worker_space_dir = f"{tmproot}/dask-worker-space" - image_name = f"/cvmfs/unpacked.cern.ch/registry.hub.docker.com/" + self.cluster_options.image + image_name = f"/cvmfs/unpacked.cern.ch/registry.hub.docker.com/" + self.condor_image logger.info("Creating with image " + image_name) From 38f0727236ea0601b96f3a4b1f47dc4abbc2d9b5 Mon Sep 17 00:00:00 2001 From: Elise Chavez <59752274+Nanoemc@users.noreply.github.com> Date: Tue, 14 May 2024 14:37:58 -0500 Subject: [PATCH 13/14] Add **kwargs back --- src/htcdaskgateway/cluster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/htcdaskgateway/cluster.py b/src/htcdaskgateway/cluster.py index 47a0299..71dd18a 100644 --- a/src/htcdaskgateway/cluster.py +++ b/src/htcdaskgateway/cluster.py @@ -44,7 +44,7 @@ async def _stop_async(self): self.status = "closed" - def scale(self, n): + def scale(self, n, **kwargs): """Scale the cluster to ``n`` workers. Parameters ---------- From 52606ebe3ce81dbcec046b56c98af4c550a99cf5 Mon Sep 17 00:00:00 2001 From: Elise Chavez <59752274+Nanoemc@users.noreply.github.com> Date: Tue, 14 May 2024 14:57:41 -0500 Subject: [PATCH 14/14] Update cluster.py --- src/htcdaskgateway/cluster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/htcdaskgateway/cluster.py b/src/htcdaskgateway/cluster.py index 71dd18a..37c569c 100644 --- a/src/htcdaskgateway/cluster.py +++ b/src/htcdaskgateway/cluster.py @@ -65,7 +65,7 @@ def scale(self, n, **kwargs): self.batchWorkerJobs.append(self.scale_batch_workers(n)) logger.debug(" New Cluster state ") logger.debug(self.batchWorkerJobs) - return self.gateway.scale_cluster(self.name, n) + return self.gateway.scale_cluster(self.name, n, **kwargs) except: print(traceback.format_exc())