-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RPD-284] Update AzureRunner to select the Terraform files corresponding to the stack name in the config file #187
[RPD-284] Update AzureRunner to select the Terraform files corresponding to the stack name in the config file #187
Conversation
* various changes * change variable names to make things more clear * shubham's comment * test for latest * update existing tests * update existing tests * shubham latest comment * add gitflow notation branches to ci (#183) * remove old, commented out code
* adds logic and tests for matcha config module * updates docstrings * adds tests and implements config object throughout matcha * updated for pr comments * updates docstring * fixes ci * updates for comments
…core-function-for-updating-stack-type # Conflicts: # src/matcha_ml/core/core.py
…dating-stack-type' into RPD-284-update-azurerunner-to-select-terraform-files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Just one comment about separating functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, a couple of architectural changes and we're good to go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. It'd be good to address the nit to simplify the code a little
with remote_state_manager.use_lock(), remote_state_manager.use_remote_state(): | ||
project_directory = os.getcwd() | ||
destination = os.path.join( | ||
project_directory, ".matcha", "infrastructure", "resources" | ||
) | ||
|
||
stack = MatchaConfigService.get_stack() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this stack
shouldn't be None
seeing as you set the stack earlier if there is no stack, so you can simplify this into a one liner on 294: MatchaConfigService.get_stack().value
(no call to lower()
as that's done in stack_set
either way)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this was the original implementation but mypy
doesn't like this though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I believe lower()
is required as the values are stored in matcha.config.json
as LLM
or DEFAULT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps adding a type to the stack
variable in the original implementation may help: stack: Optional[MatchaConfigComponentProperty] = ...
On the lower()
, if the internals are using the stack enum (they should), then the values should all be lower case
No worries if there's no work around for mypy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed lower casing. No work around for mypy
.
…update-azurerunner-to-select-terraform-files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ 🌯
* [RPD-282] adds stack cli command (#179) * adds tests and logic for stack and stack set cli commands * fixes typos * updated for comments * addresses comments * [RPD-285] Create LLM stack Terraform files (#182) * Add initial LLM Terraform files * Update Terraform Kubernetes Chroma deployment * Update Terraform docs * Revert default variables * Add missing aks module * [RPD-283] add core function for updating stack type (#185) * [RPD-287] ZenML version inference for zenserver (#180) * various changes * change variable names to make things more clear * shubham's comment * test for latest * update existing tests * update existing tests * shubham latest comment * add gitflow notation branches to ci (#183) * remove old, commented out code * [RPD-260] Add an object to handle the `matcha.config.json` file. (#184) * adds logic and tests for matcha config module * updates docstrings * adds tests and implements config object throughout matcha * updated for pr comments * updates docstring * fixes ci * updates for comments * enum and metaclass * enum and metaclass * bug removal * docstring stack_set * docstring file exists * fix current tests * add a couple tests, move logic for updating to configservice * lowercase-ify arg to enum * american spelling * american spelling * chris' comment re overwriting * friendlier api * Runtime error if not recognised arg type fpor update() * Runtime error if not recognised arg type fpor update() * update provision to use new update() API * update stack name * tests * tests * tests * quote marks * type version, mypy * various review comments * test for update() function * update tests to include quotes. * fixing tests * tidy tests, test error if resources provisioned * clearer error handling * remove unnecessary context * update test to new error type --------- Co-authored-by: Callum Wells <68609181+swells2020@users.noreply.github.com> * [RPD-286] Add documentation on "stacks" and the new LLM stack (#189) * Initial version of docs * Add motivation to stacks docs * Various docs updates based on reviews * [RPD-284] Update AzureRunner to select the Terraform files corresponding to the stack name in the config file (#187) * [RPD-287] ZenML version inference for zenserver (#180) * various changes * change variable names to make things more clear * shubham's comment * test for latest * update existing tests * update existing tests * shubham latest comment * add gitflow notation branches to ci (#183) * remove old, commented out code * [RPD-260] Add an object to handle the `matcha.config.json` file. (#184) * adds logic and tests for matcha config module * updates docstrings * adds tests and implements config object throughout matcha * updated for pr comments * updates docstring * fixes ci * updates for comments * enum and metaclass * enum and metaclass * bug removal * docstring stack_set * docstring file exists * fix current tests * add a couple tests, move logic for updating to configservice * lowercase-ify arg to enum * american spelling * american spelling * chris' comment re overwriting * friendlier api * Runtime error if not recognised arg type fpor update() * Runtime error if not recognised arg type fpor update() * update provision to use new update() API * update stack name * tests * tests * tests * Move files for selection * Clean up file * Remove a test that no longer describes the expected functionality * Remove a test that no longer describes the expected functionality * Fix tests * Stop creation of config file in local directory when running tests * Update check to use MatchaConfig object instead of to dict * Add get current stack name function to MatchaConfigService * Update get stack function * Fix test * Remove unnecessary lower casing * Fix tests * updates stack handling * Revert "updates stack handling" This reverts commit b42b31d. * [RPD-289] Update the Chroma Terraform within the LLM stack to use Helm #194 * [RPD-292] [BUG] Update AzureTemplate to not create redundant folders during provisioning (#195) * splits default stack * updates llm stack * [RPD-303] Update stack_set docstring to include example and raises (#196) --------- Co-authored-by: Callum Wells <68609181+swells2020@users.noreply.github.com> Co-authored-by: KirsoppJ <40233184+KirsoppJ@users.noreply.github.com> Co-authored-by: Jonathan Carlton <JonoCX@users.noreply.github.com>
This PR:
resources
Terraforms file todefault
.core.py
provision function to collect the stack name and use that as a pointer to the specified set of Terraform files.default
stack.This PR also fixes a bug where an error would be thrown due to the
matcha.config.json
file not being empty but not containing information relating to a resource group.This has been tested with both stacks.
One possible improvement is that when using the
default
stack an emptychroma
folder is still created within.matcha/infrastructure/resources
.Checklist
Please ensure you have done the following:
Type of change
Tick all those that apply: