wanna-ml 0.5.24__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 (74) hide show
  1. wanna_ml-0.5.24/CHANGELOG.md +11 -0
  2. wanna_ml-0.5.24/LICENCE +21 -0
  3. wanna_ml-0.5.24/PKG-INFO +137 -0
  4. wanna_ml-0.5.24/README.md +75 -0
  5. wanna_ml-0.5.24/pyproject.toml +186 -0
  6. wanna_ml-0.5.24/src/wanna/__init__.py +7 -0
  7. wanna_ml-0.5.24/src/wanna/cli/__init__.py +7 -0
  8. wanna_ml-0.5.24/src/wanna/cli/__main__.py +83 -0
  9. wanna_ml-0.5.24/src/wanna/cli/plugins/__init__.py +0 -0
  10. wanna_ml-0.5.24/src/wanna/cli/plugins/base_plugin.py +23 -0
  11. wanna_ml-0.5.24/src/wanna/cli/plugins/common_options.py +45 -0
  12. wanna_ml-0.5.24/src/wanna/cli/plugins/job_plugin.py +193 -0
  13. wanna_ml-0.5.24/src/wanna/cli/plugins/notebook_plugin.py +236 -0
  14. wanna_ml-0.5.24/src/wanna/cli/plugins/pipeline_plugin.py +197 -0
  15. wanna_ml-0.5.24/src/wanna/cli/plugins/runner.py +22 -0
  16. wanna_ml-0.5.24/src/wanna/cli/plugins/tensorboard_plugin.py +114 -0
  17. wanna_ml-0.5.24/src/wanna/cli/version.py +43 -0
  18. wanna_ml-0.5.24/src/wanna/components/__init__.py +0 -0
  19. wanna_ml-0.5.24/src/wanna/components/kubeflow/get_or_create_endpoint.py +73 -0
  20. wanna_ml-0.5.24/src/wanna/components/kubeflow/upload_model_version.py +93 -0
  21. wanna_ml-0.5.24/src/wanna/components/loader.py +18 -0
  22. wanna_ml-0.5.24/src/wanna/core/__init__.py +0 -0
  23. wanna_ml-0.5.24/src/wanna/core/deployment/__init__.py +0 -0
  24. wanna_ml-0.5.24/src/wanna/core/deployment/artifacts_push.py +54 -0
  25. wanna_ml-0.5.24/src/wanna/core/deployment/credentials.py +5 -0
  26. wanna_ml-0.5.24/src/wanna/core/deployment/io.py +40 -0
  27. wanna_ml-0.5.24/src/wanna/core/deployment/models.py +143 -0
  28. wanna_ml-0.5.24/src/wanna/core/deployment/monitoring.py +181 -0
  29. wanna_ml-0.5.24/src/wanna/core/deployment/vertex_connector.py +11 -0
  30. wanna_ml-0.5.24/src/wanna/core/deployment/vertex_jobs.py +211 -0
  31. wanna_ml-0.5.24/src/wanna/core/deployment/vertex_pipelines.py +331 -0
  32. wanna_ml-0.5.24/src/wanna/core/deployment/vertex_scheduling.py +223 -0
  33. wanna_ml-0.5.24/src/wanna/core/loggers/wanna_logger.py +71 -0
  34. wanna_ml-0.5.24/src/wanna/core/models/__init__.py +0 -0
  35. wanna_ml-0.5.24/src/wanna/core/models/base_instance.py +27 -0
  36. wanna_ml-0.5.24/src/wanna/core/models/cloud_scheduler.py +16 -0
  37. wanna_ml-0.5.24/src/wanna/core/models/docker.py +120 -0
  38. wanna_ml-0.5.24/src/wanna/core/models/gcp_components.py +31 -0
  39. wanna_ml-0.5.24/src/wanna/core/models/gcp_profile.py +67 -0
  40. wanna_ml-0.5.24/src/wanna/core/models/notification_channel.py +46 -0
  41. wanna_ml-0.5.24/src/wanna/core/models/pipeline.py +62 -0
  42. wanna_ml-0.5.24/src/wanna/core/models/tensorboard.py +16 -0
  43. wanna_ml-0.5.24/src/wanna/core/models/training_custom_job.py +192 -0
  44. wanna_ml-0.5.24/src/wanna/core/models/wanna_config.py +42 -0
  45. wanna_ml-0.5.24/src/wanna/core/models/wanna_project.py +23 -0
  46. wanna_ml-0.5.24/src/wanna/core/models/workbench.py +110 -0
  47. wanna_ml-0.5.24/src/wanna/core/services/__init__.py +0 -0
  48. wanna_ml-0.5.24/src/wanna/core/services/base.py +247 -0
  49. wanna_ml-0.5.24/src/wanna/core/services/docker.py +700 -0
  50. wanna_ml-0.5.24/src/wanna/core/services/jobs.py +600 -0
  51. wanna_ml-0.5.24/src/wanna/core/services/path_utils.py +118 -0
  52. wanna_ml-0.5.24/src/wanna/core/services/pipeline.py +398 -0
  53. wanna_ml-0.5.24/src/wanna/core/services/tensorboard.py +267 -0
  54. wanna_ml-0.5.24/src/wanna/core/services/workbench.py +224 -0
  55. wanna_ml-0.5.24/src/wanna/core/services/workbench_instance.py +519 -0
  56. wanna_ml-0.5.24/src/wanna/core/templates/__init__.py +0 -0
  57. wanna_ml-0.5.24/src/wanna/core/templates/notebook_startup_script.sh.j2 +25 -0
  58. wanna_ml-0.5.24/src/wanna/core/templates/notebook_template.Dockerfile +8 -0
  59. wanna_ml-0.5.24/src/wanna/core/templates/scheduler_cloud_function.py +87 -0
  60. wanna_ml-0.5.24/src/wanna/core/templates/scheduler_cloud_function_requirements.txt +5 -0
  61. wanna_ml-0.5.24/src/wanna/core/templates/sla_cloud_function.py +40 -0
  62. wanna_ml-0.5.24/src/wanna/core/templates/sla_cloud_function_requirements.txt +5 -0
  63. wanna_ml-0.5.24/src/wanna/core/utils/__init__.py +0 -0
  64. wanna_ml-0.5.24/src/wanna/core/utils/config_enricher.py +114 -0
  65. wanna_ml-0.5.24/src/wanna/core/utils/config_loader.py +126 -0
  66. wanna_ml-0.5.24/src/wanna/core/utils/credentials.py +69 -0
  67. wanna_ml-0.5.24/src/wanna/core/utils/env.py +89 -0
  68. wanna_ml-0.5.24/src/wanna/core/utils/gcp.py +429 -0
  69. wanna_ml-0.5.24/src/wanna/core/utils/io.py +28 -0
  70. wanna_ml-0.5.24/src/wanna/core/utils/json.py +22 -0
  71. wanna_ml-0.5.24/src/wanna/core/utils/loaders.py +47 -0
  72. wanna_ml-0.5.24/src/wanna/core/utils/templates.py +13 -0
  73. wanna_ml-0.5.24/src/wanna/core/utils/time.py +21 -0
  74. wanna_ml-0.5.24/src/wanna/core/utils/validators.py +158 -0
