From 247b685c3723a6c86622d21de62ce8d38cfdf3f6 Mon Sep 17 00:00:00 2001 From: Florian Lemaitre Date: Tue, 27 Jun 2023 17:30:30 +0200 Subject: [PATCH 1/3] Add support for nginx static file --- infrastructure/quick-deploy/aws/all-in-one/armonik.tf | 2 ++ .../quick-deploy/aws/all-in-one/parameters.tfvars | 5 +++++ infrastructure/quick-deploy/aws/all-in-one/variables.tf | 8 +++++++- .../quick-deploy/localhost/all-in-one/armonik.tf | 2 ++ .../quick-deploy/localhost/all-in-one/parameters.tfvars | 5 +++++ .../quick-deploy/localhost/all-in-one/variables.tf | 6 ++++++ 6 files changed, 27 insertions(+), 1 deletion(-) diff --git a/infrastructure/quick-deploy/aws/all-in-one/armonik.tf b/infrastructure/quick-deploy/aws/all-in-one/armonik.tf index ff719e4e5..1b36177a1 100644 --- a/infrastructure/quick-deploy/aws/all-in-one/armonik.tf +++ b/infrastructure/quick-deploy/aws/all-in-one/armonik.tf @@ -72,4 +72,6 @@ module "armonik" { # Force the dependency on Keda and metrics-server for the HPA keda_chart_name = module.keda.keda.chart_name metrics_server_chart_name = concat(module.metrics_server[*].metrics_server.chart_name, ["metrics-server"])[0] + + environment_description = var.environment_description } diff --git a/infrastructure/quick-deploy/aws/all-in-one/parameters.tfvars b/infrastructure/quick-deploy/aws/all-in-one/parameters.tfvars index 944a3d44f..bbde607b0 100644 --- a/infrastructure/quick-deploy/aws/all-in-one/parameters.tfvars +++ b/infrastructure/quick-deploy/aws/all-in-one/parameters.tfvars @@ -639,3 +639,8 @@ extra_conf = { Submitter__MaxErrorAllowed = 50 } } + +environment_description = { + name = "aws-dev" + color = "#80ff80" +} diff --git a/infrastructure/quick-deploy/aws/all-in-one/variables.tf b/infrastructure/quick-deploy/aws/all-in-one/variables.tf index 384835bd8..3cf43b4fe 100644 --- a/infrastructure/quick-deploy/aws/all-in-one/variables.tf +++ b/infrastructure/quick-deploy/aws/all-in-one/variables.tf @@ -732,4 +732,10 @@ variable "ecr" { encryption_type = optional(string, "KMS") }) default = {} -} \ No newline at end of file +} + +variable "environment_description" { + description = "Description of the environment" + type = any + default = null +} diff --git a/infrastructure/quick-deploy/localhost/all-in-one/armonik.tf b/infrastructure/quick-deploy/localhost/all-in-one/armonik.tf index 6ed0c464d..b87e044d9 100644 --- a/infrastructure/quick-deploy/localhost/all-in-one/armonik.tf +++ b/infrastructure/quick-deploy/localhost/all-in-one/armonik.tf @@ -66,4 +66,6 @@ module "armonik" { # Force the dependency on Keda and metrics-server for the HPA keda_chart_name = module.keda.keda.chart_name metrics_server_chart_name = concat(module.metrics_server[*].metrics_server.chart_name, ["metrics-server"])[0] + + environment_description = var.environment_description } diff --git a/infrastructure/quick-deploy/localhost/all-in-one/parameters.tfvars b/infrastructure/quick-deploy/localhost/all-in-one/parameters.tfvars index d338b2573..da1c8abc7 100644 --- a/infrastructure/quick-deploy/localhost/all-in-one/parameters.tfvars +++ b/infrastructure/quick-deploy/localhost/all-in-one/parameters.tfvars @@ -312,3 +312,8 @@ extra_conf = { Submitter__MaxErrorAllowed = 50 } } + +environment_description = { + name = "local-dev" + color = "#ffffff" +} diff --git a/infrastructure/quick-deploy/localhost/all-in-one/variables.tf b/infrastructure/quick-deploy/localhost/all-in-one/variables.tf index 7d1b5095c..65ed92eda 100644 --- a/infrastructure/quick-deploy/localhost/all-in-one/variables.tf +++ b/infrastructure/quick-deploy/localhost/all-in-one/variables.tf @@ -496,3 +496,9 @@ variable "helm_charts" { version = string })) } + +variable "environment_description" { + description = "Description of the environment" + type = any + default = null +} From 86da76d15939e56ff1741958064d6c3d2d055e7c Mon Sep 17 00:00:00 2001 From: esoubiran-aneo Date: Tue, 27 Jun 2023 18:07:32 +0200 Subject: [PATCH 2/3] feat: support localhost deployment chore: format fix: normalize content --- .../quick-deploy/aws/all-in-one/parameters.tfvars | 2 ++ .../quick-deploy/localhost/all-in-one/parameters.tfvars | 4 +++- .../quick-deploy/localhost/multi-stages/armonik/main.tf | 1 + .../localhost/multi-stages/armonik/parameters.tfvars | 7 +++++++ .../localhost/multi-stages/armonik/variables.tf | 6 ++++++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/infrastructure/quick-deploy/aws/all-in-one/parameters.tfvars b/infrastructure/quick-deploy/aws/all-in-one/parameters.tfvars index bbde607b0..7d6025148 100644 --- a/infrastructure/quick-deploy/aws/all-in-one/parameters.tfvars +++ b/infrastructure/quick-deploy/aws/all-in-one/parameters.tfvars @@ -642,5 +642,7 @@ extra_conf = { environment_description = { name = "aws-dev" + version = "0.0.0" + description = "AWS environment" color = "#80ff80" } diff --git a/infrastructure/quick-deploy/localhost/all-in-one/parameters.tfvars b/infrastructure/quick-deploy/localhost/all-in-one/parameters.tfvars index da1c8abc7..1d356ac1c 100644 --- a/infrastructure/quick-deploy/localhost/all-in-one/parameters.tfvars +++ b/infrastructure/quick-deploy/localhost/all-in-one/parameters.tfvars @@ -315,5 +315,7 @@ extra_conf = { environment_description = { name = "local-dev" - color = "#ffffff" + version = "0.0.0" + description = "Local development environment" + color = "blue" } diff --git a/infrastructure/quick-deploy/localhost/multi-stages/armonik/main.tf b/infrastructure/quick-deploy/localhost/multi-stages/armonik/main.tf index 0655de101..31a02828f 100644 --- a/infrastructure/quick-deploy/localhost/multi-stages/armonik/main.tf +++ b/infrastructure/quick-deploy/localhost/multi-stages/armonik/main.tf @@ -26,4 +26,5 @@ module "armonik" { ingress = var.ingress job_partitions_in_database = var.job_partitions_in_database authentication = var.authentication + environment_description = var.environment_description } diff --git a/infrastructure/quick-deploy/localhost/multi-stages/armonik/parameters.tfvars b/infrastructure/quick-deploy/localhost/multi-stages/armonik/parameters.tfvars index 5688f25ad..ceeb1c67f 100644 --- a/infrastructure/quick-deploy/localhost/multi-stages/armonik/parameters.tfvars +++ b/infrastructure/quick-deploy/localhost/multi-stages/armonik/parameters.tfvars @@ -245,3 +245,10 @@ extra_conf = { Submitter__MaxErrorAllowed = 50 } } + +environment_description = { + name = "local-dev" + version = "0.0.0" + description = "Local development environment" + color = "blue" +} diff --git a/infrastructure/quick-deploy/localhost/multi-stages/armonik/variables.tf b/infrastructure/quick-deploy/localhost/multi-stages/armonik/variables.tf index 0ee56cec7..fd050184e 100644 --- a/infrastructure/quick-deploy/localhost/multi-stages/armonik/variables.tf +++ b/infrastructure/quick-deploy/localhost/multi-stages/armonik/variables.tf @@ -252,3 +252,9 @@ variable "authentication" { require_authorization = bool }) } + +variable "environment_description" { + description = "Description of the environment" + type = any + default = null +} From 46bac14c58df2fffc6bc8bdfdd1ae2df281dad61 Mon Sep 17 00:00:00 2001 From: esoubiran-aneo Date: Wed, 28 Jun 2023 17:50:21 +0200 Subject: [PATCH 3/3] docs: create page related to this feature fix: format fix: format fix: add a line fix: add a line fix: format --- .../2.guide/differentiate-environments.md | 41 +++++++++++++++++++ .../aws/all-in-one/parameters.tfvars | 6 +-- .../aws/multi-stages/armonik/main.tf | 2 + .../multi-stages/armonik/parameters.tfvars | 6 +++ .../aws/multi-stages/armonik/variables.tf | 8 +++- .../localhost/all-in-one/parameters.tfvars | 6 +-- .../localhost/multi-stages/armonik/main.tf | 3 +- .../multi-stages/armonik/parameters.tfvars | 6 +-- 8 files changed, 67 insertions(+), 11 deletions(-) create mode 100644 .docs/content/2.guide/differentiate-environments.md diff --git a/.docs/content/2.guide/differentiate-environments.md b/.docs/content/2.guide/differentiate-environments.md new file mode 100644 index 000000000..8e679e973 --- /dev/null +++ b/.docs/content/2.guide/differentiate-environments.md @@ -0,0 +1,41 @@ +# Differentiate environments + +It's important to be able to differentiate environments, to be able to rapidly identify which environment you are working on. This is especially important when you are working on multiple environments at the same time to avoid confusion and mistakes. + +In order to achieve this differentiation, we serve a file called `environment.json` that you can access at `/static/environment.json`. + +::alert{type="info"} +In the [Admin GUI](https://github.com/aneoconsulting/ArmoniK.Admin.GUI), we use this file to display the environment name and version in the top middle. +:: + +## Content of the `environment.json` file + +This file contains the following keys: + +```json +{ + "name": "", + "description": "", + "color": "", + "version": "" +} +``` + +::alert{type="info"} +You can use any valide CSS color in the `color` key. [Read more about CSS colors](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). +:: + +## Personalize the `environment.json` file + +You can personalize the content of the file but you need to keep the `name`, `description`, `color` and `version` keys. If you change the name of the keys, the [Admin GUI](https://github.com/aneoconsulting/ArmoniK.Admin.GUI) will not be able to read the file. + +In your `parameters.tfvars` (in `armonik` layer or in the `all-in-one`), you can update the `environment.description` key to serve different content for each environment. + +```hcl +environment_description = { + name = "aws-dev" + version = "0.1.0" + description = "AWS environment" + color = "#80ff80" +} +``` diff --git a/infrastructure/quick-deploy/aws/all-in-one/parameters.tfvars b/infrastructure/quick-deploy/aws/all-in-one/parameters.tfvars index 7d6025148..a42bf7490 100644 --- a/infrastructure/quick-deploy/aws/all-in-one/parameters.tfvars +++ b/infrastructure/quick-deploy/aws/all-in-one/parameters.tfvars @@ -641,8 +641,8 @@ extra_conf = { } environment_description = { - name = "aws-dev" - version = "0.0.0" + name = "aws-dev" + version = "0.0.0" description = "AWS environment" - color = "#80ff80" + color = "#80ff80" } diff --git a/infrastructure/quick-deploy/aws/multi-stages/armonik/main.tf b/infrastructure/quick-deploy/aws/multi-stages/armonik/main.tf index 4a5d64eeb..d54822c6e 100644 --- a/infrastructure/quick-deploy/aws/multi-stages/armonik/main.tf +++ b/infrastructure/quick-deploy/aws/multi-stages/armonik/main.tf @@ -34,4 +34,6 @@ module "armonik" { ingress = merge(var.ingress, { image = local.ingress_image }) job_partitions_in_database = merge(var.job_partitions_in_database, { image = local.job_partitions_in_database_image }) authentication = merge(var.authentication, { image = local.authentication_image }) + + environment_description = var.environment_description } diff --git a/infrastructure/quick-deploy/aws/multi-stages/armonik/parameters.tfvars b/infrastructure/quick-deploy/aws/multi-stages/armonik/parameters.tfvars index 1ab993260..3b58ae581 100644 --- a/infrastructure/quick-deploy/aws/multi-stages/armonik/parameters.tfvars +++ b/infrastructure/quick-deploy/aws/multi-stages/armonik/parameters.tfvars @@ -432,3 +432,9 @@ extra_conf = { } } +environment_description = { + name = "aws-dev" + version = "0.0.0" + description = "AWS environment" + color = "#80ff80" +} diff --git a/infrastructure/quick-deploy/aws/multi-stages/armonik/variables.tf b/infrastructure/quick-deploy/aws/multi-stages/armonik/variables.tf index c39cbfbb0..458707f05 100644 --- a/infrastructure/quick-deploy/aws/multi-stages/armonik/variables.tf +++ b/infrastructure/quick-deploy/aws/multi-stages/armonik/variables.tf @@ -275,4 +275,10 @@ variable "authentication" { require_authentication = bool require_authorization = bool }) -} \ No newline at end of file +} + +variable "environment_description" { + description = "Description of the environment" + type = any + default = null +} diff --git a/infrastructure/quick-deploy/localhost/all-in-one/parameters.tfvars b/infrastructure/quick-deploy/localhost/all-in-one/parameters.tfvars index 1d356ac1c..6bdc7fc3a 100644 --- a/infrastructure/quick-deploy/localhost/all-in-one/parameters.tfvars +++ b/infrastructure/quick-deploy/localhost/all-in-one/parameters.tfvars @@ -314,8 +314,8 @@ extra_conf = { } environment_description = { - name = "local-dev" - version = "0.0.0" + name = "local-dev" + version = "0.0.0" description = "Local development environment" - color = "blue" + color = "blue" } diff --git a/infrastructure/quick-deploy/localhost/multi-stages/armonik/main.tf b/infrastructure/quick-deploy/localhost/multi-stages/armonik/main.tf index 31a02828f..cc5de7c02 100644 --- a/infrastructure/quick-deploy/localhost/multi-stages/armonik/main.tf +++ b/infrastructure/quick-deploy/localhost/multi-stages/armonik/main.tf @@ -26,5 +26,6 @@ module "armonik" { ingress = var.ingress job_partitions_in_database = var.job_partitions_in_database authentication = var.authentication - environment_description = var.environment_description + + environment_description = var.environment_description } diff --git a/infrastructure/quick-deploy/localhost/multi-stages/armonik/parameters.tfvars b/infrastructure/quick-deploy/localhost/multi-stages/armonik/parameters.tfvars index ceeb1c67f..d57cd5c50 100644 --- a/infrastructure/quick-deploy/localhost/multi-stages/armonik/parameters.tfvars +++ b/infrastructure/quick-deploy/localhost/multi-stages/armonik/parameters.tfvars @@ -247,8 +247,8 @@ extra_conf = { } environment_description = { - name = "local-dev" - version = "0.0.0" + name = "local-dev" + version = "0.0.0" description = "Local development environment" - color = "blue" + color = "blue" }