deployml-core 0.0.55__tar.gz → 0.0.57__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 (86) hide show
  1. {deployml_core-0.0.55 → deployml_core-0.0.57}/PKG-INFO +1 -1
  2. {deployml_core-0.0.55 → deployml_core-0.0.57}/pyproject.toml +1 -1
  3. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/cli/cli.py +71 -3
  4. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/templates/gcp/cloud_run/main.tf.j2 +14 -0
  5. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/utils/constants.py +1 -0
  6. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/utils/helpers.py +24 -0
  7. {deployml_core-0.0.55 → deployml_core-0.0.57}/LICENSE +0 -0
  8. {deployml_core-0.0.55 → deployml_core-0.0.57}/README.md +0 -0
  9. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/__init__.py +0 -0
  10. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/api.py +0 -0
  11. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/cli/__init__.py +0 -0
  12. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/diagnostics/__init__.py +0 -0
  13. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/diagnostics/doctor.py +0 -0
  14. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/enum/__init__.py +0 -0
  15. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/enum/cloud_provider.py +0 -0
  16. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/enum/deployment_type.py +0 -0
  17. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/notebook/__init__.py +0 -0
  18. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/notebook/deployment.py +0 -0
  19. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/notebook/display.py +0 -0
  20. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/notebook/stack.py +0 -0
  21. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/notebook/urls.py +0 -0
  22. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/notebook.py +0 -0
  23. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/templates/gcp/cloud_run/base_main.tf.j2 +0 -0
  24. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/templates/gcp/cloud_run/mlflow_main.tf.j2 +0 -0
  25. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/templates/gcp/cloud_run/terraform.tfvars.j2 +0 -0
  26. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/templates/gcp/cloud_run/variables.tf.j2 +0 -0
  27. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/templates/gcp/cloud_run/wandb_main.tf.j2 +0 -0
  28. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/templates/gcp/cloud_vm/main.tf.j2 +0 -0
  29. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/templates/gcp/cloud_vm/terraform.tfvars.j2 +0 -0
  30. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/templates/gcp/cloud_vm/variables.tf.j2 +0 -0
  31. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/templates/kubernetes_local/deployment.yaml.j2 +0 -0
  32. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/templates/kubernetes_local/mlflow-deployment.yaml.j2 +0 -0
  33. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/templates/kubernetes_local/mlflow-service.yaml.j2 +0 -0
  34. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/templates/kubernetes_local/service.yaml.j2 +0 -0
  35. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/cloud_sql_postgres/main.tf +0 -0
  36. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/cloud_sql_postgres/outputs.tf +0 -0
  37. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/cloud_sql_postgres/variables.tf +0 -0
  38. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/cron/cloud/gcp/cloud_run/main.tf +0 -0
  39. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/cron/cloud/gcp/cloud_run/outputs.tf +0 -0
  40. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/cron/cloud/gcp/cloud_run/variables.tf +0 -0
  41. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/explainability_monitoring/cloud/gcp/cloud_run/main.tf +0 -0
  42. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/explainability_monitoring/cloud/gcp/cloud_run/outputs.tf +0 -0
  43. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/explainability_monitoring/cloud/gcp/cloud_run/variables.tf +0 -0
  44. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/fairness_monitoring/cloud/gcp/cloud_run/main.tf +0 -0
  45. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/fairness_monitoring/cloud/gcp/cloud_run/outputs.tf +0 -0
  46. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/fairness_monitoring/cloud/gcp/cloud_run/variables.tf +0 -0
  47. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/fastapi/cloud/gcp/cloud_run/main.tf +0 -0
  48. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/fastapi/cloud/gcp/cloud_run/outputs.tf +0 -0
  49. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/fastapi/cloud/gcp/cloud_run/variables.tf +0 -0
  50. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/feast/cloud/gcp/cloud_run/main.tf +0 -0
  51. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/feast/cloud/gcp/cloud_run/outputs.tf +0 -0
  52. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/feast/cloud/gcp/cloud_run/variables.tf +0 -0
  53. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/feast/cloud/gcp/cloud_vm/feast_env.tpl +0 -0
  54. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/feast/cloud/gcp/cloud_vm/main.tf +0 -0
  55. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/feast/cloud/gcp/cloud_vm/outputs.tf +0 -0
  56. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/feast/cloud/gcp/cloud_vm/variables.tf +0 -0
  57. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/grafana/cloud/gcp/cloud_run/main.tf +0 -0
  58. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/grafana/cloud/gcp/cloud_run/outputs.tf +0 -0
  59. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/grafana/cloud/gcp/cloud_run/variables.tf +0 -0
  60. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/mlflow/cloud/gcp/cloud_run/main.tf +0 -0
  61. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/mlflow/cloud/gcp/cloud_run/outputs.tf +0 -0
  62. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/mlflow/cloud/gcp/cloud_run/variables.tf +0 -0
  63. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/mlflow/cloud/gcp/cloud_vm/main.tf +0 -0
  64. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/mlflow/cloud/gcp/cloud_vm/variables.tf +0 -0
  65. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/offline_scoring/cloud/gcp/cloud_run/main.tf +0 -0
  66. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/offline_scoring/cloud/gcp/cloud_run/outputs.tf +0 -0
  67. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/offline_scoring/cloud/gcp/cloud_run/variables.tf +0 -0
  68. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/teardown/cloud/gcp/cloud_function/main.py +0 -0
  69. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/teardown/cloud/gcp/cloud_function/requirements.txt +0 -0
  70. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/teardown/cloud/gcp/cloudbuild.yaml +0 -0
  71. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/teardown/cloud/gcp/main.tf +0 -0
  72. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/teardown/cloud/gcp/outputs.tf +0 -0
  73. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/teardown/cloud/gcp/teardown_script.sh +0 -0
  74. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/teardown/cloud/gcp/variables.tf +0 -0
  75. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/wandb/cloud/gcp/cloud_run/main.tf +0 -0
  76. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/wandb/cloud/gcp/cloud_run/outputs.tf +0 -0
  77. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/wandb/cloud/gcp/cloud_run/variables.tf +0 -0
  78. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/wandb/cloud/gcp/cloud_vm/main.tf +0 -0
  79. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/terraform/modules/wandb/cloud/gcp/cloud_vm/variables.tf +0 -0
  80. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/utils/__init__.py +0 -0
  81. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/utils/banner.py +0 -0
  82. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/utils/infracost.py +0 -0
  83. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/utils/kubernetes_gke.py +0 -0
  84. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/utils/kubernetes_local.py +0 -0
  85. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/utils/menu.py +0 -0
  86. {deployml_core-0.0.55 → deployml_core-0.0.57}/src/deployml/utils/teardown.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deployml-core