@@ -0,0 +1,11 @@
1
+ # Changelog #
2
+
3
+ ## Version 0.2.3 ##
4
+ * pipeline_network bug fix
5
+ * Introduction of notebook build command for CI/CD environments
6
+
7
+ ## Version 0.2.2 ##
8
+ * allow for building and pushing containers in an environment without access to GCP
9
+
10
+ ## Version 0.2.1 ##
11
+ * Initial OSS release
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Avast Software s.r.o.
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,137 @@
1
+ Metadata-Version: 2.1
2
+ Name: wanna-ml
3
+ Version: 0.5.24
4
+ Summary: CLI tool for managing ML projects on Vertex AI
5
+ Home-page: https://avast.github.io/wanna-ml
6
+ License: MIT
7
+ Keywords: mlops,vertex-ai,GCP,google-cloud-platform,machine-learning
8
+ Author: Joao Da Silva
9
+ Author-email: joao.dasilvacunha@gendigital.com
10
+ Requires-Python: >=3.10.0,<4.0
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3 :: Only
22
+ Classifier: Topic :: Scientific/Engineering
23
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
+ Classifier: Typing :: Typed
25
+ Requires-Dist: Jinja2 (>=3.1.6,<4.0.0)
26
+ Requires-Dist: PyYAML (>=6.0.3,<7.0.0)
27
+ Requires-Dist: case-converter (>=1.2.0,<2.0.0)
28
+ Requires-Dist: cookiecutter (>=2.6.0,<3.0.0)
29
+ Requires-Dist: cron-validator (>=1.0.8,<2.0.0)
30
+ Requires-Dist: dirhash (>=0.5.0,<0.6.0)
31
+ Requires-Dist: email-validator (>=2.3.0,<3.0.0)
32
+ Requires-Dist: emoji (>=2.15.0,<3.0.0)
33
+ Requires-Dist: gcloud-config-helper (>=0.3.1,<0.4.0)
34
+ Requires-Dist: gitpython (>=3.1.45,<4.0.0)
35
+ Requires-Dist: google-cloud-aiplatform (>=1.121.0,<2.0.0)
36
+ Requires-Dist: google-cloud-build (>=3.33.0,<4.0.0)
37
+ Requires-Dist: google-cloud-compute (>=1.40.0,<2.0.0)
38
+ Requires-Dist: google-cloud-functions (>=1.20.4,<2.0.0)
39
+ Requires-Dist: google-cloud-logging (>=3.12.1,<4.0.0)
40
+ Requires-Dist: google-cloud-monitoring (>=2.28.0,<3.0.0)
41
+ Requires-Dist: google-cloud-notebooks (>=1.13.3,<2.0.0)
42
+ Requires-Dist: google-cloud-pubsub (>=2.31.1,<3.0.0)
43
+ Requires-Dist: google-cloud-scheduler (>=2.16.1,<3.0.0)
44
+ Requires-Dist: google-cloud-storage (>=2.19.0,<4.0.0)
45
+ Requires-Dist: halo (>=0.0.31,<0.0.32)
46
+ Requires-Dist: igittigitt (>=2.1.5,<3.0.0)
47
+ Requires-Dist: kfp (>=2.13.0,<3.0.0)
48
+ Requires-Dist: pathvalidate (>=3.3.1,<4.0.0)
49
+ Requires-Dist: pendulum (>=3.1.0,<4.0.0)
50
+ Requires-Dist: pydantic (>=2.12.3,<3.0.0)
51
+ Requires-Dist: python-on-whales (>=0.78.0,<0.79.0)
52
+ Requires-Dist: pyyaml-include (>=2.2,<3.0)
53
+ Requires-Dist: rich (>=14.2.0,<15.0.0)
54
+ Requires-Dist: smart-open[gcs] (>=7.3.1,<8.0.0)
55
+ Requires-Dist: treelib (>=1.8.0,<2.0.0)
56
+ Requires-Dist: typed-lazyimport (>=0.3.1,<0.4.0)
57
+ Requires-Dist: typer (>=0.20.0,<0.21.0)
58
+ Requires-Dist: waiting (>=1.5.0,<2.0.0)
59
+ Project-URL: Documentation, https://avast.github.io/wanna-ml
60
+ Description-Content-Type: text/markdown
61
+
62
+ # WANNA-ML
63
+
64
+ ---
65
+
66
+ <p align="center" font-style="italic">
67
+ <em> Complete MLOps framework for Vertex-AI </em>
68
+ </p>
69
+
70
+ ---
71
+
72
+ <p align="center">
73
+ <a href="https://github.com/avast/wanna-ml/actions/workflows/build.yml" target="_blank">
74
+ <img src="https://github.com/avast/wanna-ml/actions/workflows/build.yml/badge.svg" alt="Build">
75
+ </a>
76
+ <a href="https://github.com/avast/wanna-ml/actions/workflows/release.yml" target="_blank">
77
+ <img src="https://github.com/avast/wanna-ml/actions/workflows/release.yml/badge.svg" alt="Release">
78
+ </a>
79
+ <a href="https://codecov.io/gh/avast/wanna-ml" target="_blank">
80
+ <img src="https://codecov.io/gh/avast/wanna-ml/branch/master/graph/badge.svg?token=TAFWK4GJPR" alt="Coverage">
81
+ </a>
82
+ <a href="https://pypi.org/project/wanna-ml/" target="_blank">
83
+ <img src="https://img.shields.io/pypi/v/wanna-ml?color=%2334D058&label=pypi%20package" alt="Package version">
84
+ </a>
85
+ </p>
86
+
87
+ # About WANNA-ML
88
+
89
+ WANNA-ML is a CLI tool that helps researchers, data scientists, and ML Engineers quickly adapt to Google Cloud Platform (GCP) and get started on the cloud in almost no time.
90
+
91
+ It makes it easy to start a Jupyter notebook, run training jobs and pipelines, build a Docker container, export logs to Tensorboards, and much more.
92
+
93
+ We build on top of Vertex-AI managed services and integrate with other GCP services like Cloud Build and Artifact Registry to provide you with a standardized structure for managing ML assets on GCP.
94
+
95
+
96
+ ## Help
97
+
98
+ See the [documentation](https://avast.github.io/wanna-ml/) for more details.
99
+
100
+
101
+ ## Get started
102
+
103
+ ### Installation
104
+ Install using `pip install -U wanna-ml`.
105
+
106
+ For more information on the installation process and requirements, visit out [installation page in documentation](https://avast.github.io/wanna-ml/installation)
107
+
108
+ ### Authentication
109
+ WANNA-ML relies on `gcloud` for user authentication.
110
+
111
+ 1. Install the `gcloud` CLI - follow [official guide](https://cloud.google.com/sdk/docs/install)
112
+ 2. Authenticate with the `gcloud init`
113
+ 3. Set you Google Application Credentials `gcloud auth application-default login`
114
+
115
+ ### Docker Build
116
+ You can use a local Docker daemon to build Docker images, but it is not required.
117
+ You are free to choose between local building on GCP Cloud Build.
118
+ If you prefer local Docker image building, install [Docker Desktop](https://www.docker.com/products/docker-desktop/).
119
+
120
+ ### GCP IAM Roles and Permissions
121
+ Different WANNA-ML calls require different GCP permissions to create given resources on GCP. Our [documentation page](https://avast.github.io/wanna-ml/)
122
+ lists recommended GCP IAM roles for each `wanna` command.
123
+
124
+ ## Examples
125
+ Jump to [the samples](https://github.com/avast/wanna-ml/tree/master/samples) to see a complete solution
126
+ for various use cases.
127
+
128
+ ## Issues
129
+ Please report issues to [GitHub](https://github.com/avast/wanna-ml/issues).
130
+
131
+ ## Contributing
132
+ Your contributions are always welcome, see [CONTRIBUTING.md](https://github.com/avast/wanna-ml/blob/master/CONTRIBUTING.md) for more information.
133
+ If you like WANNA-ML, don't forget to give our project a star!
134
+
135
+ ## Licence
136
+ Distributed under the MIT License - see [LICENSE](https://github.com/avast/wanna-ml/blob/master/LICENCE).
137
+
@@ -0,0 +1,75 @@
1
+ # WANNA-ML
2
+
3
+ ---
4
+
5
+ <p align="center" font-style="italic">
6
+ <em> Complete MLOps framework for Vertex-AI </em>
7
+ </p>
8
+
9
+ ---
10
+
11
+ <p align="center">
12
+ <a href="https://github.com/avast/wanna-ml/actions/workflows/build.yml" target="_blank">
13
+ <img src="https://github.com/avast/wanna-ml/actions/workflows/build.yml/badge.svg" alt="Build">
14
+ </a>
15
+ <a href="https://github.com/avast/wanna-ml/actions/workflows/release.yml" target="_blank">
16
+ <img src="https://github.com/avast/wanna-ml/actions/workflows/release.yml/badge.svg" alt="Release">
17
+ </a>
18
+ <a href="https://codecov.io/gh/avast/wanna-ml" target="_blank">
19
+ <img src="https://codecov.io/gh/avast/wanna-ml/branch/master/graph/badge.svg?token=TAFWK4GJPR" alt="Coverage">
20
+ </a>
21
+ <a href="https://pypi.org/project/wanna-ml/" target="_blank">
22
+ <img src="https://img.shields.io/pypi/v/wanna-ml?color=%2334D058&label=pypi%20package" alt="Package version">
23
+ </a>
24
+ </p>
25
+
26
+ # About WANNA-ML
27
+
28
+ WANNA-ML is a CLI tool that helps researchers, data scientists, and ML Engineers quickly adapt to Google Cloud Platform (GCP) and get started on the cloud in almost no time.
29
+
30
+ It makes it easy to start a Jupyter notebook, run training jobs and pipelines, build a Docker container, export logs to Tensorboards, and much more.
31
+
32
+ We build on top of Vertex-AI managed services and integrate with other GCP services like Cloud Build and Artifact Registry to provide you with a standardized structure for managing ML assets on GCP.
33
+
34
+
35
+ ## Help
36
+
37
+ See the [documentation](https://avast.github.io/wanna-ml/) for more details.
38
+
39
+
40
+ ## Get started
41
+
42
+ ### Installation
43
+ Install using `pip install -U wanna-ml`.
44
+
45
+ For more information on the installation process and requirements, visit out [installation page in documentation](https://avast.github.io/wanna-ml/installation)
46
+
47
+ ### Authentication
48
+ WANNA-ML relies on `gcloud` for user authentication.
49
+
50
+ 1. Install the `gcloud` CLI - follow [official guide](https://cloud.google.com/sdk/docs/install)
51
+ 2. Authenticate with the `gcloud init`
52
+ 3. Set you Google Application Credentials `gcloud auth application-default login`
53
+
54
+ ### Docker Build
55
+ You can use a local Docker daemon to build Docker images, but it is not required.
56
+ You are free to choose between local building on GCP Cloud Build.
57
+ If you prefer local Docker image building, install [Docker Desktop](https://www.docker.com/products/docker-desktop/).
58
+
59
+ ### GCP IAM Roles and Permissions
60
+ Different WANNA-ML calls require different GCP permissions to create given resources on GCP. Our [documentation page](https://avast.github.io/wanna-ml/)
61
+ lists recommended GCP IAM roles for each `wanna` command.
62
+
63
+ ## Examples
64
+ Jump to [the samples](https://github.com/avast/wanna-ml/tree/master/samples) to see a complete solution
65
+ for various use cases.
66
+
67
+ ## Issues
68
+ Please report issues to [GitHub](https://github.com/avast/wanna-ml/issues).
69
+
70
+ ## Contributing
71
+ Your contributions are always welcome, see [CONTRIBUTING.md](https://github.com/avast/wanna-ml/blob/master/CONTRIBUTING.md) for more information.
72
+ If you like WANNA-ML, don't forget to give our project a star!
73
+
74
+ ## Licence
75
+ Distributed under the MIT License - see [LICENSE](https://github.com/avast/wanna-ml/blob/master/LICENCE).
@@ -0,0 +1,186 @@
1
+ [tool.poetry]
2
+ authors = ["Joao Da Silva <joao.dasilvacunha@gendigital.com>"]
3
+ description = "CLI tool for managing ML projects on Vertex AI"
4
+ name = "wanna-ml"
5
+ version = "v0.5.24"
6
+ packages = [
7
+ { include = "wanna", from = "src" },
8
+ ]
9
+ include = ["CHANGELOG.md"]
10
+ readme = "README.md"
11
+ license = "MIT"
12
+ keywords = ["mlops", "vertex-ai", "GCP", "google-cloud-platform", "machine-learning"]
13
+ homepage = "https://avast.github.io/wanna-ml"
14
+ documentation = "https://avast.github.io/wanna-ml"
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Intended Audience :: Science/Research",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Programming Language :: Python",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3 :: Only",
23
+ "Programming Language :: Python :: 3.10",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Programming Language :: Python :: 3.12",
26
+ "Programming Language :: Python :: 3.13",
27
+ "Topic :: Scientific/Engineering",
28
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
29
+ "Typing :: Typed",
30
+ ]
31
+
32
+ [tool.poetry.dependencies]
33
+ python = ">=3.10.0, <4.0"
34
+ typed-lazyimport = ">=0.3.1,<0.4.0"
35
+ kfp = "^2.13.0"
36
+ google-cloud-aiplatform = "^1.121.0"
37
+ google-cloud-build = "^3.33.0"
38
+ google-cloud-compute = "^1.40.0"
39
+ google-cloud-functions = "^1.20.4"
40
+ google-cloud-logging = "^3.12.1"
41
+ google-cloud-monitoring = "^2.28.0"
42
+ google-cloud-notebooks = "^1.13.3"
43
+ google-cloud-scheduler = "^2.16.1"
44
+ google-cloud-storage = ">=2.19.0,<4.0.0"
45
+ gcloud-config-helper = "^0.3.1"
46
+ google-cloud-pubsub = "^2.31.1"
47
+ case-converter = "^1.2.0"
48
+ cookiecutter = "^2.6.0"
49
+ cron-validator = "^1.0.8"
50
+ dirhash = "^0.5.0"
51
+ email-validator = "^2.3.0"
52
+ emoji = "^2.15.0"
53
+ gitpython = "^3.1.45"
54
+ halo = "^0.0.31"
55
+ Jinja2 = "^3.1.6"
56
+ pathvalidate = "^3.3.1"
57
+ pydantic = "^2.12.3"
58
+ python-on-whales = "^0.78.0"
59
+ pyyaml-include = "^2.2"
60
+ PyYAML = "^6.0.3"
61
+ smart-open = {extras = ["gcs"], version = "^7.3.1"}
62
+ treelib = "^1.8.0"
63
+ typer = "^0.20.0"
64
+ waiting = "^1.5.0"
65
+ rich = "^14.2.0"
66
+ pendulum = "^3.1.0"
67
+ igittigitt = "^2.1.5"
68
+
69
+ [tool.poetry.group.samples.dependencies]
70
+ google-cloud-pipeline-components = "^2.21.0"
71
+ xgboost = "^3.1.1"
72
+ scikit-learn = "^1.7.2"
73
+
74
+ [tool.poetry.group.dev.dependencies]
75
+ mkdocs-click = "^0.8.1"
76
+ mkdocs-material = "^9.4.6"
77
+ mkdocs-typer = "^0.0.3"
78
+ mkdocstrings = "^0.23.0"
79
+ mkdocstrings-python = "^1.7.3"
80
+ mkautodoc = "^0.2.0"
81
+ markdown = "^3.5"
82
+ mock = "^5.1.0"
83
+ mypy = "^1.8.0"
84
+ pytest = "^8.0.1"
85
+ pytest-cov = "^5.0.0"
86
+ pytest-ruff = "^0.3.1"
87
+ pytest-mypy = "^0.10.3"
88
+ pytest-mock = "^3.12.0"
89
+ poethepoet = "^0.22.0"
90
+ types-mock = "^5.1.0.3"
91
+ types-pyyaml = "^6.0.12"
92
+ types-requests = "^2.31.0"
93
+ types-setuptools = "^68.2.0"
94
+ pre-commit = "^2.19.0"
95
+ pytest-env = "^1.1.5"
96
+
97
+ [tool.pytest.ini_options]
98
+ addopts = """
99
+ --verbose
100
+ --ruff
101
+ --ruff-format
102
+ --cov-report term
103
+ --cov-report xml:coverage.xml
104
+ --cov=src
105
+ --mypy
106
+ --durations=0
107
+ --ignore=templates
108
+ --ignore=samples
109
+ --ignore=dev_tests
110
+ """
111
+ #addopts = """
112
+ # --ignore=templates
113
+ # --ignore=samples
114
+ # --ignore=dev_tests
115
+ # -s
116
+ # """
117
+ filterwarnings = [
118
+ "error",
119
+ "ignore::UserWarning", # note the use of single quote below to denote "raw" strings in TOML
120
+ 'ignore::DeprecationWarning',
121
+ 'ignore::SyntaxWarning',
122
+ 'ignore::ResourceWarning',
123
+ ]
124
+ env = [
125
+ "LABEL = test"
126
+ ]
127
+
128
+ [tool.poe.tasks]
129
+ # Separate checks until https://github.com/astral-sh/ruff/issues/8232 is merged
130
+ _ruff_lint = "ruff check --fix ."
131
+ _ruff_format = "ruff format ."
132
+ format-code = ["_ruff_lint", "_ruff_format"]
133
+ docs-deploy = "mkdocs gh-deploy --force"
134
+ docs-serve = "mkdocs serve"
135
+
136
+ [tool.ruff]
137
+ line-length = 99
138
+ output-format = "full"
139
+ extend-exclude = [
140
+ "**pb2.py",
141
+ "**pb2.pyi",
142
+ "samples/**",
143
+ "templates/blank/**",
144
+ "templates/sklearn/**",
145
+ "dev_tests/**",
146
+ ]
147
+
148
+ [tool.ruff.lint]
149
+ select = ["E", "F", "I", "PERF", "ARG"]
150
+ ignore = [
151
+ "E1", # handled by formatter
152
+ "E4", # handled by formatter
153
+ "E5", # handled by formatter
154
+ "E722",
155
+ "PERF401"
156
+ ]
157
+
158
+ [tool.ruff.lint.per-file-ignores]
159
+ "tests/**.py" = [
160
+ "ARG001", # needed for mocks
161
+ "ARG002" # needed for mocks
162
+ ]
163
+
164
+ [tool.mypy]
165
+ exclude = [
166
+ "samples/pipelines/*",
167
+ "dev_tests/*",
168
+ ]
169
+ follow_imports = "silent"
170
+ mypy_path = ["src"]
171
+ namespace_packages = true
172
+ explicit_package_bases = true
173
+ strict = true
174
+ strict_optional = true
175
+ warn_redundant_casts = true
176
+ warn_unused_ignores = true
177
+ disallow_any_generics = true
178
+ implicit_reexport = true
179
+ ignore_missing_imports = true
180
+
181
+ [tool.poetry.scripts]
182
+ wanna = "wanna.cli.__main__:wanna"
183
+
184
+ [build-system]
185
+ build-backend = "poetry.core.masonry.api"
186
+ requires = ["poetry-core>=1.0.0"]
@@ -0,0 +1,7 @@
1
+ # mypy: allow-untyped-calls
2
+ from importlib import metadata as importlib_metadata
3
+
4
+ try:
5
+ __version__ = importlib_metadata.version(__name__)
6
+ except importlib_metadata.PackageNotFoundError:
7
+ __version__ = "snapshot"
@@ -0,0 +1,7 @@
1
+ # mypy: allow-untyped-calls
2
+ from importlib import metadata as importlib_metadata
3
+
4
+ try:
5
+ __version__ = importlib_metadata.version(__name__)
6
+ except importlib_metadata.PackageNotFoundError:
7
+ __version__ = "snapshot"
@@ -0,0 +1,83 @@
1
+ import logging
2
+ from pathlib import Path
3
+
4
+ import typer
5
+ from cookiecutter.main import cookiecutter
6
+
7
+ from wanna.core.loggers.wanna_logger import get_logger
8
+
9
+ from .plugins.runner import PluginRunner
10
+ from .version import perform_check
11
+
12
+ logger = get_logger(__name__)
13
+
14
+ logging.getLogger("smart_open").setLevel(logging.ERROR)
15
+ logging.getLogger("google").setLevel(logging.ERROR)
16
+ logging.getLogger("kfp").setLevel(logging.ERROR)
17
+
18
+ runner = PluginRunner()
19
+ app = runner.app
20
+
21
+
22
+ @app.command(name="version", help="Print your current and latest available version")
23
+ def version():
24
+ perform_check()
25
+
26
+
27
+ @app.command(name="init", help="Initiate a new wanna-ml project from template.")
28
+ def init(
29
+ output_dir: Path = typer.Option(
30
+ ...,
31
+ "--output-dir",
32
+ prompt="Where do you want to initiate your wanna-ml repository? (input '.' to use the current directory)",
33
+ help="The output directory where wanna-ml repository will be created",
34
+ ),
35
+ template: str = typer.Option(
36
+ ...,
37
+ "--template",
38
+ "-t",
39
+ help="The git repository of the template you want to use",
40
+ ),
41
+ checkout: str | None = typer.Option(
42
+ None,
43
+ "--checkout",
44
+ "-c",
45
+ help="The branch, tag or commit to checkout after cloning the repository",
46
+ ),
47
+ directory: str | None = typer.Option(
48
+ None,
49
+ "--directory",
50
+ "-d",
51
+ help="The directory within the repository to use as the template",
52
+ ),
53
+ overwrite_if_exists: bool = typer.Option(
54
+ False,
55
+ "--overwrite-if-exists",
56
+ help="Overwrite the contents of the output directory if it exists",
57
+ ),
58
+ no_input: bool = typer.Option(
59
+ False,
60
+ "--no-input",
61
+ help="Do not prompt for parameters and only use cookiecutter.json file content",
62
+ ),
63
+ ):
64
+ result_dir = cookiecutter(
65
+ template=template,
66
+ checkout=checkout,
67
+ directory=directory,
68
+ output_dir=output_dir,
69
+ overwrite_if_exists=overwrite_if_exists,
70
+ no_input=no_input,
71
+ )
72
+ logger.user_success(f"Repo initiated at {result_dir}")
73
+
74
+
75
+ def wanna():
76
+ """
77
+ Main entrypoint for wanna cli
78
+ """
79
+ app()
80
+
81
+
82
+ if __name__ == "__main__":
83
+ wanna()
File without changes
@@ -0,0 +1,23 @@
1
+ import abc
2
+ from typing import Any, Callable, Union
3
+
4
+ import typer
5
+
6
+ CommandRegistration = Union[Callable[..., None], tuple[Callable[..., None], dict[Any, Any]]]
7
+
8
+
9
+ class BasePlugin(abc.ABC):
10
+ """Some doc"""
11
+
12
+ def __init__(self) -> None:
13
+ self.app = typer.Typer()
14
+
15
+ def register_command(self, func: CommandRegistration) -> None:
16
+ if isinstance(func, tuple):
17
+ self.app.command(context_settings=func[1])(func[0])
18
+ else:
19
+ self.app.command()(func)
20
+
21
+ def register_many(self, funcs: list[CommandRegistration]) -> None:
22
+ for func in funcs:
23
+ self.register_command(func)
@@ -0,0 +1,45 @@
1
+ import typer
2
+
3
+ from wanna.core.deployment.models import PushMode
4
+
5
+ profile_name_option = typer.Option(
6
+ "default",
7
+ "--profile",
8
+ "-p",
9
+ envvar="WANNA_GCP_PROFILE_NAME",
10
+ help="Name of the GCP profile you want to use. "
11
+ "Profiles are loaded from wanna-ml yaml config and "
12
+ "(optionally) from this file too.",
13
+ )
14
+
15
+ wanna_file_option = typer.Option(
16
+ "wanna.yaml",
17
+ "--file",
18
+ "-f",
19
+ envvar="WANNA_FILE",
20
+ help="Path to the wanna-ml yaml configuration. Use -f - to pass the configuration through stdin.",
21
+ )
22
+
23
+ push_mode_option: PushMode = typer.Option(
24
+ PushMode.all,
25
+ "--mode",
26
+ "-m",
27
+ help="Push mode, this is useful if you want to "
28
+ "push containers in one step and deploy instances in other."
29
+ "Use all for dev",
30
+ )
31
+
32
+
33
+ def instance_name_option(instance_type: str, operation: str, help: str | None = None):
34
+ return typer.Option(
35
+ "all",
36
+ "--name",
37
+ "-n",
38
+ help=help
39
+ or f"Specify only one {instance_type} from your wanna-ml yaml configuration to {operation}. "
40
+ f"Choose 'all' to {operation} all {instance_type}s.",
41
+ )
42
+
43
+
44
+ def version_option(instance_type: str):
45
+ return typer.Option("dev", "--version", "-v", help=f"{instance_type} version")