You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by lf...@apache.org on 2020/04/01 14:17:39 UTC

[incubator-dlab] branch DLAB-1664 updated (f4d754b -> a911dfb)

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

lfrolov pushed a change to branch DLAB-1664
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git.


    from f4d754b  [DLAB-1664]: changed resource block AMI
     new 1346b9f  [DLAB-1664]: changed resource block AMI
     new a911dfb  [DLAB-1664]: added variable

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.


Summary of changes:
 infrastructure-provisioning/terraform/aws/endpoint/main/ami.tf      | 3 +--
 .../terraform/aws/endpoint/main/variables.tf                        | 6 ++++++
 infrastructure-provisioning/terraform/bin/dlab.py                   | 5 +++--
 3 files changed, 10 insertions(+), 4 deletions(-)


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


[incubator-dlab] 01/02: [DLAB-1664]: changed resource block AMI

Posted by lf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lfrolov pushed a commit to branch DLAB-1664
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 1346b9f2cec8942fc6057bf2755bcd24e3b57f9b
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Wed Apr 1 16:36:23 2020 +0300

    [DLAB-1664]: changed resource block AMI
---
 infrastructure-provisioning/terraform/aws/endpoint/main/ami.tf       | 3 +--
 infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf | 5 +++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/infrastructure-provisioning/terraform/aws/endpoint/main/ami.tf b/infrastructure-provisioning/terraform/aws/endpoint/main/ami.tf
index 9b921b2..8a84590 100644
--- a/infrastructure-provisioning/terraform/aws/endpoint/main/ami.tf
+++ b/infrastructure-provisioning/terraform/aws/endpoint/main/ami.tf
@@ -20,9 +20,8 @@
  # ******************************************************************************
 
  resource "aws_ami" "shared_notebook_ami" {
-   count = length(var.application_name)
+   count = var.delete_images ? length(var.application_name) : 0
    name = "${var.service_base_name}-${var.endpoint_id}-${var.application_name[count.index]}-notebook-image"
    virtualization_type = "hvm"
    root_device_name    = "/dev/sda1"
-   force_destroy = true
  }
\ No newline at end of file
diff --git a/infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf b/infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf
index a6ffbbb..05370d8 100644
--- a/infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf
+++ b/infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf
@@ -85,4 +85,9 @@ variable "tag_resource_id" {
 variable "application_name" {
   type    = list(string)
   default = ["jupyterlab", "jupyter", "rstudio", "tensor", "zeppelin", "deeplearning", "tensor-rstudio", "superset"]
+}
+
+variable "delete_images" {
+  description = "If set to true, delete shared images per endpoint"
+  type        = bool
 }
\ No newline at end of file


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


[incubator-dlab] 02/02: [DLAB-1664]: added variable

Posted by lf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lfrolov pushed a commit to branch DLAB-1664
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit a911dfb3692b4fac0771f9d924e1de2f8e7566f5
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Wed Apr 1 17:17:22 2020 +0300

    [DLAB-1664]: added variable
---
 infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf | 1 +
 infrastructure-provisioning/terraform/bin/dlab.py                    | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf b/infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf
index 05370d8..165eb67 100644
--- a/infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf
+++ b/infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf
@@ -90,4 +90,5 @@ variable "application_name" {
 variable "delete_images" {
   description = "If set to true, delete shared images per endpoint"
   type        = bool
+  default = false
 }
\ No newline at end of file
diff --git a/infrastructure-provisioning/terraform/bin/dlab.py b/infrastructure-provisioning/terraform/bin/dlab.py
index bd24425..701963d 100644
--- a/infrastructure-provisioning/terraform/bin/dlab.py
+++ b/infrastructure-provisioning/terraform/bin/dlab.py
@@ -290,8 +290,9 @@ class TerraformProvider:
         logging.info('terraform destroy')
         args_str = get_var_args_string(cli_args)
         params_str = get_args_string(tf_params)
-        command = ('terraform destroy -auto-approve {} {} {}'
-                   .format(self.no_color, params_str, args_str))
+        delete_images = "-var 'delete_images=true'"
+        command = ('terraform destroy -auto-approve {} {} {} {}'
+                   .format(self.no_color, params_str, args_str, delete_images))
         logging.info(command)
         Console.execute_to_command_line(command)
         if not keep_state_file:


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