deployml-core 0.0.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. deployml_core-0.0.8/LICENSE +21 -0
  2. deployml_core-0.0.8/PKG-INFO +105 -0
  3. deployml_core-0.0.8/README.md +87 -0
  4. deployml_core-0.0.8/pyproject.toml +32 -0
  5. deployml_core-0.0.8/src/deployml/__init__.py +0 -0
  6. deployml_core-0.0.8/src/deployml/cli/__init__.py +0 -0
  7. deployml_core-0.0.8/src/deployml/cli/cli.py +838 -0
  8. deployml_core-0.0.8/src/deployml/enum/__init__.py +0 -0
  9. deployml_core-0.0.8/src/deployml/enum/cloud_provider.py +10 -0
  10. deployml_core-0.0.8/src/deployml/enum/deployment_type.py +12 -0
  11. deployml_core-0.0.8/src/deployml/templates/gcp/cloud_run/base_main.tf.j2 +20 -0
  12. deployml_core-0.0.8/src/deployml/templates/gcp/cloud_run/main.tf.j2 +309 -0
  13. deployml_core-0.0.8/src/deployml/templates/gcp/cloud_run/mlflow_main.tf.j2 +378 -0
  14. deployml_core-0.0.8/src/deployml/templates/gcp/cloud_run/terraform.tfvars.j2 +71 -0
  15. deployml_core-0.0.8/src/deployml/templates/gcp/cloud_run/variables.tf.j2 +219 -0
  16. deployml_core-0.0.8/src/deployml/templates/gcp/cloud_run/wandb_main.tf.j2 +112 -0
  17. deployml_core-0.0.8/src/deployml/templates/gcp/cloud_vm/main.tf.j2 +2897 -0
  18. deployml_core-0.0.8/src/deployml/templates/gcp/cloud_vm/terraform.tfvars.j2 +185 -0
  19. deployml_core-0.0.8/src/deployml/templates/gcp/cloud_vm/variables.tf.j2 +352 -0
  20. deployml_core-0.0.8/src/deployml/terraform/modules/cloud_sql_postgres/main.tf +77 -0
  21. deployml_core-0.0.8/src/deployml/terraform/modules/cloud_sql_postgres/outputs.tf +87 -0
  22. deployml_core-0.0.8/src/deployml/terraform/modules/cloud_sql_postgres/variables.tf +57 -0
  23. deployml_core-0.0.8/src/deployml/terraform/modules/cron/cloud/gcp/cloud_run/main.tf +250 -0
  24. deployml_core-0.0.8/src/deployml/terraform/modules/cron/cloud/gcp/cloud_run/outputs.tf +38 -0
  25. deployml_core-0.0.8/src/deployml/terraform/modules/cron/cloud/gcp/cloud_run/variables.tf +119 -0
  26. deployml_core-0.0.8/src/deployml/terraform/modules/fastapi/cloud/gcp/cloud_run/main.tf +134 -0
  27. deployml_core-0.0.8/src/deployml/terraform/modules/fastapi/cloud/gcp/cloud_run/outputs.tf +14 -0
  28. deployml_core-0.0.8/src/deployml/terraform/modules/fastapi/cloud/gcp/cloud_run/variables.tf +96 -0
  29. deployml_core-0.0.8/src/deployml/terraform/modules/feast/cloud/gcp/cloud_run/main.tf +213 -0
  30. deployml_core-0.0.8/src/deployml/terraform/modules/feast/cloud/gcp/cloud_run/outputs.tf +46 -0
  31. deployml_core-0.0.8/src/deployml/terraform/modules/feast/cloud/gcp/cloud_run/variables.tf +139 -0
  32. deployml_core-0.0.8/src/deployml/terraform/modules/feast/cloud/gcp/cloud_vm/feast_env.tpl +36 -0
  33. deployml_core-0.0.8/src/deployml/terraform/modules/feast/cloud/gcp/cloud_vm/main.tf +96 -0
  34. deployml_core-0.0.8/src/deployml/terraform/modules/feast/cloud/gcp/cloud_vm/outputs.tf +54 -0
  35. deployml_core-0.0.8/src/deployml/terraform/modules/feast/cloud/gcp/cloud_vm/variables.tf +93 -0
  36. deployml_core-0.0.8/src/deployml/terraform/modules/grafana/cloud/gcp/cloud_run/main.tf +75 -0
  37. deployml_core-0.0.8/src/deployml/terraform/modules/grafana/cloud/gcp/cloud_run/outputs.tf +4 -0
  38. deployml_core-0.0.8/src/deployml/terraform/modules/grafana/cloud/gcp/cloud_run/variables.tf +55 -0
  39. deployml_core-0.0.8/src/deployml/terraform/modules/mlflow/cloud/gcp/cloud_run/main.tf +104 -0
  40. deployml_core-0.0.8/src/deployml/terraform/modules/mlflow/cloud/gcp/cloud_run/outputs.tf +24 -0
  41. deployml_core-0.0.8/src/deployml/terraform/modules/mlflow/cloud/gcp/cloud_run/variables.tf +132 -0
  42. deployml_core-0.0.8/src/deployml/terraform/modules/mlflow/cloud/gcp/cloud_vm/main.tf +1194 -0
  43. deployml_core-0.0.8/src/deployml/terraform/modules/mlflow/cloud/gcp/cloud_vm/variables.tf +197 -0
  44. deployml_core-0.0.8/src/deployml/terraform/modules/offline_scoring/cloud/gcp/cloud_run/main.tf +210 -0
  45. deployml_core-0.0.8/src/deployml/terraform/modules/offline_scoring/cloud/gcp/cloud_run/outputs.tf +45 -0
  46. deployml_core-0.0.8/src/deployml/terraform/modules/offline_scoring/cloud/gcp/cloud_run/variables.tf +182 -0
  47. deployml_core-0.0.8/src/deployml/terraform/modules/wandb/cloud/gcp/cloud_run/main.tf +79 -0
  48. deployml_core-0.0.8/src/deployml/terraform/modules/wandb/cloud/gcp/cloud_run/outputs.tf +24 -0
  49. deployml_core-0.0.8/src/deployml/terraform/modules/wandb/cloud/gcp/cloud_run/variables.tf +109 -0
  50. deployml_core-0.0.8/src/deployml/terraform/modules/wandb/cloud/gcp/cloud_vm/main.tf +222 -0
  51. deployml_core-0.0.8/src/deployml/terraform/modules/wandb/cloud/gcp/cloud_vm/variables.tf +124 -0
  52. deployml_core-0.0.8/src/deployml/utils/__init__.py +0 -0
  53. deployml_core-0.0.8/src/deployml/utils/banner.py +22 -0
  54. deployml_core-0.0.8/src/deployml/utils/constants.py +51 -0
  55. deployml_core-0.0.8/src/deployml/utils/helpers.py +435 -0
  56. deployml_core-0.0.8/src/deployml/utils/infracost.py +319 -0
  57. deployml_core-0.0.8/src/deployml/utils/menu.py +41 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Drew Hoang
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,105 @@
1
+ Metadata-Version: 2.3
2
+ Name: deployml-core
3
+ Version: 0.0.8
4
+ Summary: Infra for academia
5
+ Author: Drew Hoang
6
+ Author-email: codentell@gmail.com
7
+ Requires-Python: >=3.11
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Requires-Dist: google-cloud-storage (>=3.1.1,<4.0.0)
13
+ Requires-Dist: jinja2
14
+ Requires-Dist: pyyaml
15
+ Requires-Dist: rich
16
+ Requires-Dist: typer
17
+ Description-Content-Type: text/markdown
18
+
19
+ # deployml
20
+ Infrastructure for academia with cost analysis
21
+
22
+ ## Features
23
+
24
+ - 🏗️ **Infrastructure as Code**: Deploy ML infrastructure using Terraform
25
+ - 💰 **Cost Analysis**: Integrated infracost analysis before deployment
26
+ - ☁️ **Multi-Cloud Support**: GCP, AWS, and more
27
+ - 🔬 **ML-Focused**: Pre-configured for MLflow, experiment tracking, and model registry
28
+ - 🛡️ **Production Ready**: Security best practices and service account management
29
+
30
+ ## Instructions
31
+
32
+ ```bash
33
+ poetry install
34
+ poetry run deployml doctor
35
+ poetry run deployml deploy --config-path your-config.yaml
36
+ ```
37
+
38
+ docker build --platform=linux/amd64 -t gcr.io/mlops-intro-461805/mlflow/mlflow:latest .
39
+
40
+ gcloud auth configure-docker docker push gcr.io/PROJECT_ID/mlflow-app:latest
41
+
42
+ ## Cost Analysis Integration
43
+
44
+ deployml integrates with [infracost](https://www.infracost.io/) to provide cost estimates before deployment:
45
+
46
+ ### Installation
47
+ ```bash
48
+ brew install infracost
49
+ ```
50
+ Once installed you will need to create a free [infracost](https://www.infracost.io/) account before creating your API key.
51
+
52
+ To generate your infracost API key run the following command:
53
+
54
+ ```bash
55
+ infracost auth login
56
+ ```
57
+ If you want to retrieve your API key use:
58
+ ```bash
59
+ infracost configure get api_key
60
+ ```
61
+
62
+ ### Cost Analysis Configuration
63
+ Add cost analysis settings to your YAML configuration:
64
+
65
+ ```yaml
66
+ name: "my-mlops-stack"
67
+ cost_analysis:
68
+ enabled: true # Enable/disable cost analysis (default: true)
69
+ warning_threshold: 100.0 # Warn if monthly cost exceeds this amount
70
+ currency: "USD" # Currency for cost display
71
+ ```
72
+
73
+ ## Cloud Run Service Account Setup
74
+
75
+ 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.
76
+
77
+ ### How to get a service account email
78
+
79
+ 1. List your service accounts:
80
+ ```sh
81
+ gcloud iam service-accounts list
82
+ ```
83
+ 2. (Recommended) Create a dedicated service account for MLflow if you don't have one:
84
+ ```sh
85
+ gcloud iam service-accounts create mlflow-cloudrun --display-name "MLflow Cloud Run Service Account"
86
+ ```
87
+ 3. Find the email for your service account (it will look like `mlflow-cloudrun@YOUR_PROJECT.iam.gserviceaccount.com`).
88
+
89
+ ### Grant the service account permissions
90
+
91
+ The Terraform module will automatically grant the service account the required permissions on the artifact bucket.
92
+
93
+ ### Deploying with Terraform
94
+
95
+ Pass the service account email as a variable:
96
+
97
+ ```sh
98
+ terraform apply -var="cloud_run_service_account=mlflow-cloudrun@YOUR_PROJECT.iam.gserviceaccount.com"
99
+ ```
100
+
101
+ Or, if using the CLI, ensure it passes this variable to Terraform.
102
+
103
+ ### Why this is needed
104
+
105
+ 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.
@@ -0,0 +1,87 @@
1
+ # deployml
2
+ Infrastructure for academia with cost analysis
3
+
4
+ ## Features
5
+
6
+ - 🏗️ **Infrastructure as Code**: Deploy ML infrastructure using Terraform
7
+ - 💰 **Cost Analysis**: Integrated infracost analysis before deployment
8
+ - ☁️ **Multi-Cloud Support**: GCP, AWS, and more
9
+ - 🔬 **ML-Focused**: Pre-configured for MLflow, experiment tracking, and model registry
10
+ - 🛡️ **Production Ready**: Security best practices and service account management
11
+
12
+ ## Instructions
13
+
14
+ ```bash
15
+ poetry install
16
+ poetry run deployml doctor
17
+ poetry run deployml deploy --config-path your-config.yaml
18
+ ```
19
+
20
+ docker build --platform=linux/amd64 -t gcr.io/mlops-intro-461805/mlflow/mlflow:latest .
21
+
22
+ gcloud auth configure-docker docker push gcr.io/PROJECT_ID/mlflow-app:latest
23
+
24
+ ## Cost Analysis Integration
25
+
26
+ deployml integrates with [infracost](https://www.infracost.io/) to provide cost estimates before deployment:
27
+
28
+ ### Installation
29
+ ```bash
30
+ brew install infracost
31
+ ```
32
+ Once installed you will need to create a free [infracost](https://www.infracost.io/) account before creating your API key.
33
+
34
+ To generate your infracost API key run the following command:
35
+
36
+ ```bash
37
+ infracost auth login
38
+ ```
39
+ If you want to retrieve your API key use:
40
+ ```bash
41
+ infracost configure get api_key
42
+ ```
43
+
44
+ ### Cost Analysis Configuration
45
+ Add cost analysis settings to your YAML configuration:
46
+
47
+ ```yaml
48
+ name: "my-mlops-stack"
49
+ cost_analysis:
50
+ enabled: true # Enable/disable cost analysis (default: true)
51
+ warning_threshold: 100.0 # Warn if monthly cost exceeds this amount
52
+ currency: "USD" # Currency for cost display
53
+ ```
54
+
55
+ ## Cloud Run Service Account Setup
56
+
57
+ 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.
58
+
59
+ ### How to get a service account email
60
+
61
+ 1. List your service accounts:
62
+ ```sh
63
+ gcloud iam service-accounts list
64
+ ```
65
+ 2. (Recommended) Create a dedicated service account for MLflow if you don't have one:
66
+ ```sh
67
+ gcloud iam service-accounts create mlflow-cloudrun --display-name "MLflow Cloud Run Service Account"
68
+ ```
69
+ 3. Find the email for your service account (it will look like `mlflow-cloudrun@YOUR_PROJECT.iam.gserviceaccount.com`).
70
+
71
+ ### Grant the service account permissions
72
+
73
+ The Terraform module will automatically grant the service account the required permissions on the artifact bucket.
74
+
75
+ ### Deploying with Terraform
76
+
77
+ Pass the service account email as a variable:
78
+
79
+ ```sh
80
+ terraform apply -var="cloud_run_service_account=mlflow-cloudrun@YOUR_PROJECT.iam.gserviceaccount.com"
81
+ ```
82
+
83
+ Or, if using the CLI, ensure it passes this variable to Terraform.
84
+
85
+ ### Why this is needed
86
+
87
+ 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.
@@ -0,0 +1,32 @@
1
+
2
+ [project]
3
+ name = "deployml-core"
4
+ version = "0.0.8"
5
+ description = "Infra for academia"
6
+ authors = [
7
+ {name = "Drew Hoang", email = "codentell@gmail.com"},
8
+ {name = "Jarvin Bayona", email = "jarvin.bayona@gmail.com"},
9
+ {name = "Grant Nitta", email = "gtnitta@gmail.com"},
10
+ {name = "Robert Clements", email = "rclements@usfca.edu"}
11
+ ]
12
+ readme = "README.md"
13
+ requires-python = ">=3.11"
14
+ dependencies = [
15
+ "typer",
16
+ "pyyaml",
17
+ "jinja2",
18
+ "rich",
19
+ "google-cloud-storage>=3.1.1,<4.0.0"
20
+ ]
21
+
22
+ [project.scripts]
23
+ deployml = "deployml.cli.cli:main"
24
+
25
+ [tool.poetry]
26
+ packages = [{include = "deployml", from = "src"}]
27
+
28
+
29
+
30
+ [build-system]
31
+ requires = ["poetry-core>=2.0.0,<3.0.0"]
32
+ build-backend = "poetry.core.masonry.api"
File without changes
File without changes