3
- Version: 0.0.55
3
+ Version: 0.0.57
4
4
  Summary: Infra for academia
5
5
  License-File: LICENSE
6
6
  Author: Drew Hoang
@@ -1,7 +1,7 @@
1
1
 
2
2
  [project]
3
3
  name = "deployml-core"
4
- version = "0.0.55"
4
+ version = "0.0.57"
5
5
  description = "Infra for academia"
6
6
  authors = [
7
7
  {name = "Drew Hoang", email = "codentell@gmail.com"},
@@ -36,6 +36,7 @@ from deployml.utils.helpers import (
36
36
  cleanup_cloud_sql_resources,
37
37
  cleanup_terraform_files,
38
38
  run_terraform_with_loading_bar,
39
+ _create_docker_folder,
39
40
  )
40
41
  from deployml.utils.infracost import (
41
42
  check_infracost_available,
@@ -709,8 +710,22 @@ def generate():
709
710
  )
710
711
 
711
712
  # Write configuration to file
712
- config_filename = f"{name}.yaml"
713
- import yaml
713
+ config_filename = "config.yaml"
714
+
715
+ if not config_filename.exists():
716
+ typer.secho(
717
+ "config.yaml not found. Run 'mlops-infra init' first.",
718
+ fg=typer.colors.RED,
719
+ )
720
+ raise typer.Exit(code=1)
721
+
722
+ if not force:
723
+ confirm = typer.confirm(
724
+ "This will overwrite the existing config.yaml. Continue?"
725
+ )
726
+ if not confirm:
727
+ typer.echo("Aborted.")
728
+ raise typer.Exit()
714
729
 
715
730
  with open(config_filename, "w") as f:
716
731
  yaml.dump(config, f, default_flow_style=False, sort_keys=False)
@@ -724,7 +739,6 @@ def generate():
724
739
  fg=typer.colors.BRIGHT_BLUE,
725
740
  )
726
741
 
727
-
728
742
  @cli.command()
