From ccab06cf573581d8fc0e2218c9ee240a7b38bf8c Mon Sep 17 00:00:00 2001 From: Callum Wells <68609181+swells2020@users.noreply.github.com> Date: Thu, 17 Aug 2023 15:05:08 +0100 Subject: [PATCH 1/4] updates docs --- docs/getting-started.md | 40 +++++++++++++++++++++++++++++++++++++++- scratch.py | 3 +++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 scratch.py diff --git a/docs/getting-started.md b/docs/getting-started.md index bb9f3909..c8dc7727 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -2,6 +2,8 @@ In this guide, we'll walk you through how to provision your first machine learning infrastructure to Azure, and then use that infrastructure to train and deploy a model. The model we're using is a movie recommender, and we picked this because it's one that beginners can get up and running with quickly. +There are two ways to interact with Matcha; via the CLI tool, or through the API. Throughout this guide we'll demonstrate how to get started using either method. + There are five things we'll cover: * [Pre-requisites](#pre-requisites): everything you need to set up before starting. @@ -78,16 +80,27 @@ When you run this command, you'll be taken to the Azure login screen in a web br Next, let's provision: +CLI: ```bash matcha provision ``` -Initially, Matcha will ask you a few questions about how you'd like your infrastructure to be set up. Specifically, it will ask for a _name_ for your infrastructure, a _region_ to deploy it to. Once these details are provided, Matcha will proceed to initialize a remote state manager and ask for a password. After that, it will go ahead of provision infrastructure. +> Note: users have the choice of passing optional arguments representing the location, prefix, and password parameters by using '--location', '--prefix', or '--password'. For example; `--location uksouth --prefix test123 --password strong_password`. + +API: +```python +import matcha_ml.core as matcha + +_ = matcha.provision(location="uksouth", prefix="test123", password="strong_password") +``` + +Initially, Matcha will ask you a few questions about how you'd like your infrastructure to be set up. Specifically, it will ask for a _location_ for your infrastructure, a _prefix_ to deploy it to. Once these details are provided, Matcha will proceed to initialize a remote state manager and ask for a password. After that, it will go ahead of provision infrastructure. > Note: provisioning can take up to 20 minutes. Once provisioning is completed, you can query Matcha, using the `get` command: +CLI: ```bash matcha get ``` @@ -152,6 +165,23 @@ Experiment tracker By default, Matcha will hide sensitive resource properties. If you need one of these properties, then you can add the `--show-sensitive` flag to your `get` command. +API: +```python +import matcha_ml.core as matcha + +_ = matcha.get() +``` + +As with the CLI tool, users have the ability to 'get' specific resources by passing optional `resource_name` and `property_name` arguments to the get function, as demonstrated below: + +```python +import matcha_ml.core as matcha + +_ = matcha.get(resource_name="experiment_tracker", property_name="flavor") +``` + +> Note: the `get()` method will return a `MatchaState` object which represents the provisioned state. The `MatchaState` object contians the `get_component()` method, which will return (where applicable) a `MatchaStateComponent` object representing the specified Matcha state component. In turn, each `MatchaStateComponent` object has a `find_property()` method that will allow the user to be able to access individual component properties. + # 🤝 Sharing resources You'll notice that a configuration file is create as part of the provisioning process - it's called `matcha.config.json`. This file stores the information necessary for Matcha to identify the resource group and storage container that holds the details of the provisioned resources. @@ -236,10 +266,18 @@ This will result in a score, which represents how strongly we recommend movie ID The final thing you'll want to do is decommission the infrastructure that Matcha has set up during this guide. Matcha includes a `destroy` command which will remove everything that has been provisioned, which avoids running up an Azure bill! +CLI: ```bash matcha destroy ``` +API: +```python +import matcha_ml.core as matcha + +matcha.destroy() +``` + > Note: that this command is irreversible will remove all the resources deployed by `matcha provision` including the resource group, so make sure you save any data you wish to keep before running this command. > > You may also notice that an additional resource has appeared in Azure called 'NetworkWatcherRG' (if it wasn't already there). This is a resource that is automatically provisioned by Azure in each region when there is in-coming traffic to a provisioned resource and isn't controlled by Matcha. More information can be found [here](https://learn.microsoft.com/en-us/azure/network-watcher/network-watcher-monitoring-overview) on how to manage or remove this resource. diff --git a/scratch.py b/scratch.py new file mode 100644 index 00000000..1a40bb9c --- /dev/null +++ b/scratch.py @@ -0,0 +1,3 @@ +import matcha_ml.core as matcha + +matcha.stack_set(stack_name="llm") From 9a2627619516f1cdf191a5e313dc90d226bd6497 Mon Sep 17 00:00:00 2001 From: Callum Wells <68609181+swells2020@users.noreply.github.com> Date: Thu, 17 Aug 2023 15:08:00 +0100 Subject: [PATCH 2/4] removes scratch.py --- scratch.py | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 scratch.py diff --git a/scratch.py b/scratch.py deleted file mode 100644 index 1a40bb9c..00000000 --- a/scratch.py +++ /dev/null @@ -1,3 +0,0 @@ -import matcha_ml.core as matcha - -matcha.stack_set(stack_name="llm") From 8ab4a2c690ff8a3265067049945cbff81d43324f Mon Sep 17 00:00:00 2001 From: Callum Wells <68609181+swells2020@users.noreply.github.com> Date: Mon, 21 Aug 2023 08:43:17 +0100 Subject: [PATCH 3/4] fixes typos --- docs/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index c8dc7727..b07df8e0 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -180,7 +180,7 @@ import matcha_ml.core as matcha _ = matcha.get(resource_name="experiment_tracker", property_name="flavor") ``` -> Note: the `get()` method will return a `MatchaState` object which represents the provisioned state. The `MatchaState` object contians the `get_component()` method, which will return (where applicable) a `MatchaStateComponent` object representing the specified Matcha state component. In turn, each `MatchaStateComponent` object has a `find_property()` method that will allow the user to be able to access individual component properties. +> Note: the `get()` method will return a `MatchaState` object which represents the provisioned state. The `MatchaState` object contains the `get_component()` method, which will return (where applicable) a `MatchaStateComponent` object representing the specified Matcha state component. In turn, each `MatchaStateComponent` object has a `find_property()` method that will allow the user to be able to access individual component properties. # 🤝 Sharing resources From f1d950f2f38a59e05e64ce427c4663d1cf300af3 Mon Sep 17 00:00:00 2001 From: Callum Wells <68609181+swells2020@users.noreply.github.com> Date: Mon, 21 Aug 2023 14:16:12 +0100 Subject: [PATCH 4/4] updates for comments --- docs/getting-started.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index b07df8e0..fe5174af 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -91,7 +91,7 @@ API: ```python import matcha_ml.core as matcha -_ = matcha.provision(location="uksouth", prefix="test123", password="strong_password") +matcha_state_object: MatchaState = matcha.provision(location="uksouth", prefix="test123", password="strong_password") ``` Initially, Matcha will ask you a few questions about how you'd like your infrastructure to be set up. Specifically, it will ask for a _location_ for your infrastructure, a _prefix_ to deploy it to. Once these details are provided, Matcha will proceed to initialize a remote state manager and ask for a password. After that, it will go ahead of provision infrastructure. @@ -169,7 +169,7 @@ API: ```python import matcha_ml.core as matcha -_ = matcha.get() +matcha_state_object: MatchaState = matcha.get() ``` As with the CLI tool, users have the ability to 'get' specific resources by passing optional `resource_name` and `property_name` arguments to the get function, as demonstrated below: @@ -177,7 +177,7 @@ As with the CLI tool, users have the ability to 'get' specific resources by pass ```python import matcha_ml.core as matcha -_ = matcha.get(resource_name="experiment_tracker", property_name="flavor") +matcha_state_object: MatchaState = matcha.get(resource_name="experiment_tracker", property_name="flavor") ``` > Note: the `get()` method will return a `MatchaState` object which represents the provisioned state. The `MatchaState` object contains the `get_component()` method, which will return (where applicable) a `MatchaStateComponent` object representing the specified Matcha state component. In turn, each `MatchaStateComponent` object has a `find_property()` method that will allow the user to be able to access individual component properties.