Skip to main content

Infra for academia

Project description

deployml

Infrastructure for academia with cost analysis

Features

  • 🏗️ Infrastructure as Code: Deploy ML infrastructure using Terraform
  • 💰 Cost Analysis: Integrated infracost analysis before deployment
  • ☁️ Multi-Cloud Support: GCP, AWS, and more
  • 🔬 ML-Focused: Pre-configured for MLflow, experiment tracking, and model registry
  • 🛡️ Production Ready: Security best practices and service account management

Instructions

poetry install
poetry run deployml doctor
poetry run deployml deploy --config-path your-config.yaml

docker build --platform=linux/amd64 -t gcr.io/mlops-intro-461805/mlflow/mlflow:latest .

gcloud auth configure-docker docker push gcr.io/PROJECT_ID/mlflow-app:latest

Cost Analysis Integration

deployml integrates with infracost to provide cost estimates before deployment:

Installation

brew install infracost

Once installed you will need to create a free infracost account before creating your API key.

To generate your infracost API key run the following command:

infracost auth login

If you want to retrieve your API key use:

infracost configure get api_key

Cost Analysis Configuration

Add cost analysis settings to your YAML configuration:

name: "my-mlops-stack"
cost_analysis:
  enabled: true              # Enable/disable cost analysis (default: true)
  warning_threshold: 100.0   # Warn if monthly cost exceeds this amount
  currency: "USD"            # Currency for cost display

Cloud Run Service Account Setup

When deploying MLflow, you must specify the service account email that Cloud Run will use. This service account must have permission to access the artifact bucket.

How to get a service account email

  1. List your service accounts:
    gcloud iam service-accounts list
    
  2. (Recommended) Create a dedicated service account for MLflow if you don't have one:
    gcloud iam service-accounts create mlflow-cloudrun --display-name "MLflow Cloud Run Service Account"
    
  3. Find the email for your service account (it will look like mlflow-cloudrun@YOUR_PROJECT.iam.gserviceaccount.com).

Grant the service account permissions

The Terraform module will automatically grant the service account the required permissions on the artifact bucket.

Deploying with Terraform

Pass the service account email as a variable:

terraform apply -var="cloud_run_service_account=mlflow-cloudrun@YOUR_PROJECT.iam.gserviceaccount.com"

Or, if using the CLI, ensure it passes this variable to Terraform.

Why this is needed

The MLflow server (running on Cloud Run) needs permission to list and read artifacts in the GCS bucket. This setup ensures the MLflow UI works for all users without manual permission fixes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deployml_core-0.0.56.tar.gz (121.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deployml_core-0.0.56-py3-none-any.whl (161.1 kB view details)

Uploaded Python 3

File details

Details for the file deployml_core-0.0.56.tar.gz.

File metadata

  • Download URL: deployml_core-0.0.56.tar.gz
  • Upload date:
  • Size: 121.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for deployml_core-0.0.56.tar.gz
Algorithm Hash digest
SHA256 e3f5059fbc4cf634da7dc3becbf683cfb126f042726cd3584cdb7cf0326b595b
MD5 53c2459576b6d50b495b676767fd6ef5
BLAKE2b-256 b1d9b2dfac4da72de6cb67c44480f7c56368ad1e18c5de6c388f127eac9dc1b0

See more details on using hashes here.

File details

Details for the file deployml_core-0.0.56-py3-none-any.whl.

File metadata

  • Download URL: deployml_core-0.0.56-py3-none-any.whl
  • Upload date:
  • Size: 161.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for deployml_core-0.0.56-py3-none-any.whl
Algorithm Hash digest
SHA256 4e68c26d85fb4206fead7f4171cf5fc7c67a9dc3fef48b344878a13fe9917d03
MD5 1ef23ab9d774943f363055bf1a8d2dcc
BLAKE2b-256 6eda7362c4f2b76f92242ba89d2c0c238e67f025980d4eb21abba69fbd3afff0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page