729
743
  def terraform(
730
744
  action: str,
@@ -1830,9 +1844,23 @@ def init(
1830
1844
  project_id: str = typer.Option(
1831
1845
  "", "--project-id", "-j", help="Project ID (for GCP)"
1832
1846
  ),
1847
+ path: Path = typer.Option(
1848
+ Path.cwd(),
1849
+ "--path",
1850
+ help="Directory where project should be initialized.",
1851
+ ),
1852
+ overwrite: bool = typer.Option(
1853
+ False,
1854
+ "--overwrite",
1855
+ help="Overwrite existing docker folder if it exists.",
1856
+ ),
1833
1857
  ):
1834
1858
  """
1835
1859
  Initialize cloud project by enabling required APIs/services before deployment.
1860
+
1861
+ This creates:
1862
+ - docker/ folder with Dockerfile templates
1863
+ - config.yaml template
1836
1864
  """
1837
1865
  if provider == "gcp":
1838
1866
  if not project_id:
@@ -1867,6 +1895,46 @@ def init(
1867
1895
  else:
1868
1896
  typer.echo(f" Unknown provider: {provider}")
1869
1897
  raise typer.Exit(code=1)
1898
+
1899
+ project_root = Path(path)
1900
+ try:
1901
+ project_root.mkdir(parents=True, exist_ok=True)
1902
+
1903
+ # ----------------------------------------
1904
+ # Create docker folder
1905
+ # ----------------------------------------
1906
+ _create_docker_folder(project_root, overwrite=overwrite)
1907
+
1908
+ # ----------------------------------------
1909
+ # Create config.yaml
1910
+ # ----------------------------------------
1911
+ config_path = project_root / "config.yaml"
1912
+
1913
+ if config_path.exists() and not overwrite:
1914
+ raise FileExistsError(
1915
+ f"{config_path} already exists. Use --overwrite to replace."
1916
+ )
1917
+
1918
+ config_template = {
1919
+ "# Run `mlops-infra generate` to create your config"
1920
+ }
1921
+
1922
+ with open(config_path, "w") as f:
1923
+ yaml.dump(config_template, f, sort_keys=False)
1924
+
1925
+ typer.secho("Project initialized successfully.", fg=typer.colors.GREEN)
1926
+ typer.echo()
1927
+ typer.echo("Created:")
1928
+ typer.echo(" - docker/")
1929
+ typer.echo(" - config.yaml")
1930
+ typer.echo()
1931
+ typer.echo("Next steps:")
1932
+ typer.echo(" 1. Edit config.yaml")
1933
+ typer.echo(" 2. Build images with: mlops-infra build-images --docker-root docker")
1934
+
1935
+ except Exception as e:
1936
+ typer.secho(f"Error: {e}", fg=typer.colors.RED)
1937
+ raise typer.Exit(code=1)
1870
1938
 
1871
1939
 
1872
1940
  @cli.command()
@@ -216,6 +216,20 @@ module "{{ stage_name }}_{{ tool.name }}" {
216
216
  {% endfor %}
217
217
  {% endfor %}
218
218
 
219
+ # Bigquery table for features
220
+ {% for stage in stack %}
221
+ {% for stage_name, tool in stage.items() %}
222
+ {% if stage_name == "data_store" and tool.name == "bigquery" %}
223
+ module "{{ stage_name }}_{{ tool.name }}" {
224
+ source = "./modules/{{ tool.name }}/cloud/gcp"
225
+ project_id = var.project_id
226
+ region = var.region
227
+ dataset_id = var.dataset_id
228
+ }
229
+ {% endif %}
230
+ {% endfor %}
231
+ {% endfor %}
232
+
219
233
  # Workflow orchestration (cron scheduling) module
220
234
  {% for stage in stack %}
221
235
  {% for stage_name, tool in stage.items() %}
@@ -48,4 +48,5 @@ REQUIRED_GCP_APIS = [
48
48
  "monitoring.googleapis.com",
49
49
  "logging.googleapis.com",
50
50
  "artifactregistry.googleapis.com",
51
+ "cloudbuild.googleapis.com",
51
52
  ]
@@ -1,5 +1,6 @@
1
1
  import shutil
2
2
  import subprocess
3
+ import importlib.resources as pkg_resources
3
4
  from pathlib import Path
4
5
  from typing import Optional
5
6
  from google.cloud import storage
@@ -464,3 +465,26 @@ def run_terraform_with_loading_bar(cmd, cwd, estimated_minutes, stack=None):
464
465
  return returncode
465
466
  finally:
466
467
  f.close() # Always close the file
468
+
469
+
470
+ def _create_docker_folder(
471
+ project_root: Path,
472
+ overwrite: bool = False,
473
+ ) -> None:
474
+ docker_target = project_root / "docker"
475
+
476
+ if docker_target.exists() and not overwrite:
477
+ raise FileExistsError(
478
+ f"{docker_target} already exists. Use --overwrite to replace."
479
+ )
480
+
481
+ if docker_target.exists():
482
+ shutil.rmtree(docker_target)
483
+
484
+ docker_target.mkdir(parents=True, exist_ok=True)
485
+
486
+ templates = pkg_resources.files("deployml") / "docker"
487
+
488
+ for item in templates.iterdir():
489
+ if item.is_dir():
490
+ shutil.copytree(item, docker_target / item.name)
File without changes
File without changes