Skip to content

Latest commit

 

History

History
76 lines (62 loc) · 7.24 KB

README.md

File metadata and controls

76 lines (62 loc) · 7.24 KB

ML Flow implementation for GCP

Files overview

bucket_storage.tf - Creates bucket that will store Ml Flow artifacts. Secret is created to hold url to bucket.

cloud_run.tf - Holds configuration for the CloudRun implementation. The resources assigned are sufficient for the low traffic, cpu will be assigned only when the application is in use.

db_main.tf - DB instance using postgres (just instance itself database is created in separate file).

db_mlflow.tf - Data-base and its user, the user data (username and password) and url for database are placed in secrets as it will be used later.

iam.tf - IAM policy for database, secrets and bucket.

main.tf - Basic data about the project setup.

service_accounts.tf - Service account for the CloudRun and for objects creation in bucket.

variables.tf - Variables that need to be adjusted for individual project.

Requirements

Name Version
terraform >= 1.5
google 4.58.0

Resources

Name Type
google_artifact_registry_repository.ar_mlflow resource
google_cloud_run_service_iam_binding.access_to_mlflow resource
google_cloud_run_v2_service.mlflow_on_cloudrun resource
google_project_iam_member.cloudsql_connect resource
google_secret_manager_secret.bucket_object_creator_account_key resource
google_secret_manager_secret.db_login_ml_flow resource
google_secret_manager_secret.db_password_ml_flow resource
google_secret_manager_secret.mlflow_artifact_url resource
google_secret_manager_secret.mlflow_database_url resource
google_secret_manager_secret_iam_member.db_login_ml_flow_accessor resource
google_secret_manager_secret_iam_member.db_password_ml_flow_accessor resource
google_secret_manager_secret_iam_member.mlflow_artifact_url_accessor resource
google_secret_manager_secret_iam_member.mlflow_database_url_accessor resource
google_secret_manager_secret_version.ml-flow-artifact-url-version-basic resource
google_secret_manager_secret_version.ml-flow-pass-version-basic resource
google_secret_manager_secret_version.ml-flow-username-version-basic resource
google_secret_manager_secret_version.mlflow_database_url-version-basic resource
google_secret_manager_secret_version.mlflow_key-version-basic resource
google_service_account.bucket_object_creator resource
google_service_account.cloudrun-mlflow resource
google_service_account_key.key_to_bucket_object_creator resource
google_sql_database.ml_flow_db resource
google_sql_database_instance.main resource
google_sql_user.ml_flow_user resource
google_storage_bucket.mlflow_artifacts_bucket resource
google_storage_bucket_iam_policy.policy_bucket_object_create resource
random_password.db_password_ml_flow resource
google_iam_policy.mlflow-bucket-policy data source
google_project.project data source

Inputs

Name Description Type Default Required
bucket_users_list List of users list [] no
env Name of the environment string "prod" no
image_name Name of the imagine that will be used. string "mlflow-imagine" no
project_name Full name of the project string "test-ml-flow-terraform" no
region GCP region that will be used for the project string "europe-west2" no
vpn_to_access_db VPN that will be used to connect to DB, while using 0.0.0.0/0 the application will be available from any IP (it will be accessible from the internet). string "0.0.0.0/0" no
The inputs need to be updated with correct values before the project can be started.
Either in variables.tf or in terraform.tfvars.

Outputs

No outputs.