diff --git a/src/matcha_ml/cli/constants.py b/src/matcha_ml/cli/constants.py index 800452c5..ebd92065 100644 --- a/src/matcha_ml/cli/constants.py +++ b/src/matcha_ml/cli/constants.py @@ -25,9 +25,8 @@ "Did you know that Matcha tea was created by accident?", "The brewing temperature of the water affects the taste of Matcha", "Samurai's drank Matcha before battles", - "Matcha is provisioning Kubernetes which orchestrates tools", - "Seldon Core is used for model deployment", - "MLflow is used as an experiment tracker", + "Matcha originated in China during the Tang Dynasty (618-907 AD) but became popular in Japan during the 12th century. ", + "Matcha is made from shade-grown tea leaves. The leaves are covered for several weeks before harvest to increase chlorophyll content and develop a rich green color.", "Matcha is maintained by Fuzzy Labs", "Everything being provisioned is fully open source", ] diff --git a/src/matcha_ml/core/core.py b/src/matcha_ml/core/core.py index ed94f84e..ea984a83 100644 --- a/src/matcha_ml/core/core.py +++ b/src/matcha_ml/core/core.py @@ -18,7 +18,6 @@ MatchaConfigComponentProperty, MatchaConfigService, ) - from matcha_ml.constants import DEFAULT_STACK, LLM_STACK, STACK_MODULES from matcha_ml.core._validation import is_valid_prefix, is_valid_region from matcha_ml.errors import MatchaError, MatchaInputError @@ -28,8 +27,6 @@ from matcha_ml.state import MatchaStateService, RemoteStateManager from matcha_ml.state.matcha_state import MatchaState from matcha_ml.templates.azure_template import ( - DEFAULT_STACK_TF, - LLM_STACK_TF, AzureTemplate, ) @@ -308,10 +305,6 @@ def provision( project_directory, ".matcha", "infrastructure", "resources" ) - stack = MatchaConfigService.get_stack() - if stack is not None: - stack_name = stack.value - template = os.path.join( os.path.dirname(__file__), os.pardir, @@ -319,9 +312,7 @@ def provision( "modules", ) - azure_template = AzureTemplate( - LLM_STACK_TF if stack_name == StackType.LLM.value else DEFAULT_STACK_TF - ) + azure_template = AzureTemplate() zenml_version = infer_zenml_version() config = azure_template.build_template_configuration( diff --git a/src/matcha_ml/infrastructure/default/.gitignore b/src/matcha_ml/infrastructure/default/.gitignore deleted file mode 100644 index 6304eb3c..00000000 --- a/src/matcha_ml/infrastructure/default/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -# Local .terraform directories -**/.terraform/* - -# .tfstate files -*.tfstate -*.tfstate.* - -# Crash log files -crash.log -crash.*.log - -# Exclude all .tfvars files, which are likely to contain sensitive data, such as -# password, private keys, and other secrets. These should not be part of version -# control as they are data points which are potentially sensitive and subject -# to change depending on the environment. -*.tfvars -*.tfvars.json - -# Ignore override files as they are usually used to override resources locally and so -# are not checked in -override.tf -override.tf.json -*_override.tf -*_override.tf.json - -# Include override files you do wish to add to version control using negated pattern -# !example_override.tf - -# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan -# example: *tfplan* - -# Ignore CLI configuration files -.terraformrc -terraform.rc diff --git a/src/matcha_ml/infrastructure/default/.terraform.lock.hcl b/src/matcha_ml/infrastructure/default/.terraform.lock.hcl deleted file mode 100644 index ecf35119..00000000 --- a/src/matcha_ml/infrastructure/default/.terraform.lock.hcl +++ /dev/null @@ -1,183 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/gavinbunney/kubectl" { - version = "1.14.0" - constraints = "1.14.0" - hashes = [ - "h1:gLFn+RvP37sVzp9qnFCwngRjjFV649r6apjxvJ1E/SE=", - "h1:mX2AOFIMIxJmW5kM8DT51gloIOKCr9iT6W8yodnUyfs=", - "zh:0350f3122ff711984bbc36f6093c1fe19043173fad5a904bce27f86afe3cc858", - "zh:07ca36c7aa7533e8325b38232c77c04d6ef1081cb0bac9d56e8ccd51f12f2030", - "zh:0c351afd91d9e994a71fe64bbd1662d0024006b3493bb61d46c23ea3e42a7cf5", - "zh:39f1a0aa1d589a7e815b62b5aa11041040903b061672c4cfc7de38622866cbc4", - "zh:428d3a321043b78e23c91a8d641f2d08d6b97f74c195c654f04d2c455e017de5", - "zh:4baf5b1de2dfe9968cc0f57fd4be5a741deb5b34ee0989519267697af5f3eee5", - "zh:6131a927f9dffa014ab5ca5364ac965fe9b19830d2bbf916a5b2865b956fdfcf", - "zh:c62e0c9fd052cbf68c5c2612af4f6408c61c7e37b615dc347918d2442dd05e93", - "zh:f0beffd7ce78f49ead612e4b1aefb7cb6a461d040428f514f4f9cc4e5698ac65", - ] -} - -provider "registry.terraform.io/hashicorp/azurerm" { - version = "3.48.0" - constraints = ">= 3.16.0, 3.48.0" - hashes = [ - "h1:5sGcXKelc4o4MnPZfKKs9pd8w969TtlCV+0IZvW58Cs=", - "h1:RSUCtxgd6hD9J11YZGOA4yffeu5P8YmQnP5SRNl6+d8=", - "zh:01bd328009f2803ebc18ac27535e7d1548c735bb5bd02460e471acc835e5dd19", - "zh:070b0bdd5ff27232eec7ef9128fc9bd17e6bdae503ddcc450c944449f3a8d216", - "zh:0a0a0e81f7ab8757aa83876fffbc57328843664900923d8b3c577e7596884726", - "zh:30994e6988c92d90a71b88bff0bbc4fa8f3b48034d18eb068bd5281888304579", - "zh:54dfdbae2bf79f8104ae73e5c6cd94a69d1e6de4345322f6c8eb6affb04a66c5", - "zh:55ba99b32346237435d7212b3f2521952ee67934dd5ee942a51642357b0ad4fc", - "zh:881bc29857511f7eedc3d359a0f2dcca6b526a48f6d54887cafdb25647abd1fd", - "zh:892bfa34b95b6b4b2ced24dc2989edf512b193bd9e5cf121ae47bb9d9e6d0b94", - "zh:c7d2c778b0f251990874ee859b9093fbb4beb9b3968858137da6c5167c797ea9", - "zh:db558aa70b163af44a73fcb1306d0e4dcafcafe585bedb90ef69f063fa9766a3", - "zh:e0ae252b7bea560e05fde09fe632f012430fb91ff9063fce560d997ecdb1cf75", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - ] -} - -provider "registry.terraform.io/hashicorp/external" { - version = "2.3.1" - hashes = [ - "h1:9rJggijNdRdFk//ViQPGZdK0xu9XU/9qBDijNsZJMg0=", - "h1:bROCw6g5D/3fFnWeJ01L4IrdnJl1ILU8DGDgXCtYzaY=", - "zh:001e2886dc81fc98cf17cf34c0d53cb2dae1e869464792576e11b0f34ee92f54", - "zh:2eeac58dd75b1abdf91945ac4284c9ccb2bfb17fa9bdb5f5d408148ff553b3ee", - "zh:2fc39079ba61411a737df2908942e6970cb67ed2f4fb19090cd44ce2082903dd", - "zh:472a71c624952cff7aa98a7b967f6c7bb53153dbd2b8f356ceb286e6743bb4e2", - "zh:4cff06d31272aac8bc35e9b7faec42cf4554cbcbae1092eaab6ab7f643c215d9", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:7ed16ccd2049fa089616b98c0bd57219f407958f318f3c697843e2397ddf70df", - "zh:842696362c92bf2645eb85c739410fd51376be6c488733efae44f4ce688da50e", - "zh:8985129f2eccfd7f1841ce06f3bf2bbede6352ec9e9f926fbaa6b1a05313b326", - "zh:a5f0602d8ec991a5411ef42f872aa90f6347e93886ce67905c53cfea37278e05", - "zh:bf4ab82cbe5256dcef16949973bf6aa1a98c2c73a98d6a44ee7bc40809d002b8", - "zh:e70770be62aa70198fa899526d671643ff99eecf265bf1a50e798fc3480bd417", - ] -} - -provider "registry.terraform.io/hashicorp/helm" { - version = "2.0.3" - constraints = "~> 2.0.1" - hashes = [ - "h1:FRSVqY+1/AUO/j/lVxHHsLudfSA9gDc7Dsu+YxcJSEY=", - "h1:eUr4dHyxlcLmLja0wBgJC7t5bfHzbtACyuumKPuDrGs=", - "zh:154e0aa489e474e2eeb3de94be7666133faf6fd950712a640425b2bf3a81ee95", - "zh:16a2be6c4b61d0c5205c63816148c7ab0c8f56a75c05e8d897fa4d5cac0c029a", - "zh:189e47bc723f8c29bcfe2c1638d43b8148f614ea86e642f4b50b2acb4b760224", - "zh:3763901d3630213002cb8c70bb24c628cd29738ff6591585250ea8636264abd6", - "zh:4822f85e4700ea049384523d98de0ef7d83549844b13e94bbd544cec05557a9a", - "zh:62c5b87b09e0051bab0b712e3ad465fd53e66f9619dbe76ee23519d1087d8a05", - "zh:a0a6a842b11190dd1841e98bbb74961074e7ffb95984be5cc392df9f532d803e", - "zh:beac4e6806e77447e1018f3404a5fbf782d20d82a0d9b4a31e9bfc7d2bbecab6", - "zh:e1bbaa09bf4f4a91ec7606f84d2e0200a02e7b24d045e8b5daebd87d7a75b7ce", - "zh:ed1e05c50212d4f57435ccdd68cfb98d8395927c316df76d1dd6509566d3aeaa", - "zh:fdc687e16a964bb652ddb670f6832fdead25235eca551796cfed70ec07d94931", - ] -} - -provider "registry.terraform.io/hashicorp/kubernetes" { - version = "2.11.0" - constraints = "~> 2.11.0" - hashes = [ - "h1:T65SZhN/tQgsAsHe/G5PCgpjofi+aTKPZ+nZg6WOJpc=", - "h1:pJiAJwZKUaoAJ4x+3ONJkwEVkjrwGROCGFgj7noPO58=", - "zh:143a19dd0ea3b07fc5e3d9231f3c2d01f92894385c98a67327de74c76c715843", - "zh:1fc757d209e09c3cf7848e4274daa32408c07743698fbed10ee52a4a479b62b6", - "zh:22dfebd0685749c51a8f765d51a1090a259778960ac1cd4f32021a325b2b9b72", - "zh:3039b3b76e870cd8fc404cf75a29c66b171c6ba9b6182e131b6ae2ca648ec7c0", - "zh:3af0a15562fcab4b5684b18802e0239371b2b8ff9197ed069ff4827f795a002b", - "zh:50aaf20336d1296a73315adb66f7687f75bd5c6b1f93a894b95c75cc142810ec", - "zh:682064fabff895ec351860b4fe0321290bbbb17c2a410b62c9bea0039400650e", - "zh:70ac914d5830b3371a2679d8f77cc20c419a6e12925145afae6c977c8eb90934", - "zh:710aa02cccf7b0f3fb50880d6d2a7a8b8c9435248666616844ba71f74648cddc", - "zh:88e418118cd5afbdec4984944c7ab36950bf48e8d3e09e090232e55eecfb470b", - "zh:9cef159377bf23fa331f8724fdc6ce27ad39a217a4bae6df3b1ca408fc643da6", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - ] -} - -provider "registry.terraform.io/hashicorp/local" { - version = "2.1.0" - constraints = "2.1.0" - hashes = [ - "h1:EYZdckuGU3n6APs97nS2LxZm3dDtGqyM4qaIvsmac8o=", - "h1:KfieWtVyGWwplSoLIB5usKAUnrIkDQBkWaR5TI+4WYg=", - "zh:0f1ec65101fa35050978d483d6e8916664b7556800348456ff3d09454ac1eae2", - "zh:36e42ac19f5d68467aacf07e6adcf83c7486f2e5b5f4339e9671f68525fc87ab", - "zh:6db9db2a1819e77b1642ec3b5e95042b202aee8151a0256d289f2e141bf3ceb3", - "zh:719dfd97bb9ddce99f7d741260b8ece2682b363735c764cac83303f02386075a", - "zh:7598bb86e0378fd97eaa04638c1a4c75f960f62f69d3662e6d80ffa5a89847fe", - "zh:ad0a188b52517fec9eca393f1e2c9daea362b33ae2eb38a857b6b09949a727c1", - "zh:c46846c8df66a13fee6eff7dc5d528a7f868ae0dcf92d79deaac73cc297ed20c", - "zh:dc1a20a2eec12095d04bf6da5321f535351a594a636912361db20eb2a707ccc4", - "zh:e57ab4771a9d999401f6badd8b018558357d3cbdf3d33cc0c4f83e818ca8e94b", - "zh:ebdcde208072b4b0f8d305ebf2bfdc62c926e0717599dcf8ec2fd8c5845031c3", - "zh:ef34c52b68933bedd0868a13ccfd59ff1c820f299760b3c02e008dc95e2ece91", - ] -} - -provider "registry.terraform.io/hashicorp/null" { - version = "3.2.1" - constraints = "3.2.1" - hashes = [ - "h1:FbGfc+muBsC17Ohy5g806iuI1hQc4SIexpYCrQHQd8w=", - "h1:tSj1mL6OQ8ILGqR2mDu7OYYYWf+hoir0pf9KAQ8IzO8=", - "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", - "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", - "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", - "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", - "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", - "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", - "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", - "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", - "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", - "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.1.0" - constraints = "3.1.0" - hashes = [ - "h1:BZMEPucF+pbu9gsPk0G0BHx7YP04+tKdq2MrRDF1EDM=", - "h1:rKYu5ZUbXwrLG1w81k7H3nce/Ys6yAxXhWcbtk36HjY=", - "zh:2bbb3339f0643b5daa07480ef4397bd23a79963cc364cdfbb4e86354cb7725bc", - "zh:3cd456047805bf639fbf2c761b1848880ea703a054f76db51852008b11008626", - "zh:4f251b0eda5bb5e3dc26ea4400dba200018213654b69b4a5f96abee815b4f5ff", - "zh:7011332745ea061e517fe1319bd6c75054a314155cb2c1199a5b01fe1889a7e2", - "zh:738ed82858317ccc246691c8b85995bc125ac3b4143043219bd0437adc56c992", - "zh:7dbe52fac7bb21227acd7529b487511c91f4107db9cc4414f50d04ffc3cab427", - "zh:a3a9251fb15f93e4cfc1789800fc2d7414bbc18944ad4c5c98f466e6477c42bc", - "zh:a543ec1a3a8c20635cf374110bd2f87c07374cf2c50617eee2c669b3ceeeaa9f", - "zh:d9ab41d556a48bd7059f0810cf020500635bfc696c9fc3adab5ea8915c1d886b", - "zh:d9e13427a7d011dbd654e591b0337e6074eef8c3b9bb11b2e39eaaf257044fd7", - "zh:f7605bd1437752114baf601bdf6931debe6dc6bfe3006eb7e9bb9080931dca8a", - ] -} - -provider "registry.terraform.io/loafoe/htpasswd" { - version = "1.0.4" - constraints = "1.0.4" - hashes = [ - "h1:/OCwJ2uB9PfESHNn4bDwdHnMOp8x5D/aNvvUl8XNFA4=", - "h1:v/EZlkxlFBRlLIK2rmgbksuhbxOwenP3TQvreUhCAtE=", - "zh:1f17ffcb8ab2f19de1242a6980f78334fc81efeaddfa85545435048f54045e4a", - "zh:6265fd9bbb718d55655120044b4969c80aa938ecfb17a0fd7541ff7de8c54e1e", - "zh:79b7a6e3260b084530f6bdaba13536843fa55fc28569965a69cbdcb5d5c208a5", - "zh:827991bd4481b9c0f33a922f5168146d0e68f627c8c71f1c18da27df05386502", - "zh:898a54254123718828d07ca54fba9626f6c706e4849c1d5bfd93d16df4463a6f", - "zh:b42f93565c8e5ab902d12a44dc34efa7207f5a568c7588f957732be3d9cd3997", - "zh:d43a78148ae10aac214c7abef7c131d78b7173d28ab679354ac67c11ff979f8e", - "zh:ddb702db1b27df028dab0364fbd90a1f5d97244e41765a7e66a8afc1a85d8371", - "zh:df22dd80e4639c14ec428d345cdf21851e807890cfe72908759d037cfaed68b7", - "zh:f6c7dfbc72ad83727c1fcfc064adb0362d947b66a2f5ba185742d5668c598c96", - "zh:f7e1feafd63a1987f5e39f9c75ac05dc153ffde2c9dd669847c19ad318bbebe7", - ] -} diff --git a/src/matcha_ml/infrastructure/default/README.md b/src/matcha_ml/infrastructure/default/README.md deleted file mode 100644 index c60ac705..00000000 --- a/src/matcha_ml/infrastructure/default/README.md +++ /dev/null @@ -1,67 +0,0 @@ -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | >= 0.14.8 | -| [azurerm](#requirement\_azurerm) | >=3.16.0 | -| [helm](#requirement\_helm) | ~> 2.0.1 | -| [htpasswd](#requirement\_htpasswd) | 1.0.4 | -| [kubectl](#requirement\_kubectl) | 1.14.0 | -| [kubernetes](#requirement\_kubernetes) | ~> 2.11.0 | -| [local](#requirement\_local) | 2.1.0 | -| [null](#requirement\_null) | 3.2.1 | -| [random](#requirement\_random) | 3.1.0 | - -## Providers - -| Name | Version | -|------|---------| -| [external](#provider\_external) | 2.3.1 | -| [null](#provider\_null) | 3.2.1 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [acr](#module\_acr) | ./azure_container_registry | n/a | -| [aks](#module\_aks) | ./aks | n/a | -| [mlflow](#module\_mlflow) | ./mlflow_module | n/a | -| [resource\_group](#module\_resource\_group) | ./resource_group | n/a | -| [seldon](#module\_seldon) | ./seldon | n/a | -| [storage](#module\_storage) | ./storage | n/a | -| [zenml\_storage](#module\_zenml\_storage) | ./zenml_storage | n/a | -| [zenserver](#module\_zenserver) | ./zen_server | n/a | - -## Resources - -| Name | Type | -|------|------| -| [null_resource.configure_local_kubectl](https://registry.terraform.io/providers/hashicorp/null/3.2.1/docs/resources/resource) | resource | -| [external_external.os](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/external) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [location](#input\_location) | The Azure Region in which all resources should be provisioned | `string` | n/a | yes | -| [password](#input\_password) | Password for ZenServer | `string` | n/a | yes | -| [prefix](#input\_prefix) | A prefix used for all resources | `string` | `"matcha"` | no | -| [seldon\_name](#input\_seldon\_name) | Name of the Seldon deployment | `string` | `"seldon"` | no | -| [seldon\_namespace](#input\_seldon\_namespace) | Namespace for Seldon resources | `string` | `"seldon-system"` | no | -| [username](#input\_username) | Username for ZenServer | `string` | `"default"` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| [azure\_container\_registry](#output\_azure\_container\_registry) | The URL for the Azure Container Registry | -| [azure\_registry\_name](#output\_azure\_registry\_name) | The name of the Azure Container Registry | -| [k8s\_context](#output\_k8s\_context) | The name of the Kubernetes context used for deployment | -| [mlflow\_tracking\_url](#output\_mlflow\_tracking\_url) | The URL for the MLflow tracking server | -| [seldon\_base\_url](#output\_seldon\_base\_url) | The base URL for the Seldon API server | -| [seldon\_workloads\_namespace](#output\_seldon\_workloads\_namespace) | The Kubernetes namespace for Seldon workloads | -| [zen\_server\_password](#output\_zen\_server\_password) | The password for accessing the ZenServer API server | -| [zen\_server\_url](#output\_zen\_server\_url) | The URL for the ZenServer API server | -| [zen\_server\_username](#output\_zen\_server\_username) | The username for accessing the ZenServer API server | -| [zenml\_connection\_string](#output\_zenml\_connection\_string) | The primary connection string for the ZenML Azure Storage Account | -| [zenml\_storage\_path](#output\_zenml\_storage\_path) | The Azure Blob Storage Container path for storing ZenML artifacts | diff --git a/src/matcha_ml/infrastructure/default/aks/README.md b/src/matcha_ml/infrastructure/default/aks/README.md deleted file mode 100644 index 8b7b77bb..00000000 --- a/src/matcha_ml/infrastructure/default/aks/README.md +++ /dev/null @@ -1,41 +0,0 @@ -## Requirements - -No requirements. - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | n/a | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_kubernetes_cluster.main](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster) | resource | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [location](#input\_location) | The Azure region where the Kubernetes cluster will be created | `string` | n/a | yes | -| [prefix](#input\_prefix) | Prefix to be used for all resources in this module | `string` | n/a | yes | -| [resource\_group\_name](#input\_resource\_group\_name) | The name of the resource group to create the Kubernetes cluster in | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [aks\_cluster\_id](#output\_aks\_cluster\_id) | ID of the created Kubernetes cluster | -| [aks\_cluster\_name](#output\_aks\_cluster\_name) | Name of the created Kubernetes cluster | -| [aks\_object\_id](#output\_aks\_object\_id) | Object ID for the Kubernetes cluster | -| [aks\_principal\_id](#output\_aks\_principal\_id) | Principal ID for the Kubernetes cluster | -| [client\_certificate](#output\_client\_certificate) | Client certificate for accessing the Kubernetes cluster | -| [client\_key](#output\_client\_key) | Client key for accessing the Kubernetes cluster | -| [cluster\_ca\_certificate](#output\_cluster\_ca\_certificate) | Cluster CA certificate for the Kubernetes cluster | -| [host](#output\_host) | Host address for the Kubernetes cluster | -| [kube\_config](#output\_kube\_config) | Raw Kubernetes configuration for the created cluster | diff --git a/src/matcha_ml/infrastructure/default/aks/main.tf b/src/matcha_ml/infrastructure/default/aks/main.tf deleted file mode 100644 index 262c24c6..00000000 --- a/src/matcha_ml/infrastructure/default/aks/main.tf +++ /dev/null @@ -1,19 +0,0 @@ -resource "azurerm_kubernetes_cluster" "main" { - name = "${var.prefix}-k8s" - location = var.location - resource_group_name = var.resource_group_name - dns_prefix = "${var.prefix}-k8s" - - default_node_pool { - name = "default" - vm_size = "Standard_DS3_v2" - - enable_auto_scaling = true - max_count = 3 - min_count = 1 - } - - identity { - type = "SystemAssigned" - } -} diff --git a/src/matcha_ml/infrastructure/default/aks/output.tf b/src/matcha_ml/infrastructure/default/aks/output.tf deleted file mode 100644 index de131e60..00000000 --- a/src/matcha_ml/infrastructure/default/aks/output.tf +++ /dev/null @@ -1,46 +0,0 @@ -output "kube_config" { - description = "Raw Kubernetes configuration for the created cluster" - value = azurerm_kubernetes_cluster.main.kube_config_raw - sensitive = true -} - -output "client_key" { - description = "Client key for accessing the Kubernetes cluster" - value = azurerm_kubernetes_cluster.main.kube_config.0.client_key -} - -output "client_certificate" { - description = "Client certificate for accessing the Kubernetes cluster" - value = azurerm_kubernetes_cluster.main.kube_config.0.client_certificate - sensitive = true -} - -output "cluster_ca_certificate" { - description = "Cluster CA certificate for the Kubernetes cluster" - value = azurerm_kubernetes_cluster.main.kube_config.0.cluster_ca_certificate -} - -output "host" { - description = "Host address for the Kubernetes cluster" - value = azurerm_kubernetes_cluster.main.kube_config.0.host -} - -output "aks_cluster_id" { - description = "ID of the created Kubernetes cluster" - value = azurerm_kubernetes_cluster.main.id -} - -output "aks_cluster_name" { - description = "Name of the created Kubernetes cluster" - value = azurerm_kubernetes_cluster.main.name -} - -output "aks_principal_id" { - description = "Principal ID for the Kubernetes cluster" - value = azurerm_kubernetes_cluster.main.identity[0].principal_id -} - -output "aks_object_id" { - description = "Object ID for the Kubernetes cluster" - value = azurerm_kubernetes_cluster.main.kubelet_identity[0].object_id -} diff --git a/src/matcha_ml/infrastructure/default/aks/variables.tf b/src/matcha_ml/infrastructure/default/aks/variables.tf deleted file mode 100644 index f48f6d27..00000000 --- a/src/matcha_ml/infrastructure/default/aks/variables.tf +++ /dev/null @@ -1,14 +0,0 @@ -variable "prefix" { - description = "Prefix to be used for all resources in this module" - type = string -} - -variable "location" { - description = "The Azure region where the Kubernetes cluster will be created" - type = string -} - -variable "resource_group_name" { - description = "The name of the resource group to create the Kubernetes cluster in" - type = string -} diff --git a/src/matcha_ml/infrastructure/default/azure_container_registry/README.md b/src/matcha_ml/infrastructure/default/azure_container_registry/README.md deleted file mode 100644 index 70af6ba7..00000000 --- a/src/matcha_ml/infrastructure/default/azure_container_registry/README.md +++ /dev/null @@ -1,36 +0,0 @@ -## Requirements - -No requirements. - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | n/a | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_container_registry.main](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/container_registry) | resource | -| [azurerm_role_assignment.aks_acr_access](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment) | resource | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [aks\_object\_id](#input\_aks\_object\_id) | Object id for aks cluster | `string` | n/a | yes | -| [location](#input\_location) | The Azure region in which this resources should be created. | `string` | n/a | yes | -| [prefix](#input\_prefix) | A prefix used for all resources | `string` | n/a | yes | -| [resource\_group\_name](#input\_resource\_group\_name) | The resource group name which is used to create the resource group | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [container\_registry\_name](#output\_container\_registry\_name) | The name of the container registry | -| [container\_registry\_url](#output\_container\_registry\_url) | The URL used to log into the container registry | diff --git a/src/matcha_ml/infrastructure/default/azure_container_registry/main.tf b/src/matcha_ml/infrastructure/default/azure_container_registry/main.tf deleted file mode 100644 index 9c7ec142..00000000 --- a/src/matcha_ml/infrastructure/default/azure_container_registry/main.tf +++ /dev/null @@ -1,13 +0,0 @@ -resource "azurerm_container_registry" "main" { - name = "cr${var.prefix}" - resource_group_name = var.resource_group_name - location = var.location - sku = "Standard" -} - -resource "azurerm_role_assignment" "aks_acr_access" { - scope = azurerm_container_registry.main.id - role_definition_name = "AcrPull" - principal_id = var.aks_object_id - skip_service_principal_aad_check = true -} diff --git a/src/matcha_ml/infrastructure/default/azure_container_registry/output.tf b/src/matcha_ml/infrastructure/default/azure_container_registry/output.tf deleted file mode 100644 index a2069133..00000000 --- a/src/matcha_ml/infrastructure/default/azure_container_registry/output.tf +++ /dev/null @@ -1,10 +0,0 @@ -# output for container registry -output "container_registry_url" { - description = "The URL used to log into the container registry" - value = azurerm_container_registry.main.login_server -} - -output "container_registry_name" { - description = "The name of the container registry" - value = azurerm_container_registry.main.name -} diff --git a/src/matcha_ml/infrastructure/default/azure_container_registry/variables.tf b/src/matcha_ml/infrastructure/default/azure_container_registry/variables.tf deleted file mode 100644 index 513a9768..00000000 --- a/src/matcha_ml/infrastructure/default/azure_container_registry/variables.tf +++ /dev/null @@ -1,19 +0,0 @@ -variable "prefix" { - description = "A prefix used for all resources" - type = string -} - -variable "resource_group_name" { - description = "The resource group name which is used to create the resource group" - type = string -} - -variable "location" { - description = "The Azure region in which this resources should be created." - type = string -} - -variable "aks_object_id" { - description = "Object id for aks cluster" - type = string -} diff --git a/src/matcha_ml/infrastructure/default/configure_kubectl.tf b/src/matcha_ml/infrastructure/default/configure_kubectl.tf deleted file mode 100644 index 6e69e9de..00000000 --- a/src/matcha_ml/infrastructure/default/configure_kubectl.tf +++ /dev/null @@ -1,12 +0,0 @@ -# Derived from ZenML's stack recipes; source: https://github.com/zenml-io/mlops-stacks/blob/8eb06596bf836d3a3dd2634fbc7f2b5687421811/aws-minimal/configure_kubectl.tf - -# set up local kubectl client to access the newly created cluster -resource "null_resource" "configure_local_kubectl" { - provisioner "local-exec" { - command = "az aks get-credentials --resource-group ${module.resource_group.name} --name ${module.aks.aks_cluster_name} --context ${local.kubectl_context} --overwrite-existing" - } -} - -locals { - kubectl_context = "terraform-${module.aks.aks_cluster_name}-${replace(substr(timestamp(), 0, 16), ":", "_")}" -} diff --git a/src/matcha_ml/infrastructure/default/data_version_control_storage/README.md b/src/matcha_ml/infrastructure/default/data_version_control_storage/README.md deleted file mode 100644 index cae1bfe3..00000000 --- a/src/matcha_ml/infrastructure/default/data_version_control_storage/README.md +++ /dev/null @@ -1,44 +0,0 @@ -## Requirements - -| Name | Version | -|------|---------| -| [azurerm](#requirement\_azurerm) | 3.48.0 | - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | 3.48.0 | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_storage_account.storageaccount](https://registry.terraform.io/providers/hashicorp/azurerm/3.48.0/docs/resources/storage_account) | resource | -| [azurerm_storage_container.storagecontainer](https://registry.terraform.io/providers/hashicorp/azurerm/3.48.0/docs/resources/storage_container) | resource | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [location](#input\_location) | The Azure Region in which this resources should be created. | `string` | n/a | yes | -| [prefix](#input\_prefix) | The prefix which should be used for naming storage account ({prefix}storageacc) and container ({prefix}storagecontainer) | `string` | n/a | yes | -| [resource\_group\_name](#input\_resource\_group\_name) | The resource group name which is used to create the resource group | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [blobstorage\_container\_path](#output\_blobstorage\_container\_path) | The Azure Blob Storage Container path for storing your artifacts | -| [primary\_access\_key](#output\_primary\_access\_key) | Azure Storage Account - Primary access key | -| [primary\_blob\_connection\_string](#output\_primary\_blob\_connection\_string) | Azure Storage Account - Primary Blob service connection string | -| [primary\_connection\_string](#output\_primary\_connection\_string) | Azure Storage Account - Primary connection string | -| [secondary\_access\_key](#output\_secondary\_access\_key) | Azure Storage Account - Secondary access key | -| [secondary\_blob\_connection\_string](#output\_secondary\_blob\_connection\_string) | Azure Storage Account - Secondary Blob service connection string | -| [secondary\_connection\_string](#output\_secondary\_connection\_string) | Azure Storage Account - Secondary connection string | -| [storage\_account\_name](#output\_storage\_account\_name) | The name of the Azure Storage Account. | -| [storage\_container\_name](#output\_storage\_container\_name) | The name of the Azure Storage Container. | diff --git a/src/matcha_ml/infrastructure/default/data_version_control_storage/main.tf b/src/matcha_ml/infrastructure/default/data_version_control_storage/main.tf deleted file mode 100644 index 72b26b18..00000000 --- a/src/matcha_ml/infrastructure/default/data_version_control_storage/main.tf +++ /dev/null @@ -1,22 +0,0 @@ -# Reference: https://github.com/hashicorp/terraform-provider-azurerm/tree/main/examples/storage/storage-container - -# create a storage account -resource "azurerm_storage_account" "storageaccount" { - name = "${var.prefix}dvcacc" - resource_group_name = var.resource_group_name - location = var.location - - account_tier = "Standard" - account_kind = "StorageV2" - account_replication_type = "LRS" - enable_https_traffic_only = true - access_tier = "Hot" - allow_nested_items_to_be_public = true -} - -# create a storage container inside created storage account -resource "azurerm_storage_container" "storagecontainer" { - name = "${var.prefix}dvcstore" - storage_account_name = azurerm_storage_account.storageaccount.name - container_access_type = "container" -} diff --git a/src/matcha_ml/infrastructure/default/data_version_control_storage/output.tf b/src/matcha_ml/infrastructure/default/data_version_control_storage/output.tf deleted file mode 100644 index 45a5f5ce..00000000 --- a/src/matcha_ml/infrastructure/default/data_version_control_storage/output.tf +++ /dev/null @@ -1,15 +0,0 @@ -output "storage_container_name" { - description = "The name of the Azure Storage Container." - value = azurerm_storage_container.storagecontainer.name -} - -output "storage_account_name" { - description = "The name of the Azure Storage Account." - value = azurerm_storage_account.storageaccount.name -} - -output "primary_connection_string" { - description = "Azure Storage Account - Primary connection string" - value = azurerm_storage_account.storageaccount.primary_connection_string - sensitive = true -} diff --git a/src/matcha_ml/infrastructure/default/data_version_control_storage/providers.tf b/src/matcha_ml/infrastructure/default/data_version_control_storage/providers.tf deleted file mode 100644 index e2d7507d..00000000 --- a/src/matcha_ml/infrastructure/default/data_version_control_storage/providers.tf +++ /dev/null @@ -1,8 +0,0 @@ -terraform { - required_providers { - azurerm = { - source = "hashicorp/azurerm" - version = "3.48.0" - } - } -} diff --git a/src/matcha_ml/infrastructure/default/data_version_control_storage/variables.tf b/src/matcha_ml/infrastructure/default/data_version_control_storage/variables.tf deleted file mode 100644 index 8a3fab49..00000000 --- a/src/matcha_ml/infrastructure/default/data_version_control_storage/variables.tf +++ /dev/null @@ -1,14 +0,0 @@ -variable "resource_group_name" { - description = "The resource group name which is used to create the resource group" - type = string -} - -variable "prefix" { - description = "The prefix which should be used for naming storage account ({prefix}dvcacc) and container ({prefix}dvcstore)" - type = string -} - -variable "location" { - description = "The Azure Region in which this resources should be created." - type = string -} diff --git a/src/matcha_ml/infrastructure/default/helm.tf b/src/matcha_ml/infrastructure/default/helm.tf deleted file mode 100644 index dac70cd9..00000000 --- a/src/matcha_ml/infrastructure/default/helm.tf +++ /dev/null @@ -1,10 +0,0 @@ -provider "helm" { - kubernetes { - host = module.aks.host - - client_certificate = base64decode(module.aks.client_certificate) - client_key = base64decode(module.aks.client_key) - cluster_ca_certificate = base64decode(module.aks.cluster_ca_certificate) - config_path = local.kubectl_config_path - } -} diff --git a/src/matcha_ml/infrastructure/default/kubernetes.tf b/src/matcha_ml/infrastructure/default/kubernetes.tf deleted file mode 100644 index 304dcc5e..00000000 --- a/src/matcha_ml/infrastructure/default/kubernetes.tf +++ /dev/null @@ -1,30 +0,0 @@ -# Derived from ZenML's stack recipes; source: https://github.com/zenml-io/mlops-stacks/blob/8eb06596bf836d3a3dd2634fbc7f2b5687421811/aws-minimal/kubernetes.tf - -# check if the host OS is Linux or Windows -data "external" "os" { - working_dir = path.module - program = ["printf", "{\"os\": \"Linux\"}"] -} - -locals { - os = data.external.os.result.os - kubectl_config_path = local.os == "Windows" ? "%USERPROFILE%\\.kube\\config" : "~/.kube/config" -} - -# a default (non-aliased) provider configuration for "kubernetes" -provider "kubernetes" { - host = module.aks.host - - client_certificate = base64decode(module.aks.client_certificate) - client_key = base64decode(module.aks.client_key) - cluster_ca_certificate = base64decode(module.aks.cluster_ca_certificate) - config_path = local.kubectl_config_path -} - -provider "kubectl" { - host = module.aks.host - - client_certificate = base64decode(module.aks.client_certificate) - client_key = base64decode(module.aks.client_key) - cluster_ca_certificate = base64decode(module.aks.cluster_ca_certificate) -} diff --git a/src/matcha_ml/infrastructure/default/main.tf b/src/matcha_ml/infrastructure/default/main.tf deleted file mode 100644 index 55d761e7..00000000 --- a/src/matcha_ml/infrastructure/default/main.tf +++ /dev/null @@ -1,96 +0,0 @@ -provider "azurerm" { - features { - resource_group { - prevent_deletion_if_contains_resources = false - } - } -} - -module "resource_group" { - source = "./resource_group" - - prefix = var.prefix -} - -module "storage" { - source = "./storage" - - resource_group_name = module.resource_group.name - prefix = var.prefix - location = var.location -} - -module "zenml_storage" { - source = "./zenml_storage" - - prefix = var.prefix - resource_group_name = module.resource_group.name - location = var.location - aks_principal_id = module.aks.aks_principal_id -} - -module "data_version_control_storage" { - source = "./data_version_control_storage" - - resource_group_name = module.resource_group.name - prefix = var.prefix - location = var.location -} - -module "aks" { - source = "./aks" - - prefix = var.prefix - location = var.location - resource_group_name = module.resource_group.name -} - -module "acr" { - source = "./azure_container_registry" - - prefix = var.prefix - resource_group_name = module.resource_group.name - location = var.location - aks_object_id = module.aks.aks_object_id -} - -module "mlflow" { - source = "./mlflow_module" - - depends_on = [null_resource.configure_local_kubectl] - - # storage variables - storage_account_name = module.storage.storage_account_name - storage_container_name = module.storage.storage_container_name - artifact_azure_access_key = module.storage.primary_access_key -} - - -module "zenserver" { - source = "./zen_server" - - depends_on = [null_resource.configure_local_kubectl] - - # resource group variables - resource_group_name = module.resource_group.name - location = var.location - prefix = var.prefix - - # ZenServer credentials - username = var.username - password = var.password - - zenmlserver_version = var.zenmlserver_version -} - - -module "seldon" { - source = "./seldon" - - depends_on = [null_resource.configure_local_kubectl] - - # details about the seldon deployment - seldon_name = var.seldon_name - seldon_namespace = var.seldon_namespace - -} diff --git a/src/matcha_ml/infrastructure/default/mlflow_module/README.md b/src/matcha_ml/infrastructure/default/mlflow_module/README.md deleted file mode 100644 index a06e695c..00000000 --- a/src/matcha_ml/infrastructure/default/mlflow_module/README.md +++ /dev/null @@ -1,41 +0,0 @@ -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | >= 0.14.8 | -| [htpasswd](#requirement\_htpasswd) | 1.0.4 | - -## Providers - -| Name | Version | -|------|---------| -| [helm](#provider\_helm) | n/a | -| [kubernetes](#provider\_kubernetes) | n/a | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [helm_release.mlflow-tracking](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | -| [kubernetes_namespace.k8s_ns](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | -| [kubernetes_service.mlflow_tracking](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/service) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [artifact\_azure](#input\_artifact\_azure) | Boolean to indicate if we are using Azure Blob Storage as storage for MLFlow | `bool` | `true` | no | -| [artifact\_azure\_access\_key](#input\_artifact\_azure\_access\_key) | Access Key for Azure Blob Storage | `string` | `""` | no | -| [artifact\_proxied\_access](#input\_artifact\_proxied\_access) | Boolean to indicate if we are using proxied artifact storage | `bool` | `false` | no | -| [storage\_account\_name](#input\_storage\_account\_name) | Name of Azure Storage Container already created inside Azure Blob Storage | `string` | n/a | yes | -| [storage\_container\_name](#input\_storage\_container\_name) | Name of container to create inside Azure Storage Account to store artifacts | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [mlflow\_tracking\_url](#output\_mlflow\_tracking\_url) | The tracking URL for MLFlow dashboard | diff --git a/src/matcha_ml/infrastructure/default/mlflow_module/getURI.tf b/src/matcha_ml/infrastructure/default/mlflow_module/getURI.tf deleted file mode 100644 index e4a6890c..00000000 --- a/src/matcha_ml/infrastructure/default/mlflow_module/getURI.tf +++ /dev/null @@ -1,8 +0,0 @@ -# Derived from ZenML's stack recipes; source: https://github.com/zenml-io/mlops-stacks/blob/8eb06596bf836d3a3dd2634fbc7f2b5687421811/azure-minimal/get_URIs.tf - -# get URI for MLflow tracking server -data "kubernetes_service" "mlflow_tracking" { - metadata { - name = helm_release.mlflow_tracking.name - } -} diff --git a/src/matcha_ml/infrastructure/default/mlflow_module/main.tf b/src/matcha_ml/infrastructure/default/mlflow_module/main.tf deleted file mode 100644 index eb97dfaa..00000000 --- a/src/matcha_ml/infrastructure/default/mlflow_module/main.tf +++ /dev/null @@ -1,44 +0,0 @@ -# create the mlflow tracking server deployment using mlflow helm charts -# Reference: https://github.com/community-charts/helm-charts/blob/main/charts/mlflow/values.yaml -resource "helm_release" "mlflow_tracking" { - - name = "mlflow-tracking" - repository = "https://community-charts.github.io/helm-charts" - chart = "mlflow" - - # Change type from "ClusterIP" to "LoadBalancer" - set { - name = "service.type" - value = "LoadBalancer" - } - # set proxied access to artifact storage - set { - name = "artifactRoot.proxiedArtifactStorage" - value = var.artifact_proxied_access - type = "auto" - } - - # Derived from ZenML's stack recipes; source: https://github.com/zenml-io/mlops-stacks/blob/8eb06596bf836d3a3dd2634fbc7f2b5687421811/aws-minimal/mlflow-module/mlflow.tf#L39 - # set values for Azure Blob Storage - set { - name = "artifactRoot.azureBlob.enabled" - value = var.artifact_azure - type = "auto" - } - set { - name = "artifactRoot.azureBlob.storageAccount" - value = var.storage_account_name - type = "string" - } - set { - name = "artifactRoot.azureBlob.container" - value = var.storage_container_name - type = "string" - } - set_sensitive { - name = "artifactRoot.azureBlob.accessKey" - value = var.artifact_azure_access_key - type = "string" - } - -} diff --git a/src/matcha_ml/infrastructure/default/mlflow_module/output.tf b/src/matcha_ml/infrastructure/default/mlflow_module/output.tf deleted file mode 100644 index d73628a7..00000000 --- a/src/matcha_ml/infrastructure/default/mlflow_module/output.tf +++ /dev/null @@ -1,4 +0,0 @@ -output "mlflow_tracking_url" { - description = "The tracking URL for MLFlow dashboard" - value = "http://${data.kubernetes_service.mlflow_tracking.status.0.load_balancer.0.ingress.0.ip}:${data.kubernetes_service.mlflow_tracking.spec.0.port.0.port}" -} diff --git a/src/matcha_ml/infrastructure/default/mlflow_module/providers.tf b/src/matcha_ml/infrastructure/default/mlflow_module/providers.tf deleted file mode 100644 index f46344cb..00000000 --- a/src/matcha_ml/infrastructure/default/mlflow_module/providers.tf +++ /dev/null @@ -1,12 +0,0 @@ -# Derived from ZenML's stack recipes; source: https://github.com/zenml-io/mlops-stacks/blob/8eb06596bf836d3a3dd2634fbc7f2b5687421811/aws-minimal/mlflow-module/providers.tf - -# defining the providers required by the mlflow module -terraform { - required_providers { - htpasswd = { - source = "loafoe/htpasswd" - version = "1.0.4" - } - } - required_version = ">= 0.14.8" -} diff --git a/src/matcha_ml/infrastructure/default/mlflow_module/variables.tf b/src/matcha_ml/infrastructure/default/mlflow_module/variables.tf deleted file mode 100644 index 058a5057..00000000 --- a/src/matcha_ml/infrastructure/default/mlflow_module/variables.tf +++ /dev/null @@ -1,29 +0,0 @@ -# artifact storage variables -variable "artifact_proxied_access" { - description = "Boolean to indicate if we are using proxied artifact storage" - type = bool - default = false -} - -variable "storage_account_name" { - description = "Name of Azure Storage Container already created inside Azure Blob Storage" - type = string -} - -variable "storage_container_name" { - description = "Name of container to create inside Azure Storage Account to store artifacts" - type = string -} - -variable "artifact_azure" { - description = "Boolean to indicate if we are using Azure Blob Storage as storage for MLFlow" - type = bool - default = true -} - - -variable "artifact_azure_access_key" { - description = "Access Key for Azure Blob Storage" - type = string - default = "" -} diff --git a/src/matcha_ml/infrastructure/default/mlflow_module/zenml_namespace.tf b/src/matcha_ml/infrastructure/default/mlflow_module/zenml_namespace.tf deleted file mode 100644 index c0705a8a..00000000 --- a/src/matcha_ml/infrastructure/default/mlflow_module/zenml_namespace.tf +++ /dev/null @@ -1,5 +0,0 @@ -resource "kubernetes_namespace" "k8s_ns" { - metadata { - name = "zenml" - } -} diff --git a/src/matcha_ml/infrastructure/default/output.tf b/src/matcha_ml/infrastructure/default/output.tf deleted file mode 100644 index f62fd806..00000000 --- a/src/matcha_ml/infrastructure/default/output.tf +++ /dev/null @@ -1,94 +0,0 @@ -output "experiment_tracker_mlflow_tracking_url" { - description = "The URL for the MLflow tracking server" - value = module.mlflow.mlflow_tracking_url -} - -output "experiment_tracker_mlflow_azure_connection_string" { - description = "The Azure connection string for the MLflow artifact storage" - value = module.storage.primary_connection_string - sensitive = true -} - -output "pipeline_zenml_storage_path" { - description = "The Azure Blob Storage Container path for storing ZenML artifacts" - value = module.zenml_storage.zenml_blobstorage_container_path -} - - -output "pipeline_zenml_connection_string" { - description = "The primary connection string for the ZenML Azure Storage Account" - value = module.zenml_storage.zenml_primary_connection_string - sensitive = true -} - -output "orchestrator_aks_k8s_context" { - description = "The name of the Kubernetes context used for deployment" - value = local.kubectl_context -} - -output "pipeline_zenml_server_url" { - description = "The URL for the ZenServer API server" - value = module.zenserver.zenserver_url -} - -output "pipeline_zenml_server_username" { - description = "The username for accessing the ZenServer API server" - value = module.zenserver.zenserver_username -} - -output "pipeline_zenml_server_password" { - description = "The password for accessing the ZenServer API server" - value = module.zenserver.zenserver_password - sensitive = true -} - -output "container_registry_azure_registry_url" { - description = "The URL for the Azure Container Registry" - value = module.acr.container_registry_url -} - -output "container_registry_azure_registry_name" { - description = "The name of the Azure Container Registry" - value = module.acr.container_registry_name -} - -output "model_deployer_seldon_workloads_namespace" { - description = "The Kubernetes namespace for Seldon workloads" - value = module.seldon.workloads_namespace -} - -output "model_deployer_seldon_base_url" { - description = "The base URL for the Seldon API server" - value = module.seldon.base_url -} - -output "cloud_azure_resource_group_name" { - description = "Name of the Azure resource group" - value = module.resource_group.name -} - -output "cloud_azure_prefix"{ - description = "The Azure resource group name prefix" - value = var.prefix -} - -output "cloud_azure_location"{ - description = "The Azure location in which the resources are provisioned" - value = var.location -} - -output "data_version_control_primary_connection_string"{ - description = "The primary connection string for the ZenML Azure Storage Account" - value = module.data_version_control_storage.primary_connection_string - sensitive = true -} - -output "data_version_control_storage_container_name"{ - description = "The name of the container used for data version control" - value = module.data_version_control_storage.storage_container_name -} - -output "data_version_control_storage_account_name"{ - description = "The name of the storage account for data version control" - value = module.data_version_control_storage.storage_account_name -} diff --git a/src/matcha_ml/infrastructure/default/printf.cmd b/src/matcha_ml/infrastructure/default/printf.cmd deleted file mode 100644 index 07e225fa..00000000 --- a/src/matcha_ml/infrastructure/default/printf.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -echo {"os": "Windows"} diff --git a/src/matcha_ml/infrastructure/default/providers.tf b/src/matcha_ml/infrastructure/default/providers.tf deleted file mode 100644 index b3876b23..00000000 --- a/src/matcha_ml/infrastructure/default/providers.tf +++ /dev/null @@ -1,46 +0,0 @@ -# defining the providers for the all module -terraform { - required_providers { - azurerm = { - source = "hashicorp/azurerm" - version = ">=3.16.0" - } - - random = { - source = "hashicorp/random" - version = "3.1.0" - } - - helm = { - source = "hashicorp/helm" - version = "~> 2.0.1" - } - - local = { - source = "hashicorp/local" - version = "2.1.0" - } - - null = { - source = "hashicorp/null" - version = "3.2.1" - } - - kubernetes = { - source = "hashicorp/kubernetes" - version = "~> 2.11.0" - } - - kubectl = { - source = "gavinbunney/kubectl" - version = "1.14.0" - } - - htpasswd = { - source = "loafoe/htpasswd" - version = "1.0.4" - } - } - - required_version = ">= 0.14.8" -} diff --git a/src/matcha_ml/infrastructure/default/resource_group/README.md b/src/matcha_ml/infrastructure/default/resource_group/README.md deleted file mode 100644 index 72624d2e..00000000 --- a/src/matcha_ml/infrastructure/default/resource_group/README.md +++ /dev/null @@ -1,32 +0,0 @@ -## Requirements - -No requirements. - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | n/a | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_resource_group.main](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [location](#input\_location) | The Azure region in which resource group should be provisioned | `string` | n/a | yes | -| [prefix](#input\_prefix) | A prefix used for all resources | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [name](#output\_name) | Name of the resource group | diff --git a/src/matcha_ml/infrastructure/default/resource_group/main.tf b/src/matcha_ml/infrastructure/default/resource_group/main.tf deleted file mode 100644 index 6afb0a9e..00000000 --- a/src/matcha_ml/infrastructure/default/resource_group/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -data "azurerm_resource_group" "main" { - name = "${var.prefix}-resources" -} diff --git a/src/matcha_ml/infrastructure/default/resource_group/output.tf b/src/matcha_ml/infrastructure/default/resource_group/output.tf deleted file mode 100644 index 55f05726..00000000 --- a/src/matcha_ml/infrastructure/default/resource_group/output.tf +++ /dev/null @@ -1,4 +0,0 @@ -output "name" { - description = "Name of the resource group" - value = data.azurerm_resource_group.main.name -} diff --git a/src/matcha_ml/infrastructure/default/resource_group/variables.tf b/src/matcha_ml/infrastructure/default/resource_group/variables.tf deleted file mode 100644 index 0325a60e..00000000 --- a/src/matcha_ml/infrastructure/default/resource_group/variables.tf +++ /dev/null @@ -1,4 +0,0 @@ -variable "prefix" { - description = "A prefix used for all resources" - type = string -} diff --git a/src/matcha_ml/infrastructure/default/seldon/README.md b/src/matcha_ml/infrastructure/default/seldon/README.md deleted file mode 100644 index 9ceb938e..00000000 --- a/src/matcha_ml/infrastructure/default/seldon/README.md +++ /dev/null @@ -1,49 +0,0 @@ -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | >= 0.14.8 | -| [kubectl](#requirement\_kubectl) | 1.14.0 | - -## Providers - -| Name | Version | -|------|---------| -| [helm](#provider\_helm) | n/a | -| [kubectl](#provider\_kubectl) | 1.14.0 | -| [kubernetes](#provider\_kubernetes) | n/a | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [helm_release.istio_base](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | -| [helm_release.istio_ingress](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | -| [helm_release.istiod](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | -| [helm_release.seldon](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | -| [kubectl_manifest.gateway](https://registry.terraform.io/providers/gavinbunney/kubectl/1.14.0/docs/resources/manifest) | resource | -| [kubernetes_cluster_role_binding_v1.seldon_machinelearning-permission_binding](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/cluster_role_binding_v1) | resource | -| [kubernetes_cluster_role_v1.seldon-machinelearning_permission](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/cluster_role_v1) | resource | -| [kubernetes_namespace.istio_ns](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | -| [kubernetes_namespace.seldon_ns](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | -| [kubernetes_namespace.seldon_workloads](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | -| [kubernetes_service.seldon_ingress](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/service) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [seldon\_name](#input\_seldon\_name) | Seldon Helm deployment name | `string` | n/a | yes | -| [seldon\_namespace](#input\_seldon\_namespace) | Seldon system namespace | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [base\_url](#output\_base\_url) | The base URL of the Seldon deployment | -| [ingress\_gateway\_spec](#output\_ingress\_gateway\_spec) | The YAML specification for the Istio ingress gateway | -| [workloads\_namespace](#output\_workloads\_namespace) | The namespace for Seldon workloads | diff --git a/src/matcha_ml/infrastructure/default/seldon/istio.tf b/src/matcha_ml/infrastructure/default/seldon/istio.tf deleted file mode 100644 index 7c4d9a9a..00000000 --- a/src/matcha_ml/infrastructure/default/seldon/istio.tf +++ /dev/null @@ -1,65 +0,0 @@ -# Derived from ZenML's stack recipes; source: https://github.com/zenml-io/mlops-stacks/blob/8eb06596bf836d3a3dd2634fbc7f2b5687421811/aws-minimal/seldon/istio.tf - -# create a namespace for istio resources -resource "kubernetes_namespace" "istio_ns" { - metadata { - name = "istio-system" - labels = { - istio-injection = "enabled" - } - } -} - -# istio-base creates the istio definitions that will be used going forward -resource "helm_release" "istio_base" { - name = "istio-base-seldon" - repository = "https://istio-release.storage.googleapis.com/charts" - chart = "base" - - # adding a dependency on the istio-namespace - namespace = kubernetes_namespace.istio_ns.metadata[0].name -} - -# the istio daemon -resource "helm_release" "istiod" { - name = "istiod-seldon" - repository = helm_release.istio_base.repository # dependency on istio-base - chart = "istiod" - - namespace = kubernetes_namespace.istio_ns.metadata[0].name -} - -# the istio ingress gateway -# cannot use kubernetes_manifest resource since it practically -# doesn't support CRDs. Going with kubectl instead. -resource "kubectl_manifest" "gateway" { - yaml_body = < [azurerm](#requirement\_azurerm) | 3.48.0 | - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | 3.48.0 | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_storage_account.storageaccount](https://registry.terraform.io/providers/hashicorp/azurerm/3.48.0/docs/resources/storage_account) | resource | -| [azurerm_storage_container.storagecontainer](https://registry.terraform.io/providers/hashicorp/azurerm/3.48.0/docs/resources/storage_container) | resource | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [location](#input\_location) | The Azure Region in which this resources should be created. | `string` | n/a | yes | -| [prefix](#input\_prefix) | The prefix which should be used for naming storage account ({prefix}storageacc) and container ({prefix}storagecontainer) | `string` | n/a | yes | -| [resource\_group\_name](#input\_resource\_group\_name) | The resource group name which is used to create the resource group | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [blobstorage\_container\_path](#output\_blobstorage\_container\_path) | The Azure Blob Storage Container path for storing your artifacts | -| [primary\_access\_key](#output\_primary\_access\_key) | Azure Storage Account - Primary access key | -| [primary\_blob\_connection\_string](#output\_primary\_blob\_connection\_string) | Azure Storage Account - Primary Blob service connection string | -| [primary\_connection\_string](#output\_primary\_connection\_string) | Azure Storage Account - Primary connection string | -| [secondary\_access\_key](#output\_secondary\_access\_key) | Azure Storage Account - Secondary access key | -| [secondary\_blob\_connection\_string](#output\_secondary\_blob\_connection\_string) | Azure Storage Account - Secondary Blob service connection string | -| [secondary\_connection\_string](#output\_secondary\_connection\_string) | Azure Storage Account - Secondary connection string | -| [storage\_account\_name](#output\_storage\_account\_name) | The name of the Azure Storage Account. | -| [storage\_container\_name](#output\_storage\_container\_name) | The name of the Azure Storage Container. | diff --git a/src/matcha_ml/infrastructure/default/storage/main.tf b/src/matcha_ml/infrastructure/default/storage/main.tf deleted file mode 100644 index b448a625..00000000 --- a/src/matcha_ml/infrastructure/default/storage/main.tf +++ /dev/null @@ -1,22 +0,0 @@ -# Reference: https://github.com/hashicorp/terraform-provider-azurerm/tree/main/examples/storage/storage-container - -# create a storage account -resource "azurerm_storage_account" "storageaccount" { - name = "st${var.prefix}acc" - resource_group_name = var.resource_group_name - location = var.location - - account_tier = "Standard" - account_kind = "StorageV2" - account_replication_type = "LRS" - enable_https_traffic_only = true - access_tier = "Hot" - allow_nested_items_to_be_public = true -} - -# create a storage container inside created storage account -resource "azurerm_storage_container" "storagecontainer" { - name = "${var.prefix}store" - storage_account_name = azurerm_storage_account.storageaccount.name - container_access_type = "container" -} diff --git a/src/matcha_ml/infrastructure/default/storage/output.tf b/src/matcha_ml/infrastructure/default/storage/output.tf deleted file mode 100644 index ef9a9916..00000000 --- a/src/matcha_ml/infrastructure/default/storage/output.tf +++ /dev/null @@ -1,50 +0,0 @@ -output "storage_container_name" { - description = "The name of the Azure Storage Container." - value = azurerm_storage_container.storagecontainer.name -} - -output "blobstorage_container_path" { - description = "The Azure Blob Storage Container path for storing your artifacts" - value = "az://${azurerm_storage_container.storagecontainer.name}" -} - -output "storage_account_name" { - description = "The name of the Azure Storage Account." - value = azurerm_storage_account.storageaccount.name -} - -output "primary_access_key" { - description = "Azure Storage Account - Primary access key" - value = azurerm_storage_account.storageaccount.primary_access_key - sensitive = true -} - -output "secondary_access_key" { - description = "Azure Storage Account - Secondary access key" - value = azurerm_storage_account.storageaccount.secondary_access_key - sensitive = true -} - -output "primary_connection_string" { - description = "Azure Storage Account - Primary connection string" - value = azurerm_storage_account.storageaccount.primary_connection_string - sensitive = true -} - -output "secondary_connection_string" { - description = "Azure Storage Account - Secondary connection string" - value = azurerm_storage_account.storageaccount.secondary_connection_string - sensitive = true -} - -output "primary_blob_connection_string" { - description = "Azure Storage Account - Primary Blob service connection string" - value = azurerm_storage_account.storageaccount.primary_blob_connection_string - sensitive = true -} - -output "secondary_blob_connection_string" { - description = "Azure Storage Account - Secondary Blob service connection string" - value = azurerm_storage_account.storageaccount.secondary_blob_connection_string - sensitive = true -} diff --git a/src/matcha_ml/infrastructure/default/storage/providers.tf b/src/matcha_ml/infrastructure/default/storage/providers.tf deleted file mode 100644 index e2d7507d..00000000 --- a/src/matcha_ml/infrastructure/default/storage/providers.tf +++ /dev/null @@ -1,8 +0,0 @@ -terraform { - required_providers { - azurerm = { - source = "hashicorp/azurerm" - version = "3.48.0" - } - } -} diff --git a/src/matcha_ml/infrastructure/default/storage/variables.tf b/src/matcha_ml/infrastructure/default/storage/variables.tf deleted file mode 100644 index 23388ac3..00000000 --- a/src/matcha_ml/infrastructure/default/storage/variables.tf +++ /dev/null @@ -1,14 +0,0 @@ -variable "resource_group_name" { - description = "The resource group name which is used to create the resource group" - type = string -} - -variable "prefix" { - description = "The prefix which should be used for naming storage account ({prefix}storageacc) and container ({prefix}storagecontainer)" - type = string -} - -variable "location" { - description = "The Azure Region in which this resources should be created." - type = string -} diff --git a/src/matcha_ml/infrastructure/default/variables.tf b/src/matcha_ml/infrastructure/default/variables.tf deleted file mode 100644 index 15202b4e..00000000 --- a/src/matcha_ml/infrastructure/default/variables.tf +++ /dev/null @@ -1,42 +0,0 @@ -variable "prefix" { - description = "A prefix used for all resources" - type = string - default = "matcha" -} - -variable "location" { - description = "The Azure Region in which all resources should be provisioned" - type = string -} - -variable "username" { - description = "Username for ZenServer" - type = string - default = "default" -} - -variable "password" { - description = "Password for ZenServer" - type = string - sensitive = true -} - -variable "zenmlserver_version" { - description = "The tag to use for the zenmlserver docker image." - default = "latest" - type = string -} - -# seldon variables -variable "seldon_name" { - description = "Name of the Seldon deployment" - type = string - default = "seldon" -} - -variable "seldon_namespace" { - description = "Namespace for Seldon resources" - type = string - default = "seldon-system" - -} diff --git a/src/matcha_ml/infrastructure/default/zen_server/README.md b/src/matcha_ml/infrastructure/default/zen_server/README.md deleted file mode 100644 index 8b7759f2..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/README.md +++ /dev/null @@ -1,69 +0,0 @@ -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | >= 0.14.8 | -| [htpasswd](#requirement\_htpasswd) | 1.0.4 | -| [kubectl](#requirement\_kubectl) | 1.14.0 | - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | n/a | -| [helm](#provider\_helm) | n/a | -| [kubernetes](#provider\_kubernetes) | n/a | -| [random](#provider\_random) | n/a | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_mysql_flexible_database.db](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_flexible_database) | resource | -| [azurerm_mysql_flexible_server.mysql](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_flexible_server) | resource | -| [azurerm_mysql_flexible_server_configuration.require_ssl](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_flexible_server_configuration) | resource | -| [azurerm_mysql_flexible_server_firewall_rule.allow_IPs](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_flexible_server_firewall_rule) | resource | -| [helm_release.zen_server](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | -| [kubernetes_namespace.zen_server](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | -| [random_password.mysql_password](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource | -| [kubernetes_service.zen_server](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/service) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [analytics\_opt\_in](#input\_analytics\_opt\_in) | The flag to enable/disable analytics | `bool` | `false` | no | -| [database\_password](#input\_database\_password) | The password for the CloudSQL store | `string` | `""` | no | -| [database\_ssl\_ca](#input\_database\_ssl\_ca) | The server ca for the Flexible MySQL instance | `string` | `""` | no | -| [database\_ssl\_cert](#input\_database\_ssl\_cert) | The client cert for the Flexible MySQL instance | `string` | `""` | no | -| [database\_ssl\_key](#input\_database\_ssl\_key) | The client key for the Flexible MySQL instance | `string` | `""` | no | -| [database\_ssl\_verify\_server\_cert](#input\_database\_ssl\_verify\_server\_cert) | Should SSL be verified? | `bool` | `false` | no | -| [database\_url](#input\_database\_url) | The URL for the Flexible MySQL instance | `string` | `""` | no | -| [database\_username](#input\_database\_username) | The username for the CloudSQL store | `string` | `"user"` | no | -| [db\_disk\_size](#input\_db\_disk\_size) | The allocated storage in gigabytes | `number` | `20` | no | -| [db\_instance\_name](#input\_db\_instance\_name) | The name for the Flexible MySQL store | `string` | `"zenmlserver"` | no | -| [db\_name](#input\_db\_name) | The name for the database | `string` | `"zendb"` | no | -| [db\_sku\_name](#input\_db\_sku\_name) | The sku\_name for the database resource | `string` | `"B_Standard_B1s"` | no | -| [db\_version](#input\_db\_version) | The version of MySQL to use | `string` | `"5.7"` | no | -| [deploy\_db](#input\_deploy\_db) | Should a Flexible MySQL instance be created? | `bool` | `true` | no | -| [kubectl\_config\_path](#input\_kubectl\_config\_path) | The path to the kube config | `string` | `""` | no | -| [location](#input\_location) | The location for your Azure resources | `string` | n/a | yes | -| [namespace](#input\_namespace) | The namespace to install the ZenML server Helm chart in | `string` | `"terraform-server"` | no | -| [password](#input\_password) | Password for the default ZenML server account | `string` | n/a | yes | -| [prefix](#input\_prefix) | A prefix used for all resources | `string` | n/a | yes | -| [resource\_group\_name](#input\_resource\_group\_name) | The resource group in Azure that you want to deploy ZenML to | `string` | n/a | yes | -| [username](#input\_username) | Username for the default ZenML server account | `string` | `"default"` | no | -| [zenmlserver\_image\_repo](#input\_zenmlserver\_image\_repo) | The repository to use for the zenmlserver docker image. | `string` | `"zenmldocker/zenml-server"` | no | -| [zenmlserver\_image\_tag](#input\_zenmlserver\_image\_tag) | The tag to use for the zenmlserver docker image. | `string` | `"latest"` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| [zenserver\_password](#output\_zenserver\_password) | The password used to access the ZenML server | -| [zenserver\_url](#output\_zenserver\_url) | The URL for the ZenML server | -| [zenserver\_username](#output\_zenserver\_username) | The username used to access the ZenML server | diff --git a/src/matcha_ml/infrastructure/default/zen_server/getURL.tf b/src/matcha_ml/infrastructure/default/zen_server/getURL.tf deleted file mode 100644 index a45aff5b..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/getURL.tf +++ /dev/null @@ -1,10 +0,0 @@ -data "kubernetes_service" "zen_server" { - metadata { - name = "${helm_release.zen_server.name}-zenml" - namespace = helm_release.zen_server.namespace - } - - depends_on = [ - helm_release.zen_server - ] -} diff --git a/src/matcha_ml/infrastructure/default/zen_server/ingress.tf b/src/matcha_ml/infrastructure/default/zen_server/ingress.tf deleted file mode 100644 index 257498df..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/ingress.tf +++ /dev/null @@ -1,30 +0,0 @@ -# # set up the nginx ingress controller -# resource "kubernetes_namespace" "nginx-ns" { -# count = var.create_ingress_controller ? 1 : 0 -# metadata { -# name = "${var.name}-ingress" -# } -# } - -# resource "helm_release" "nginx-controller" { -# name = "zenml" -# count = var.create_ingress_controller ? 1 : 0 -# repository = "https://kubernetes.github.io/ingress-nginx" -# chart = "ingress-nginx" -# # dependency on nginx-ns -# namespace = var.create_ingress_controller ? kubernetes_namespace.nginx-ns[0].metadata[0].name : "" -# depends_on = [ -# resource.kubernetes_namespace.nginx-ns -# ] -# } - -# data "kubernetes_service" "ingress-controller" { -# count = var.create_ingress_controller ? 1 : 0 -# metadata { -# name = "zenml-ingress-nginx-controller" -# namespace = var.create_ingress_controller ? kubernetes_namespace.nginx-ns[0].metadata[0].name : "" -# } -# depends_on = [ -# resource.helm_release.nginx-controller -# ] -# } diff --git a/src/matcha_ml/infrastructure/default/zen_server/main.tf b/src/matcha_ml/infrastructure/default/zen_server/main.tf deleted file mode 100644 index d4026cac..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/main.tf +++ /dev/null @@ -1,112 +0,0 @@ -# Derived from ZenML's stack recipes; source: https://github.com/zenml-io/mlops-stacks/blob/8eb06596bf836d3a3dd2634fbc7f2b5687421811/modules/zenml-module/zen_server.tf - -# create the ZenServer deployment -resource "kubernetes_namespace" "zen_server" { - metadata { - name = "${var.prefix}-${var.namespace}" - } -} - -resource "helm_release" "zen_server" { - - name = "${var.prefix}-zenserver" - chart = "${path.module}/zenml_helm" - namespace = kubernetes_namespace.zen_server.metadata[0].name - - set { - name = "zenml.image.repository" - value = var.zenmlserver_image_repo - } - - set { - name = "zenml.defaultUsername" - value = var.username - } - set { - name = "zenml.defaultPassword" - value = var.password - } - set { - name = "zenml.deploymentType" - value = "azure" - } - set { - name = "zenml.analyticsOptIn" - value = var.analytics_opt_in - } - - # # Ingress set up - # set { - # name = "zenml.rootUrlPath" - # value = var.ingress_path != "" ? "/${var.ingress_path}" : "" - # } - # set { - # name = "zenml.ingress.path" - # value = var.ingress_path != "" ? "/${var.ingress_path}/?(.*)" : "/" - # } - # set { - # name = "zenml.ingress.annotations.nginx\\.ingress\\.kubernetes\\.io/rewrite-target" - # value = var.ingress_path != "" ? "/$1" : "" - # } - # set { - # name = "zenml.ingress.host" - # value = var.create_ingress_controller ? "${data.kubernetes_service.ingress-controller[0].status.0.load_balancer.0.ingress.0.ip}.nip.io" : "${var.ingress_controller_hostname}.nip.io" - # } - # set { - # name = "zenml.ingress.tls.enabled" - # value = var.ingress_tls - # } - # set { - # name = "zenml.ingress.tls.generateCerts" - # value = var.ingress_tls_generate_certs - # } - # set { - # name = "zenml.ingress.tls.secretName" - # value = "${var.prefix}-${var.ingress_tls_secret_name}" - # } - - # set parameters for the mysql database - set { - name = "zenml.database.url" - value = var.deploy_db ? "mysql://${var.database_username}:${azurerm_mysql_flexible_server.mysql[0].administrator_password}@${azurerm_mysql_flexible_server.mysql[0].name}.mysql.database.azure.com:3306/${var.db_name}" : var.database_url - } - set { - name = "zenml.database.sslCa" - value = var.deploy_db ? "" : var.database_ssl_ca - } - set { - name = "zenml.database.sslCert" - value = var.deploy_db ? "" : var.database_ssl_cert - } - set { - name = "zenml.database.sslKey" - value = var.deploy_db ? "" : var.database_ssl_key - } - set { - name = "zenml.database.sslVerifyServerCert" - value = var.deploy_db ? false : var.database_ssl_verify_server_cert - } - set { - name = "zenml.image.tag" - value = var.zenmlserver_version - } - depends_on = [ - resource.kubernetes_namespace.zen_server - ] -} - -# data "kubernetes_secret" "certificates" { -# metadata { -# name = "${var.prefix}-${var.ingress_tls_secret_name}" -# namespace = "${var.prefix}-${var.namespace}" -# } -# binary_data = { -# "tls.crt" = "" -# "tls.key" = "" -# "ca.crt" = "" -# } - -# depends_on = [ -# helm_release.zen-server -# ] -# } diff --git a/src/matcha_ml/infrastructure/default/zen_server/outputs.tf b/src/matcha_ml/infrastructure/default/zen_server/outputs.tf deleted file mode 100644 index 8d986559..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/outputs.tf +++ /dev/null @@ -1,19 +0,0 @@ -output "zenserver_url" { - description = "The URL for the ZenML server" - value = "http://${data.kubernetes_service.zen_server.status.0.load_balancer.0.ingress.0.ip}" -} - -output "zenserver_username" { - description = "The username used to access the ZenML server" - value = var.username -} - -output "zenserver_password" { - description = "The password used to access the ZenML server" - value = var.password - sensitive = true -} - -# output "zenserver_url" { -# value = var.create_ingress_controller ? "https://${data.kubernetes_service.ingress-controller[0].status.0.load_balancer.0.ingress.0.ip}.nip.io/${var.ingress_path}" : "https://${var.ingress_controller_hostname}.nip.io/${var.ingress_path}" -# } diff --git a/src/matcha_ml/infrastructure/default/zen_server/providers.tf b/src/matcha_ml/infrastructure/default/zen_server/providers.tf deleted file mode 100644 index a418423b..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/providers.tf +++ /dev/null @@ -1,16 +0,0 @@ -# defining the providers for the zenserver module -terraform { - required_providers { - kubectl = { - source = "gavinbunney/kubectl" - version = "1.14.0" - } - - htpasswd = { - source = "loafoe/htpasswd" - version = "1.0.4" - } - } - - required_version = ">= 0.14.8" -} diff --git a/src/matcha_ml/infrastructure/default/zen_server/sql.tf b/src/matcha_ml/infrastructure/default/zen_server/sql.tf deleted file mode 100644 index 4e87117e..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/sql.tf +++ /dev/null @@ -1,57 +0,0 @@ -resource "azurerm_mysql_flexible_server" "mysql" { - count = var.deploy_db ? 1 : 0 - name = "${var.prefix}${var.db_instance_name}" - resource_group_name = var.resource_group_name - location = var.location - administrator_login = var.database_username - administrator_password = var.database_password == "" ? random_password.mysql_password.result : var.database_password - version = var.db_version - storage { - size_gb = var.db_disk_size - } - sku_name = var.db_sku_name -} - -resource "azurerm_mysql_flexible_database" "db" { - count = var.deploy_db ? 1 : 0 - name = "${var.prefix}${var.db_name}" - resource_group_name = var.resource_group_name - server_name = azurerm_mysql_flexible_server.mysql[0].name - charset = "utf8" - collation = "utf8_unicode_ci" -} - -resource "azurerm_mysql_flexible_server_firewall_rule" "allow_IPs" { - count = var.deploy_db ? 1 : 0 - name = "all_traffic" - resource_group_name = var.resource_group_name - server_name = azurerm_mysql_flexible_server.mysql[0].name - start_ip_address = "0.0.0.0" - end_ip_address = "255.255.255.255" -} - -resource "azurerm_mysql_flexible_server_configuration" "require_ssl" { - count = var.deploy_db ? 1 : 0 - name = "require_secure_transport" - resource_group_name = var.resource_group_name - server_name = azurerm_mysql_flexible_server.mysql[0].name - value = "OFF" -} - -resource "random_password" "mysql_password" { - length = 12 - special = false - min_lower = 1 - min_numeric = 1 - min_upper = 1 -} - -# # download SSL certificate -# resource "null_resource" "download-SSL-certificate" { -# count = var.deploy_db ? 1 : 0 - -# provisioner "local-exec" { -# command = "wget https://dl.cacerts.digicert.com/DigiCertGlobalRootCA.crt.pem" -# } - -# } diff --git a/src/matcha_ml/infrastructure/default/zen_server/variables.tf b/src/matcha_ml/infrastructure/default/zen_server/variables.tf deleted file mode 100644 index ae4a8d66..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/variables.tf +++ /dev/null @@ -1,167 +0,0 @@ -variable "prefix" { - description = "A prefix used for all resources" - type = string -} - -variable "resource_group_name" { - description = "The resource group in Azure that you want to deploy ZenML to" - type = string -} - -variable "location" { - description = "The location for your Azure resources" - type = string -} - -# ZenServer credentials -variable "username" { - description = "Username for the default ZenML server account" - default = "default" - type = string -} - -variable "password" { - description = "Password for the default ZenML server account" - type = string -} - -variable "namespace" { - description = "The namespace to install the ZenML server Helm chart in" - default = "terraform-server" - type = string -} - -variable "kubectl_config_path" { - description = "The path to the kube config" - default = "" - type = string -} - -variable "analytics_opt_in" { - description = "The flag to enable/disable analytics" - default = false - type = bool -} - -# If you want a new Flexible Server, choose a name and a password. If you already -# have an instance, provide the name and the password here too. -variable "database_username" { - description = "The username for the CloudSQL store" - default = "user" - type = string -} -variable "database_password" { - description = "The password for the CloudSQL store" - default = "" - type = string -} - -# if you enable the deploy_db option, this will -# create a new Flexible MySQL instance and then use it for this -# ZenServer. If disabled, you have to supply connection details -# in the section below. -variable "deploy_db" { - description = "Should a Flexible MySQL instance be created?" - default = true - type = bool -} -variable "db_instance_name" { - description = "The name for the Flexible MySQL store" - default = "zenmlserver" - type = string -} -variable "db_name" { - description = "The name for the database" - default = "zendb" - type = string -} -variable "db_version" { - description = "The version of MySQL to use" - default = "5.7" -} -variable "db_sku_name" { - description = "The sku_name for the database resource" - default = "B_Standard_B1s" - type = string -} -variable "db_disk_size" { - description = "The allocated storage in gigabytes" - default = 20 - type = number -} - -# If you haven't enabled the deploy_db option, provide -# the following value in addition to setting the username and -# password in the values.tfvars.json file. -variable "database_url" { - description = "The URL for the Flexible MySQL instance" - default = "" - type = string -} -variable "database_ssl_ca" { - description = "The server ca for the Flexible MySQL instance" - default = "" - type = string -} -variable "database_ssl_cert" { - description = "The client cert for the Flexible MySQL instance" - default = "" - type = string -} -variable "database_ssl_key" { - description = "The client key for the Flexible MySQL instance" - default = "" - type = string -} -variable "database_ssl_verify_server_cert" { - description = "Should SSL be verified?" - default = false - type = bool -} - -# # Ingress variables -# variable "ingress_path" { -# description = "The path on the Ingress URL to expose ZenML at" -# default = "zenml" -# type = string -# } - -# # set to true if you don't already have an nginx ingress -# # controller in your cluster -# variable "create_ingress_controller" { -# description = "set to true if you want to create an ingress controller in your cluster" -# default = true -# type = bool -# } - -# # if you already have an ingress controller, supply it's URL -# variable "ingress_controller_hostname" { -# description = "The hostname for the ingress controller on your cluster" -# default = "" -# type = string -# } -# variable "ingress_tls" { -# description = "Whether to enable tls on the ingress or not" -# default = true -# type = bool -# } -# variable "ingress_tls_generate_certs" { -# description = "Whether to enable tls certificates or not" -# default = true -# type = bool -# } -# variable "ingress_tls_secret_name" { -# description = "Name for the Kubernetes secret that stores certificates" -# default = "zenml-tls-certs" -# type = string -# } - -variable "zenmlserver_image_repo" { - description = "The repository to use for the zenmlserver docker image." - default = "zenmldocker/zenml-server" - type = string -} -variable "zenmlserver_version" { - description = "The tag to use for the zenmlserver docker image." - type = string -} diff --git a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/Chart.yaml b/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/Chart.yaml deleted file mode 100644 index 51fbb0fe..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/Chart.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v2 -name: zenml -version: "1.0" -description: Open source MLOps framework for portable production ready ML pipelines -keywords: -- mlops -- zenml -- server -home: https://zenml.io -sources: -- https://github.com/zenml-io/zenml -icon: https://raw.githubusercontent.com/zenml-io/zenml/main/docs/book/.gitbook/assets/zenml_logo.png -appVersion: "0.42.1" diff --git a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/NOTES.txt b/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/NOTES.txt deleted file mode 100644 index a4de5753..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/NOTES.txt +++ /dev/null @@ -1,36 +0,0 @@ -{{- if .Values.zenml.ingress.enabled }} -{{- if .Values.zenml.ingress.host }} -You can access the ZenML server at: - - http{{ if $.Values.zenml.ingress.tls.enabled }}s{{ end }}://{{ .Values.zenml.ingress.host }}{{ .Values.zenml.ingress.path }} - -with the following credentials: - - username: {{ .Values.zenml.defaultUsername }} - password: {{ .Values.zenml.defaultPassword }} - -{{- else }} - - -{{- end }} -{{- else }} - -You can get the ZenML server URL by running these commands: - -{{- if contains "NodePort" .Values.zenml.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "zenml.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.zenml.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "zenml.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "zenml.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.zenml.service.port }} -{{- else if contains "ClusterIP" .Values.zenml.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "zenml.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} - -{{- end }} diff --git a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/_helpers.tpl b/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/_helpers.tpl deleted file mode 100644 index 6732baae..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/_helpers.tpl +++ /dev/null @@ -1,70 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "zenml.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "zenml.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "zenml.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "zenml.labels" -}} -helm.sh/chart: {{ include "zenml.chart" . }} -{{ include "zenml.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} -{{- define "zenml.metadataLabels" -}} -helm.sh/chart: {{ include "zenml.chart" . }} -{{ include "zenml.metadataSelectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "zenml.selectorLabels" -}} -app.kubernetes.io/name: {{ include "zenml.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "zenml.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "zenml.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/cert-secret.yaml b/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/cert-secret.yaml deleted file mode 100644 index c10854db..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/cert-secret.yaml +++ /dev/null @@ -1,45 +0,0 @@ -{{- if and .Values.zenml.ingress.enabled .Values.zenml.ingress.tls.enabled .Values.zenml.ingress.tls.generateCerts -}} - -{{- $certSubjectName := .Values.zenml.ingress.host -}} - -{{- $prevServerSecret := (lookup "v1" "Secret" .Release.Namespace .Values.zenml.ingress.tls.secretName) -}} -{{- if or .Release.IsInstall (not $prevServerSecret) }} -{{- $_ := set . "regenerateCerts" true -}} -{{- else if eq (index $prevServerSecret.metadata.annotations "zenml.certs/subject-name") $certSubjectName }} -{{- $_ := set . "regenerateCerts" false -}} -{{- else }} -{{- $_ := set . "regenerateCerts" true -}} -{{- end }} - -{{- if .regenerateCerts }} - -{{- $caCert := genCA "zenml-ca" 365 -}} -{{- $serverCert := genSignedCert $certSubjectName nil (list $certSubjectName) 365 $caCert -}} - -{{- $_ := set . "caCert" $caCert.Cert -}} -{{- $_ := set . "serverCert" $serverCert.Cert -}} -{{- $_ := set . "serverKey" $serverCert.Key -}} - -{{- else }} - -{{- $_ := set . "caCert" (index $prevServerSecret.data "ca.crt" | b64dec) -}} -{{- $_ := set . "serverCert" (index $prevServerSecret.data "tls.crt" | b64dec) -}} -{{- $_ := set . "serverKey" (index $prevServerSecret.data "tls.key" | b64dec) -}} - -{{- end }} - -apiVersion: v1 -kind: Secret -metadata: - name: {{ .Values.zenml.ingress.tls.secretName }} - labels: - {{- include "zenml.labels" . | nindent 4 }} - annotations: - zenml.certs/subject-name: {{ $certSubjectName}} -type: kubernetes.io/tls -data: - tls.crt: {{ .serverCert | b64enc | quote }} - tls.key: {{ .serverKey | b64enc | quote }} - ca.crt: {{ .caCert | b64enc | quote }} - -{{- end }} diff --git a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/hpa.yaml b/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/hpa.yaml deleted file mode 100644 index da913c40..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/hpa.yaml +++ /dev/null @@ -1,28 +0,0 @@ -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "zenml.fullname" . }} - labels: - {{- include "zenml.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "zenml.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/server-deployment.yaml b/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/server-deployment.yaml deleted file mode 100644 index 6e28098f..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/server-deployment.yaml +++ /dev/null @@ -1,242 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "zenml.fullname" . }} - labels: - {{- include "zenml.labels" . | nindent 4 }} -spec: - {{- if .Values.zenml.database.url }} - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.zenml.replicaCount }} - {{- end }} - {{- else }} - replicas: 1 - {{- end }} - selector: - matchLabels: - {{- include "zenml.selectorLabels" . | nindent 6 }} - template: - metadata: - annotations: - checksum/secret: {{ include (print $.Template.BasePath "/server-secret.yaml") . | sha256sum }} - {{- with .Values.podAnnotations }} - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "zenml.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "zenml.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - {{- if and (eq .Values.zenml.secretsStore.type "gcp") .Values.zenml.secretsStore.gcp.google_application_credentials }} - volumes: - - name: gcp-credentials - secret: - secretName: {{ include "zenml.fullname" . }} - items: - - key: GOOGLE_APPLICATION_CREDENTIALS_FILE - path: credentials.json - {{- end }} - {{- if .Values.zenml.database.url }} - initContainers: - - name: {{ .Chart.Name }}-db-init - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.zenml.image.repository }}:{{ .Values.zenml.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.zenml.image.pullPolicy }} - args: ["status"] - command: ['zenml'] - env: - {{- if .Values.zenml.debug }} - - name: ZENML_LOGGING_VERBOSITY - value: "DEBUG" - {{- end }} - - name: ZENML_ANALYTICS_OPT_IN - value: "False" - - name: ZENML_DEFAULT_PROJECT_NAME - value: {{ .Values.zenml.defaultProject | quote }} - - name: ZENML_DEFAULT_USER_NAME - value: {{ .Values.zenml.defaultUsername | quote }} - {{- if .Values.zenml.database.url }} - - name: ZENML_STORE_TYPE - value: sql - - name: ZENML_STORE_SSL_VERIFY_SERVER_CERT - value: {{ .Values.zenml.database.sslVerifyServerCert | default "false" | quote }} - {{- end }} - {{- if .Values.zenml.secretsStore.enabled }} - - name: ZENML_SECRETS_STORE_TYPE - value: {{ .Values.zenml.secretsStore.type | quote }} - {{- if eq .Values.zenml.secretsStore.type "aws" }} - - name: ZENML_SECRETS_STORE_REGION_NAME - value: {{ .Values.zenml.secretsStore.aws.region_name | quote }} - - name: ZENML_SECRETS_STORE_SECRET_LIST_REFRESH_TIMEOUT - value: {{ .Values.zenml.secretsStore.aws.secret_list_refresh_timeout | quote }} - {{- else if eq .Values.zenml.secretsStore.type "gcp" }} - - name: ZENML_SECRETS_STORE_PROJECT_ID - value: {{ .Values.zenml.secretsStore.gcp.project_id | quote }} - {{- if .Values.zenml.secretsStore.gcp.google_application_credentials }} - - name: GOOGLE_APPLICATION_CREDENTIALS - value: /gcp-credentials/credentials.json - {{- end }} - {{- else if eq .Values.zenml.secretsStore.type "azure" }} - - name: ZENML_SECRETS_STORE_KEY_VAULT_NAME - value: {{ .Values.zenml.secretsStore.azure.key_vault_name | quote }} - {{- else if eq .Values.zenml.secretsStore.type "hashicorp" }} - - name: ZENML_SECRETS_STORE_VAULT_ADDR - value: {{ .Values.zenml.secretsStore.hashicorp.vault_addr | quote }} - {{- if .Values.zenml.secretsStore.hashicorp.vault_namespace }} - - name: ZENML_SECRETS_STORE_VAULT_NAMESPACE - value: {{ .Values.zenml.secretsStore.hashicorp.vault_namespace | quote }} - {{- end }} - {{- if .Values.zenml.secretsStore.hashicorp.max_versions }} - - name: ZENML_SECRETS_STORE_MAX_VERSIONS - value: {{ .Values.zenml.secretsStore.hashicorp.max_versions | quote }} - {{- end }} - {{- else if eq .Values.zenml.secretsStore.type "custom" }} - - name: ZENML_SECRETS_STORE_CLASS_PATH - value: {{ .Values.zenml.secretsStore.custom.class_path | quote }} - {{- end }} - {{- else }} - - name: ZENML_SECRETS_STORE_TYPE - value: none - {{- end }} - {{- if .Values.zenml.environment }} - {{- range $key, $value := .Values.zenml.environment }} - - name: {{ $key }} - value: {{ $value | quote }} - {{- end }} - {{- end }} - envFrom: - - secretRef: - name: {{ include "zenml.fullname" . }} - {{- if and (eq .Values.zenml.secretsStore.type "gcp") .Values.zenml.secretsStore.gcp.google_application_credentials }} - volumeMounts: - - name: gcp-credentials - mountPath: /gcp-credentials - readOnly: true - {{- end }} - {{- end }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.zenml.image.repository }}:{{ .Values.zenml.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.zenml.image.pullPolicy }} - env: - {{- if .Values.zenml.debug }} - - name: ZENML_LOGGING_VERBOSITY - value: "DEBUG" - {{- end }} - {{- if .Values.zenml.analyticsOptIn }} - - name: ZENML_ANALYTICS_OPT_IN - value: "True" - {{- else if not .Values.zenml.analyticsOptIn }} - - name: ZENML_ANALYTICS_OPT_IN - value: "False" - {{- end }} - - name: ZENML_AUTH_TYPE - value: {{ .Values.zenml.authType | quote }} - {{- if .Values.zenml.rootUrlPath }} - - name: ZENML_SERVER_ROOT_URL_PATH - value: {{ .Values.zenml.rootUrlPath | quote }} - {{- end }} - - name: ZENML_DEFAULT_PROJECT_NAME - value: {{ .Values.zenml.defaultProject | quote }} - - name: ZENML_DEFAULT_USER_NAME - value: {{ .Values.zenml.defaultUsername | quote }} - {{- if .Values.zenml.enableImplicitAuthMethods }} - - name: ZENML_ENABLE_IMPLICIT_AUTH_METHODS - value: "True" - {{- end }} - {{- if .Values.zenml.database.url }} - - name: ZENML_STORE_TYPE - value: sql - - name: DISABLE_DATABASE_MIGRATION - value: "True" - - name: ZENML_STORE_SSL_VERIFY_SERVER_CERT - value: {{ .Values.zenml.database.sslVerifyServerCert | default "false" | quote }} - {{- end }} - {{- if .Values.zenml.secretsStore.enabled }} - - name: ZENML_SECRETS_STORE_TYPE - value: {{ .Values.zenml.secretsStore.type | quote }} - {{- if eq .Values.zenml.secretsStore.type "aws" }} - - name: ZENML_SECRETS_STORE_REGION_NAME - value: {{ .Values.zenml.secretsStore.aws.region_name | quote }} - - name: ZENML_SECRETS_STORE_SECRET_LIST_REFRESH_TIMEOUT - value: {{ .Values.zenml.secretsStore.aws.secret_list_refresh_timeout | quote }} - {{- else if eq .Values.zenml.secretsStore.type "gcp" }} - - name: ZENML_SECRETS_STORE_PROJECT_ID - value: {{ .Values.zenml.secretsStore.gcp.project_id | quote }} - {{- if .Values.zenml.secretsStore.gcp.google_application_credentials }} - - name: GOOGLE_APPLICATION_CREDENTIALS - value: /gcp-credentials/credentials.json - {{- end }} - {{- else if eq .Values.zenml.secretsStore.type "azure" }} - - name: ZENML_SECRETS_STORE_KEY_VAULT_NAME - value: {{ .Values.zenml.secretsStore.azure.key_vault_name | quote }} - {{- else if eq .Values.zenml.secretsStore.type "hashicorp" }} - - name: ZENML_SECRETS_STORE_VAULT_ADDR - value: {{ .Values.zenml.secretsStore.hashicorp.vault_addr | quote }} - {{- if .Values.zenml.secretsStore.hashicorp.vault_namespace }} - - name: ZENML_SECRETS_STORE_VAULT_NAMESPACE - value: {{ .Values.zenml.secretsStore.hashicorp.vault_namespace | quote }} - {{- end }} - {{- if .Values.zenml.secretsStore.hashicorp.max_versions }} - - name: ZENML_SECRETS_STORE_MAX_VERSIONS - value: {{ .Values.zenml.secretsStore.hashicorp.max_versions | quote }} - {{- end }} - {{- else if eq .Values.zenml.secretsStore.type "custom" }} - - name: ZENML_SECRETS_STORE_CLASS_PATH - value: {{ .Values.zenml.secretsStore.custom.class_path | quote }} - {{- end }} - {{- else }} - - name: ZENML_SECRETS_STORE_TYPE - value: none - {{- end }} - - name: ZENML_SERVER_DEPLOYMENT_TYPE - value: {{ .Values.zenml.deploymentType | default "kubernetes" }} - {{- if .Values.zenml.environment }} - {{- range $key, $value := .Values.zenml.environment }} - - name: {{ $key }} - value: {{ $value | quote }} - {{- end }} - {{- end }} - envFrom: - - secretRef: - name: {{ include "zenml.fullname" . }} - {{- if and (eq .Values.zenml.secretsStore.type "gcp") .Values.zenml.secretsStore.gcp.google_application_credentials }} - volumeMounts: - - name: gcp-credentials - mountPath: /gcp-credentials - readOnly: true - {{- end }} - ports: - - name: http - containerPort: 8080 - protocol: TCP - livenessProbe: - httpGet: - path: /health - port: http - readinessProbe: - httpGet: - path: /health - port: http - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/server-ingress.yaml b/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/server-ingress.yaml deleted file mode 100644 index d2e0423e..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/server-ingress.yaml +++ /dev/null @@ -1,59 +0,0 @@ -{{- if .Values.zenml.ingress.enabled -}} -{{- $fullName := include "zenml.fullname" . -}} -{{- $svcPort := .Values.zenml.service.port -}} -{{- if and .Values.zenml.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.zenml.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.zenml.ingress.annotations "kubernetes.io/ingress.class" .Values.zenml.ingress.className}} - {{- end }} -{{- end }} -{{- if and $.Values.zenml.ingress.tls.enabled (eq .Values.zenml.ingress.className "nginx") }} - {{- $_ := set .Values.zenml.ingress.annotations "nginx.ingress.kubernetes.io/ssl-redirect" "true"}} -{{- end }} - -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "zenml.labels" . | nindent 4 }} - {{- with .Values.zenml.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.zenml.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.zenml.ingress.className }} - {{- end }} - {{- if .Values.zenml.ingress.tls.enabled }} - tls: - - hosts: - - {{ .Values.zenml.ingress.host | quote }} - secretName: {{ .Values.zenml.ingress.tls.secretName }} - {{- end }} - rules: - - http: - paths: - - path: {{ .Values.zenml.ingress.path }} - {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} - pathType: Prefix - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- if .Values.zenml.ingress.host }} - host: {{ .Values.zenml.ingress.host | quote }} - {{- end }} -{{- end }} diff --git a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/server-secret.yaml b/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/server-secret.yaml deleted file mode 100644 index 45f8fd11..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/server-secret.yaml +++ /dev/null @@ -1,70 +0,0 @@ -apiVersion: v1 -kind: Secret -type: Opaque -metadata: - name: {{ include "zenml.fullname" . }} - labels: - {{- include "zenml.labels" . | nindent 4 }} -data: - ZENML_DEFAULT_USER_PASSWORD: {{ .Values.zenml.defaultPassword | b64enc | quote }} - {{- if .Values.zenml.jwtSecretKey }} - ZENML_JWT_SECRET_KEY: {{ .Values.zenml.jwtSecretKey | b64enc | quote }} - {{- else if .Release.IsInstall }} - ZENML_JWT_SECRET_KEY: {{ randAlphaNum 32 | b64enc | quote }} - {{- else }} - ZENML_JWT_SECRET_KEY: {{ (lookup "v1" "Secret" .Release.Namespace (include "zenml.fullname" .)).data.ZENML_JWT_SECRET_KEY | default (randAlphaNum 32 | b64enc | quote) }} - {{- end }} - {{- if .Values.zenml.database.url }} - ZENML_STORE_URL: {{ .Values.zenml.database.url | b64enc | quote }} - {{- if .Values.zenml.database.sslCa }} - ZENML_STORE_SSL_CA: {{ .Files.Get .Values.zenml.database.sslCa | b64enc }} - {{- end }} - {{- if .Values.zenml.database.sslCert }} - ZENML_STORE_SSL_CERT: {{ .Files.Get .Values.zenml.database.sslCert | b64enc }} - {{- end }} - {{- if .Values.zenml.database.sslKey }} - ZENML_STORE_SSL_KEY: {{ .Files.Get .Values.zenml.database.sslKey | b64enc }} - {{- end }} - {{- end }} - {{- if .Values.zenml.secretsStore.enabled }} - {{- if eq .Values.zenml.secretsStore.type "sql" }} - {{- if .Values.zenml.secretsStore.sql.encryptionKey }} - ZENML_SECRETS_STORE_ENCRYPTION_KEY: {{ .Values.zenml.secretsStore.sql.encryptionKey | b64enc | quote }} - {{- else if .Values.zenml.secretsStore.encryptionKey }} - ZENML_SECRETS_STORE_ENCRYPTION_KEY: {{ .Values.zenml.secretsStore.encryptionKey | b64enc | quote }} - {{- end }} - {{- else if eq .Values.zenml.secretsStore.type "aws" }} - {{- if .Values.zenml.secretsStore.aws.aws_access_key_id }} - ZENML_SECRETS_STORE_AWS_ACCESS_KEY_ID: {{ .Values.zenml.secretsStore.aws.aws_access_key_id | b64enc | quote }} - {{- end }} - {{- if .Values.zenml.secretsStore.aws.aws_secret_access_key }} - ZENML_SECRETS_STORE_AWS_SECRET_ACCESS_KEY: {{ .Values.zenml.secretsStore.aws.aws_secret_access_key | b64enc | quote }} - {{- end }} - {{- if .Values.zenml.secretsStore.aws.aws_session_token }} - ZENML_SECRETS_STORE_AWS_SESSION_TOKEN: {{ .Values.zenml.secretsStore.aws.aws_session_token | b64enc | quote }} - {{- end }} - {{- else if eq .Values.zenml.secretsStore.type "azure" }} - {{- if .Values.zenml.secretsStore.azure.azure_client_id }} - ZENML_SECRETS_STORE_AZURE_CLIENT_ID: {{ .Values.zenml.secretsStore.azure.azure_client_id | b64enc | quote }} - {{- end }} - {{- if .Values.zenml.secretsStore.azure.azure_client_secret }} - ZENML_SECRETS_STORE_AZURE_CLIENT_SECRET: {{ .Values.zenml.secretsStore.azure.azure_client_secret | b64enc | quote }} - {{- end }} - {{- if .Values.zenml.secretsStore.azure.azure_tenant_id }} - ZENML_SECRETS_STORE_AZURE_TENANT_ID: {{ .Values.zenml.secretsStore.azure.azure_tenant_id | b64enc | quote }} - {{- end }} - {{- else if eq .Values.zenml.secretsStore.type "gcp" }} - {{- if .Values.zenml.secretsStore.gcp.google_application_credentials }} - GOOGLE_APPLICATION_CREDENTIALS_FILE: {{ .Files.Get .Values.zenml.secretsStore.gcp.google_application_credentials | b64enc | quote }} - {{- end }} - {{- else if eq .Values.zenml.secretsStore.type "hashicorp" }} - {{- if .Values.zenml.secretsStore.hashicorp.vault_token }} - ZENML_SECRETS_STORE_VAULT_TOKEN: {{ .Values.zenml.secretsStore.hashicorp.vault_token | b64enc | quote }} - {{- end }} - {{- end }} - {{- end }} - {{- if .Values.zenml.environment }} - {{- range $key, $value := .Values.zenml.environment }} - {{ $key }}: {{ $value | b64enc | quote }} - {{- end }} - {{- end }} diff --git a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/server-service.yaml b/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/server-service.yaml deleted file mode 100644 index 74d00f3a..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/server-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "zenml.fullname" . }} - labels: - {{- include "zenml.labels" . | nindent 4 }} -spec: - type: {{ .Values.zenml.service.type }} - ports: - - port: {{ .Values.zenml.service.port }} - targetPort: 8080 - protocol: TCP - name: http - selector: - {{- include "zenml.selectorLabels" . | nindent 4 }} diff --git a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/serviceaccount.yaml b/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/serviceaccount.yaml deleted file mode 100644 index 79eacbc8..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/serviceaccount.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "zenml.serviceAccountName" . }} - labels: - {{- include "zenml.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/tests/test-connection.yaml b/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/tests/test-connection.yaml deleted file mode 100644 index 1ff5a91f..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "zenml.fullname" . }}-test-connection" - labels: - {{- include "zenml.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "zenml.fullname" . }}:{{ .Values.zenml.service.port }}'] - restartPolicy: Never diff --git a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/values.yaml b/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/values.yaml deleted file mode 100644 index e03a5cd7..00000000 --- a/src/matcha_ml/infrastructure/default/zen_server/zenml_helm/values.yaml +++ /dev/null @@ -1,326 +0,0 @@ -# Default values for zenml. - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - - -# ZenML server related options. -zenml: - - replicaCount: 1 - - image: - repository: zenmldocker/zenml-server - pullPolicy: Always - # Overrides the image tag whose default is the chart appVersion. - tag: - - debug: true - - # Flag to enable/disable the tracking process of the analytics - analyticsOptIn: true - - # ZenML server deployment type. This field is used for telemetry purposes. - # Example values are "local", "kubernetes", "aws", "gcp", "azure". - deploymentType: - - # The ZenML authentication scheme. Use one of: - # - # NO_AUTH - No authentication - # HTTP_BASIC - HTTP Basic authentication - # OAUTH2_PASSWORD_BEARER - OAuth2 password bearer with JWT tokens - authType: OAUTH2_PASSWORD_BEARER - - # The secret key used to sign JWT tokens. Only relevant if the - # OAUTH2_PASSWORD_BEARER authentication scheme is used. This should be set to - # a random string with a recommended length of at least 32 characters, e.g.: - # - # ```python - # from secrets import token_hex - # token_hex(32) - # ``` - # - # or: - # - # ```shell - # openssl rand -hex 32 - # ``` - # - # If not explicitly set, a random key will be generated when the helm - # chart is installed and reused for all subsequent upgrades. - jwtSecretKey: - - # The root URL path to use when behind a proxy. This is useful when the - # `rewrite-target` annotation is used in the ingress controller, e.g.: - # - # ```yaml - # rootUrlPath: /zenml - # - # ingress: - # enabled: true - # className: "nginx" - # annotations: - # nginx.ingress.kubernetes.io/rewrite-target: /$1 - # host: - # path: /zenml/?(.*) - # ``` - rootUrlPath: - - defaultProject: default - defaultUsername: default - # Use your own password here - defaultPassword: zenml - - # Implicit authentication methods featured by service connectors that support - # them are disabled by default, for security reasons. This is because they - # allow users to authenticate to the cloud provider where ZenML is running - # without having to provide any credentials. - enableImplicitAuthMethods: false - - # MySQL database configuration. If not set, a local sqlite database will be - # used, which will not be persisted across pod restarts. - # NOTE: the certificate files need to be copied in the helm chart folder and - # the paths configured here need to be relative to the root of the helm chart. - database: {} - # url: "mysql://admin:password@zenml-mysql:3306/database" - # sslCa: /path/to/ca.pem - # sslCert: /path/to/client-cert.pem - # sslKey: /path/to/client-key.pem - # sslVerifyServerCert: True - - - # Secrets store settings. This is used to store centralized secrets. - secretsStore: - - # Set to false to disable the secrets store. - enabled: true - - # The type of secrets store to use. Use one of: - # - # sql - Use the same SQL database as the ZenML server - # aws - Use the AWS Secrets Manager as a secrets store - # gcp - Use the GCP Secrets Manager as a secrets store - # azure - Use the Azure Key Vault as a secrets store - # hashicorp - Use the HashiCorp Vault as a secrets store - # custom - Use a custom secrets store implementation (needs a custom - # ZenML server image with the custom secrets store implementation - # installed) - # - # Depending on the type, additional configuration options may be required - # under the respective sections. - # - type: sql - - # SQL secrets store configuration. Only relevant if the `sql` secrets store - # type is configured. - sql: - - # The secret key used to encrypt secrets in the SQL database. Only relevant - # if the SQL secrets store type is used. This should be set to a random - # string with a recommended length of at least 32 characters, e.g.: - # - # ```python - # from secrets import token_hex - # token_hex(32) - # ``` - # - # or: - # - # ```shell - # openssl rand -hex 32 - # ``` - # - # If not set, database secret encryption will be disabled. - # - # IMPORTANT: If you configure encryption for your SQL database secrets - # store, you should keep this value somewhere safe and secure, as it will be - # required to decrypt the secrets in the database. If you lose the - # encryption key, you will not be able to decrypt the secrets in the - # database and will have to reset them. You should not change this value - # after you have already configured encryption for your SQL database - # secrets store. - encryptionKey: - - # AWS secrets store configuration. Only relevant if the `aws` secrets store - # type is configured. - aws: - - # The AWS region to use. This must be set to the region where the AWS - # Secrets Manager service that you want to use is located. - region_name: us-east-1 - - # The AWS credentials to use to authenticate with the AWS Secrets - # Manager instance. You can omit these if you are running the ZenML server - # in an AWS EKS cluster that has an IAM role attached to it that has - # permissions to access the AWS Secrets Manager instance. - # NOTE: setting this is the same as setting the AWS_ACCESS_KEY_ID, - # AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN environment variables - # in the zenml.secretEnvironment variable. - aws_access_key_id: - aws_secret_access_key: - aws_session_token: - - # The AWS Secrets Manager has a known issue where it does not immediately - # reflect new and updated secrets in the `list_secrets` results. To work - # around this issue, you can set this value to a non-zero value to - # get the ZenML server to wait after creating or updating an AWS secret - # until the changes are reflected in the secrets returned by - # `list_secrets` or the number of seconds specified by this value has - # elapsed. Should not be set to a high value as it may cause thread - # starvation in the ZenML server on high load. - secret_list_refresh_timeout: 0 - - - # GCP secrets store configuration. Only relevant if the `gcp` secrets store - # type is configured. - gcp: - - # The GCP project ID to use. This must be set to the project ID where the - # GCP Secrets Manager service that you want to use is located. - project_id: my-gcp-project - - # Path to the GCP credentials file to use to authenticate with the GCP Secrets - # Manager instance. You can omit this if you are running the ZenML server - # in a GCP GKE cluster that uses workload identity to authenticate with - # GCP services without the need for credentials. - # NOTE: the credentials file needs to be copied in the helm chart folder - # and the path configured here needs to be relative to the root of the - # helm chart. - google_application_credentials: - - # AWS Key Vault secrets store configuration. Only relevant if the `azure` - # secrets store type is configured. - azure: - - # The name of the Azure Key Vault. This must be set to point to the Azure - # Key Vault instance that you want to use. - key_vault_name: - - # The Azure application service principal credentials to use to - # authenticate with the Azure Key Vault API. You can omit these if you are - # running the ZenML server hosted in Azure and are using a managed - # identity to access the Azure Key Vault service. - # NOTE: setting this is the same as setting the AZURE_CLIENT_ID, - # AZURE_CLIENT_SECRET, and AZURE_TENANT_ID environment variables - # in the zenml.secretEnvironment variable. - azure_client_id: - azure_client_secret: - azure_tenant_id: - - # HashiCorp Vault secrets store configuration. Only relevant if the `hashicorp` - # secrets store type is configured - hashicorp: - - # The url of the HashiCorp Vault server - vault_addr: https://vault.example.com - # The token used to authenticate with the Vault server - vault_token: - # The Vault Enterprise namespace. Not required for Vault OSS. - vault_namespace: - # The maximum number of secret versions to keep. If not set, the default - # value of 1 will be used (only the latest version will be kept). - max_versions: - - # Custom secrets store configuration. Only relevant if the `custom` secrets - # store type is configured. - custom: - - # The class path of the custom secrets store implementation. This should - # point to a full Python class that extends the - # `zenml.zen_stores.secrets_stores.base_secrets_store.BaseSecretsStore` - # base class. The class should be importable from the container image - # that you are using for the ZenML server. - # - # Any additional configuration options for the custom secrets store - # implementation should be passed through the `environment` and the - # `secretEnvironment` variables and using the `ZENML_SECRETS_STORE_` - # environment variable naming convention. For example, if the custom - # secrets store implementation expects an `aws_access_key_id` option, you - # should set the `ZENML_SECRETS_STORE_AWS_ACCESS_KEY_ID` environment - # variable in the `zenml.secretEnvironment` variable. - class_path: my.custom.secrets.store.MyCustomSecretsStore - - # Extra environment variables to set in the ZenML server container. - environment: {} - - # Extra environment variables to set in the ZenML server container that - # should be kept secret. These will be set as Kubernetes secrets and - # mounted as environment variables in the ZenML server container. - secretEnvironment: {} - - service: - type: LoadBalancer # changed from ClusterIP - port: 80 - - ingress: - enabled: false # changed from true - className: "nginx" - annotations: - nginx.ingress.kubernetes.io/ssl-redirect: "true" - # nginx.ingress.kubernetes.io/rewrite-target: /$1 - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - # cert-manager.io/cluster-issuer: "letsencrypt" - - # hint: you can use a service like nip.io to get a wildcard DNS for your - # ingress IP address. For example, if your ingress IP is 192.168.0.1, you - # can use a host name like zenml.192.168.0.1.nip.io. This allows you to - # reuse the same ingress for multiple deployments and/or services. - host: - path: / - tls: - enabled: false - # NOTE: if enabled, this will generate self-signed certificates during - # installation. This also requires that the ingress host be set to the - # domain name or IP address used to access the ZenML server from outside - # the cluster. - generateCerts: false - secretName: zenml-tls-certs - - -serviceAccount: - # Specifies whether a service account should be created - create: true - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "zenml" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: - runAsNonRoot: true - runAsUser: 1000 - # capabilities: - # drop: - # - ALL - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/src/matcha_ml/infrastructure/default/zenml_storage/README.md b/src/matcha_ml/infrastructure/default/zenml_storage/README.md deleted file mode 100644 index 3787ccea..00000000 --- a/src/matcha_ml/infrastructure/default/zenml_storage/README.md +++ /dev/null @@ -1,45 +0,0 @@ -## Requirements - -No requirements. - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | n/a | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_role_assignment.zenmlstorage](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment) | resource | -| [azurerm_storage_account.zenmlaccount](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_account) | resource | -| [azurerm_storage_container.zenmlstoragecontainer](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_container) | resource | -| [azurerm_storage_account.zenmlaccount](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/storage_account) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [aks\_principal\_id](#input\_aks\_principal\_id) | Principal id for aks cluster | `string` | n/a | yes | -| [location](#input\_location) | The Azure Region in which this resources should be created. | `string` | n/a | yes | -| [prefix](#input\_prefix) | A prefix used for all resources | `string` | n/a | yes | -| [resource\_group\_name](#input\_resource\_group\_name) | The resource group name which is used to create the resource group | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [zenml\_blobstorage\_container\_path](#output\_zenml\_blobstorage\_container\_path) | The Azure Blob Storage Container path for storing zenml artifacts | -| [zenml\_primary\_access\_key](#output\_zenml\_primary\_access\_key) | ZenML Azure Storage Account - Primary access key | -| [zenml\_primary\_blob\_connection\_string](#output\_zenml\_primary\_blob\_connection\_string) | ZenML Azure Storage Account - Primary Blob service connection string | -| [zenml\_primary\_connection\_string](#output\_zenml\_primary\_connection\_string) | ZenML Azure Storage Account - Primary connection string | -| [zenml\_secondary\_access\_key](#output\_zenml\_secondary\_access\_key) | ZenML Azure Storage Account - Secondary access key | -| [zenml\_secondary\_blob\_connection\_string](#output\_zenml\_secondary\_blob\_connection\_string) | ZenML Azure Storage Account - Secondary Blob service connection string | -| [zenml\_secondary\_connection\_string](#output\_zenml\_secondary\_connection\_string) | ZenML Azure Storage Account - Secondary connection string | -| [zenml\_storage\_account\_name](#output\_zenml\_storage\_account\_name) | The name of the Azure Storage Account used to store ZenML artifacts. | -| [zenml\_storage\_container\_name](#output\_zenml\_storage\_container\_name) | The name of the Azure Storage container used to store ZenML artifacts. | diff --git a/src/matcha_ml/infrastructure/default/zenml_storage/main.tf b/src/matcha_ml/infrastructure/default/zenml_storage/main.tf deleted file mode 100644 index 8a37cb74..00000000 --- a/src/matcha_ml/infrastructure/default/zenml_storage/main.tf +++ /dev/null @@ -1,31 +0,0 @@ -# Reference: https://github.com/hashicorp/terraform-provider-azurerm/tree/main/examples/storage/storage-container - -# create a storage account -resource "azurerm_storage_account" "zenmlaccount" { - name = "${var.prefix}zenmlacc" - resource_group_name = var.resource_group_name - location = var.location - - account_tier = "Standard" - account_kind = "StorageV2" - account_replication_type = "LRS" -} - -# create a storage container inside created storage account -resource "azurerm_storage_container" "zenmlstoragecontainer" { - name = "${var.prefix}artifactstore" - storage_account_name = azurerm_storage_account.zenmlaccount.name - container_access_type = "private" -} - - -data "azurerm_storage_account" "zenmlaccount" { - name = azurerm_storage_account.zenmlaccount.name - resource_group_name = var.resource_group_name -} - -resource "azurerm_role_assignment" "zenmlstorage" { - scope = azurerm_storage_account.zenmlaccount.id - role_definition_name = "Contributor" - principal_id = var.aks_principal_id -} diff --git a/src/matcha_ml/infrastructure/default/zenml_storage/output.tf b/src/matcha_ml/infrastructure/default/zenml_storage/output.tf deleted file mode 100644 index 84226fbf..00000000 --- a/src/matcha_ml/infrastructure/default/zenml_storage/output.tf +++ /dev/null @@ -1,50 +0,0 @@ -output "zenml_storage_container_name" { - description = "The name of the Azure Storage container used to store ZenML artifacts." - value = azurerm_storage_container.zenmlstoragecontainer.name -} - -output "zenml_blobstorage_container_path" { - description = "The Azure Blob Storage Container path for storing zenml artifacts" - value = "az://${azurerm_storage_container.zenmlstoragecontainer.name}" -} - -output "zenml_storage_account_name" { - description = "The name of the Azure Storage Account used to store ZenML artifacts." - value = azurerm_storage_account.zenmlaccount.name -} - -output "zenml_primary_access_key" { - description = "ZenML Azure Storage Account - Primary access key" - value = azurerm_storage_account.zenmlaccount.primary_access_key - sensitive = true -} - -output "zenml_secondary_access_key" { - description = "ZenML Azure Storage Account - Secondary access key" - value = azurerm_storage_account.zenmlaccount.secondary_access_key - sensitive = true -} - -output "zenml_primary_connection_string" { - description = "ZenML Azure Storage Account - Primary connection string" - value = azurerm_storage_account.zenmlaccount.primary_connection_string - sensitive = true -} - -output "zenml_secondary_connection_string" { - description = "ZenML Azure Storage Account - Secondary connection string" - value = azurerm_storage_account.zenmlaccount.secondary_connection_string - sensitive = true -} - -output "zenml_primary_blob_connection_string" { - description = "ZenML Azure Storage Account - Primary Blob service connection string" - value = azurerm_storage_account.zenmlaccount.primary_blob_connection_string - sensitive = true -} - -output "zenml_secondary_blob_connection_string" { - description = "ZenML Azure Storage Account - Secondary Blob service connection string" - value = azurerm_storage_account.zenmlaccount.secondary_blob_connection_string - sensitive = true -} diff --git a/src/matcha_ml/infrastructure/default/zenml_storage/variables.tf b/src/matcha_ml/infrastructure/default/zenml_storage/variables.tf deleted file mode 100644 index c41ea739..00000000 --- a/src/matcha_ml/infrastructure/default/zenml_storage/variables.tf +++ /dev/null @@ -1,19 +0,0 @@ -variable "prefix" { - description = "A prefix used for all resources" - type = string -} - -variable "resource_group_name" { - description = "The resource group name which is used to create the resource group" - type = string -} - -variable "location" { - description = "The Azure Region in which this resources should be created." - type = string -} - -variable "aks_principal_id" { - description = "Principal id for aks cluster" - type = string -} diff --git a/src/matcha_ml/infrastructure/llm/.gitignore b/src/matcha_ml/infrastructure/llm/.gitignore deleted file mode 100644 index 6304eb3c..00000000 --- a/src/matcha_ml/infrastructure/llm/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -# Local .terraform directories -**/.terraform/* - -# .tfstate files -*.tfstate -*.tfstate.* - -# Crash log files -crash.log -crash.*.log - -# Exclude all .tfvars files, which are likely to contain sensitive data, such as -# password, private keys, and other secrets. These should not be part of version -# control as they are data points which are potentially sensitive and subject -# to change depending on the environment. -*.tfvars -*.tfvars.json - -# Ignore override files as they are usually used to override resources locally and so -# are not checked in -override.tf -override.tf.json -*_override.tf -*_override.tf.json - -# Include override files you do wish to add to version control using negated pattern -# !example_override.tf - -# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan -# example: *tfplan* - -# Ignore CLI configuration files -.terraformrc -terraform.rc diff --git a/src/matcha_ml/infrastructure/llm/.terraform.lock.hcl b/src/matcha_ml/infrastructure/llm/.terraform.lock.hcl deleted file mode 100644 index 81956fc8..00000000 --- a/src/matcha_ml/infrastructure/llm/.terraform.lock.hcl +++ /dev/null @@ -1,174 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/gavinbunney/kubectl" { - version = "1.14.0" - constraints = "1.14.0" - hashes = [ - "h1:mX2AOFIMIxJmW5kM8DT51gloIOKCr9iT6W8yodnUyfs=", - "zh:0350f3122ff711984bbc36f6093c1fe19043173fad5a904bce27f86afe3cc858", - "zh:07ca36c7aa7533e8325b38232c77c04d6ef1081cb0bac9d56e8ccd51f12f2030", - "zh:0c351afd91d9e994a71fe64bbd1662d0024006b3493bb61d46c23ea3e42a7cf5", - "zh:39f1a0aa1d589a7e815b62b5aa11041040903b061672c4cfc7de38622866cbc4", - "zh:428d3a321043b78e23c91a8d641f2d08d6b97f74c195c654f04d2c455e017de5", - "zh:4baf5b1de2dfe9968cc0f57fd4be5a741deb5b34ee0989519267697af5f3eee5", - "zh:6131a927f9dffa014ab5ca5364ac965fe9b19830d2bbf916a5b2865b956fdfcf", - "zh:c62e0c9fd052cbf68c5c2612af4f6408c61c7e37b615dc347918d2442dd05e93", - "zh:f0beffd7ce78f49ead612e4b1aefb7cb6a461d040428f514f4f9cc4e5698ac65", - ] -} - -provider "registry.terraform.io/hashicorp/azurerm" { - version = "3.48.0" - constraints = ">= 3.16.0, 3.48.0" - hashes = [ - "h1:RSUCtxgd6hD9J11YZGOA4yffeu5P8YmQnP5SRNl6+d8=", - "zh:01bd328009f2803ebc18ac27535e7d1548c735bb5bd02460e471acc835e5dd19", - "zh:070b0bdd5ff27232eec7ef9128fc9bd17e6bdae503ddcc450c944449f3a8d216", - "zh:0a0a0e81f7ab8757aa83876fffbc57328843664900923d8b3c577e7596884726", - "zh:30994e6988c92d90a71b88bff0bbc4fa8f3b48034d18eb068bd5281888304579", - "zh:54dfdbae2bf79f8104ae73e5c6cd94a69d1e6de4345322f6c8eb6affb04a66c5", - "zh:55ba99b32346237435d7212b3f2521952ee67934dd5ee942a51642357b0ad4fc", - "zh:881bc29857511f7eedc3d359a0f2dcca6b526a48f6d54887cafdb25647abd1fd", - "zh:892bfa34b95b6b4b2ced24dc2989edf512b193bd9e5cf121ae47bb9d9e6d0b94", - "zh:c7d2c778b0f251990874ee859b9093fbb4beb9b3968858137da6c5167c797ea9", - "zh:db558aa70b163af44a73fcb1306d0e4dcafcafe585bedb90ef69f063fa9766a3", - "zh:e0ae252b7bea560e05fde09fe632f012430fb91ff9063fce560d997ecdb1cf75", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - ] -} - -provider "registry.terraform.io/hashicorp/external" { - version = "2.3.1" - hashes = [ - "h1:9rJggijNdRdFk//ViQPGZdK0xu9XU/9qBDijNsZJMg0=", - "zh:001e2886dc81fc98cf17cf34c0d53cb2dae1e869464792576e11b0f34ee92f54", - "zh:2eeac58dd75b1abdf91945ac4284c9ccb2bfb17fa9bdb5f5d408148ff553b3ee", - "zh:2fc39079ba61411a737df2908942e6970cb67ed2f4fb19090cd44ce2082903dd", - "zh:472a71c624952cff7aa98a7b967f6c7bb53153dbd2b8f356ceb286e6743bb4e2", - "zh:4cff06d31272aac8bc35e9b7faec42cf4554cbcbae1092eaab6ab7f643c215d9", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:7ed16ccd2049fa089616b98c0bd57219f407958f318f3c697843e2397ddf70df", - "zh:842696362c92bf2645eb85c739410fd51376be6c488733efae44f4ce688da50e", - "zh:8985129f2eccfd7f1841ce06f3bf2bbede6352ec9e9f926fbaa6b1a05313b326", - "zh:a5f0602d8ec991a5411ef42f872aa90f6347e93886ce67905c53cfea37278e05", - "zh:bf4ab82cbe5256dcef16949973bf6aa1a98c2c73a98d6a44ee7bc40809d002b8", - "zh:e70770be62aa70198fa899526d671643ff99eecf265bf1a50e798fc3480bd417", - ] -} - -provider "registry.terraform.io/hashicorp/helm" { - version = "2.0.3" - constraints = "~> 2.0.1" - hashes = [ - "h1:FRSVqY+1/AUO/j/lVxHHsLudfSA9gDc7Dsu+YxcJSEY=", - "zh:154e0aa489e474e2eeb3de94be7666133faf6fd950712a640425b2bf3a81ee95", - "zh:16a2be6c4b61d0c5205c63816148c7ab0c8f56a75c05e8d897fa4d5cac0c029a", - "zh:189e47bc723f8c29bcfe2c1638d43b8148f614ea86e642f4b50b2acb4b760224", - "zh:3763901d3630213002cb8c70bb24c628cd29738ff6591585250ea8636264abd6", - "zh:4822f85e4700ea049384523d98de0ef7d83549844b13e94bbd544cec05557a9a", - "zh:62c5b87b09e0051bab0b712e3ad465fd53e66f9619dbe76ee23519d1087d8a05", - "zh:a0a6a842b11190dd1841e98bbb74961074e7ffb95984be5cc392df9f532d803e", - "zh:beac4e6806e77447e1018f3404a5fbf782d20d82a0d9b4a31e9bfc7d2bbecab6", - "zh:e1bbaa09bf4f4a91ec7606f84d2e0200a02e7b24d045e8b5daebd87d7a75b7ce", - "zh:ed1e05c50212d4f57435ccdd68cfb98d8395927c316df76d1dd6509566d3aeaa", - "zh:fdc687e16a964bb652ddb670f6832fdead25235eca551796cfed70ec07d94931", - ] -} - -provider "registry.terraform.io/hashicorp/kubernetes" { - version = "2.11.0" - constraints = "~> 2.11.0" - hashes = [ - "h1:T65SZhN/tQgsAsHe/G5PCgpjofi+aTKPZ+nZg6WOJpc=", - "zh:143a19dd0ea3b07fc5e3d9231f3c2d01f92894385c98a67327de74c76c715843", - "zh:1fc757d209e09c3cf7848e4274daa32408c07743698fbed10ee52a4a479b62b6", - "zh:22dfebd0685749c51a8f765d51a1090a259778960ac1cd4f32021a325b2b9b72", - "zh:3039b3b76e870cd8fc404cf75a29c66b171c6ba9b6182e131b6ae2ca648ec7c0", - "zh:3af0a15562fcab4b5684b18802e0239371b2b8ff9197ed069ff4827f795a002b", - "zh:50aaf20336d1296a73315adb66f7687f75bd5c6b1f93a894b95c75cc142810ec", - "zh:682064fabff895ec351860b4fe0321290bbbb17c2a410b62c9bea0039400650e", - "zh:70ac914d5830b3371a2679d8f77cc20c419a6e12925145afae6c977c8eb90934", - "zh:710aa02cccf7b0f3fb50880d6d2a7a8b8c9435248666616844ba71f74648cddc", - "zh:88e418118cd5afbdec4984944c7ab36950bf48e8d3e09e090232e55eecfb470b", - "zh:9cef159377bf23fa331f8724fdc6ce27ad39a217a4bae6df3b1ca408fc643da6", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - ] -} - -provider "registry.terraform.io/hashicorp/local" { - version = "2.1.0" - constraints = "2.1.0" - hashes = [ - "h1:KfieWtVyGWwplSoLIB5usKAUnrIkDQBkWaR5TI+4WYg=", - "zh:0f1ec65101fa35050978d483d6e8916664b7556800348456ff3d09454ac1eae2", - "zh:36e42ac19f5d68467aacf07e6adcf83c7486f2e5b5f4339e9671f68525fc87ab", - "zh:6db9db2a1819e77b1642ec3b5e95042b202aee8151a0256d289f2e141bf3ceb3", - "zh:719dfd97bb9ddce99f7d741260b8ece2682b363735c764cac83303f02386075a", - "zh:7598bb86e0378fd97eaa04638c1a4c75f960f62f69d3662e6d80ffa5a89847fe", - "zh:ad0a188b52517fec9eca393f1e2c9daea362b33ae2eb38a857b6b09949a727c1", - "zh:c46846c8df66a13fee6eff7dc5d528a7f868ae0dcf92d79deaac73cc297ed20c", - "zh:dc1a20a2eec12095d04bf6da5321f535351a594a636912361db20eb2a707ccc4", - "zh:e57ab4771a9d999401f6badd8b018558357d3cbdf3d33cc0c4f83e818ca8e94b", - "zh:ebdcde208072b4b0f8d305ebf2bfdc62c926e0717599dcf8ec2fd8c5845031c3", - "zh:ef34c52b68933bedd0868a13ccfd59ff1c820f299760b3c02e008dc95e2ece91", - ] -} - -provider "registry.terraform.io/hashicorp/null" { - version = "3.2.1" - constraints = "3.2.1" - hashes = [ - "h1:tSj1mL6OQ8ILGqR2mDu7OYYYWf+hoir0pf9KAQ8IzO8=", - "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", - "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", - "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", - "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", - "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", - "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", - "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", - "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", - "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", - "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.1.0" - constraints = "3.1.0" - hashes = [ - "h1:rKYu5ZUbXwrLG1w81k7H3nce/Ys6yAxXhWcbtk36HjY=", - "zh:2bbb3339f0643b5daa07480ef4397bd23a79963cc364cdfbb4e86354cb7725bc", - "zh:3cd456047805bf639fbf2c761b1848880ea703a054f76db51852008b11008626", - "zh:4f251b0eda5bb5e3dc26ea4400dba200018213654b69b4a5f96abee815b4f5ff", - "zh:7011332745ea061e517fe1319bd6c75054a314155cb2c1199a5b01fe1889a7e2", - "zh:738ed82858317ccc246691c8b85995bc125ac3b4143043219bd0437adc56c992", - "zh:7dbe52fac7bb21227acd7529b487511c91f4107db9cc4414f50d04ffc3cab427", - "zh:a3a9251fb15f93e4cfc1789800fc2d7414bbc18944ad4c5c98f466e6477c42bc", - "zh:a543ec1a3a8c20635cf374110bd2f87c07374cf2c50617eee2c669b3ceeeaa9f", - "zh:d9ab41d556a48bd7059f0810cf020500635bfc696c9fc3adab5ea8915c1d886b", - "zh:d9e13427a7d011dbd654e591b0337e6074eef8c3b9bb11b2e39eaaf257044fd7", - "zh:f7605bd1437752114baf601bdf6931debe6dc6bfe3006eb7e9bb9080931dca8a", - ] -} - -provider "registry.terraform.io/loafoe/htpasswd" { - version = "1.0.4" - constraints = "1.0.4" - hashes = [ - "h1:/OCwJ2uB9PfESHNn4bDwdHnMOp8x5D/aNvvUl8XNFA4=", - "zh:1f17ffcb8ab2f19de1242a6980f78334fc81efeaddfa85545435048f54045e4a", - "zh:6265fd9bbb718d55655120044b4969c80aa938ecfb17a0fd7541ff7de8c54e1e", - "zh:79b7a6e3260b084530f6bdaba13536843fa55fc28569965a69cbdcb5d5c208a5", - "zh:827991bd4481b9c0f33a922f5168146d0e68f627c8c71f1c18da27df05386502", - "zh:898a54254123718828d07ca54fba9626f6c706e4849c1d5bfd93d16df4463a6f", - "zh:b42f93565c8e5ab902d12a44dc34efa7207f5a568c7588f957732be3d9cd3997", - "zh:d43a78148ae10aac214c7abef7c131d78b7173d28ab679354ac67c11ff979f8e", - "zh:ddb702db1b27df028dab0364fbd90a1f5d97244e41765a7e66a8afc1a85d8371", - "zh:df22dd80e4639c14ec428d345cdf21851e807890cfe72908759d037cfaed68b7", - "zh:f6c7dfbc72ad83727c1fcfc064adb0362d947b66a2f5ba185742d5668c598c96", - "zh:f7e1feafd63a1987f5e39f9c75ac05dc153ffde2c9dd669847c19ad318bbebe7", - ] -} diff --git a/src/matcha_ml/infrastructure/llm/README.md b/src/matcha_ml/infrastructure/llm/README.md deleted file mode 100644 index 88361d90..00000000 --- a/src/matcha_ml/infrastructure/llm/README.md +++ /dev/null @@ -1,76 +0,0 @@ -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | >= 0.14.8 | -| [azurerm](#requirement\_azurerm) | >=3.16.0 | -| [helm](#requirement\_helm) | ~> 2.0.1 | -| [htpasswd](#requirement\_htpasswd) | 1.0.4 | -| [kubectl](#requirement\_kubectl) | 1.14.0 | -| [kubernetes](#requirement\_kubernetes) | ~> 2.11.0 | -| [local](#requirement\_local) | 2.1.0 | -| [null](#requirement\_null) | 3.2.1 | -| [random](#requirement\_random) | 3.1.0 | - -## Providers - -| Name | Version | -|------|---------| -| [external](#provider\_external) | n/a | -| [null](#provider\_null) | 3.2.1 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [acr](#module\_acr) | ./azure_container_registry | n/a | -| [aks](#module\_aks) | ./aks | n/a | -| [chroma](#module\_chroma) | ./chroma | n/a | -| [data\_version\_control\_storage](#module\_data\_version\_control\_storage) | ./data_version_control_storage | n/a | -| [mlflow](#module\_mlflow) | ./mlflow_module | n/a | -| [resource\_group](#module\_resource\_group) | ./resource_group | n/a | -| [seldon](#module\_seldon) | ./seldon | n/a | -| [storage](#module\_storage) | ./storage | n/a | -| [zenml\_storage](#module\_zenml\_storage) | ./zenml_storage | n/a | -| [zenserver](#module\_zenserver) | ./zen_server | n/a | - -## Resources - -| Name | Type | -|------|------| -| [null_resource.configure_local_kubectl](https://registry.terraform.io/providers/hashicorp/null/3.2.1/docs/resources/resource) | resource | -| [external_external.os](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/external) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [location](#input\_location) | The Azure Region in which all resources should be provisioned | `string` | `"uksouth"` | no | -| [password](#input\_password) | Password for ZenServer | `string` | `"default"` | no | -| [prefix](#input\_prefix) | A prefix used for all resources | `string` | `"christest1"` | no | -| [seldon\_name](#input\_seldon\_name) | Name of the Seldon deployment | `string` | `"seldon"` | no | -| [seldon\_namespace](#input\_seldon\_namespace) | Namespace for Seldon resources | `string` | `"seldon-system"` | no | -| [username](#input\_username) | Username for ZenServer | `string` | `"default"` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| [cloud\_azure\_location](#output\_cloud\_azure\_location) | The Azure location in which the resources are provisioned | -| [cloud\_azure\_prefix](#output\_cloud\_azure\_prefix) | The Azure resource group name prefix | -| [cloud\_azure\_resource\_group\_name](#output\_cloud\_azure\_resource\_group\_name) | Name of the Azure resource group | -| [container\_registry\_azure\_registry\_name](#output\_container\_registry\_azure\_registry\_name) | The name of the Azure Container Registry | -| [container\_registry\_azure\_registry\_url](#output\_container\_registry\_azure\_registry\_url) | The URL for the Azure Container Registry | -| [data\_version\_control\_primary\_connection\_string](#output\_data\_version\_control\_primary\_connection\_string) | The primary connection string for the ZenML Azure Storage Account | -| [data\_version\_control\_storage\_account\_name](#output\_data\_version\_control\_storage\_account\_name) | The name of the storage account for data version control | -| [data\_version\_control\_storage\_container\_name](#output\_data\_version\_control\_storage\_container\_name) | The name of the container used for data version control | -| [experiment\_tracker\_mlflow\_azure\_connection\_string](#output\_experiment\_tracker\_mlflow\_azure\_connection\_string) | The Azure connection string for the MLflow artifact storage | -| [experiment\_tracker\_mlflow\_tracking\_url](#output\_experiment\_tracker\_mlflow\_tracking\_url) | The URL for the MLflow tracking server | -| [model\_deployer\_seldon\_base\_url](#output\_model\_deployer\_seldon\_base\_url) | The base URL for the Seldon API server | -| [model\_deployer\_seldon\_workloads\_namespace](#output\_model\_deployer\_seldon\_workloads\_namespace) | The Kubernetes namespace for Seldon workloads | -| [orchestrator\_aks\_k8s\_context](#output\_orchestrator\_aks\_k8s\_context) | The name of the Kubernetes context used for deployment | -| [pipeline\_zenml\_connection\_string](#output\_pipeline\_zenml\_connection\_string) | The primary connection string for the ZenML Azure Storage Account | -| [pipeline\_zenml\_server\_password](#output\_pipeline\_zenml\_server\_password) | The password for accessing the ZenServer API server | -| [pipeline\_zenml\_server\_url](#output\_pipeline\_zenml\_server\_url) | The URL for the ZenServer API server | -| [pipeline\_zenml\_server\_username](#output\_pipeline\_zenml\_server\_username) | The username for accessing the ZenServer API server | -| [pipeline\_zenml\_storage\_path](#output\_pipeline\_zenml\_storage\_path) | The Azure Blob Storage Container path for storing ZenML artifacts | diff --git a/src/matcha_ml/infrastructure/llm/aks/README.md b/src/matcha_ml/infrastructure/llm/aks/README.md deleted file mode 100644 index 8b7b77bb..00000000 --- a/src/matcha_ml/infrastructure/llm/aks/README.md +++ /dev/null @@ -1,41 +0,0 @@ -## Requirements - -No requirements. - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | n/a | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_kubernetes_cluster.main](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster) | resource | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [location](#input\_location) | The Azure region where the Kubernetes cluster will be created | `string` | n/a | yes | -| [prefix](#input\_prefix) | Prefix to be used for all resources in this module | `string` | n/a | yes | -| [resource\_group\_name](#input\_resource\_group\_name) | The name of the resource group to create the Kubernetes cluster in | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [aks\_cluster\_id](#output\_aks\_cluster\_id) | ID of the created Kubernetes cluster | -| [aks\_cluster\_name](#output\_aks\_cluster\_name) | Name of the created Kubernetes cluster | -| [aks\_object\_id](#output\_aks\_object\_id) | Object ID for the Kubernetes cluster | -| [aks\_principal\_id](#output\_aks\_principal\_id) | Principal ID for the Kubernetes cluster | -| [client\_certificate](#output\_client\_certificate) | Client certificate for accessing the Kubernetes cluster | -| [client\_key](#output\_client\_key) | Client key for accessing the Kubernetes cluster | -| [cluster\_ca\_certificate](#output\_cluster\_ca\_certificate) | Cluster CA certificate for the Kubernetes cluster | -| [host](#output\_host) | Host address for the Kubernetes cluster | -| [kube\_config](#output\_kube\_config) | Raw Kubernetes configuration for the created cluster | diff --git a/src/matcha_ml/infrastructure/llm/aks/main.tf b/src/matcha_ml/infrastructure/llm/aks/main.tf deleted file mode 100644 index 262c24c6..00000000 --- a/src/matcha_ml/infrastructure/llm/aks/main.tf +++ /dev/null @@ -1,19 +0,0 @@ -resource "azurerm_kubernetes_cluster" "main" { - name = "${var.prefix}-k8s" - location = var.location - resource_group_name = var.resource_group_name - dns_prefix = "${var.prefix}-k8s" - - default_node_pool { - name = "default" - vm_size = "Standard_DS3_v2" - - enable_auto_scaling = true - max_count = 3 - min_count = 1 - } - - identity { - type = "SystemAssigned" - } -} diff --git a/src/matcha_ml/infrastructure/llm/aks/output.tf b/src/matcha_ml/infrastructure/llm/aks/output.tf deleted file mode 100644 index de131e60..00000000 --- a/src/matcha_ml/infrastructure/llm/aks/output.tf +++ /dev/null @@ -1,46 +0,0 @@ -output "kube_config" { - description = "Raw Kubernetes configuration for the created cluster" - value = azurerm_kubernetes_cluster.main.kube_config_raw - sensitive = true -} - -output "client_key" { - description = "Client key for accessing the Kubernetes cluster" - value = azurerm_kubernetes_cluster.main.kube_config.0.client_key -} - -output "client_certificate" { - description = "Client certificate for accessing the Kubernetes cluster" - value = azurerm_kubernetes_cluster.main.kube_config.0.client_certificate - sensitive = true -} - -output "cluster_ca_certificate" { - description = "Cluster CA certificate for the Kubernetes cluster" - value = azurerm_kubernetes_cluster.main.kube_config.0.cluster_ca_certificate -} - -output "host" { - description = "Host address for the Kubernetes cluster" - value = azurerm_kubernetes_cluster.main.kube_config.0.host -} - -output "aks_cluster_id" { - description = "ID of the created Kubernetes cluster" - value = azurerm_kubernetes_cluster.main.id -} - -output "aks_cluster_name" { - description = "Name of the created Kubernetes cluster" - value = azurerm_kubernetes_cluster.main.name -} - -output "aks_principal_id" { - description = "Principal ID for the Kubernetes cluster" - value = azurerm_kubernetes_cluster.main.identity[0].principal_id -} - -output "aks_object_id" { - description = "Object ID for the Kubernetes cluster" - value = azurerm_kubernetes_cluster.main.kubelet_identity[0].object_id -} diff --git a/src/matcha_ml/infrastructure/llm/aks/variables.tf b/src/matcha_ml/infrastructure/llm/aks/variables.tf deleted file mode 100644 index f48f6d27..00000000 --- a/src/matcha_ml/infrastructure/llm/aks/variables.tf +++ /dev/null @@ -1,14 +0,0 @@ -variable "prefix" { - description = "Prefix to be used for all resources in this module" - type = string -} - -variable "location" { - description = "The Azure region where the Kubernetes cluster will be created" - type = string -} - -variable "resource_group_name" { - description = "The name of the resource group to create the Kubernetes cluster in" - type = string -} diff --git a/src/matcha_ml/infrastructure/llm/azure_container_registry/README.md b/src/matcha_ml/infrastructure/llm/azure_container_registry/README.md deleted file mode 100644 index 70af6ba7..00000000 --- a/src/matcha_ml/infrastructure/llm/azure_container_registry/README.md +++ /dev/null @@ -1,36 +0,0 @@ -## Requirements - -No requirements. - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | n/a | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_container_registry.main](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/container_registry) | resource | -| [azurerm_role_assignment.aks_acr_access](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment) | resource | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [aks\_object\_id](#input\_aks\_object\_id) | Object id for aks cluster | `string` | n/a | yes | -| [location](#input\_location) | The Azure region in which this resources should be created. | `string` | n/a | yes | -| [prefix](#input\_prefix) | A prefix used for all resources | `string` | n/a | yes | -| [resource\_group\_name](#input\_resource\_group\_name) | The resource group name which is used to create the resource group | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [container\_registry\_name](#output\_container\_registry\_name) | The name of the container registry | -| [container\_registry\_url](#output\_container\_registry\_url) | The URL used to log into the container registry | diff --git a/src/matcha_ml/infrastructure/llm/azure_container_registry/main.tf b/src/matcha_ml/infrastructure/llm/azure_container_registry/main.tf deleted file mode 100644 index 9c7ec142..00000000 --- a/src/matcha_ml/infrastructure/llm/azure_container_registry/main.tf +++ /dev/null @@ -1,13 +0,0 @@ -resource "azurerm_container_registry" "main" { - name = "cr${var.prefix}" - resource_group_name = var.resource_group_name - location = var.location - sku = "Standard" -} - -resource "azurerm_role_assignment" "aks_acr_access" { - scope = azurerm_container_registry.main.id - role_definition_name = "AcrPull" - principal_id = var.aks_object_id - skip_service_principal_aad_check = true -} diff --git a/src/matcha_ml/infrastructure/llm/azure_container_registry/output.tf b/src/matcha_ml/infrastructure/llm/azure_container_registry/output.tf deleted file mode 100644 index a2069133..00000000 --- a/src/matcha_ml/infrastructure/llm/azure_container_registry/output.tf +++ /dev/null @@ -1,10 +0,0 @@ -# output for container registry -output "container_registry_url" { - description = "The URL used to log into the container registry" - value = azurerm_container_registry.main.login_server -} - -output "container_registry_name" { - description = "The name of the container registry" - value = azurerm_container_registry.main.name -} diff --git a/src/matcha_ml/infrastructure/llm/azure_container_registry/variables.tf b/src/matcha_ml/infrastructure/llm/azure_container_registry/variables.tf deleted file mode 100644 index 513a9768..00000000 --- a/src/matcha_ml/infrastructure/llm/azure_container_registry/variables.tf +++ /dev/null @@ -1,19 +0,0 @@ -variable "prefix" { - description = "A prefix used for all resources" - type = string -} - -variable "resource_group_name" { - description = "The resource group name which is used to create the resource group" - type = string -} - -variable "location" { - description = "The Azure region in which this resources should be created." - type = string -} - -variable "aks_object_id" { - description = "Object id for aks cluster" - type = string -} diff --git a/src/matcha_ml/infrastructure/llm/chroma/README.md b/src/matcha_ml/infrastructure/llm/chroma/README.md deleted file mode 100644 index 52f1fcc3..00000000 --- a/src/matcha_ml/infrastructure/llm/chroma/README.md +++ /dev/null @@ -1,29 +0,0 @@ - -## Requirements - -No requirements. - -## Providers - -| Name | Version | -|------|---------| -| [helm](#provider\_helm) | n/a | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [helm_release.chroma](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | - -## Inputs - -No inputs. - -## Outputs - -No outputs. - diff --git a/src/matcha_ml/infrastructure/llm/chroma/chroma_helm/Chart.yaml b/src/matcha_ml/infrastructure/llm/chroma/chroma_helm/Chart.yaml deleted file mode 100644 index 3932fbba..00000000 --- a/src/matcha_ml/infrastructure/llm/chroma/chroma_helm/Chart.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v2 -name: chroma -description: Chroma Server Helm Chart -version: 0.1.0 diff --git a/src/matcha_ml/infrastructure/llm/chroma/chroma_helm/templates/deployment.yaml b/src/matcha_ml/infrastructure/llm/chroma/chroma_helm/templates/deployment.yaml deleted file mode 100644 index fedc6444..00000000 --- a/src/matcha_ml/infrastructure/llm/chroma/chroma_helm/templates/deployment.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# templates/deployment.yaml -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ .Release.Name }}-server -spec: - selector: - matchLabels: - app: {{ .Release.Name }}-server - template: - metadata: - labels: - app: {{ .Release.Name }}-server - spec: - containers: - - name: {{ .Release.Name }}-server - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} - ports: - - containerPort: 8000 - resources: -{{ toYaml .Values.resources | indent 12 }} - volumeMounts: - - mountPath: /index_data - name: {{ .Release.Name }}-server-index - restartPolicy: Always - volumes: - - name: {{ .Release.Name }}-server-index - persistentVolumeClaim: - claimName: {{ .Release.Name }}-server-index diff --git a/src/matcha_ml/infrastructure/llm/chroma/chroma_helm/templates/pvc.yaml b/src/matcha_ml/infrastructure/llm/chroma/chroma_helm/templates/pvc.yaml deleted file mode 100644 index 56d3b0fe..00000000 --- a/src/matcha_ml/infrastructure/llm/chroma/chroma_helm/templates/pvc.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# templates/pvc.yaml -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ .Release.Name }}-server-index -spec: - accessModes: - - ReadWriteOnce - storageClassName: {{ .Values.pvc.storageClassName }} - resources: - requests: - storage: {{ .Values.pvc.requestsStorage }} diff --git a/src/matcha_ml/infrastructure/llm/chroma/chroma_helm/templates/service.yaml b/src/matcha_ml/infrastructure/llm/chroma/chroma_helm/templates/service.yaml deleted file mode 100644 index 9ce103d6..00000000 --- a/src/matcha_ml/infrastructure/llm/chroma/chroma_helm/templates/service.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# templates/service.yaml -apiVersion: v1 -kind: Service -metadata: - name: {{ .Release.Name }}-service -spec: - selector: - app: {{ .Release.Name }}-server - ports: - - name: "8123" - port: 8123 - targetPort: 8123 - - name: "9000" - port: 9000 - targetPort: 9000 - - name: "8000" - port: 8000 - targetPort: 8000 diff --git a/src/matcha_ml/infrastructure/llm/chroma/chroma_helm/values.yaml b/src/matcha_ml/infrastructure/llm/chroma/chroma_helm/values.yaml deleted file mode 100644 index c38d484a..00000000 --- a/src/matcha_ml/infrastructure/llm/chroma/chroma_helm/values.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# values.yaml -image: - repository: ghcr.io/chroma-core/chroma - tag: 0.4.3 - -resources: - requests: - memory: "256Mi" - cpu: "256m" - limits: - memory: "2Gi" - cpu: "2" - -pvc: - accessModes: - - ReadWriteOnce - storageClassName: default - requestsStorage: "100Mi" diff --git a/src/matcha_ml/infrastructure/llm/chroma/main.tf b/src/matcha_ml/infrastructure/llm/chroma/main.tf deleted file mode 100644 index d91003fb..00000000 --- a/src/matcha_ml/infrastructure/llm/chroma/main.tf +++ /dev/null @@ -1,7 +0,0 @@ -resource "helm_release" "chroma" { - name = "chroma" - chart = "${path.module}/chroma_helm" - namespace = "default" - - values = [file("${path.module}/chroma_helm/values.yaml")] -} diff --git a/src/matcha_ml/infrastructure/llm/configure_kubectl.tf b/src/matcha_ml/infrastructure/llm/configure_kubectl.tf deleted file mode 100644 index 6e69e9de..00000000 --- a/src/matcha_ml/infrastructure/llm/configure_kubectl.tf +++ /dev/null @@ -1,12 +0,0 @@ -# Derived from ZenML's stack recipes; source: https://github.com/zenml-io/mlops-stacks/blob/8eb06596bf836d3a3dd2634fbc7f2b5687421811/aws-minimal/configure_kubectl.tf - -# set up local kubectl client to access the newly created cluster -resource "null_resource" "configure_local_kubectl" { - provisioner "local-exec" { - command = "az aks get-credentials --resource-group ${module.resource_group.name} --name ${module.aks.aks_cluster_name} --context ${local.kubectl_context} --overwrite-existing" - } -} - -locals { - kubectl_context = "terraform-${module.aks.aks_cluster_name}-${replace(substr(timestamp(), 0, 16), ":", "_")}" -} diff --git a/src/matcha_ml/infrastructure/llm/data_version_control_storage/README.md b/src/matcha_ml/infrastructure/llm/data_version_control_storage/README.md deleted file mode 100644 index cae1bfe3..00000000 --- a/src/matcha_ml/infrastructure/llm/data_version_control_storage/README.md +++ /dev/null @@ -1,44 +0,0 @@ -## Requirements - -| Name | Version | -|------|---------| -| [azurerm](#requirement\_azurerm) | 3.48.0 | - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | 3.48.0 | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_storage_account.storageaccount](https://registry.terraform.io/providers/hashicorp/azurerm/3.48.0/docs/resources/storage_account) | resource | -| [azurerm_storage_container.storagecontainer](https://registry.terraform.io/providers/hashicorp/azurerm/3.48.0/docs/resources/storage_container) | resource | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [location](#input\_location) | The Azure Region in which this resources should be created. | `string` | n/a | yes | -| [prefix](#input\_prefix) | The prefix which should be used for naming storage account ({prefix}storageacc) and container ({prefix}storagecontainer) | `string` | n/a | yes | -| [resource\_group\_name](#input\_resource\_group\_name) | The resource group name which is used to create the resource group | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [blobstorage\_container\_path](#output\_blobstorage\_container\_path) | The Azure Blob Storage Container path for storing your artifacts | -| [primary\_access\_key](#output\_primary\_access\_key) | Azure Storage Account - Primary access key | -| [primary\_blob\_connection\_string](#output\_primary\_blob\_connection\_string) | Azure Storage Account - Primary Blob service connection string | -| [primary\_connection\_string](#output\_primary\_connection\_string) | Azure Storage Account - Primary connection string | -| [secondary\_access\_key](#output\_secondary\_access\_key) | Azure Storage Account - Secondary access key | -| [secondary\_blob\_connection\_string](#output\_secondary\_blob\_connection\_string) | Azure Storage Account - Secondary Blob service connection string | -| [secondary\_connection\_string](#output\_secondary\_connection\_string) | Azure Storage Account - Secondary connection string | -| [storage\_account\_name](#output\_storage\_account\_name) | The name of the Azure Storage Account. | -| [storage\_container\_name](#output\_storage\_container\_name) | The name of the Azure Storage Container. | diff --git a/src/matcha_ml/infrastructure/llm/data_version_control_storage/main.tf b/src/matcha_ml/infrastructure/llm/data_version_control_storage/main.tf deleted file mode 100644 index 72b26b18..00000000 --- a/src/matcha_ml/infrastructure/llm/data_version_control_storage/main.tf +++ /dev/null @@ -1,22 +0,0 @@ -# Reference: https://github.com/hashicorp/terraform-provider-azurerm/tree/main/examples/storage/storage-container - -# create a storage account -resource "azurerm_storage_account" "storageaccount" { - name = "${var.prefix}dvcacc" - resource_group_name = var.resource_group_name - location = var.location - - account_tier = "Standard" - account_kind = "StorageV2" - account_replication_type = "LRS" - enable_https_traffic_only = true - access_tier = "Hot" - allow_nested_items_to_be_public = true -} - -# create a storage container inside created storage account -resource "azurerm_storage_container" "storagecontainer" { - name = "${var.prefix}dvcstore" - storage_account_name = azurerm_storage_account.storageaccount.name - container_access_type = "container" -} diff --git a/src/matcha_ml/infrastructure/llm/data_version_control_storage/output.tf b/src/matcha_ml/infrastructure/llm/data_version_control_storage/output.tf deleted file mode 100644 index 45a5f5ce..00000000 --- a/src/matcha_ml/infrastructure/llm/data_version_control_storage/output.tf +++ /dev/null @@ -1,15 +0,0 @@ -output "storage_container_name" { - description = "The name of the Azure Storage Container." - value = azurerm_storage_container.storagecontainer.name -} - -output "storage_account_name" { - description = "The name of the Azure Storage Account." - value = azurerm_storage_account.storageaccount.name -} - -output "primary_connection_string" { - description = "Azure Storage Account - Primary connection string" - value = azurerm_storage_account.storageaccount.primary_connection_string - sensitive = true -} diff --git a/src/matcha_ml/infrastructure/llm/data_version_control_storage/providers.tf b/src/matcha_ml/infrastructure/llm/data_version_control_storage/providers.tf deleted file mode 100644 index e2d7507d..00000000 --- a/src/matcha_ml/infrastructure/llm/data_version_control_storage/providers.tf +++ /dev/null @@ -1,8 +0,0 @@ -terraform { - required_providers { - azurerm = { - source = "hashicorp/azurerm" - version = "3.48.0" - } - } -} diff --git a/src/matcha_ml/infrastructure/llm/data_version_control_storage/variables.tf b/src/matcha_ml/infrastructure/llm/data_version_control_storage/variables.tf deleted file mode 100644 index 8a3fab49..00000000 --- a/src/matcha_ml/infrastructure/llm/data_version_control_storage/variables.tf +++ /dev/null @@ -1,14 +0,0 @@ -variable "resource_group_name" { - description = "The resource group name which is used to create the resource group" - type = string -} - -variable "prefix" { - description = "The prefix which should be used for naming storage account ({prefix}dvcacc) and container ({prefix}dvcstore)" - type = string -} - -variable "location" { - description = "The Azure Region in which this resources should be created." - type = string -} diff --git a/src/matcha_ml/infrastructure/llm/helm.tf b/src/matcha_ml/infrastructure/llm/helm.tf deleted file mode 100644 index dac70cd9..00000000 --- a/src/matcha_ml/infrastructure/llm/helm.tf +++ /dev/null @@ -1,10 +0,0 @@ -provider "helm" { - kubernetes { - host = module.aks.host - - client_certificate = base64decode(module.aks.client_certificate) - client_key = base64decode(module.aks.client_key) - cluster_ca_certificate = base64decode(module.aks.cluster_ca_certificate) - config_path = local.kubectl_config_path - } -} diff --git a/src/matcha_ml/infrastructure/llm/kubernetes.tf b/src/matcha_ml/infrastructure/llm/kubernetes.tf deleted file mode 100644 index 304dcc5e..00000000 --- a/src/matcha_ml/infrastructure/llm/kubernetes.tf +++ /dev/null @@ -1,30 +0,0 @@ -# Derived from ZenML's stack recipes; source: https://github.com/zenml-io/mlops-stacks/blob/8eb06596bf836d3a3dd2634fbc7f2b5687421811/aws-minimal/kubernetes.tf - -# check if the host OS is Linux or Windows -data "external" "os" { - working_dir = path.module - program = ["printf", "{\"os\": \"Linux\"}"] -} - -locals { - os = data.external.os.result.os - kubectl_config_path = local.os == "Windows" ? "%USERPROFILE%\\.kube\\config" : "~/.kube/config" -} - -# a default (non-aliased) provider configuration for "kubernetes" -provider "kubernetes" { - host = module.aks.host - - client_certificate = base64decode(module.aks.client_certificate) - client_key = base64decode(module.aks.client_key) - cluster_ca_certificate = base64decode(module.aks.cluster_ca_certificate) - config_path = local.kubectl_config_path -} - -provider "kubectl" { - host = module.aks.host - - client_certificate = base64decode(module.aks.client_certificate) - client_key = base64decode(module.aks.client_key) - cluster_ca_certificate = base64decode(module.aks.cluster_ca_certificate) -} diff --git a/src/matcha_ml/infrastructure/llm/main.tf b/src/matcha_ml/infrastructure/llm/main.tf deleted file mode 100644 index 2636d089..00000000 --- a/src/matcha_ml/infrastructure/llm/main.tf +++ /dev/null @@ -1,102 +0,0 @@ -provider "azurerm" { - features { - resource_group { - prevent_deletion_if_contains_resources = false - } - } -} - -module "resource_group" { - source = "./resource_group" - - prefix = var.prefix -} - -module "storage" { - source = "./storage" - - resource_group_name = module.resource_group.name - prefix = var.prefix - location = var.location -} - -module "zenml_storage" { - source = "./zenml_storage" - - prefix = var.prefix - resource_group_name = module.resource_group.name - location = var.location - aks_principal_id = module.aks.aks_principal_id -} - -module "data_version_control_storage" { - source = "./data_version_control_storage" - - resource_group_name = module.resource_group.name - prefix = var.prefix - location = var.location -} - -module "aks" { - source = "./aks" - - prefix = var.prefix - location = var.location - resource_group_name = module.resource_group.name -} - -module "acr" { - source = "./azure_container_registry" - - prefix = var.prefix - resource_group_name = module.resource_group.name - location = var.location - aks_object_id = module.aks.aks_object_id -} - -module "mlflow" { - source = "./mlflow_module" - - depends_on = [null_resource.configure_local_kubectl] - - # storage variables - storage_account_name = module.storage.storage_account_name - storage_container_name = module.storage.storage_container_name - artifact_azure_access_key = module.storage.primary_access_key -} - - -module "zenserver" { - source = "./zen_server" - - depends_on = [null_resource.configure_local_kubectl] - - # resource group variables - resource_group_name = module.resource_group.name - location = var.location - prefix = var.prefix - - # ZenServer credentials - username = var.username - password = var.password - - zenmlserver_version = var.zenmlserver_version -} - - -module "seldon" { - source = "./seldon" - - depends_on = [null_resource.configure_local_kubectl] - - # details about the seldon deployment - seldon_name = var.seldon_name - seldon_namespace = var.seldon_namespace - -} - -module "chroma" { - source = "./chroma" - - depends_on = [null_resource.configure_local_kubectl] -} diff --git a/src/matcha_ml/infrastructure/llm/mlflow_module/README.md b/src/matcha_ml/infrastructure/llm/mlflow_module/README.md deleted file mode 100644 index a06e695c..00000000 --- a/src/matcha_ml/infrastructure/llm/mlflow_module/README.md +++ /dev/null @@ -1,41 +0,0 @@ -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | >= 0.14.8 | -| [htpasswd](#requirement\_htpasswd) | 1.0.4 | - -## Providers - -| Name | Version | -|------|---------| -| [helm](#provider\_helm) | n/a | -| [kubernetes](#provider\_kubernetes) | n/a | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [helm_release.mlflow-tracking](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | -| [kubernetes_namespace.k8s_ns](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | -| [kubernetes_service.mlflow_tracking](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/service) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [artifact\_azure](#input\_artifact\_azure) | Boolean to indicate if we are using Azure Blob Storage as storage for MLFlow | `bool` | `true` | no | -| [artifact\_azure\_access\_key](#input\_artifact\_azure\_access\_key) | Access Key for Azure Blob Storage | `string` | `""` | no | -| [artifact\_proxied\_access](#input\_artifact\_proxied\_access) | Boolean to indicate if we are using proxied artifact storage | `bool` | `false` | no | -| [storage\_account\_name](#input\_storage\_account\_name) | Name of Azure Storage Container already created inside Azure Blob Storage | `string` | n/a | yes | -| [storage\_container\_name](#input\_storage\_container\_name) | Name of container to create inside Azure Storage Account to store artifacts | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [mlflow\_tracking\_url](#output\_mlflow\_tracking\_url) | The tracking URL for MLFlow dashboard | diff --git a/src/matcha_ml/infrastructure/llm/mlflow_module/getURI.tf b/src/matcha_ml/infrastructure/llm/mlflow_module/getURI.tf deleted file mode 100644 index e4a6890c..00000000 --- a/src/matcha_ml/infrastructure/llm/mlflow_module/getURI.tf +++ /dev/null @@ -1,8 +0,0 @@ -# Derived from ZenML's stack recipes; source: https://github.com/zenml-io/mlops-stacks/blob/8eb06596bf836d3a3dd2634fbc7f2b5687421811/azure-minimal/get_URIs.tf - -# get URI for MLflow tracking server -data "kubernetes_service" "mlflow_tracking" { - metadata { - name = helm_release.mlflow_tracking.name - } -} diff --git a/src/matcha_ml/infrastructure/llm/mlflow_module/main.tf b/src/matcha_ml/infrastructure/llm/mlflow_module/main.tf deleted file mode 100644 index eb97dfaa..00000000 --- a/src/matcha_ml/infrastructure/llm/mlflow_module/main.tf +++ /dev/null @@ -1,44 +0,0 @@ -# create the mlflow tracking server deployment using mlflow helm charts -# Reference: https://github.com/community-charts/helm-charts/blob/main/charts/mlflow/values.yaml -resource "helm_release" "mlflow_tracking" { - - name = "mlflow-tracking" - repository = "https://community-charts.github.io/helm-charts" - chart = "mlflow" - - # Change type from "ClusterIP" to "LoadBalancer" - set { - name = "service.type" - value = "LoadBalancer" - } - # set proxied access to artifact storage - set { - name = "artifactRoot.proxiedArtifactStorage" - value = var.artifact_proxied_access - type = "auto" - } - - # Derived from ZenML's stack recipes; source: https://github.com/zenml-io/mlops-stacks/blob/8eb06596bf836d3a3dd2634fbc7f2b5687421811/aws-minimal/mlflow-module/mlflow.tf#L39 - # set values for Azure Blob Storage - set { - name = "artifactRoot.azureBlob.enabled" - value = var.artifact_azure - type = "auto" - } - set { - name = "artifactRoot.azureBlob.storageAccount" - value = var.storage_account_name - type = "string" - } - set { - name = "artifactRoot.azureBlob.container" - value = var.storage_container_name - type = "string" - } - set_sensitive { - name = "artifactRoot.azureBlob.accessKey" - value = var.artifact_azure_access_key - type = "string" - } - -} diff --git a/src/matcha_ml/infrastructure/llm/mlflow_module/output.tf b/src/matcha_ml/infrastructure/llm/mlflow_module/output.tf deleted file mode 100644 index d73628a7..00000000 --- a/src/matcha_ml/infrastructure/llm/mlflow_module/output.tf +++ /dev/null @@ -1,4 +0,0 @@ -output "mlflow_tracking_url" { - description = "The tracking URL for MLFlow dashboard" - value = "http://${data.kubernetes_service.mlflow_tracking.status.0.load_balancer.0.ingress.0.ip}:${data.kubernetes_service.mlflow_tracking.spec.0.port.0.port}" -} diff --git a/src/matcha_ml/infrastructure/llm/mlflow_module/providers.tf b/src/matcha_ml/infrastructure/llm/mlflow_module/providers.tf deleted file mode 100644 index f46344cb..00000000 --- a/src/matcha_ml/infrastructure/llm/mlflow_module/providers.tf +++ /dev/null @@ -1,12 +0,0 @@ -# Derived from ZenML's stack recipes; source: https://github.com/zenml-io/mlops-stacks/blob/8eb06596bf836d3a3dd2634fbc7f2b5687421811/aws-minimal/mlflow-module/providers.tf - -# defining the providers required by the mlflow module -terraform { - required_providers { - htpasswd = { - source = "loafoe/htpasswd" - version = "1.0.4" - } - } - required_version = ">= 0.14.8" -} diff --git a/src/matcha_ml/infrastructure/llm/mlflow_module/variables.tf b/src/matcha_ml/infrastructure/llm/mlflow_module/variables.tf deleted file mode 100644 index 058a5057..00000000 --- a/src/matcha_ml/infrastructure/llm/mlflow_module/variables.tf +++ /dev/null @@ -1,29 +0,0 @@ -# artifact storage variables -variable "artifact_proxied_access" { - description = "Boolean to indicate if we are using proxied artifact storage" - type = bool - default = false -} - -variable "storage_account_name" { - description = "Name of Azure Storage Container already created inside Azure Blob Storage" - type = string -} - -variable "storage_container_name" { - description = "Name of container to create inside Azure Storage Account to store artifacts" - type = string -} - -variable "artifact_azure" { - description = "Boolean to indicate if we are using Azure Blob Storage as storage for MLFlow" - type = bool - default = true -} - - -variable "artifact_azure_access_key" { - description = "Access Key for Azure Blob Storage" - type = string - default = "" -} diff --git a/src/matcha_ml/infrastructure/llm/mlflow_module/zenml_namespace.tf b/src/matcha_ml/infrastructure/llm/mlflow_module/zenml_namespace.tf deleted file mode 100644 index c0705a8a..00000000 --- a/src/matcha_ml/infrastructure/llm/mlflow_module/zenml_namespace.tf +++ /dev/null @@ -1,5 +0,0 @@ -resource "kubernetes_namespace" "k8s_ns" { - metadata { - name = "zenml" - } -} diff --git a/src/matcha_ml/infrastructure/llm/output.tf b/src/matcha_ml/infrastructure/llm/output.tf deleted file mode 100644 index f62fd806..00000000 --- a/src/matcha_ml/infrastructure/llm/output.tf +++ /dev/null @@ -1,94 +0,0 @@ -output "experiment_tracker_mlflow_tracking_url" { - description = "The URL for the MLflow tracking server" - value = module.mlflow.mlflow_tracking_url -} - -output "experiment_tracker_mlflow_azure_connection_string" { - description = "The Azure connection string for the MLflow artifact storage" - value = module.storage.primary_connection_string - sensitive = true -} - -output "pipeline_zenml_storage_path" { - description = "The Azure Blob Storage Container path for storing ZenML artifacts" - value = module.zenml_storage.zenml_blobstorage_container_path -} - - -output "pipeline_zenml_connection_string" { - description = "The primary connection string for the ZenML Azure Storage Account" - value = module.zenml_storage.zenml_primary_connection_string - sensitive = true -} - -output "orchestrator_aks_k8s_context" { - description = "The name of the Kubernetes context used for deployment" - value = local.kubectl_context -} - -output "pipeline_zenml_server_url" { - description = "The URL for the ZenServer API server" - value = module.zenserver.zenserver_url -} - -output "pipeline_zenml_server_username" { - description = "The username for accessing the ZenServer API server" - value = module.zenserver.zenserver_username -} - -output "pipeline_zenml_server_password" { - description = "The password for accessing the ZenServer API server" - value = module.zenserver.zenserver_password - sensitive = true -} - -output "container_registry_azure_registry_url" { - description = "The URL for the Azure Container Registry" - value = module.acr.container_registry_url -} - -output "container_registry_azure_registry_name" { - description = "The name of the Azure Container Registry" - value = module.acr.container_registry_name -} - -output "model_deployer_seldon_workloads_namespace" { - description = "The Kubernetes namespace for Seldon workloads" - value = module.seldon.workloads_namespace -} - -output "model_deployer_seldon_base_url" { - description = "The base URL for the Seldon API server" - value = module.seldon.base_url -} - -output "cloud_azure_resource_group_name" { - description = "Name of the Azure resource group" - value = module.resource_group.name -} - -output "cloud_azure_prefix"{ - description = "The Azure resource group name prefix" - value = var.prefix -} - -output "cloud_azure_location"{ - description = "The Azure location in which the resources are provisioned" - value = var.location -} - -output "data_version_control_primary_connection_string"{ - description = "The primary connection string for the ZenML Azure Storage Account" - value = module.data_version_control_storage.primary_connection_string - sensitive = true -} - -output "data_version_control_storage_container_name"{ - description = "The name of the container used for data version control" - value = module.data_version_control_storage.storage_container_name -} - -output "data_version_control_storage_account_name"{ - description = "The name of the storage account for data version control" - value = module.data_version_control_storage.storage_account_name -} diff --git a/src/matcha_ml/infrastructure/llm/printf.cmd b/src/matcha_ml/infrastructure/llm/printf.cmd deleted file mode 100644 index 07e225fa..00000000 --- a/src/matcha_ml/infrastructure/llm/printf.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -echo {"os": "Windows"} diff --git a/src/matcha_ml/infrastructure/llm/providers.tf b/src/matcha_ml/infrastructure/llm/providers.tf deleted file mode 100644 index b3876b23..00000000 --- a/src/matcha_ml/infrastructure/llm/providers.tf +++ /dev/null @@ -1,46 +0,0 @@ -# defining the providers for the all module -terraform { - required_providers { - azurerm = { - source = "hashicorp/azurerm" - version = ">=3.16.0" - } - - random = { - source = "hashicorp/random" - version = "3.1.0" - } - - helm = { - source = "hashicorp/helm" - version = "~> 2.0.1" - } - - local = { - source = "hashicorp/local" - version = "2.1.0" - } - - null = { - source = "hashicorp/null" - version = "3.2.1" - } - - kubernetes = { - source = "hashicorp/kubernetes" - version = "~> 2.11.0" - } - - kubectl = { - source = "gavinbunney/kubectl" - version = "1.14.0" - } - - htpasswd = { - source = "loafoe/htpasswd" - version = "1.0.4" - } - } - - required_version = ">= 0.14.8" -} diff --git a/src/matcha_ml/infrastructure/llm/resource_group/README.md b/src/matcha_ml/infrastructure/llm/resource_group/README.md deleted file mode 100644 index 72624d2e..00000000 --- a/src/matcha_ml/infrastructure/llm/resource_group/README.md +++ /dev/null @@ -1,32 +0,0 @@ -## Requirements - -No requirements. - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | n/a | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_resource_group.main](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [location](#input\_location) | The Azure region in which resource group should be provisioned | `string` | n/a | yes | -| [prefix](#input\_prefix) | A prefix used for all resources | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [name](#output\_name) | Name of the resource group | diff --git a/src/matcha_ml/infrastructure/llm/resource_group/main.tf b/src/matcha_ml/infrastructure/llm/resource_group/main.tf deleted file mode 100644 index 6afb0a9e..00000000 --- a/src/matcha_ml/infrastructure/llm/resource_group/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -data "azurerm_resource_group" "main" { - name = "${var.prefix}-resources" -} diff --git a/src/matcha_ml/infrastructure/llm/resource_group/output.tf b/src/matcha_ml/infrastructure/llm/resource_group/output.tf deleted file mode 100644 index 55f05726..00000000 --- a/src/matcha_ml/infrastructure/llm/resource_group/output.tf +++ /dev/null @@ -1,4 +0,0 @@ -output "name" { - description = "Name of the resource group" - value = data.azurerm_resource_group.main.name -} diff --git a/src/matcha_ml/infrastructure/llm/resource_group/variables.tf b/src/matcha_ml/infrastructure/llm/resource_group/variables.tf deleted file mode 100644 index 0325a60e..00000000 --- a/src/matcha_ml/infrastructure/llm/resource_group/variables.tf +++ /dev/null @@ -1,4 +0,0 @@ -variable "prefix" { - description = "A prefix used for all resources" - type = string -} diff --git a/src/matcha_ml/infrastructure/llm/seldon/README.md b/src/matcha_ml/infrastructure/llm/seldon/README.md deleted file mode 100644 index 9ceb938e..00000000 --- a/src/matcha_ml/infrastructure/llm/seldon/README.md +++ /dev/null @@ -1,49 +0,0 @@ -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | >= 0.14.8 | -| [kubectl](#requirement\_kubectl) | 1.14.0 | - -## Providers - -| Name | Version | -|------|---------| -| [helm](#provider\_helm) | n/a | -| [kubectl](#provider\_kubectl) | 1.14.0 | -| [kubernetes](#provider\_kubernetes) | n/a | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [helm_release.istio_base](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | -| [helm_release.istio_ingress](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | -| [helm_release.istiod](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | -| [helm_release.seldon](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | -| [kubectl_manifest.gateway](https://registry.terraform.io/providers/gavinbunney/kubectl/1.14.0/docs/resources/manifest) | resource | -| [kubernetes_cluster_role_binding_v1.seldon_machinelearning-permission_binding](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/cluster_role_binding_v1) | resource | -| [kubernetes_cluster_role_v1.seldon-machinelearning_permission](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/cluster_role_v1) | resource | -| [kubernetes_namespace.istio_ns](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | -| [kubernetes_namespace.seldon_ns](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | -| [kubernetes_namespace.seldon_workloads](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | -| [kubernetes_service.seldon_ingress](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/service) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [seldon\_name](#input\_seldon\_name) | Seldon Helm deployment name | `string` | n/a | yes | -| [seldon\_namespace](#input\_seldon\_namespace) | Seldon system namespace | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [base\_url](#output\_base\_url) | The base URL of the Seldon deployment | -| [ingress\_gateway\_spec](#output\_ingress\_gateway\_spec) | The YAML specification for the Istio ingress gateway | -| [workloads\_namespace](#output\_workloads\_namespace) | The namespace for Seldon workloads | diff --git a/src/matcha_ml/infrastructure/llm/seldon/istio.tf b/src/matcha_ml/infrastructure/llm/seldon/istio.tf deleted file mode 100644 index 7c4d9a9a..00000000 --- a/src/matcha_ml/infrastructure/llm/seldon/istio.tf +++ /dev/null @@ -1,65 +0,0 @@ -# Derived from ZenML's stack recipes; source: https://github.com/zenml-io/mlops-stacks/blob/8eb06596bf836d3a3dd2634fbc7f2b5687421811/aws-minimal/seldon/istio.tf - -# create a namespace for istio resources -resource "kubernetes_namespace" "istio_ns" { - metadata { - name = "istio-system" - labels = { - istio-injection = "enabled" - } - } -} - -# istio-base creates the istio definitions that will be used going forward -resource "helm_release" "istio_base" { - name = "istio-base-seldon" - repository = "https://istio-release.storage.googleapis.com/charts" - chart = "base" - - # adding a dependency on the istio-namespace - namespace = kubernetes_namespace.istio_ns.metadata[0].name -} - -# the istio daemon -resource "helm_release" "istiod" { - name = "istiod-seldon" - repository = helm_release.istio_base.repository # dependency on istio-base - chart = "istiod" - - namespace = kubernetes_namespace.istio_ns.metadata[0].name -} - -# the istio ingress gateway -# cannot use kubernetes_manifest resource since it practically -# doesn't support CRDs. Going with kubectl instead. -resource "kubectl_manifest" "gateway" { - yaml_body = < [azurerm](#requirement\_azurerm) | 3.48.0 | - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | 3.48.0 | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_storage_account.storageaccount](https://registry.terraform.io/providers/hashicorp/azurerm/3.48.0/docs/resources/storage_account) | resource | -| [azurerm_storage_container.storagecontainer](https://registry.terraform.io/providers/hashicorp/azurerm/3.48.0/docs/resources/storage_container) | resource | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [location](#input\_location) | The Azure Region in which this resources should be created. | `string` | n/a | yes | -| [prefix](#input\_prefix) | The prefix which should be used for naming storage account ({prefix}storageacc) and container ({prefix}storagecontainer) | `string` | n/a | yes | -| [resource\_group\_name](#input\_resource\_group\_name) | The resource group name which is used to create the resource group | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [blobstorage\_container\_path](#output\_blobstorage\_container\_path) | The Azure Blob Storage Container path for storing your artifacts | -| [primary\_access\_key](#output\_primary\_access\_key) | Azure Storage Account - Primary access key | -| [primary\_blob\_connection\_string](#output\_primary\_blob\_connection\_string) | Azure Storage Account - Primary Blob service connection string | -| [primary\_connection\_string](#output\_primary\_connection\_string) | Azure Storage Account - Primary connection string | -| [secondary\_access\_key](#output\_secondary\_access\_key) | Azure Storage Account - Secondary access key | -| [secondary\_blob\_connection\_string](#output\_secondary\_blob\_connection\_string) | Azure Storage Account - Secondary Blob service connection string | -| [secondary\_connection\_string](#output\_secondary\_connection\_string) | Azure Storage Account - Secondary connection string | -| [storage\_account\_name](#output\_storage\_account\_name) | The name of the Azure Storage Account. | -| [storage\_container\_name](#output\_storage\_container\_name) | The name of the Azure Storage Container. | diff --git a/src/matcha_ml/infrastructure/llm/storage/main.tf b/src/matcha_ml/infrastructure/llm/storage/main.tf deleted file mode 100644 index b448a625..00000000 --- a/src/matcha_ml/infrastructure/llm/storage/main.tf +++ /dev/null @@ -1,22 +0,0 @@ -# Reference: https://github.com/hashicorp/terraform-provider-azurerm/tree/main/examples/storage/storage-container - -# create a storage account -resource "azurerm_storage_account" "storageaccount" { - name = "st${var.prefix}acc" - resource_group_name = var.resource_group_name - location = var.location - - account_tier = "Standard" - account_kind = "StorageV2" - account_replication_type = "LRS" - enable_https_traffic_only = true - access_tier = "Hot" - allow_nested_items_to_be_public = true -} - -# create a storage container inside created storage account -resource "azurerm_storage_container" "storagecontainer" { - name = "${var.prefix}store" - storage_account_name = azurerm_storage_account.storageaccount.name - container_access_type = "container" -} diff --git a/src/matcha_ml/infrastructure/llm/storage/output.tf b/src/matcha_ml/infrastructure/llm/storage/output.tf deleted file mode 100644 index ef9a9916..00000000 --- a/src/matcha_ml/infrastructure/llm/storage/output.tf +++ /dev/null @@ -1,50 +0,0 @@ -output "storage_container_name" { - description = "The name of the Azure Storage Container." - value = azurerm_storage_container.storagecontainer.name -} - -output "blobstorage_container_path" { - description = "The Azure Blob Storage Container path for storing your artifacts" - value = "az://${azurerm_storage_container.storagecontainer.name}" -} - -output "storage_account_name" { - description = "The name of the Azure Storage Account." - value = azurerm_storage_account.storageaccount.name -} - -output "primary_access_key" { - description = "Azure Storage Account - Primary access key" - value = azurerm_storage_account.storageaccount.primary_access_key - sensitive = true -} - -output "secondary_access_key" { - description = "Azure Storage Account - Secondary access key" - value = azurerm_storage_account.storageaccount.secondary_access_key - sensitive = true -} - -output "primary_connection_string" { - description = "Azure Storage Account - Primary connection string" - value = azurerm_storage_account.storageaccount.primary_connection_string - sensitive = true -} - -output "secondary_connection_string" { - description = "Azure Storage Account - Secondary connection string" - value = azurerm_storage_account.storageaccount.secondary_connection_string - sensitive = true -} - -output "primary_blob_connection_string" { - description = "Azure Storage Account - Primary Blob service connection string" - value = azurerm_storage_account.storageaccount.primary_blob_connection_string - sensitive = true -} - -output "secondary_blob_connection_string" { - description = "Azure Storage Account - Secondary Blob service connection string" - value = azurerm_storage_account.storageaccount.secondary_blob_connection_string - sensitive = true -} diff --git a/src/matcha_ml/infrastructure/llm/storage/providers.tf b/src/matcha_ml/infrastructure/llm/storage/providers.tf deleted file mode 100644 index e2d7507d..00000000 --- a/src/matcha_ml/infrastructure/llm/storage/providers.tf +++ /dev/null @@ -1,8 +0,0 @@ -terraform { - required_providers { - azurerm = { - source = "hashicorp/azurerm" - version = "3.48.0" - } - } -} diff --git a/src/matcha_ml/infrastructure/llm/storage/variables.tf b/src/matcha_ml/infrastructure/llm/storage/variables.tf deleted file mode 100644 index 23388ac3..00000000 --- a/src/matcha_ml/infrastructure/llm/storage/variables.tf +++ /dev/null @@ -1,14 +0,0 @@ -variable "resource_group_name" { - description = "The resource group name which is used to create the resource group" - type = string -} - -variable "prefix" { - description = "The prefix which should be used for naming storage account ({prefix}storageacc) and container ({prefix}storagecontainer)" - type = string -} - -variable "location" { - description = "The Azure Region in which this resources should be created." - type = string -} diff --git a/src/matcha_ml/infrastructure/llm/variables.tf b/src/matcha_ml/infrastructure/llm/variables.tf deleted file mode 100644 index a9172b66..00000000 --- a/src/matcha_ml/infrastructure/llm/variables.tf +++ /dev/null @@ -1,41 +0,0 @@ -variable "prefix" { - description = "A prefix used for all resources" - type = string - default = "matcha" -} - -variable "location" { - description = "The Azure Region in which all resources should be provisioned" - type = string -} - -variable "username" { - description = "Username for ZenServer" - type = string - default = "default" -} - -variable "password" { - description = "Password for ZenServer" - type = string - sensitive = true -} - -variable "zenmlserver_version" { - description = "The tag to use for the zenmlserver docker image." - default = "latest" - type = string -} - -# seldon variables -variable "seldon_name" { - description = "Name of the Seldon deployment" - type = string - default = "seldon" -} - -variable "seldon_namespace" { - description = "Namespace for Seldon resources" - type = string - default = "seldon-system" -} diff --git a/src/matcha_ml/infrastructure/llm/zen_server/README.md b/src/matcha_ml/infrastructure/llm/zen_server/README.md deleted file mode 100644 index 8b7759f2..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/README.md +++ /dev/null @@ -1,69 +0,0 @@ -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | >= 0.14.8 | -| [htpasswd](#requirement\_htpasswd) | 1.0.4 | -| [kubectl](#requirement\_kubectl) | 1.14.0 | - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | n/a | -| [helm](#provider\_helm) | n/a | -| [kubernetes](#provider\_kubernetes) | n/a | -| [random](#provider\_random) | n/a | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_mysql_flexible_database.db](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_flexible_database) | resource | -| [azurerm_mysql_flexible_server.mysql](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_flexible_server) | resource | -| [azurerm_mysql_flexible_server_configuration.require_ssl](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_flexible_server_configuration) | resource | -| [azurerm_mysql_flexible_server_firewall_rule.allow_IPs](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mysql_flexible_server_firewall_rule) | resource | -| [helm_release.zen_server](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource | -| [kubernetes_namespace.zen_server](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | -| [random_password.mysql_password](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource | -| [kubernetes_service.zen_server](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/service) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [analytics\_opt\_in](#input\_analytics\_opt\_in) | The flag to enable/disable analytics | `bool` | `false` | no | -| [database\_password](#input\_database\_password) | The password for the CloudSQL store | `string` | `""` | no | -| [database\_ssl\_ca](#input\_database\_ssl\_ca) | The server ca for the Flexible MySQL instance | `string` | `""` | no | -| [database\_ssl\_cert](#input\_database\_ssl\_cert) | The client cert for the Flexible MySQL instance | `string` | `""` | no | -| [database\_ssl\_key](#input\_database\_ssl\_key) | The client key for the Flexible MySQL instance | `string` | `""` | no | -| [database\_ssl\_verify\_server\_cert](#input\_database\_ssl\_verify\_server\_cert) | Should SSL be verified? | `bool` | `false` | no | -| [database\_url](#input\_database\_url) | The URL for the Flexible MySQL instance | `string` | `""` | no | -| [database\_username](#input\_database\_username) | The username for the CloudSQL store | `string` | `"user"` | no | -| [db\_disk\_size](#input\_db\_disk\_size) | The allocated storage in gigabytes | `number` | `20` | no | -| [db\_instance\_name](#input\_db\_instance\_name) | The name for the Flexible MySQL store | `string` | `"zenmlserver"` | no | -| [db\_name](#input\_db\_name) | The name for the database | `string` | `"zendb"` | no | -| [db\_sku\_name](#input\_db\_sku\_name) | The sku\_name for the database resource | `string` | `"B_Standard_B1s"` | no | -| [db\_version](#input\_db\_version) | The version of MySQL to use | `string` | `"5.7"` | no | -| [deploy\_db](#input\_deploy\_db) | Should a Flexible MySQL instance be created? | `bool` | `true` | no | -| [kubectl\_config\_path](#input\_kubectl\_config\_path) | The path to the kube config | `string` | `""` | no | -| [location](#input\_location) | The location for your Azure resources | `string` | n/a | yes | -| [namespace](#input\_namespace) | The namespace to install the ZenML server Helm chart in | `string` | `"terraform-server"` | no | -| [password](#input\_password) | Password for the default ZenML server account | `string` | n/a | yes | -| [prefix](#input\_prefix) | A prefix used for all resources | `string` | n/a | yes | -| [resource\_group\_name](#input\_resource\_group\_name) | The resource group in Azure that you want to deploy ZenML to | `string` | n/a | yes | -| [username](#input\_username) | Username for the default ZenML server account | `string` | `"default"` | no | -| [zenmlserver\_image\_repo](#input\_zenmlserver\_image\_repo) | The repository to use for the zenmlserver docker image. | `string` | `"zenmldocker/zenml-server"` | no | -| [zenmlserver\_image\_tag](#input\_zenmlserver\_image\_tag) | The tag to use for the zenmlserver docker image. | `string` | `"latest"` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| [zenserver\_password](#output\_zenserver\_password) | The password used to access the ZenML server | -| [zenserver\_url](#output\_zenserver\_url) | The URL for the ZenML server | -| [zenserver\_username](#output\_zenserver\_username) | The username used to access the ZenML server | diff --git a/src/matcha_ml/infrastructure/llm/zen_server/getURL.tf b/src/matcha_ml/infrastructure/llm/zen_server/getURL.tf deleted file mode 100644 index a45aff5b..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/getURL.tf +++ /dev/null @@ -1,10 +0,0 @@ -data "kubernetes_service" "zen_server" { - metadata { - name = "${helm_release.zen_server.name}-zenml" - namespace = helm_release.zen_server.namespace - } - - depends_on = [ - helm_release.zen_server - ] -} diff --git a/src/matcha_ml/infrastructure/llm/zen_server/ingress.tf b/src/matcha_ml/infrastructure/llm/zen_server/ingress.tf deleted file mode 100644 index 257498df..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/ingress.tf +++ /dev/null @@ -1,30 +0,0 @@ -# # set up the nginx ingress controller -# resource "kubernetes_namespace" "nginx-ns" { -# count = var.create_ingress_controller ? 1 : 0 -# metadata { -# name = "${var.name}-ingress" -# } -# } - -# resource "helm_release" "nginx-controller" { -# name = "zenml" -# count = var.create_ingress_controller ? 1 : 0 -# repository = "https://kubernetes.github.io/ingress-nginx" -# chart = "ingress-nginx" -# # dependency on nginx-ns -# namespace = var.create_ingress_controller ? kubernetes_namespace.nginx-ns[0].metadata[0].name : "" -# depends_on = [ -# resource.kubernetes_namespace.nginx-ns -# ] -# } - -# data "kubernetes_service" "ingress-controller" { -# count = var.create_ingress_controller ? 1 : 0 -# metadata { -# name = "zenml-ingress-nginx-controller" -# namespace = var.create_ingress_controller ? kubernetes_namespace.nginx-ns[0].metadata[0].name : "" -# } -# depends_on = [ -# resource.helm_release.nginx-controller -# ] -# } diff --git a/src/matcha_ml/infrastructure/llm/zen_server/main.tf b/src/matcha_ml/infrastructure/llm/zen_server/main.tf deleted file mode 100644 index d4026cac..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/main.tf +++ /dev/null @@ -1,112 +0,0 @@ -# Derived from ZenML's stack recipes; source: https://github.com/zenml-io/mlops-stacks/blob/8eb06596bf836d3a3dd2634fbc7f2b5687421811/modules/zenml-module/zen_server.tf - -# create the ZenServer deployment -resource "kubernetes_namespace" "zen_server" { - metadata { - name = "${var.prefix}-${var.namespace}" - } -} - -resource "helm_release" "zen_server" { - - name = "${var.prefix}-zenserver" - chart = "${path.module}/zenml_helm" - namespace = kubernetes_namespace.zen_server.metadata[0].name - - set { - name = "zenml.image.repository" - value = var.zenmlserver_image_repo - } - - set { - name = "zenml.defaultUsername" - value = var.username - } - set { - name = "zenml.defaultPassword" - value = var.password - } - set { - name = "zenml.deploymentType" - value = "azure" - } - set { - name = "zenml.analyticsOptIn" - value = var.analytics_opt_in - } - - # # Ingress set up - # set { - # name = "zenml.rootUrlPath" - # value = var.ingress_path != "" ? "/${var.ingress_path}" : "" - # } - # set { - # name = "zenml.ingress.path" - # value = var.ingress_path != "" ? "/${var.ingress_path}/?(.*)" : "/" - # } - # set { - # name = "zenml.ingress.annotations.nginx\\.ingress\\.kubernetes\\.io/rewrite-target" - # value = var.ingress_path != "" ? "/$1" : "" - # } - # set { - # name = "zenml.ingress.host" - # value = var.create_ingress_controller ? "${data.kubernetes_service.ingress-controller[0].status.0.load_balancer.0.ingress.0.ip}.nip.io" : "${var.ingress_controller_hostname}.nip.io" - # } - # set { - # name = "zenml.ingress.tls.enabled" - # value = var.ingress_tls - # } - # set { - # name = "zenml.ingress.tls.generateCerts" - # value = var.ingress_tls_generate_certs - # } - # set { - # name = "zenml.ingress.tls.secretName" - # value = "${var.prefix}-${var.ingress_tls_secret_name}" - # } - - # set parameters for the mysql database - set { - name = "zenml.database.url" - value = var.deploy_db ? "mysql://${var.database_username}:${azurerm_mysql_flexible_server.mysql[0].administrator_password}@${azurerm_mysql_flexible_server.mysql[0].name}.mysql.database.azure.com:3306/${var.db_name}" : var.database_url - } - set { - name = "zenml.database.sslCa" - value = var.deploy_db ? "" : var.database_ssl_ca - } - set { - name = "zenml.database.sslCert" - value = var.deploy_db ? "" : var.database_ssl_cert - } - set { - name = "zenml.database.sslKey" - value = var.deploy_db ? "" : var.database_ssl_key - } - set { - name = "zenml.database.sslVerifyServerCert" - value = var.deploy_db ? false : var.database_ssl_verify_server_cert - } - set { - name = "zenml.image.tag" - value = var.zenmlserver_version - } - depends_on = [ - resource.kubernetes_namespace.zen_server - ] -} - -# data "kubernetes_secret" "certificates" { -# metadata { -# name = "${var.prefix}-${var.ingress_tls_secret_name}" -# namespace = "${var.prefix}-${var.namespace}" -# } -# binary_data = { -# "tls.crt" = "" -# "tls.key" = "" -# "ca.crt" = "" -# } - -# depends_on = [ -# helm_release.zen-server -# ] -# } diff --git a/src/matcha_ml/infrastructure/llm/zen_server/outputs.tf b/src/matcha_ml/infrastructure/llm/zen_server/outputs.tf deleted file mode 100644 index 8d986559..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/outputs.tf +++ /dev/null @@ -1,19 +0,0 @@ -output "zenserver_url" { - description = "The URL for the ZenML server" - value = "http://${data.kubernetes_service.zen_server.status.0.load_balancer.0.ingress.0.ip}" -} - -output "zenserver_username" { - description = "The username used to access the ZenML server" - value = var.username -} - -output "zenserver_password" { - description = "The password used to access the ZenML server" - value = var.password - sensitive = true -} - -# output "zenserver_url" { -# value = var.create_ingress_controller ? "https://${data.kubernetes_service.ingress-controller[0].status.0.load_balancer.0.ingress.0.ip}.nip.io/${var.ingress_path}" : "https://${var.ingress_controller_hostname}.nip.io/${var.ingress_path}" -# } diff --git a/src/matcha_ml/infrastructure/llm/zen_server/providers.tf b/src/matcha_ml/infrastructure/llm/zen_server/providers.tf deleted file mode 100644 index a418423b..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/providers.tf +++ /dev/null @@ -1,16 +0,0 @@ -# defining the providers for the zenserver module -terraform { - required_providers { - kubectl = { - source = "gavinbunney/kubectl" - version = "1.14.0" - } - - htpasswd = { - source = "loafoe/htpasswd" - version = "1.0.4" - } - } - - required_version = ">= 0.14.8" -} diff --git a/src/matcha_ml/infrastructure/llm/zen_server/sql.tf b/src/matcha_ml/infrastructure/llm/zen_server/sql.tf deleted file mode 100644 index 4e87117e..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/sql.tf +++ /dev/null @@ -1,57 +0,0 @@ -resource "azurerm_mysql_flexible_server" "mysql" { - count = var.deploy_db ? 1 : 0 - name = "${var.prefix}${var.db_instance_name}" - resource_group_name = var.resource_group_name - location = var.location - administrator_login = var.database_username - administrator_password = var.database_password == "" ? random_password.mysql_password.result : var.database_password - version = var.db_version - storage { - size_gb = var.db_disk_size - } - sku_name = var.db_sku_name -} - -resource "azurerm_mysql_flexible_database" "db" { - count = var.deploy_db ? 1 : 0 - name = "${var.prefix}${var.db_name}" - resource_group_name = var.resource_group_name - server_name = azurerm_mysql_flexible_server.mysql[0].name - charset = "utf8" - collation = "utf8_unicode_ci" -} - -resource "azurerm_mysql_flexible_server_firewall_rule" "allow_IPs" { - count = var.deploy_db ? 1 : 0 - name = "all_traffic" - resource_group_name = var.resource_group_name - server_name = azurerm_mysql_flexible_server.mysql[0].name - start_ip_address = "0.0.0.0" - end_ip_address = "255.255.255.255" -} - -resource "azurerm_mysql_flexible_server_configuration" "require_ssl" { - count = var.deploy_db ? 1 : 0 - name = "require_secure_transport" - resource_group_name = var.resource_group_name - server_name = azurerm_mysql_flexible_server.mysql[0].name - value = "OFF" -} - -resource "random_password" "mysql_password" { - length = 12 - special = false - min_lower = 1 - min_numeric = 1 - min_upper = 1 -} - -# # download SSL certificate -# resource "null_resource" "download-SSL-certificate" { -# count = var.deploy_db ? 1 : 0 - -# provisioner "local-exec" { -# command = "wget https://dl.cacerts.digicert.com/DigiCertGlobalRootCA.crt.pem" -# } - -# } diff --git a/src/matcha_ml/infrastructure/llm/zen_server/variables.tf b/src/matcha_ml/infrastructure/llm/zen_server/variables.tf deleted file mode 100644 index ae4a8d66..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/variables.tf +++ /dev/null @@ -1,167 +0,0 @@ -variable "prefix" { - description = "A prefix used for all resources" - type = string -} - -variable "resource_group_name" { - description = "The resource group in Azure that you want to deploy ZenML to" - type = string -} - -variable "location" { - description = "The location for your Azure resources" - type = string -} - -# ZenServer credentials -variable "username" { - description = "Username for the default ZenML server account" - default = "default" - type = string -} - -variable "password" { - description = "Password for the default ZenML server account" - type = string -} - -variable "namespace" { - description = "The namespace to install the ZenML server Helm chart in" - default = "terraform-server" - type = string -} - -variable "kubectl_config_path" { - description = "The path to the kube config" - default = "" - type = string -} - -variable "analytics_opt_in" { - description = "The flag to enable/disable analytics" - default = false - type = bool -} - -# If you want a new Flexible Server, choose a name and a password. If you already -# have an instance, provide the name and the password here too. -variable "database_username" { - description = "The username for the CloudSQL store" - default = "user" - type = string -} -variable "database_password" { - description = "The password for the CloudSQL store" - default = "" - type = string -} - -# if you enable the deploy_db option, this will -# create a new Flexible MySQL instance and then use it for this -# ZenServer. If disabled, you have to supply connection details -# in the section below. -variable "deploy_db" { - description = "Should a Flexible MySQL instance be created?" - default = true - type = bool -} -variable "db_instance_name" { - description = "The name for the Flexible MySQL store" - default = "zenmlserver" - type = string -} -variable "db_name" { - description = "The name for the database" - default = "zendb" - type = string -} -variable "db_version" { - description = "The version of MySQL to use" - default = "5.7" -} -variable "db_sku_name" { - description = "The sku_name for the database resource" - default = "B_Standard_B1s" - type = string -} -variable "db_disk_size" { - description = "The allocated storage in gigabytes" - default = 20 - type = number -} - -# If you haven't enabled the deploy_db option, provide -# the following value in addition to setting the username and -# password in the values.tfvars.json file. -variable "database_url" { - description = "The URL for the Flexible MySQL instance" - default = "" - type = string -} -variable "database_ssl_ca" { - description = "The server ca for the Flexible MySQL instance" - default = "" - type = string -} -variable "database_ssl_cert" { - description = "The client cert for the Flexible MySQL instance" - default = "" - type = string -} -variable "database_ssl_key" { - description = "The client key for the Flexible MySQL instance" - default = "" - type = string -} -variable "database_ssl_verify_server_cert" { - description = "Should SSL be verified?" - default = false - type = bool -} - -# # Ingress variables -# variable "ingress_path" { -# description = "The path on the Ingress URL to expose ZenML at" -# default = "zenml" -# type = string -# } - -# # set to true if you don't already have an nginx ingress -# # controller in your cluster -# variable "create_ingress_controller" { -# description = "set to true if you want to create an ingress controller in your cluster" -# default = true -# type = bool -# } - -# # if you already have an ingress controller, supply it's URL -# variable "ingress_controller_hostname" { -# description = "The hostname for the ingress controller on your cluster" -# default = "" -# type = string -# } -# variable "ingress_tls" { -# description = "Whether to enable tls on the ingress or not" -# default = true -# type = bool -# } -# variable "ingress_tls_generate_certs" { -# description = "Whether to enable tls certificates or not" -# default = true -# type = bool -# } -# variable "ingress_tls_secret_name" { -# description = "Name for the Kubernetes secret that stores certificates" -# default = "zenml-tls-certs" -# type = string -# } - -variable "zenmlserver_image_repo" { - description = "The repository to use for the zenmlserver docker image." - default = "zenmldocker/zenml-server" - type = string -} -variable "zenmlserver_version" { - description = "The tag to use for the zenmlserver docker image." - type = string -} diff --git a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/Chart.yaml b/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/Chart.yaml deleted file mode 100644 index 51fbb0fe..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/Chart.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v2 -name: zenml -version: "1.0" -description: Open source MLOps framework for portable production ready ML pipelines -keywords: -- mlops -- zenml -- server -home: https://zenml.io -sources: -- https://github.com/zenml-io/zenml -icon: https://raw.githubusercontent.com/zenml-io/zenml/main/docs/book/.gitbook/assets/zenml_logo.png -appVersion: "0.42.1" diff --git a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/NOTES.txt b/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/NOTES.txt deleted file mode 100644 index a4de5753..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/NOTES.txt +++ /dev/null @@ -1,36 +0,0 @@ -{{- if .Values.zenml.ingress.enabled }} -{{- if .Values.zenml.ingress.host }} -You can access the ZenML server at: - - http{{ if $.Values.zenml.ingress.tls.enabled }}s{{ end }}://{{ .Values.zenml.ingress.host }}{{ .Values.zenml.ingress.path }} - -with the following credentials: - - username: {{ .Values.zenml.defaultUsername }} - password: {{ .Values.zenml.defaultPassword }} - -{{- else }} - - -{{- end }} -{{- else }} - -You can get the ZenML server URL by running these commands: - -{{- if contains "NodePort" .Values.zenml.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "zenml.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.zenml.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "zenml.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "zenml.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.zenml.service.port }} -{{- else if contains "ClusterIP" .Values.zenml.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "zenml.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} - -{{- end }} diff --git a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/_helpers.tpl b/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/_helpers.tpl deleted file mode 100644 index 6732baae..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/_helpers.tpl +++ /dev/null @@ -1,70 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "zenml.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "zenml.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "zenml.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "zenml.labels" -}} -helm.sh/chart: {{ include "zenml.chart" . }} -{{ include "zenml.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} -{{- define "zenml.metadataLabels" -}} -helm.sh/chart: {{ include "zenml.chart" . }} -{{ include "zenml.metadataSelectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "zenml.selectorLabels" -}} -app.kubernetes.io/name: {{ include "zenml.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "zenml.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "zenml.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/cert-secret.yaml b/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/cert-secret.yaml deleted file mode 100644 index c10854db..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/cert-secret.yaml +++ /dev/null @@ -1,45 +0,0 @@ -{{- if and .Values.zenml.ingress.enabled .Values.zenml.ingress.tls.enabled .Values.zenml.ingress.tls.generateCerts -}} - -{{- $certSubjectName := .Values.zenml.ingress.host -}} - -{{- $prevServerSecret := (lookup "v1" "Secret" .Release.Namespace .Values.zenml.ingress.tls.secretName) -}} -{{- if or .Release.IsInstall (not $prevServerSecret) }} -{{- $_ := set . "regenerateCerts" true -}} -{{- else if eq (index $prevServerSecret.metadata.annotations "zenml.certs/subject-name") $certSubjectName }} -{{- $_ := set . "regenerateCerts" false -}} -{{- else }} -{{- $_ := set . "regenerateCerts" true -}} -{{- end }} - -{{- if .regenerateCerts }} - -{{- $caCert := genCA "zenml-ca" 365 -}} -{{- $serverCert := genSignedCert $certSubjectName nil (list $certSubjectName) 365 $caCert -}} - -{{- $_ := set . "caCert" $caCert.Cert -}} -{{- $_ := set . "serverCert" $serverCert.Cert -}} -{{- $_ := set . "serverKey" $serverCert.Key -}} - -{{- else }} - -{{- $_ := set . "caCert" (index $prevServerSecret.data "ca.crt" | b64dec) -}} -{{- $_ := set . "serverCert" (index $prevServerSecret.data "tls.crt" | b64dec) -}} -{{- $_ := set . "serverKey" (index $prevServerSecret.data "tls.key" | b64dec) -}} - -{{- end }} - -apiVersion: v1 -kind: Secret -metadata: - name: {{ .Values.zenml.ingress.tls.secretName }} - labels: - {{- include "zenml.labels" . | nindent 4 }} - annotations: - zenml.certs/subject-name: {{ $certSubjectName}} -type: kubernetes.io/tls -data: - tls.crt: {{ .serverCert | b64enc | quote }} - tls.key: {{ .serverKey | b64enc | quote }} - ca.crt: {{ .caCert | b64enc | quote }} - -{{- end }} diff --git a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/hpa.yaml b/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/hpa.yaml deleted file mode 100644 index da913c40..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/hpa.yaml +++ /dev/null @@ -1,28 +0,0 @@ -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "zenml.fullname" . }} - labels: - {{- include "zenml.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "zenml.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/server-deployment.yaml b/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/server-deployment.yaml deleted file mode 100644 index 6e28098f..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/server-deployment.yaml +++ /dev/null @@ -1,242 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "zenml.fullname" . }} - labels: - {{- include "zenml.labels" . | nindent 4 }} -spec: - {{- if .Values.zenml.database.url }} - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.zenml.replicaCount }} - {{- end }} - {{- else }} - replicas: 1 - {{- end }} - selector: - matchLabels: - {{- include "zenml.selectorLabels" . | nindent 6 }} - template: - metadata: - annotations: - checksum/secret: {{ include (print $.Template.BasePath "/server-secret.yaml") . | sha256sum }} - {{- with .Values.podAnnotations }} - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "zenml.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "zenml.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - {{- if and (eq .Values.zenml.secretsStore.type "gcp") .Values.zenml.secretsStore.gcp.google_application_credentials }} - volumes: - - name: gcp-credentials - secret: - secretName: {{ include "zenml.fullname" . }} - items: - - key: GOOGLE_APPLICATION_CREDENTIALS_FILE - path: credentials.json - {{- end }} - {{- if .Values.zenml.database.url }} - initContainers: - - name: {{ .Chart.Name }}-db-init - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.zenml.image.repository }}:{{ .Values.zenml.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.zenml.image.pullPolicy }} - args: ["status"] - command: ['zenml'] - env: - {{- if .Values.zenml.debug }} - - name: ZENML_LOGGING_VERBOSITY - value: "DEBUG" - {{- end }} - - name: ZENML_ANALYTICS_OPT_IN - value: "False" - - name: ZENML_DEFAULT_PROJECT_NAME - value: {{ .Values.zenml.defaultProject | quote }} - - name: ZENML_DEFAULT_USER_NAME - value: {{ .Values.zenml.defaultUsername | quote }} - {{- if .Values.zenml.database.url }} - - name: ZENML_STORE_TYPE - value: sql - - name: ZENML_STORE_SSL_VERIFY_SERVER_CERT - value: {{ .Values.zenml.database.sslVerifyServerCert | default "false" | quote }} - {{- end }} - {{- if .Values.zenml.secretsStore.enabled }} - - name: ZENML_SECRETS_STORE_TYPE - value: {{ .Values.zenml.secretsStore.type | quote }} - {{- if eq .Values.zenml.secretsStore.type "aws" }} - - name: ZENML_SECRETS_STORE_REGION_NAME - value: {{ .Values.zenml.secretsStore.aws.region_name | quote }} - - name: ZENML_SECRETS_STORE_SECRET_LIST_REFRESH_TIMEOUT - value: {{ .Values.zenml.secretsStore.aws.secret_list_refresh_timeout | quote }} - {{- else if eq .Values.zenml.secretsStore.type "gcp" }} - - name: ZENML_SECRETS_STORE_PROJECT_ID - value: {{ .Values.zenml.secretsStore.gcp.project_id | quote }} - {{- if .Values.zenml.secretsStore.gcp.google_application_credentials }} - - name: GOOGLE_APPLICATION_CREDENTIALS - value: /gcp-credentials/credentials.json - {{- end }} - {{- else if eq .Values.zenml.secretsStore.type "azure" }} - - name: ZENML_SECRETS_STORE_KEY_VAULT_NAME - value: {{ .Values.zenml.secretsStore.azure.key_vault_name | quote }} - {{- else if eq .Values.zenml.secretsStore.type "hashicorp" }} - - name: ZENML_SECRETS_STORE_VAULT_ADDR - value: {{ .Values.zenml.secretsStore.hashicorp.vault_addr | quote }} - {{- if .Values.zenml.secretsStore.hashicorp.vault_namespace }} - - name: ZENML_SECRETS_STORE_VAULT_NAMESPACE - value: {{ .Values.zenml.secretsStore.hashicorp.vault_namespace | quote }} - {{- end }} - {{- if .Values.zenml.secretsStore.hashicorp.max_versions }} - - name: ZENML_SECRETS_STORE_MAX_VERSIONS - value: {{ .Values.zenml.secretsStore.hashicorp.max_versions | quote }} - {{- end }} - {{- else if eq .Values.zenml.secretsStore.type "custom" }} - - name: ZENML_SECRETS_STORE_CLASS_PATH - value: {{ .Values.zenml.secretsStore.custom.class_path | quote }} - {{- end }} - {{- else }} - - name: ZENML_SECRETS_STORE_TYPE - value: none - {{- end }} - {{- if .Values.zenml.environment }} - {{- range $key, $value := .Values.zenml.environment }} - - name: {{ $key }} - value: {{ $value | quote }} - {{- end }} - {{- end }} - envFrom: - - secretRef: - name: {{ include "zenml.fullname" . }} - {{- if and (eq .Values.zenml.secretsStore.type "gcp") .Values.zenml.secretsStore.gcp.google_application_credentials }} - volumeMounts: - - name: gcp-credentials - mountPath: /gcp-credentials - readOnly: true - {{- end }} - {{- end }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.zenml.image.repository }}:{{ .Values.zenml.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.zenml.image.pullPolicy }} - env: - {{- if .Values.zenml.debug }} - - name: ZENML_LOGGING_VERBOSITY - value: "DEBUG" - {{- end }} - {{- if .Values.zenml.analyticsOptIn }} - - name: ZENML_ANALYTICS_OPT_IN - value: "True" - {{- else if not .Values.zenml.analyticsOptIn }} - - name: ZENML_ANALYTICS_OPT_IN - value: "False" - {{- end }} - - name: ZENML_AUTH_TYPE - value: {{ .Values.zenml.authType | quote }} - {{- if .Values.zenml.rootUrlPath }} - - name: ZENML_SERVER_ROOT_URL_PATH - value: {{ .Values.zenml.rootUrlPath | quote }} - {{- end }} - - name: ZENML_DEFAULT_PROJECT_NAME - value: {{ .Values.zenml.defaultProject | quote }} - - name: ZENML_DEFAULT_USER_NAME - value: {{ .Values.zenml.defaultUsername | quote }} - {{- if .Values.zenml.enableImplicitAuthMethods }} - - name: ZENML_ENABLE_IMPLICIT_AUTH_METHODS - value: "True" - {{- end }} - {{- if .Values.zenml.database.url }} - - name: ZENML_STORE_TYPE - value: sql - - name: DISABLE_DATABASE_MIGRATION - value: "True" - - name: ZENML_STORE_SSL_VERIFY_SERVER_CERT - value: {{ .Values.zenml.database.sslVerifyServerCert | default "false" | quote }} - {{- end }} - {{- if .Values.zenml.secretsStore.enabled }} - - name: ZENML_SECRETS_STORE_TYPE - value: {{ .Values.zenml.secretsStore.type | quote }} - {{- if eq .Values.zenml.secretsStore.type "aws" }} - - name: ZENML_SECRETS_STORE_REGION_NAME - value: {{ .Values.zenml.secretsStore.aws.region_name | quote }} - - name: ZENML_SECRETS_STORE_SECRET_LIST_REFRESH_TIMEOUT - value: {{ .Values.zenml.secretsStore.aws.secret_list_refresh_timeout | quote }} - {{- else if eq .Values.zenml.secretsStore.type "gcp" }} - - name: ZENML_SECRETS_STORE_PROJECT_ID - value: {{ .Values.zenml.secretsStore.gcp.project_id | quote }} - {{- if .Values.zenml.secretsStore.gcp.google_application_credentials }} - - name: GOOGLE_APPLICATION_CREDENTIALS - value: /gcp-credentials/credentials.json - {{- end }} - {{- else if eq .Values.zenml.secretsStore.type "azure" }} - - name: ZENML_SECRETS_STORE_KEY_VAULT_NAME - value: {{ .Values.zenml.secretsStore.azure.key_vault_name | quote }} - {{- else if eq .Values.zenml.secretsStore.type "hashicorp" }} - - name: ZENML_SECRETS_STORE_VAULT_ADDR - value: {{ .Values.zenml.secretsStore.hashicorp.vault_addr | quote }} - {{- if .Values.zenml.secretsStore.hashicorp.vault_namespace }} - - name: ZENML_SECRETS_STORE_VAULT_NAMESPACE - value: {{ .Values.zenml.secretsStore.hashicorp.vault_namespace | quote }} - {{- end }} - {{- if .Values.zenml.secretsStore.hashicorp.max_versions }} - - name: ZENML_SECRETS_STORE_MAX_VERSIONS - value: {{ .Values.zenml.secretsStore.hashicorp.max_versions | quote }} - {{- end }} - {{- else if eq .Values.zenml.secretsStore.type "custom" }} - - name: ZENML_SECRETS_STORE_CLASS_PATH - value: {{ .Values.zenml.secretsStore.custom.class_path | quote }} - {{- end }} - {{- else }} - - name: ZENML_SECRETS_STORE_TYPE - value: none - {{- end }} - - name: ZENML_SERVER_DEPLOYMENT_TYPE - value: {{ .Values.zenml.deploymentType | default "kubernetes" }} - {{- if .Values.zenml.environment }} - {{- range $key, $value := .Values.zenml.environment }} - - name: {{ $key }} - value: {{ $value | quote }} - {{- end }} - {{- end }} - envFrom: - - secretRef: - name: {{ include "zenml.fullname" . }} - {{- if and (eq .Values.zenml.secretsStore.type "gcp") .Values.zenml.secretsStore.gcp.google_application_credentials }} - volumeMounts: - - name: gcp-credentials - mountPath: /gcp-credentials - readOnly: true - {{- end }} - ports: - - name: http - containerPort: 8080 - protocol: TCP - livenessProbe: - httpGet: - path: /health - port: http - readinessProbe: - httpGet: - path: /health - port: http - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/server-ingress.yaml b/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/server-ingress.yaml deleted file mode 100644 index d2e0423e..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/server-ingress.yaml +++ /dev/null @@ -1,59 +0,0 @@ -{{- if .Values.zenml.ingress.enabled -}} -{{- $fullName := include "zenml.fullname" . -}} -{{- $svcPort := .Values.zenml.service.port -}} -{{- if and .Values.zenml.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.zenml.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.zenml.ingress.annotations "kubernetes.io/ingress.class" .Values.zenml.ingress.className}} - {{- end }} -{{- end }} -{{- if and $.Values.zenml.ingress.tls.enabled (eq .Values.zenml.ingress.className "nginx") }} - {{- $_ := set .Values.zenml.ingress.annotations "nginx.ingress.kubernetes.io/ssl-redirect" "true"}} -{{- end }} - -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "zenml.labels" . | nindent 4 }} - {{- with .Values.zenml.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.zenml.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.zenml.ingress.className }} - {{- end }} - {{- if .Values.zenml.ingress.tls.enabled }} - tls: - - hosts: - - {{ .Values.zenml.ingress.host | quote }} - secretName: {{ .Values.zenml.ingress.tls.secretName }} - {{- end }} - rules: - - http: - paths: - - path: {{ .Values.zenml.ingress.path }} - {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} - pathType: Prefix - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- if .Values.zenml.ingress.host }} - host: {{ .Values.zenml.ingress.host | quote }} - {{- end }} -{{- end }} diff --git a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/server-secret.yaml b/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/server-secret.yaml deleted file mode 100644 index 45f8fd11..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/server-secret.yaml +++ /dev/null @@ -1,70 +0,0 @@ -apiVersion: v1 -kind: Secret -type: Opaque -metadata: - name: {{ include "zenml.fullname" . }} - labels: - {{- include "zenml.labels" . | nindent 4 }} -data: - ZENML_DEFAULT_USER_PASSWORD: {{ .Values.zenml.defaultPassword | b64enc | quote }} - {{- if .Values.zenml.jwtSecretKey }} - ZENML_JWT_SECRET_KEY: {{ .Values.zenml.jwtSecretKey | b64enc | quote }} - {{- else if .Release.IsInstall }} - ZENML_JWT_SECRET_KEY: {{ randAlphaNum 32 | b64enc | quote }} - {{- else }} - ZENML_JWT_SECRET_KEY: {{ (lookup "v1" "Secret" .Release.Namespace (include "zenml.fullname" .)).data.ZENML_JWT_SECRET_KEY | default (randAlphaNum 32 | b64enc | quote) }} - {{- end }} - {{- if .Values.zenml.database.url }} - ZENML_STORE_URL: {{ .Values.zenml.database.url | b64enc | quote }} - {{- if .Values.zenml.database.sslCa }} - ZENML_STORE_SSL_CA: {{ .Files.Get .Values.zenml.database.sslCa | b64enc }} - {{- end }} - {{- if .Values.zenml.database.sslCert }} - ZENML_STORE_SSL_CERT: {{ .Files.Get .Values.zenml.database.sslCert | b64enc }} - {{- end }} - {{- if .Values.zenml.database.sslKey }} - ZENML_STORE_SSL_KEY: {{ .Files.Get .Values.zenml.database.sslKey | b64enc }} - {{- end }} - {{- end }} - {{- if .Values.zenml.secretsStore.enabled }} - {{- if eq .Values.zenml.secretsStore.type "sql" }} - {{- if .Values.zenml.secretsStore.sql.encryptionKey }} - ZENML_SECRETS_STORE_ENCRYPTION_KEY: {{ .Values.zenml.secretsStore.sql.encryptionKey | b64enc | quote }} - {{- else if .Values.zenml.secretsStore.encryptionKey }} - ZENML_SECRETS_STORE_ENCRYPTION_KEY: {{ .Values.zenml.secretsStore.encryptionKey | b64enc | quote }} - {{- end }} - {{- else if eq .Values.zenml.secretsStore.type "aws" }} - {{- if .Values.zenml.secretsStore.aws.aws_access_key_id }} - ZENML_SECRETS_STORE_AWS_ACCESS_KEY_ID: {{ .Values.zenml.secretsStore.aws.aws_access_key_id | b64enc | quote }} - {{- end }} - {{- if .Values.zenml.secretsStore.aws.aws_secret_access_key }} - ZENML_SECRETS_STORE_AWS_SECRET_ACCESS_KEY: {{ .Values.zenml.secretsStore.aws.aws_secret_access_key | b64enc | quote }} - {{- end }} - {{- if .Values.zenml.secretsStore.aws.aws_session_token }} - ZENML_SECRETS_STORE_AWS_SESSION_TOKEN: {{ .Values.zenml.secretsStore.aws.aws_session_token | b64enc | quote }} - {{- end }} - {{- else if eq .Values.zenml.secretsStore.type "azure" }} - {{- if .Values.zenml.secretsStore.azure.azure_client_id }} - ZENML_SECRETS_STORE_AZURE_CLIENT_ID: {{ .Values.zenml.secretsStore.azure.azure_client_id | b64enc | quote }} - {{- end }} - {{- if .Values.zenml.secretsStore.azure.azure_client_secret }} - ZENML_SECRETS_STORE_AZURE_CLIENT_SECRET: {{ .Values.zenml.secretsStore.azure.azure_client_secret | b64enc | quote }} - {{- end }} - {{- if .Values.zenml.secretsStore.azure.azure_tenant_id }} - ZENML_SECRETS_STORE_AZURE_TENANT_ID: {{ .Values.zenml.secretsStore.azure.azure_tenant_id | b64enc | quote }} - {{- end }} - {{- else if eq .Values.zenml.secretsStore.type "gcp" }} - {{- if .Values.zenml.secretsStore.gcp.google_application_credentials }} - GOOGLE_APPLICATION_CREDENTIALS_FILE: {{ .Files.Get .Values.zenml.secretsStore.gcp.google_application_credentials | b64enc | quote }} - {{- end }} - {{- else if eq .Values.zenml.secretsStore.type "hashicorp" }} - {{- if .Values.zenml.secretsStore.hashicorp.vault_token }} - ZENML_SECRETS_STORE_VAULT_TOKEN: {{ .Values.zenml.secretsStore.hashicorp.vault_token | b64enc | quote }} - {{- end }} - {{- end }} - {{- end }} - {{- if .Values.zenml.environment }} - {{- range $key, $value := .Values.zenml.environment }} - {{ $key }}: {{ $value | b64enc | quote }} - {{- end }} - {{- end }} diff --git a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/server-service.yaml b/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/server-service.yaml deleted file mode 100644 index 74d00f3a..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/server-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "zenml.fullname" . }} - labels: - {{- include "zenml.labels" . | nindent 4 }} -spec: - type: {{ .Values.zenml.service.type }} - ports: - - port: {{ .Values.zenml.service.port }} - targetPort: 8080 - protocol: TCP - name: http - selector: - {{- include "zenml.selectorLabels" . | nindent 4 }} diff --git a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/serviceaccount.yaml b/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/serviceaccount.yaml deleted file mode 100644 index 79eacbc8..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/serviceaccount.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "zenml.serviceAccountName" . }} - labels: - {{- include "zenml.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/tests/test-connection.yaml b/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/tests/test-connection.yaml deleted file mode 100644 index 1ff5a91f..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "zenml.fullname" . }}-test-connection" - labels: - {{- include "zenml.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "zenml.fullname" . }}:{{ .Values.zenml.service.port }}'] - restartPolicy: Never diff --git a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/values.yaml b/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/values.yaml deleted file mode 100644 index e03a5cd7..00000000 --- a/src/matcha_ml/infrastructure/llm/zen_server/zenml_helm/values.yaml +++ /dev/null @@ -1,326 +0,0 @@ -# Default values for zenml. - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - - -# ZenML server related options. -zenml: - - replicaCount: 1 - - image: - repository: zenmldocker/zenml-server - pullPolicy: Always - # Overrides the image tag whose default is the chart appVersion. - tag: - - debug: true - - # Flag to enable/disable the tracking process of the analytics - analyticsOptIn: true - - # ZenML server deployment type. This field is used for telemetry purposes. - # Example values are "local", "kubernetes", "aws", "gcp", "azure". - deploymentType: - - # The ZenML authentication scheme. Use one of: - # - # NO_AUTH - No authentication - # HTTP_BASIC - HTTP Basic authentication - # OAUTH2_PASSWORD_BEARER - OAuth2 password bearer with JWT tokens - authType: OAUTH2_PASSWORD_BEARER - - # The secret key used to sign JWT tokens. Only relevant if the - # OAUTH2_PASSWORD_BEARER authentication scheme is used. This should be set to - # a random string with a recommended length of at least 32 characters, e.g.: - # - # ```python - # from secrets import token_hex - # token_hex(32) - # ``` - # - # or: - # - # ```shell - # openssl rand -hex 32 - # ``` - # - # If not explicitly set, a random key will be generated when the helm - # chart is installed and reused for all subsequent upgrades. - jwtSecretKey: - - # The root URL path to use when behind a proxy. This is useful when the - # `rewrite-target` annotation is used in the ingress controller, e.g.: - # - # ```yaml - # rootUrlPath: /zenml - # - # ingress: - # enabled: true - # className: "nginx" - # annotations: - # nginx.ingress.kubernetes.io/rewrite-target: /$1 - # host: - # path: /zenml/?(.*) - # ``` - rootUrlPath: - - defaultProject: default - defaultUsername: default - # Use your own password here - defaultPassword: zenml - - # Implicit authentication methods featured by service connectors that support - # them are disabled by default, for security reasons. This is because they - # allow users to authenticate to the cloud provider where ZenML is running - # without having to provide any credentials. - enableImplicitAuthMethods: false - - # MySQL database configuration. If not set, a local sqlite database will be - # used, which will not be persisted across pod restarts. - # NOTE: the certificate files need to be copied in the helm chart folder and - # the paths configured here need to be relative to the root of the helm chart. - database: {} - # url: "mysql://admin:password@zenml-mysql:3306/database" - # sslCa: /path/to/ca.pem - # sslCert: /path/to/client-cert.pem - # sslKey: /path/to/client-key.pem - # sslVerifyServerCert: True - - - # Secrets store settings. This is used to store centralized secrets. - secretsStore: - - # Set to false to disable the secrets store. - enabled: true - - # The type of secrets store to use. Use one of: - # - # sql - Use the same SQL database as the ZenML server - # aws - Use the AWS Secrets Manager as a secrets store - # gcp - Use the GCP Secrets Manager as a secrets store - # azure - Use the Azure Key Vault as a secrets store - # hashicorp - Use the HashiCorp Vault as a secrets store - # custom - Use a custom secrets store implementation (needs a custom - # ZenML server image with the custom secrets store implementation - # installed) - # - # Depending on the type, additional configuration options may be required - # under the respective sections. - # - type: sql - - # SQL secrets store configuration. Only relevant if the `sql` secrets store - # type is configured. - sql: - - # The secret key used to encrypt secrets in the SQL database. Only relevant - # if the SQL secrets store type is used. This should be set to a random - # string with a recommended length of at least 32 characters, e.g.: - # - # ```python - # from secrets import token_hex - # token_hex(32) - # ``` - # - # or: - # - # ```shell - # openssl rand -hex 32 - # ``` - # - # If not set, database secret encryption will be disabled. - # - # IMPORTANT: If you configure encryption for your SQL database secrets - # store, you should keep this value somewhere safe and secure, as it will be - # required to decrypt the secrets in the database. If you lose the - # encryption key, you will not be able to decrypt the secrets in the - # database and will have to reset them. You should not change this value - # after you have already configured encryption for your SQL database - # secrets store. - encryptionKey: - - # AWS secrets store configuration. Only relevant if the `aws` secrets store - # type is configured. - aws: - - # The AWS region to use. This must be set to the region where the AWS - # Secrets Manager service that you want to use is located. - region_name: us-east-1 - - # The AWS credentials to use to authenticate with the AWS Secrets - # Manager instance. You can omit these if you are running the ZenML server - # in an AWS EKS cluster that has an IAM role attached to it that has - # permissions to access the AWS Secrets Manager instance. - # NOTE: setting this is the same as setting the AWS_ACCESS_KEY_ID, - # AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN environment variables - # in the zenml.secretEnvironment variable. - aws_access_key_id: - aws_secret_access_key: - aws_session_token: - - # The AWS Secrets Manager has a known issue where it does not immediately - # reflect new and updated secrets in the `list_secrets` results. To work - # around this issue, you can set this value to a non-zero value to - # get the ZenML server to wait after creating or updating an AWS secret - # until the changes are reflected in the secrets returned by - # `list_secrets` or the number of seconds specified by this value has - # elapsed. Should not be set to a high value as it may cause thread - # starvation in the ZenML server on high load. - secret_list_refresh_timeout: 0 - - - # GCP secrets store configuration. Only relevant if the `gcp` secrets store - # type is configured. - gcp: - - # The GCP project ID to use. This must be set to the project ID where the - # GCP Secrets Manager service that you want to use is located. - project_id: my-gcp-project - - # Path to the GCP credentials file to use to authenticate with the GCP Secrets - # Manager instance. You can omit this if you are running the ZenML server - # in a GCP GKE cluster that uses workload identity to authenticate with - # GCP services without the need for credentials. - # NOTE: the credentials file needs to be copied in the helm chart folder - # and the path configured here needs to be relative to the root of the - # helm chart. - google_application_credentials: - - # AWS Key Vault secrets store configuration. Only relevant if the `azure` - # secrets store type is configured. - azure: - - # The name of the Azure Key Vault. This must be set to point to the Azure - # Key Vault instance that you want to use. - key_vault_name: - - # The Azure application service principal credentials to use to - # authenticate with the Azure Key Vault API. You can omit these if you are - # running the ZenML server hosted in Azure and are using a managed - # identity to access the Azure Key Vault service. - # NOTE: setting this is the same as setting the AZURE_CLIENT_ID, - # AZURE_CLIENT_SECRET, and AZURE_TENANT_ID environment variables - # in the zenml.secretEnvironment variable. - azure_client_id: - azure_client_secret: - azure_tenant_id: - - # HashiCorp Vault secrets store configuration. Only relevant if the `hashicorp` - # secrets store type is configured - hashicorp: - - # The url of the HashiCorp Vault server - vault_addr: https://vault.example.com - # The token used to authenticate with the Vault server - vault_token: - # The Vault Enterprise namespace. Not required for Vault OSS. - vault_namespace: - # The maximum number of secret versions to keep. If not set, the default - # value of 1 will be used (only the latest version will be kept). - max_versions: - - # Custom secrets store configuration. Only relevant if the `custom` secrets - # store type is configured. - custom: - - # The class path of the custom secrets store implementation. This should - # point to a full Python class that extends the - # `zenml.zen_stores.secrets_stores.base_secrets_store.BaseSecretsStore` - # base class. The class should be importable from the container image - # that you are using for the ZenML server. - # - # Any additional configuration options for the custom secrets store - # implementation should be passed through the `environment` and the - # `secretEnvironment` variables and using the `ZENML_SECRETS_STORE_` - # environment variable naming convention. For example, if the custom - # secrets store implementation expects an `aws_access_key_id` option, you - # should set the `ZENML_SECRETS_STORE_AWS_ACCESS_KEY_ID` environment - # variable in the `zenml.secretEnvironment` variable. - class_path: my.custom.secrets.store.MyCustomSecretsStore - - # Extra environment variables to set in the ZenML server container. - environment: {} - - # Extra environment variables to set in the ZenML server container that - # should be kept secret. These will be set as Kubernetes secrets and - # mounted as environment variables in the ZenML server container. - secretEnvironment: {} - - service: - type: LoadBalancer # changed from ClusterIP - port: 80 - - ingress: - enabled: false # changed from true - className: "nginx" - annotations: - nginx.ingress.kubernetes.io/ssl-redirect: "true" - # nginx.ingress.kubernetes.io/rewrite-target: /$1 - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - # cert-manager.io/cluster-issuer: "letsencrypt" - - # hint: you can use a service like nip.io to get a wildcard DNS for your - # ingress IP address. For example, if your ingress IP is 192.168.0.1, you - # can use a host name like zenml.192.168.0.1.nip.io. This allows you to - # reuse the same ingress for multiple deployments and/or services. - host: - path: / - tls: - enabled: false - # NOTE: if enabled, this will generate self-signed certificates during - # installation. This also requires that the ingress host be set to the - # domain name or IP address used to access the ZenML server from outside - # the cluster. - generateCerts: false - secretName: zenml-tls-certs - - -serviceAccount: - # Specifies whether a service account should be created - create: true - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "zenml" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: - runAsNonRoot: true - runAsUser: 1000 - # capabilities: - # drop: - # - ALL - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/src/matcha_ml/infrastructure/llm/zenml_storage/README.md b/src/matcha_ml/infrastructure/llm/zenml_storage/README.md deleted file mode 100644 index 3787ccea..00000000 --- a/src/matcha_ml/infrastructure/llm/zenml_storage/README.md +++ /dev/null @@ -1,45 +0,0 @@ -## Requirements - -No requirements. - -## Providers - -| Name | Version | -|------|---------| -| [azurerm](#provider\_azurerm) | n/a | - -## Modules - -No modules. - -## Resources - -| Name | Type | -|------|------| -| [azurerm_role_assignment.zenmlstorage](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment) | resource | -| [azurerm_storage_account.zenmlaccount](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_account) | resource | -| [azurerm_storage_container.zenmlstoragecontainer](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_container) | resource | -| [azurerm_storage_account.zenmlaccount](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/storage_account) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [aks\_principal\_id](#input\_aks\_principal\_id) | Principal id for aks cluster | `string` | n/a | yes | -| [location](#input\_location) | The Azure Region in which this resources should be created. | `string` | n/a | yes | -| [prefix](#input\_prefix) | A prefix used for all resources | `string` | n/a | yes | -| [resource\_group\_name](#input\_resource\_group\_name) | The resource group name which is used to create the resource group | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [zenml\_blobstorage\_container\_path](#output\_zenml\_blobstorage\_container\_path) | The Azure Blob Storage Container path for storing zenml artifacts | -| [zenml\_primary\_access\_key](#output\_zenml\_primary\_access\_key) | ZenML Azure Storage Account - Primary access key | -| [zenml\_primary\_blob\_connection\_string](#output\_zenml\_primary\_blob\_connection\_string) | ZenML Azure Storage Account - Primary Blob service connection string | -| [zenml\_primary\_connection\_string](#output\_zenml\_primary\_connection\_string) | ZenML Azure Storage Account - Primary connection string | -| [zenml\_secondary\_access\_key](#output\_zenml\_secondary\_access\_key) | ZenML Azure Storage Account - Secondary access key | -| [zenml\_secondary\_blob\_connection\_string](#output\_zenml\_secondary\_blob\_connection\_string) | ZenML Azure Storage Account - Secondary Blob service connection string | -| [zenml\_secondary\_connection\_string](#output\_zenml\_secondary\_connection\_string) | ZenML Azure Storage Account - Secondary connection string | -| [zenml\_storage\_account\_name](#output\_zenml\_storage\_account\_name) | The name of the Azure Storage Account used to store ZenML artifacts. | -| [zenml\_storage\_container\_name](#output\_zenml\_storage\_container\_name) | The name of the Azure Storage container used to store ZenML artifacts. | diff --git a/src/matcha_ml/infrastructure/llm/zenml_storage/main.tf b/src/matcha_ml/infrastructure/llm/zenml_storage/main.tf deleted file mode 100644 index 8a37cb74..00000000 --- a/src/matcha_ml/infrastructure/llm/zenml_storage/main.tf +++ /dev/null @@ -1,31 +0,0 @@ -# Reference: https://github.com/hashicorp/terraform-provider-azurerm/tree/main/examples/storage/storage-container - -# create a storage account -resource "azurerm_storage_account" "zenmlaccount" { - name = "${var.prefix}zenmlacc" - resource_group_name = var.resource_group_name - location = var.location - - account_tier = "Standard" - account_kind = "StorageV2" - account_replication_type = "LRS" -} - -# create a storage container inside created storage account -resource "azurerm_storage_container" "zenmlstoragecontainer" { - name = "${var.prefix}artifactstore" - storage_account_name = azurerm_storage_account.zenmlaccount.name - container_access_type = "private" -} - - -data "azurerm_storage_account" "zenmlaccount" { - name = azurerm_storage_account.zenmlaccount.name - resource_group_name = var.resource_group_name -} - -resource "azurerm_role_assignment" "zenmlstorage" { - scope = azurerm_storage_account.zenmlaccount.id - role_definition_name = "Contributor" - principal_id = var.aks_principal_id -} diff --git a/src/matcha_ml/infrastructure/llm/zenml_storage/output.tf b/src/matcha_ml/infrastructure/llm/zenml_storage/output.tf deleted file mode 100644 index 84226fbf..00000000 --- a/src/matcha_ml/infrastructure/llm/zenml_storage/output.tf +++ /dev/null @@ -1,50 +0,0 @@ -output "zenml_storage_container_name" { - description = "The name of the Azure Storage container used to store ZenML artifacts." - value = azurerm_storage_container.zenmlstoragecontainer.name -} - -output "zenml_blobstorage_container_path" { - description = "The Azure Blob Storage Container path for storing zenml artifacts" - value = "az://${azurerm_storage_container.zenmlstoragecontainer.name}" -} - -output "zenml_storage_account_name" { - description = "The name of the Azure Storage Account used to store ZenML artifacts." - value = azurerm_storage_account.zenmlaccount.name -} - -output "zenml_primary_access_key" { - description = "ZenML Azure Storage Account - Primary access key" - value = azurerm_storage_account.zenmlaccount.primary_access_key - sensitive = true -} - -output "zenml_secondary_access_key" { - description = "ZenML Azure Storage Account - Secondary access key" - value = azurerm_storage_account.zenmlaccount.secondary_access_key - sensitive = true -} - -output "zenml_primary_connection_string" { - description = "ZenML Azure Storage Account - Primary connection string" - value = azurerm_storage_account.zenmlaccount.primary_connection_string - sensitive = true -} - -output "zenml_secondary_connection_string" { - description = "ZenML Azure Storage Account - Secondary connection string" - value = azurerm_storage_account.zenmlaccount.secondary_connection_string - sensitive = true -} - -output "zenml_primary_blob_connection_string" { - description = "ZenML Azure Storage Account - Primary Blob service connection string" - value = azurerm_storage_account.zenmlaccount.primary_blob_connection_string - sensitive = true -} - -output "zenml_secondary_blob_connection_string" { - description = "ZenML Azure Storage Account - Secondary Blob service connection string" - value = azurerm_storage_account.zenmlaccount.secondary_blob_connection_string - sensitive = true -} diff --git a/src/matcha_ml/infrastructure/llm/zenml_storage/variables.tf b/src/matcha_ml/infrastructure/llm/zenml_storage/variables.tf deleted file mode 100644 index c41ea739..00000000 --- a/src/matcha_ml/infrastructure/llm/zenml_storage/variables.tf +++ /dev/null @@ -1,19 +0,0 @@ -variable "prefix" { - description = "A prefix used for all resources" - type = string -} - -variable "resource_group_name" { - description = "The resource group name which is used to create the resource group" - type = string -} - -variable "location" { - description = "The Azure Region in which this resources should be created." - type = string -} - -variable "aks_principal_id" { - description = "Principal id for aks cluster" - type = string -} diff --git a/src/matcha_ml/templates/azure_template.py b/src/matcha_ml/templates/azure_template.py index e5a40908..7b05f3a8 100644 --- a/src/matcha_ml/templates/azure_template.py +++ b/src/matcha_ml/templates/azure_template.py @@ -16,25 +16,6 @@ from matcha_ml.state import MatchaState, MatchaStateService from matcha_ml.templates.base_template import BaseTemplate, TemplateVariables -DEFAULT_STACK_TF = [ - "aks", - "resource_group", - "mlflow_module", - "storage", - "seldon", - "zenml_storage", - "zen_server", - "azure_container_registry", - "zen_server/zenml_helm", - "zen_server/zenml_helm/templates", - "data_version_control_storage", -] -LLM_STACK_TF = DEFAULT_STACK_TF + [ - "chroma", - "chroma/chroma_helm", - "chroma/chroma_helm/templates", -] - class AzureTemplate(BaseTemplate): """A template tailored for provisioning the resources on azure. @@ -43,13 +24,9 @@ class AzureTemplate(BaseTemplate): BaseTemplate: The base template class. """ - def __init__(self, submodule_names: List[str]) -> None: - """Initialize the StateStorageTemplate with the submodule names. - - Args: - submodule_names (List[str]): A list of submodule names. - """ - super().__init__(submodule_names) + def __init__(self) -> None: + """Initialize the StateStorageTemplate.""" + pass @staticmethod def empty_directory_except_files(directory: str, except_files: List[str]) -> None: diff --git a/tests/test_cli/test_provision.py b/tests/test_cli/test_provision.py index 060f3013..4f472775 100644 --- a/tests/test_cli/test_provision.py +++ b/tests/test_cli/test_provision.py @@ -9,7 +9,6 @@ from typer.testing import CliRunner from matcha_ml.cli.cli import app -from matcha_ml.templates.azure_template import DEFAULT_STACK_TF BASE_DIR = os.path.dirname(os.path.abspath(__file__)) TEMPLATE_DIR = os.path.join( @@ -66,15 +65,6 @@ def assert_infrastructure( module_file_path = os.path.join(destination_path, module_file_name) assert os.path.exists(module_file_path) - for module_name in DEFAULT_STACK_TF: - for module_file_name in glob.glob( - os.path.join(TEMPLATE_DIR, module_name, "*.tf") - ): - module_file_path = os.path.join( - destination_path, module_name, module_file_name - ) - assert os.path.exists(module_file_path) - # Check that Terraform variables file exists and content is equal/correct variables_file_path = os.path.join(destination_path, "terraform.tfvars.json") assert os.path.exists(variables_file_path) diff --git a/tests/test_core/test_core_provision.py b/tests/test_core/test_core_provision.py index 9a934122..8593e668 100644 --- a/tests/test_core/test_core_provision.py +++ b/tests/test_core/test_core_provision.py @@ -23,7 +23,6 @@ from matcha_ml.state.matcha_state import ( MatchaState, ) -from matcha_ml.templates.azure_template import DEFAULT_STACK_TF BASE_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -154,15 +153,6 @@ def assert_infrastructure( module_file_path = os.path.join(destination_path, module_file_name) assert os.path.exists(module_file_path) - for module_name in DEFAULT_STACK_TF: - for module_file_name in glob.glob( - os.path.join(TEMPLATE_DIR, module_name, "*.tf") - ): - module_file_path = os.path.join( - destination_path, module_name, module_file_name - ) - assert os.path.exists(module_file_path) - # Check that Terraform variables file exists and content is equal/correct variables_file_path = os.path.join(destination_path, "terraform.tfvars.json") assert os.path.exists(variables_file_path)