Skip to content

Commit

Permalink
db password prompt deleted - shell makefile for linux users
Browse files Browse the repository at this point in the history
  • Loading branch information
louispaga committed Apr 23, 2021
1 parent 29531a7 commit f9e6039
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
6 changes: 5 additions & 1 deletion IaC/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ resource "random_id" "artifacts_bucket_name_suffix" {
byte_length = 5
}

resource "random_password" "password" {
length = 16
}

module "network" {
source = "./modules/network"
network_name = var.network_name
Expand All @@ -44,7 +48,7 @@ module "network" {
module "mlflow" {
source = "./modules/mlflow"
artifacts_bucket_name = "${var.artifacts_bucket}-${random_id.artifacts_bucket_name_suffix.hex}"
db_password_value = var.db_password_value
db_password_value = random_password.password.result
server_docker_image = var.mlflow_docker_image
project_id = var.project_id
consent_screen_support_email = var.consent_screen_support_email
Expand Down
6 changes: 1 addition & 5 deletions IaC/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ variable "artifacts_bucket" {
type = string
default = "oneclick-mlflow-store"
}
variable "db_password_value" {
description = "Database password to connect to your instance"
type = string
}
variable "mlflow_docker_image" {
description = "Docker image used in container registry"
type = string
Expand All @@ -48,4 +44,4 @@ variable "storage_uniform" {
type = bool
description = "Wether or not uniform level acces is to be activated for the buckets"
default = true
}
}
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
ifeq ($(SHELL),/bin/sh)
SHELL:=/bin/bash
endif
pre-requesites:
source vars_base && cd Iac/prerequesites && terraform init && terraform apply
source vars_base && cd IaC/prerequesites && terraform init && terraform apply

build-docker:
source vars_base && cd tracking_server && docker build -t $${TF_VAR_mlflow_docker_image} -f tracking.Dockerfile .
Expand All @@ -8,16 +11,16 @@ push-docker:
source vars_base && docker push $${TF_VAR_mlflow_docker_image}

init-terraform:
source vars_base && cd Iac && terraform init -backend-config="bucket=$${TF_VAR_backend_bucket}"
source vars_base && cd IaC && terraform init -backend-config="bucket=$${TF_VAR_backend_bucket}"

apply-terraform:
source vars_base && cd Iac && terraform apply
source vars_base && cd IaC && terraform apply

plan-terraform:
source vars_base && cd Iac && terraform plan
source vars_base && cd IaC && terraform plan

destroy-terraform:
source vars_base && cd Iac && terraform destroy
source vars_base && cd IaC && terraform destroy

apply: init-terraform apply-terraform

Expand Down

0 comments on commit f9e6039

Please sign in to comment.