You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by my...@apache.org on 2021/04/22 06:55:53 UTC
[incubator-datalab] branch DATALAB-2372 created (now 2f48047)
This is an automated email from the ASF dual-hosted git repository.
mykolabodnar pushed a change to branch DATALAB-2372
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git.
at 2f48047 [DataLab-2372] - [AWS] Get Deeplearning image id fixed
This branch includes the following new commits:
new 2d4e48f [DataLab-2372] - [AWS] Create Deeplearning notebook from cloud AMI added
new 2f48047 [DataLab-2372] - [AWS] Get Deeplearning image id fixed
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org
[incubator-datalab] 02/02: [DataLab-2372] - [AWS] Get Deeplearning
image id fixed
Posted by my...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mykolabodnar pushed a commit to branch DATALAB-2372
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
commit 2f48047c2e8c7eefef0cfb58a97f157b34bfc8ff
Author: bodnarmykola <bo...@gmail.com>
AuthorDate: Thu Apr 22 09:55:31 2021 +0300
[DataLab-2372] - [AWS] Get Deeplearning image id fixed
---
.../src/general/conf/datalab.ini | 2 +-
.../src/general/lib/aws/meta_lib.py | 23 ----------------------
.../general/scripts/aws/common_prepare_notebook.py | 4 ++--
3 files changed, 3 insertions(+), 26 deletions(-)
diff --git a/infrastructure-provisioning/src/general/conf/datalab.ini b/infrastructure-provisioning/src/general/conf/datalab.ini
index c80f92f..480c6c9 100644
--- a/infrastructure-provisioning/src/general/conf/datalab.ini
+++ b/infrastructure-provisioning/src/general/conf/datalab.ini
@@ -127,7 +127,7 @@ debian_image_name = ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-202010
### Amazon ami name based on RedHat conf_os_family for all DataLab instances
redhat_image_name = RHEL-7.4_HVM-20180103-x86_64-2-Hourly2-GP2
### Amazon ami name for Deeplearning notebook
-deeplearning_image_code = 7peu8ckrjv69aj4y6nx91gfc
+deeplearning_image_name = Deep Learning AMI (Ubuntu 18.04) Version 42.1
### Amazon account ID
# account_id =
### Amazon billing bucket
diff --git a/infrastructure-provisioning/src/general/lib/aws/meta_lib.py b/infrastructure-provisioning/src/general/lib/aws/meta_lib.py
index 23af998..33d95ec 100644
--- a/infrastructure-provisioning/src/general/lib/aws/meta_lib.py
+++ b/infrastructure-provisioning/src/general/lib/aws/meta_lib.py
@@ -635,29 +635,6 @@ def get_ami_id(ami_name):
append_result(str({"error": "Unable to find AMI", "error_message": str(err) + "\n Traceback: " + traceback.print_exc(file=sys.stdout)}))
traceback.print_exc(file=sys.stdout)
-def get_ami_id_by_product_code(product_code):
- try:
- client = boto3.client('ec2')
- image_id = ''
- response = client.describe_images(
- Filters=[
- {
- 'Name': 'product-code',
- 'Values': [product_code]
- }
- ])
- response = response.get('Images')
- for i in response:
- image_id = i.get('ImageId')
- if image_id == '':
- raise Exception("Unable to find image id with name: " + ami_name)
- return image_id
- except Exception as err:
- logging.error("Failed to find AMI: " + ami_name + " : " + str(err) + "\n Traceback: " + traceback.print_exc(file=sys.stdout))
- append_result(str({"error": "Unable to find AMI", "error_message": str(err) + "\n Traceback: " + traceback.print_exc(file=sys.stdout)}))
- traceback.print_exc(file=sys.stdout)
-
-
def get_iam_profile(profile_name, count=0):
client = boto3.client('iam')
iam_profile = ''
diff --git a/infrastructure-provisioning/src/general/scripts/aws/common_prepare_notebook.py b/infrastructure-provisioning/src/general/scripts/aws/common_prepare_notebook.py
index 728a64f..17fde95 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/common_prepare_notebook.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/common_prepare_notebook.py
@@ -104,8 +104,8 @@ if __name__ == "__main__":
notebook_config['ami_id'] = datalab.meta_lib.get_ami_id(os.environ['aws_{}_image_name'.format(
os.environ['conf_os_family'])])
image_id = datalab.meta_lib.get_ami_id_by_name(notebook_config['notebook_image_name'], 'available')
- if os.environ['aws_deeplearning_image_code']:
- image_id = datalab.meta_lib.get_ami_id_by_product_code(os.environ['aws_deeplearning_image_code'])
+ if os.environ['aws_deeplearning_image_name'] and os.environ['application'] == 'deeplearning':
+ image_id = datalab.meta_lib.get_ami_id(os.environ['aws_deeplearning_image_name'])
if image_id != '':
notebook_config['ami_id'] = image_id
print('Pre-configured image found. Using: {}'.format(notebook_config['ami_id']))
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org
[incubator-datalab] 01/02: [DataLab-2372] - [AWS] Create
Deeplearning notebook from cloud AMI added
Posted by my...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mykolabodnar pushed a commit to branch DATALAB-2372
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
commit 2d4e48f10bfffb2b0ce2975ce798167c8e431769
Author: bodnarmykola <bo...@gmail.com>
AuthorDate: Wed Apr 21 15:13:19 2021 +0300
[DataLab-2372] - [AWS] Create Deeplearning notebook from cloud AMI added
---
.../src/general/conf/datalab.ini | 2 ++
.../src/general/lib/aws/meta_lib.py | 22 ++++++++++++++++++++++
.../general/scripts/aws/common_prepare_notebook.py | 2 ++
3 files changed, 26 insertions(+)
diff --git a/infrastructure-provisioning/src/general/conf/datalab.ini b/infrastructure-provisioning/src/general/conf/datalab.ini
index 58705d1..c80f92f 100644
--- a/infrastructure-provisioning/src/general/conf/datalab.ini
+++ b/infrastructure-provisioning/src/general/conf/datalab.ini
@@ -126,6 +126,8 @@ region = us-west-2
debian_image_name = ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20201026
### Amazon ami name based on RedHat conf_os_family for all DataLab instances
redhat_image_name = RHEL-7.4_HVM-20180103-x86_64-2-Hourly2-GP2
+### Amazon ami name for Deeplearning notebook
+deeplearning_image_code = 7peu8ckrjv69aj4y6nx91gfc
### Amazon account ID
# account_id =
### Amazon billing bucket
diff --git a/infrastructure-provisioning/src/general/lib/aws/meta_lib.py b/infrastructure-provisioning/src/general/lib/aws/meta_lib.py
index e959d83..23af998 100644
--- a/infrastructure-provisioning/src/general/lib/aws/meta_lib.py
+++ b/infrastructure-provisioning/src/general/lib/aws/meta_lib.py
@@ -635,6 +635,28 @@ def get_ami_id(ami_name):
append_result(str({"error": "Unable to find AMI", "error_message": str(err) + "\n Traceback: " + traceback.print_exc(file=sys.stdout)}))
traceback.print_exc(file=sys.stdout)
+def get_ami_id_by_product_code(product_code):
+ try:
+ client = boto3.client('ec2')
+ image_id = ''
+ response = client.describe_images(
+ Filters=[
+ {
+ 'Name': 'product-code',
+ 'Values': [product_code]
+ }
+ ])
+ response = response.get('Images')
+ for i in response:
+ image_id = i.get('ImageId')
+ if image_id == '':
+ raise Exception("Unable to find image id with name: " + ami_name)
+ return image_id
+ except Exception as err:
+ logging.error("Failed to find AMI: " + ami_name + " : " + str(err) + "\n Traceback: " + traceback.print_exc(file=sys.stdout))
+ append_result(str({"error": "Unable to find AMI", "error_message": str(err) + "\n Traceback: " + traceback.print_exc(file=sys.stdout)}))
+ traceback.print_exc(file=sys.stdout)
+
def get_iam_profile(profile_name, count=0):
client = boto3.client('iam')
diff --git a/infrastructure-provisioning/src/general/scripts/aws/common_prepare_notebook.py b/infrastructure-provisioning/src/general/scripts/aws/common_prepare_notebook.py
index a823535..728a64f 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/common_prepare_notebook.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/common_prepare_notebook.py
@@ -104,6 +104,8 @@ if __name__ == "__main__":
notebook_config['ami_id'] = datalab.meta_lib.get_ami_id(os.environ['aws_{}_image_name'.format(
os.environ['conf_os_family'])])
image_id = datalab.meta_lib.get_ami_id_by_name(notebook_config['notebook_image_name'], 'available')
+ if os.environ['aws_deeplearning_image_code']:
+ image_id = datalab.meta_lib.get_ami_id_by_product_code(os.environ['aws_deeplearning_image_code'])
if image_id != '':
notebook_config['ami_id'] = image_id
print('Pre-configured image found. Using: {}'.format(notebook_config['ami_id']))
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org