Merge pull request #1236 from apache/DATALAB-2473

[DATALAB-2473] - [Azure] Tensor version on UI fixed
diff --git a/README.md b/README.md
index df52b48..7c24a2e 100644
--- a/README.md
+++ b/README.md
@@ -1171,7 +1171,6 @@
 ```
 {
   "os_pkg": {"htop": "2.0.1-1ubuntu1", "python-mysqldb": "1.3.7-1build2"},
-  "pip2": {"requests": "N/A", "configparser": "N/A"},
   "pip3": {"configparser": "N/A"},
   "r_pkg": {"rmarkdown": "1.5"},
   "others": {"Keras": "N/A"}
@@ -1190,7 +1189,7 @@
 | notebook\_instance\_name      | Name of the Notebook instance to terminate                                           |
 | aws\_region                   | AWS region where infrastructure was deployed                                         |
 | application                   | Type of the notebook template (jupyter/rstudio/zeppelin/tensor/deeplearning)         |
-| libs                          | List of additional libraries in JSON format with type (os_pkg/pip2/pip3/r_pkg/others)|
+| libs                          | List of additional libraries in JSON format with type (os_pkg/pip3/r_pkg/others)|
 | action                        | lib_install                                                                          |
 
 **Example** of additional_libs parameter:
@@ -1201,7 +1200,6 @@
   "libs": [
     {"group": "os_pkg", "name": "nmap"},
     {"group": "os_pkg", "name": "htop"},
-    {"group": "pip2", "name": "requests"},
     {"group": "pip3", "name": "configparser"},
     {"group": "r_pkg", "name": "rmarkdown"},
     {"group": "others", "name": "Keras"}
@@ -1237,7 +1235,7 @@
 | notebook\_instance\_name      | Name of the Notebook instance to terminate                                           |
 | azure\_resource\_group\_name  | Name of the resource group where all DataLab resources are being provisioned            |
 | application                   | Type of the notebook template (jupyter/rstudio/zeppelin/tensor/deeplearning)         |
-| libs                          | List of additional libraries in JSON format with type (os_pkg/pip2/pip3/r_pkg/others)|
+| libs                          | List of additional libraries in JSON format with type (os_pkg/pip3/r_pkg/others)|
 | action                        | lib_install                                                                          |
 </details>
 
@@ -1269,7 +1267,7 @@
 | gcp\_project\_id              | ID of GCP project                                                                    |
 | gcp\_zone                     | GCP zone name                                                                        |
 | application                   | Type of the notebook template (jupyter/rstudio/zeppelin/tensor/deeplearning)         |
-| libs                          | List of additional libraries in JSON format with type (os_pkg/pip2/pip3/r_pkg/others)|
+| libs                          | List of additional libraries in JSON format with type (os_pkg/pip3/r_pkg/others)|
 | action                        | lib_install                                                                          |
 </details>
 
@@ -1462,7 +1460,6 @@
 ```
 {
   "os_pkg": {"htop": "2.0.1-1ubuntu1", "python-mysqldb": "1.3.7-1build2"},
-  "pip2": {"requests": "N/A", "configparser": "N/A"},
   "pip3": {"configparser": "N/A"},
   "r_pkg": {"rmarkdown": "1.5"},
   "others": {"Keras": "N/A"}
@@ -1480,7 +1477,7 @@
 | computational\_id             | Name of Dataengine-service                                                           |
 | aws\_region                   | AWS region where infrastructure was deployed                                         |
 | application                   | Type of the notebook template (jupyter/rstudio/zeppelin/tensor/deeplearning)         |
-| libs                          | List of additional libraries in JSON format with type (os_pkg/pip2/pip3/r_pkg/others)|
+| libs                          | List of additional libraries in JSON format with type (os_pkg/pip3/r_pkg/others)|
 | action                        | lib_install                                                                          |
 
 **Example** of additional_libs parameter:
@@ -1491,7 +1488,6 @@
   "libs": [
     {"group": "os_pkg", "name": "nmap"},
     {"group": "os_pkg", "name": "htop"},
-    {"group": "pip2", "name": "requests"},
     {"group": "pip3", "name": "configparser"},
     {"group": "r_pkg", "name": "rmarkdown"},
     {"group": "others", "name": "Keras"}
@@ -1678,7 +1674,6 @@
 ```
 {
   "os_pkg": {"htop": "2.0.1-1ubuntu1", "python-mysqldb": "1.3.7-1build2"},
-  "pip2": {"requests": "N/A", "configparser": "N/A"},
   "pip3": {"configparser": "N/A"},
   "r_pkg": {"rmarkdown": "1.5"},
   "others": {"Keras": "N/A"}
@@ -1706,7 +1701,6 @@
   "libs": [
     {"group": "os_pkg", "name": "nmap"},
     {"group": "os_pkg", "name": "htop"},
-    {"group": "pip2", "name": "requests"},
     {"group": "pip3", "name": "configparser"},
     {"group": "r_pkg", "name": "rmarkdown"},
     {"group": "others", "name": "Keras"}
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_prepare.py b/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_prepare.py
index 83d8740..3229525 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_prepare.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_prepare.py
@@ -140,12 +140,12 @@
 
     subprocess.run("echo Waiting for changes to propagate; sleep 10", shell=True, check=True)
 
-    if 'masterGPUCount' in os.environ:
+    if 'master_gpu_count' in os.environ:
         dataproc_cluster = json.loads(open('/root/templates/dataengine-service_cluster_with_gpu.json').read())
-        dataproc_cluster['config']['masterConfig']['accelerators'][0]['acceleratorCount'] = int(os.environ['masterGPUCount'])
-        dataproc_cluster['config']['masterConfig']['accelerators'][0]['acceleratorTypeUri'] = os.environ['masterGPUType']
-        dataproc_cluster['config']['workerConfig']['accelerators'][0]['acceleratorCount'] = int(os.environ['slaveGPUCount'])
-        dataproc_cluster['config']['workerConfig']['accelerators'][0]['acceleratorTypeUri'] = os.environ['slaveGPUType']
+        dataproc_cluster['config']['masterConfig']['accelerators'][0]['acceleratorCount'] = int(os.environ['master_gpu_count'])
+        dataproc_cluster['config']['masterConfig']['accelerators'][0]['acceleratorTypeUri'] = os.environ['master_gpu_type']
+        dataproc_cluster['config']['workerConfig']['accelerators'][0]['acceleratorCount'] = int(os.environ['slave_gpu_count'])
+        dataproc_cluster['config']['workerConfig']['accelerators'][0]['acceleratorTypeUri'] = os.environ['slave_gpu_type']
         gpu_driver = 'gs://goog-dataproc-initialization-actions-{}/gpu/install_gpu_driver.sh'.format(dataproc_conf['region'])
         dataproc_cluster['config']['initializationActions'][0]['executableFile'] = gpu_driver
 
diff --git a/infrastructure-provisioning/src/general/templates/aws/jenkins_jobs/dataengine-service_install_additional_libs/config.xml b/infrastructure-provisioning/src/general/templates/aws/jenkins_jobs/dataengine-service_install_additional_libs/config.xml
index fdf7930..5c9c4b3 100644
--- a/infrastructure-provisioning/src/general/templates/aws/jenkins_jobs/dataengine-service_install_additional_libs/config.xml
+++ b/infrastructure-provisioning/src/general/templates/aws/jenkins_jobs/dataengine-service_install_additional_libs/config.xml
@@ -61,11 +61,10 @@
             [
               {"group": "os_pkg", "name": "nmap"},
               {"group": "os_pkg", "name": "htop"},
-              {"group": "pip2", "name": "requests"},
               {"group": "pip3", "name": "configparser"},
               {"group": "r_pkg", "name": "rmarkdown"},
             ]
-            Types: for OS - os_pkg, for Python - pip2/pip3, for R - r_pkg
+            Types: for OS - os_pkg, for Python - pip3, for R - r_pkg
             NOTE: You need to escape each double quote.
             For Example: {\"group\": \"os_pkg\", \"name\": \"htop\"}
           </description>
diff --git a/infrastructure-provisioning/src/general/templates/aws/jenkins_jobs/dataengine_install_additional_libs/config.xml b/infrastructure-provisioning/src/general/templates/aws/jenkins_jobs/dataengine_install_additional_libs/config.xml
index 9b3600e..abc6599 100644
--- a/infrastructure-provisioning/src/general/templates/aws/jenkins_jobs/dataengine_install_additional_libs/config.xml
+++ b/infrastructure-provisioning/src/general/templates/aws/jenkins_jobs/dataengine_install_additional_libs/config.xml
@@ -61,11 +61,10 @@
             [
               {"group": "os_pkg", "name": "nmap"},
               {"group": "os_pkg", "name": "htop"},
-              {"group": "pip2", "name": "requests"},
               {"group": "pip3", "name": "configparser"},
               {"group": "r_pkg", "name": "rmarkdown"},
             ]
-            Types: for OS - os_pkg, for Python - pip2/pip3, for R - r_pkg
+            Types: for OS - os_pkg, for Python - pip3, for R - r_pkg
             NOTE: You need to escape each double quote.
             For Example: {\"group\": \"os_pkg\", \"name\": \"htop\"}
           </description>
diff --git a/infrastructure-provisioning/src/general/templates/aws/jenkins_jobs/notebook_install_additional_libs/config.xml b/infrastructure-provisioning/src/general/templates/aws/jenkins_jobs/notebook_install_additional_libs/config.xml
index 52f5aae..719035d 100644
--- a/infrastructure-provisioning/src/general/templates/aws/jenkins_jobs/notebook_install_additional_libs/config.xml
+++ b/infrastructure-provisioning/src/general/templates/aws/jenkins_jobs/notebook_install_additional_libs/config.xml
@@ -65,11 +65,10 @@
             [
               {"group": "os_pkg", "name": "nmap"},
               {"group": "os_pkg", "name": "htop"},
-              {"group": "pip2", "name": "requests"},
               {"group": "pip3", "name": "configparser"},
               {"group": "r_pkg", "name": "rmarkdown"},
             ]
-            Types: for OS - os_pkg, for Python - pip2/pip3, for R - r_pkg
+            Types: for OS - os_pkg, for Python - pip3, for R - r_pkg
             NOTE: You need to escape each double quote.
             For Example: {\"group\": \"os_pkg\", \"name\": \"htop\"}
           </description>
diff --git a/infrastructure-provisioning/src/general/templates/azure/jenkins_jobs/dataengine_install_additional_libs/config.xml b/infrastructure-provisioning/src/general/templates/azure/jenkins_jobs/dataengine_install_additional_libs/config.xml
index 9b3600e..abc6599 100644
--- a/infrastructure-provisioning/src/general/templates/azure/jenkins_jobs/dataengine_install_additional_libs/config.xml
+++ b/infrastructure-provisioning/src/general/templates/azure/jenkins_jobs/dataengine_install_additional_libs/config.xml
@@ -61,11 +61,10 @@
             [
               {"group": "os_pkg", "name": "nmap"},
               {"group": "os_pkg", "name": "htop"},
-              {"group": "pip2", "name": "requests"},
               {"group": "pip3", "name": "configparser"},
               {"group": "r_pkg", "name": "rmarkdown"},
             ]
-            Types: for OS - os_pkg, for Python - pip2/pip3, for R - r_pkg
+            Types: for OS - os_pkg, for Python - pip3, for R - r_pkg
             NOTE: You need to escape each double quote.
             For Example: {\"group\": \"os_pkg\", \"name\": \"htop\"}
           </description>
diff --git a/infrastructure-provisioning/src/general/templates/azure/jenkins_jobs/notebook_install_additional_libs/config.xml b/infrastructure-provisioning/src/general/templates/azure/jenkins_jobs/notebook_install_additional_libs/config.xml
index 52f5aae..719035d 100644
--- a/infrastructure-provisioning/src/general/templates/azure/jenkins_jobs/notebook_install_additional_libs/config.xml
+++ b/infrastructure-provisioning/src/general/templates/azure/jenkins_jobs/notebook_install_additional_libs/config.xml
@@ -65,11 +65,10 @@
             [
               {"group": "os_pkg", "name": "nmap"},
               {"group": "os_pkg", "name": "htop"},
-              {"group": "pip2", "name": "requests"},
               {"group": "pip3", "name": "configparser"},
               {"group": "r_pkg", "name": "rmarkdown"},
             ]
-            Types: for OS - os_pkg, for Python - pip2/pip3, for R - r_pkg
+            Types: for OS - os_pkg, for Python - pip3, for R - r_pkg
             NOTE: You need to escape each double quote.
             For Example: {\"group\": \"os_pkg\", \"name\": \"htop\"}
           </description>
diff --git a/infrastructure-provisioning/src/general/templates/gcp/jenkins_jobs/dataengine-service_install_additional_libs/config.xml b/infrastructure-provisioning/src/general/templates/gcp/jenkins_jobs/dataengine-service_install_additional_libs/config.xml
index 703803e..5ddce0c 100644
--- a/infrastructure-provisioning/src/general/templates/gcp/jenkins_jobs/dataengine-service_install_additional_libs/config.xml
+++ b/infrastructure-provisioning/src/general/templates/gcp/jenkins_jobs/dataengine-service_install_additional_libs/config.xml
@@ -65,11 +65,10 @@
             [
               {"group": "os_pkg", "name": "nmap"},
               {"group": "os_pkg", "name": "htop"},
-              {"group": "pip2", "name": "requests"},
               {"group": "pip3", "name": "configparser"},
               {"group": "r_pkg", "name": "rmarkdown"},
             ]
-            Types: for OS - os_pkg, for Python - pip2/pip3, for R - r_pkg
+            Types: for OS - os_pkg, for Python - pip3, for R - r_pkg
             NOTE: You need to escape each double quote.
             For Example: {\"group\": \"os_pkg\", \"name\": \"htop\"}
           </description>
diff --git a/infrastructure-provisioning/src/general/templates/gcp/jenkins_jobs/dataengine_install_additional_libs/config.xml b/infrastructure-provisioning/src/general/templates/gcp/jenkins_jobs/dataengine_install_additional_libs/config.xml
index 9b3600e..abc6599 100644
--- a/infrastructure-provisioning/src/general/templates/gcp/jenkins_jobs/dataengine_install_additional_libs/config.xml
+++ b/infrastructure-provisioning/src/general/templates/gcp/jenkins_jobs/dataengine_install_additional_libs/config.xml
@@ -61,11 +61,10 @@
             [
               {"group": "os_pkg", "name": "nmap"},
               {"group": "os_pkg", "name": "htop"},
-              {"group": "pip2", "name": "requests"},
               {"group": "pip3", "name": "configparser"},
               {"group": "r_pkg", "name": "rmarkdown"},
             ]
-            Types: for OS - os_pkg, for Python - pip2/pip3, for R - r_pkg
+            Types: for OS - os_pkg, for Python - pip3, for R - r_pkg
             NOTE: You need to escape each double quote.
             For Example: {\"group\": \"os_pkg\", \"name\": \"htop\"}
           </description>
diff --git a/infrastructure-provisioning/src/general/templates/gcp/jenkins_jobs/notebook_install_additional_libs/config.xml b/infrastructure-provisioning/src/general/templates/gcp/jenkins_jobs/notebook_install_additional_libs/config.xml
index 52f5aae..719035d 100644
--- a/infrastructure-provisioning/src/general/templates/gcp/jenkins_jobs/notebook_install_additional_libs/config.xml
+++ b/infrastructure-provisioning/src/general/templates/gcp/jenkins_jobs/notebook_install_additional_libs/config.xml
@@ -65,11 +65,10 @@
             [
               {"group": "os_pkg", "name": "nmap"},
               {"group": "os_pkg", "name": "htop"},
-              {"group": "pip2", "name": "requests"},
               {"group": "pip3", "name": "configparser"},
               {"group": "r_pkg", "name": "rmarkdown"},
             ]
-            Types: for OS - os_pkg, for Python - pip2/pip3, for R - r_pkg
+            Types: for OS - os_pkg, for Python - pip3, for R - r_pkg
             NOTE: You need to escape each double quote.
             For Example: {\"group\": \"os_pkg\", \"name\": \"htop\"}
           </description>
diff --git a/integration-tests/examples/test_libs/deeplearning/lib_groups.json b/integration-tests/examples/test_libs/deeplearning/lib_groups.json
index 0e8d040..b77b8c2 100644
--- a/integration-tests/examples/test_libs/deeplearning/lib_groups.json
+++ b/integration-tests/examples/test_libs/deeplearning/lib_groups.json
@@ -1,5 +1,4 @@
 [
-  "pip2",
   "pip3",
   "others",
   "os_pkg"
diff --git a/integration-tests/examples/test_libs/deeplearning/lib_list.json b/integration-tests/examples/test_libs/deeplearning/lib_list.json
index 8e6d23d..d360bd8 100644
--- a/integration-tests/examples/test_libs/deeplearning/lib_list.json
+++ b/integration-tests/examples/test_libs/deeplearning/lib_list.json
@@ -8,10 +8,6 @@
     "start_with": "gh"
   },
   {
-    "group": "pip2",
-    "start_with": "sp"
-  },
-  {
     "group": "pip3",
     "start_with": "sp"
   }
diff --git a/integration-tests/examples/test_libs/jupyter/lib_groups.json b/integration-tests/examples/test_libs/jupyter/lib_groups.json
index 821acb6..87e47a5 100644
--- a/integration-tests/examples/test_libs/jupyter/lib_groups.json
+++ b/integration-tests/examples/test_libs/jupyter/lib_groups.json
@@ -1,5 +1,4 @@
 [
-  "pip2",
   "pip3",
   "others",
   "os_pkg",
diff --git a/integration-tests/examples/test_libs/jupyter/lib_list.json b/integration-tests/examples/test_libs/jupyter/lib_list.json
index 7986430..5590429 100644
--- a/integration-tests/examples/test_libs/jupyter/lib_list.json
+++ b/integration-tests/examples/test_libs/jupyter/lib_list.json
@@ -12,10 +12,6 @@
     "start_with": "sp"
   },
   {
-    "group": "pip2",
-    "start_with": "sp"
-  },
-  {
     "group": "pip3",
     "start_with": "sp"
   }
diff --git a/integration-tests/examples/test_libs/lib_groups.json b/integration-tests/examples/test_libs/lib_groups.json
index 9c4e5f0..5cd7bfe 100644
--- a/integration-tests/examples/test_libs/lib_groups.json
+++ b/integration-tests/examples/test_libs/lib_groups.json
@@ -1,5 +1,4 @@
 [
-  "pip2",
   "pip3",
   "os_pkg",
   "r_pkg"
diff --git a/integration-tests/examples/test_libs/rstudio/lib_groups.json b/integration-tests/examples/test_libs/rstudio/lib_groups.json
index 821acb6..87e47a5 100644
--- a/integration-tests/examples/test_libs/rstudio/lib_groups.json
+++ b/integration-tests/examples/test_libs/rstudio/lib_groups.json
@@ -1,5 +1,4 @@
 [
-  "pip2",
   "pip3",
   "others",
   "os_pkg",
diff --git a/integration-tests/examples/test_libs/rstudio/lib_list.json b/integration-tests/examples/test_libs/rstudio/lib_list.json
index 7986430..5590429 100644
--- a/integration-tests/examples/test_libs/rstudio/lib_list.json
+++ b/integration-tests/examples/test_libs/rstudio/lib_list.json
@@ -12,10 +12,6 @@
     "start_with": "sp"
   },
   {
-    "group": "pip2",
-    "start_with": "sp"
-  },
-  {
     "group": "pip3",
     "start_with": "sp"
   }
diff --git a/integration-tests/examples/test_libs/tensor/lib_groups.json b/integration-tests/examples/test_libs/tensor/lib_groups.json
index 0e8d040..b77b8c2 100644
--- a/integration-tests/examples/test_libs/tensor/lib_groups.json
+++ b/integration-tests/examples/test_libs/tensor/lib_groups.json
@@ -1,5 +1,4 @@
 [
-  "pip2",
   "pip3",
   "others",
   "os_pkg"
diff --git a/integration-tests/examples/test_libs/tensor/lib_list.json b/integration-tests/examples/test_libs/tensor/lib_list.json
index 8e6d23d..d360bd8 100644
--- a/integration-tests/examples/test_libs/tensor/lib_list.json
+++ b/integration-tests/examples/test_libs/tensor/lib_list.json
@@ -8,10 +8,6 @@
     "start_with": "gh"
   },
   {
-    "group": "pip2",
-    "start_with": "sp"
-  },
-  {
     "group": "pip3",
     "start_with": "sp"
   }
diff --git a/integration-tests/examples/test_libs/zeppelin/lib_groups.json b/integration-tests/examples/test_libs/zeppelin/lib_groups.json
index 821acb6..87e47a5 100644
--- a/integration-tests/examples/test_libs/zeppelin/lib_groups.json
+++ b/integration-tests/examples/test_libs/zeppelin/lib_groups.json
@@ -1,5 +1,4 @@
 [
-  "pip2",
   "pip3",
   "others",
   "os_pkg",
diff --git a/integration-tests/examples/test_libs/zeppelin/lib_list.json b/integration-tests/examples/test_libs/zeppelin/lib_list.json
index 7986430..b443274 100644
--- a/integration-tests/examples/test_libs/zeppelin/lib_list.json
+++ b/integration-tests/examples/test_libs/zeppelin/lib_list.json
@@ -11,10 +11,7 @@
     "group": "r_pkg",
     "start_with": "sp"
   },
-  {
-    "group": "pip2",
-    "start_with": "sp"
-  },
+
   {
     "group": "pip3",
     "start_with": "sp"
diff --git a/services/datalab-model/src/main/java/com/epam/datalab/dto/LibraryGroups.java b/services/datalab-model/src/main/java/com/epam/datalab/dto/LibraryGroups.java
index 39ff924..3bc772c 100644
--- a/services/datalab-model/src/main/java/com/epam/datalab/dto/LibraryGroups.java
+++ b/services/datalab-model/src/main/java/com/epam/datalab/dto/LibraryGroups.java
@@ -21,7 +21,6 @@
 
 public enum LibraryGroups {
     GROUP_JAVA("java"),
-    GROUP_PIP2("pip2"),
     GROUP_PIP3("pip3"),
     GROUP_R_PKG("r_pkg"),
     GROUP_OS_PKG("os_pkg"),
diff --git a/services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/ChangePropertiesService.java b/services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/ChangePropertiesService.java
index b45cfa6..67f75b4 100644
--- a/services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/ChangePropertiesService.java
+++ b/services/datalab-webapp-common/src/main/java/com/epam/datalab/properties/ChangePropertiesService.java
@@ -79,7 +79,6 @@
         } catch (IOException e) {
             log.error("Failed to read with path {}", servicePath);
             throw new DynamicChangePropertiesException(String.format("Failed during overwriting %s", serviceName));
-
         }
         return oldFile;
     }
@@ -126,7 +125,7 @@
         }
         for (String secretOrUser : secretsAndUsers) {
             int start = confWithReplacedSecretConf.indexOf(secretOrUser);
-            int end = confWithReplacedSecretConf.indexOf(":", start);
+            int end = confWithReplacedSecretConf.indexOf("\n", start) - 1;
             boolean isTure;
             try {
                 String s = confWithReplacedSecretConf.substring(start, end);
diff --git a/services/provisioning-service/src/main/resources/mock_response/aws/notebook_lib_list_pkgs.json b/services/provisioning-service/src/main/resources/mock_response/aws/notebook_lib_list_pkgs.json
index b0816fc..acc4568 100644
--- a/services/provisioning-service/src/main/resources/mock_response/aws/notebook_lib_list_pkgs.json
+++ b/services/provisioning-service/src/main/resources/mock_response/aws/notebook_lib_list_pkgs.json
@@ -5,11 +5,6 @@
   	"pyvcf/xenial": "0.6.7-2build1",
   	"pyxplot/xenial": "0.9.2-6build1"
   	},
-  "pip2": {
-  	"requests": "N/A",
-  	"configparser": "N/A",
-	  "SparseAce": "N/A"
-  	},
   "pip3": {
   	"configparser": "N/A",
 	  "sparkL": "N/A"
diff --git a/services/provisioning-service/src/main/resources/mock_response/azure/notebook_lib_list_pkgs.json b/services/provisioning-service/src/main/resources/mock_response/azure/notebook_lib_list_pkgs.json
index b0816fc..acc4568 100644
--- a/services/provisioning-service/src/main/resources/mock_response/azure/notebook_lib_list_pkgs.json
+++ b/services/provisioning-service/src/main/resources/mock_response/azure/notebook_lib_list_pkgs.json
@@ -5,11 +5,6 @@
   	"pyvcf/xenial": "0.6.7-2build1",
   	"pyxplot/xenial": "0.9.2-6build1"
   	},
-  "pip2": {
-  	"requests": "N/A",
-  	"configparser": "N/A",
-	  "SparseAce": "N/A"
-  	},
   "pip3": {
   	"configparser": "N/A",
 	  "sparkL": "N/A"
diff --git a/services/provisioning-service/src/main/resources/mock_response/gcp/notebook_lib_list_pkgs.json b/services/provisioning-service/src/main/resources/mock_response/gcp/notebook_lib_list_pkgs.json
index b0816fc..acc4568 100644
--- a/services/provisioning-service/src/main/resources/mock_response/gcp/notebook_lib_list_pkgs.json
+++ b/services/provisioning-service/src/main/resources/mock_response/gcp/notebook_lib_list_pkgs.json
@@ -5,11 +5,6 @@
   	"pyvcf/xenial": "0.6.7-2build1",
   	"pyxplot/xenial": "0.9.2-6build1"
   	},
-  "pip2": {
-  	"requests": "N/A",
-  	"configparser": "N/A",
-	  "SparseAce": "N/A"
-  	},
   "pip3": {
   	"configparser": "N/A",
 	  "sparkL": "N/A"
diff --git a/services/self-service/src/main/java/com/epam/datalab/backendapi/domain/NotebookTemplate.java b/services/self-service/src/main/java/com/epam/datalab/backendapi/domain/NotebookTemplate.java
index ffc4c60..294621e 100644
--- a/services/self-service/src/main/java/com/epam/datalab/backendapi/domain/NotebookTemplate.java
+++ b/services/self-service/src/main/java/com/epam/datalab/backendapi/domain/NotebookTemplate.java
@@ -19,6 +19,11 @@
 
 package com.epam.datalab.backendapi.domain;
 
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
 public enum NotebookTemplate {
     JUPYTER("Jupyter notebook 6.1.6"),
     JUPYTER_LAB("JupyterLab 0.35.6"),
@@ -26,15 +31,9 @@
     DEEP_LEARNING("Deep Learning  2.4"),
     TENSOR("Jupyter with TensorFlow 2.3.2"),
     TENSOR_RSTUDIO("RStudio with TensorFlow 2.3.2"),
-    RSTUDIO("RStudio 1.4.1103");
+    RSTUDIO("RStudio 1.4.1103"),
+    TENSOR_GCP("Jupyter with TensorFlow 2.1.0"),
+    DEEP_LEARNING_GCP("Deeplearning notebook");
 
-    private String name;
-
-    NotebookTemplate(String name) {
-        this.name = name;
-    }
-
-    public String getName() {
-        return name;
-    }
+    private final String name;
 }
diff --git a/services/self-service/src/main/java/com/epam/datalab/backendapi/service/impl/LibraryServiceImpl.java b/services/self-service/src/main/java/com/epam/datalab/backendapi/service/impl/LibraryServiceImpl.java
index b66123b..9ee95f2 100644
--- a/services/self-service/src/main/java/com/epam/datalab/backendapi/service/impl/LibraryServiceImpl.java
+++ b/services/self-service/src/main/java/com/epam/datalab/backendapi/service/impl/LibraryServiceImpl.java
@@ -22,6 +22,7 @@
 import com.epam.datalab.auth.UserInfo;
 import com.epam.datalab.backendapi.annotation.*;
 import com.epam.datalab.backendapi.dao.BaseDAO;
+import com.epam.datalab.backendapi.dao.ComputationalDAO;
 import com.epam.datalab.backendapi.dao.ExploratoryDAO;
 import com.epam.datalab.backendapi.dao.ExploratoryLibDAO;
 import com.epam.datalab.backendapi.domain.EndpointDTO;
@@ -70,24 +71,24 @@
     private static final String COMPUTATIONAL_NOT_FOUND_MSG = "Computational with name %s was not found";
     private static final String LIB_ALREADY_INSTALLED = "Library %s is already installing";
 
-    @Inject
-    private ExploratoryDAO exploratoryDAO;
+    private final ExploratoryDAO exploratoryDAO;
+    private final ExploratoryLibDAO libraryDAO;
+    private final RequestBuilder requestBuilder;
+    private final RESTService provisioningService;
+    private final RequestId requestId;
+    private final EndpointService endpointService;
 
     @Inject
-    private ExploratoryLibDAO libraryDAO;
-
-    @Inject
-    private RequestBuilder requestBuilder;
-
-    @Named(ServiceConsts.PROVISIONING_SERVICE_NAME)
-    @Inject
-    private RESTService provisioningService;
-
-    @Inject
-    private RequestId requestId;
-
-    @Inject
-    private EndpointService endpointService;
+    public LibraryServiceImpl(ExploratoryDAO exploratoryDAO, ExploratoryLibDAO libraryDAO, RequestBuilder requestBuilder,
+                              @Named(ServiceConsts.PROVISIONING_SERVICE_NAME) RESTService provisioningService,
+                              RequestId requestId, EndpointService endpointService, ComputationalDAO computationalDAO) {
+        this.exploratoryDAO = exploratoryDAO;
+        this.libraryDAO = libraryDAO;
+        this.requestBuilder = requestBuilder;
+        this.provisioningService = provisioningService;
+        this.requestId = requestId;
+        this.endpointService = endpointService;
+    }
 
 
     @Override
@@ -100,7 +101,6 @@
             Document document = (Document) libraryDAO.findComputationalLibraries(user, project,
                     exploratoryName, computationalName)
                     .getOrDefault(ExploratoryLibDAO.COMPUTATIONAL_LIBS, new Document());
-
             return (List<Document>) document.getOrDefault(computationalName, new ArrayList<>());
         }
     }
@@ -158,7 +158,7 @@
     public List<String> getExploratoryLibGroups(UserInfo userInfo, String projectName, String exploratoryName) {
         UserInstanceDTO userInstanceDTO = exploratoryDAO.fetchExploratoryFields(userInfo.getName(), projectName, exploratoryName);
         final String templateName = userInstanceDTO.getTemplateName();
-        List<LibraryGroups> groups = new ArrayList<>(Arrays.asList(GROUP_PIP2, GROUP_PIP3, GROUP_OTHERS, GROUP_OS_PKG));
+        List<LibraryGroups> groups = new ArrayList<>(Arrays.asList(GROUP_PIP3, GROUP_OTHERS, GROUP_OS_PKG));
 
         if (isTemplateGroup(templateName, Stream.of(JUPYTER, ZEPPELIN))) {
             groups.addAll(Arrays.asList(GROUP_R_PKG, GROUP_JAVA));
@@ -169,6 +169,9 @@
         if (isTemplateGroup(templateName, Stream.of(RSTUDIO, TENSOR_RSTUDIO))) {
             groups.add(GROUP_R_PKG);
         }
+        if (isTemplateGroup(templateName, Stream.of(DEEP_LEARNING_GCP, TENSOR_GCP))) {
+            groups.add(GROUP_JAVA);
+        }
 
         return groups
                 .stream()
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/util/helpUtils.ts b/services/self-service/src/main/resources/webapp/src/app/core/util/helpUtils.ts
index e078fde..a0eae85 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/util/helpUtils.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/util/helpUtils.ts
@@ -36,40 +36,23 @@
     }
   }
 
-  public static addSizeToGpuType(gpuType: string = ''): string {
-    switch (gpuType) {
-      case 'nvidia-tesla-t4':
-        return 'S';
+  public static addSizeToGpuType(index): string {
 
-      case 'nvidia-tesla-p100':
-        return 'M';
+    const sizes = ['S', 'M', 'L', 'XL', 'XXL'];
 
-      case 'nvidia-tesla-v100':
-        return 'L';
-    }
+    return sizes[index];
   }
 
   public static sortGpuTypes(gpuType: Array<string> = []): Array<string> {
-    let sortedTypes = [];
+    
+    const sortedTypes = [
+      'nvidia-tesla-t4', 
+      'nvidia-tesla-k80', 
+      'nvidia-tesla-p4', 
+      'nvidia-tesla-p100', 
+      'nvidia-tesla-v100'
+    ];
 
-    gpuType?.forEach(type => checkType(type));
-
-    function checkType(type) {
-      switch (type) {
-        case 'nvidia-tesla-t4':
-          sortedTypes[0] = type;
-          return;
-  
-        case 'nvidia-tesla-p100':
-          sortedTypes[1] = type;
-          return;
-  
-        case 'nvidia-tesla-v100':
-          sortedTypes[2] = type;
-          return;
-      }
-    }
-
-    return sortedTypes;
+    return sortedTypes.filter(el => gpuType.includes(el));;
   }
 }
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html
index 6fd4253..7b339f7 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html
@@ -170,9 +170,9 @@
                     <mat-select formControlName="master_GPU_type" disableOptionCentering
                                 placeholder="Select master GPU type"
                                 [disabled]="!resourceForm.controls['shape_master'].value">
-                      <mat-option *ngFor="let type of sortGpuTypes(selectedImage.computationGPU)"
+                      <mat-option *ngFor="let type of sortGpuTypes(selectedImage.computationGPU); index as i"
                                   [value]="type" >
-                        <strong class="highlight icon-label">{{ addSizeToGpuType(type) }}</strong> {{ type }}
+                        <strong class="highlight icon-label">{{ addSizeToGpuType(i) }}</strong> {{ type }}
                       </mat-option>
                       <mat-option *ngIf="!selectedImage.computationGPU?.length" class="multiple-select ml-10" disabled>
                         Master GPU types list is empty
@@ -223,8 +223,8 @@
                   <mat-form-field>
                     <mat-label>Select slave GPU type</mat-label>
                     <mat-select formControlName="slave_GPU_type" disableOptionCentering [disabled]="!resourceForm.controls['shape_slave'].value">
-                      <mat-option *ngFor="let type of sortGpuTypes(selectedImage.computationGPU)" [value]="type">
-                        <strong class="highlight icon-label">{{ addSizeToGpuType(type) }}</strong> {{ type }}
+                      <mat-option *ngFor="let type of sortGpuTypes(selectedImage.computationGPU); index as i" [value]="type">
+                        <strong class="highlight icon-label">{{ addSizeToGpuType(i) }}</strong> {{ type }}
                       </mat-option>
                       <mat-option *ngIf="!selectedImage.computationGPU?.length" class="multiple-select ml-10" disabled>
                         Slave GPU types list is empty
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.html
index aaa633c..28d54f3 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.html
@@ -231,8 +231,8 @@
                   <mat-label>Select GPU type</mat-label>
                   <mat-select formControlName="gpu_type" disableOptionCentering [disabled]="!createExploratoryForm.controls['shape'].value"
                               panelClass="create-resources-dialog" placeholder="GPU type">
-                      <mat-option *ngFor="let list_item of gpuTypes" [value]="list_item" (click)="setCount('', list_item)">
-                        <strong class="highlight icon-label">{{ addSizeToGpuType(list_item) }}</strong> {{ list_item }}
+                      <mat-option *ngFor="let list_item of gpuTypes; index as i" [value]="list_item" (click)="setCount('', list_item)">
+                        <strong class="highlight icon-label">{{ addSizeToGpuType(i) }}</strong> {{ list_item }}
                       </mat-option>
                       <mat-option *ngIf="!gpuTypes.length" class="multiple-select ml-10" disabled>
                         GPU list is empty
diff --git a/services/self-service/src/test/java/com/epam/datalab/backendapi/service/impl/LibraryServiceImplTest.java b/services/self-service/src/test/java/com/epam/datalab/backendapi/service/impl/LibraryServiceImplTest.java
index 80c0327..af5dc5a 100644
--- a/services/self-service/src/test/java/com/epam/datalab/backendapi/service/impl/LibraryServiceImplTest.java
+++ b/services/self-service/src/test/java/com/epam/datalab/backendapi/service/impl/LibraryServiceImplTest.java
@@ -79,7 +79,6 @@
     private final String COMPUTATIONAL_NAME = "compName";
 
     private static final String GROUP_JAVA = "java";
-    private static final String GROUP_PIP2 = "pip2";
     private static final String GROUP_PIP3 = "pip3";
     private static final String GROUP_R_PKG = "r_pkg";
     private static final String GROUP_OS_PKG = "os_pkg";
@@ -366,7 +365,7 @@
 
     @Test
     public void getExploratoryJupyterLibGroups() {
-        List<Object> exploratoryGroups = Arrays.asList(GROUP_PIP2, GROUP_PIP3, GROUP_OTHERS, GROUP_OS_PKG, GROUP_R_PKG, GROUP_JAVA);
+        List<Object> exploratoryGroups = Arrays.asList(GROUP_PIP3, GROUP_OTHERS, GROUP_OS_PKG, GROUP_R_PKG, GROUP_JAVA);
         when(exploratoryDAO.fetchExploratoryFields(anyString(), anyString(), anyString())).thenReturn(getJupyterUserInstanceDtoForLibGroups());
 
         List<String> exploratoryGroupsResult = libraryService.getExploratoryLibGroups(getUser(), PROJECT, EXPLORATORY_NAME);
@@ -377,7 +376,7 @@
 
     @Test
     public void getExploratoryRstudioLibGroups() {
-        List<Object> exploratoryGroups = Arrays.asList(GROUP_PIP2, GROUP_PIP3, GROUP_OTHERS, GROUP_OS_PKG, GROUP_R_PKG);
+        List<Object> exploratoryGroups = Arrays.asList(GROUP_PIP3, GROUP_OTHERS, GROUP_OS_PKG, GROUP_R_PKG);
         when(exploratoryDAO.fetchExploratoryFields(anyString(), anyString(), anyString())).thenReturn(getRstudioUserInstanceDtoForLibGroups());
 
         List<String> exploratoryGroupsResult = libraryService.getExploratoryLibGroups(getUser(), PROJECT, EXPLORATORY_NAME);