You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by ol...@apache.org on 2022/03/11 11:16:41 UTC

[incubator-datalab] branch gcp-jupyter-highgpu-template-1 updated: added a-100 gpu type from ini file

This is an automated email from the ASF dual-hosted git repository.

olehmykolaishyn pushed a commit to branch gcp-jupyter-highgpu-template-1
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git


The following commit(s) were added to refs/heads/gcp-jupyter-highgpu-template-1 by this push:
     new 7a2ce67  added a-100 gpu type from ini file
     new e686f9b  Merge branch 'gcp-jupyter-highgpu-template-1' of https://github.com/apache/incubator-datalab into gcp-jupyter-highgpu-template-1
7a2ce67 is described below

commit 7a2ce675af28f4dec69767baff90f2691278cd74
Author: oleh_mykolaishyn <ow...@gmail.com>
AuthorDate: Fri Mar 11 13:15:59 2022 +0200

    added a-100 gpu type from ini file
---
 infrastructure-provisioning/scripts/deploy_datalab.py      |  2 ++
 infrastructure-provisioning/src/general/conf/datalab.ini   |  2 ++
 .../src/general/scripts/gcp/common_prepare_notebook.py     | 14 +++++++-------
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/infrastructure-provisioning/scripts/deploy_datalab.py b/infrastructure-provisioning/scripts/deploy_datalab.py
index 8f55428..87a3f74 100644
--- a/infrastructure-provisioning/scripts/deploy_datalab.py
+++ b/infrastructure-provisioning/scripts/deploy_datalab.py
@@ -271,6 +271,8 @@ def build_parser():
     gcp_parser.add_argument('--gcp_wrapped_csek', type=str, default='',
                             help='customer supplied encryption key for disk/image encryption in RFC 4648 base64 '
                                  'encoded, RSA-wrapped 2048-bit format as rsaEncryptedKey')
+    gcp_parser.add_argument('--gcp_jupyter_gpu_type', type=str, default='nvidia-tesla-a100',
+                            help='gpu type for jupyter gpu notebooks with a2-highgpu-1g shape')
 
     gcp_required_args = gcp_parser.add_argument_group('Required arguments')
     gcp_required_args.add_argument('--gcp_region', type=str, required=True, help='GCP region')
diff --git a/infrastructure-provisioning/src/general/conf/datalab.ini b/infrastructure-provisioning/src/general/conf/datalab.ini
index 5eeccc6..2fcd74f 100644
--- a/infrastructure-provisioning/src/general/conf/datalab.ini
+++ b/infrastructure-provisioning/src/general/conf/datalab.ini
@@ -253,6 +253,8 @@ ssn_instance_size = n1-standard-2
 edge_instance_size = n1-standard-1
 ### GPU type for Tensor/DeepLaerning notebooks
 gpu_accelerator_type = nvidia-tesla-k80
+### GPU type for jupyter-gpu and jupyter-gpu-conda notebooks
+jupyter_gpu_type = nvidia-tesla-a100
 
 #--- [ssn] section contains all parameters that are using for self-service node provisioning ---#
 [ssn]
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/common_prepare_notebook.py b/infrastructure-provisioning/src/general/scripts/gcp/common_prepare_notebook.py
index a1e45d2..533d255 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/common_prepare_notebook.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/common_prepare_notebook.py
@@ -159,15 +159,15 @@ if __name__ == "__main__":
         notebook_config['gpu_accelerator_type'] = 'None'
         notebook_config['gpu_accelerator_count'] = 'None'
 
-        # if os.environ['application'] == 'jupyter-gpu':
-        #    notebook_config['gpu_accelerator_type'] == 'nvidia-tesla-a100'
-        #    notebook_config['gpu_accelerator_count'] == '1'
 
-        if os.environ['application'] in ('tensor', 'tensor-rstudio', 'deeplearning', 'jupyter-gpu', 'jupyter-gpu-conda') or os.environ[
-            'gpu_enabled'] == 'True':
+        if os.environ['application'] in ('tensor', 'tensor-rstudio', 'deeplearning') or os.environ['gpu_enabled'] == 'True':
             if os.environ['gpuType'] != '':
-                notebook_config['gpu_accelerator_type'] = os.environ['gpuType']
-                notebook_config['gpu_accelerator_count'] = os.environ['gpuCount']
+                if os.environ['application'] == 'jupyter-gpu' or os.environ['application'] == 'jupyter-gpu-conda':
+                    notebook_config['gpu_accelerator_type'] == os.environ['gcp_jupyter_gpu_type']
+                    notebook_config['gpu_accelerator_count'] == '1'
+                else:
+                    notebook_config['gpu_accelerator_type'] = os.environ['gpuType']
+                    notebook_config['gpu_accelerator_count'] = os.environ['gpuCount']
             else:
                 notebook_config['gpu_accelerator_type'] = os.environ['gcp_gpu_accelerator_type']
 

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org