API Reference Documentation
The core functionality for Matcha API.
StackType
Bases: Enum
Enum defining matcha stack types.
Source code in src/matcha_ml/core/core.py
53 54 55 56 57 |
|
StackTypeMeta
Bases: EnumMeta
Metaclass for the StackType Enum.
Source code in src/matcha_ml/core/core.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
__contains__
__contains__(item)
Dunder method for checking if an item is a member of the enum.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item |
str
|
the quantity to check for in the Enum. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if item is a member of the Enum, False otherwise. |
Source code in src/matcha_ml/core/core.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
analytics_opt_in
analytics_opt_in()
Enable the collection of anonymous usage data (enabled by default).
More information regarding why we collect usage data, and how it is used, can be found here.
Source code in src/matcha_ml/core/core.py
209 210 211 212 213 214 215 |
|
analytics_opt_out
analytics_opt_out()
Disable the collection of anonymous usage data.
More information regarding why we collect usage data, and how it is used, can be found here.
Source code in src/matcha_ml/core/core.py
200 201 202 203 204 205 206 |
|
destroy
destroy()
Destroy the provisioned cloud resources.
Decommission the cloud infrastructure built by Matcha when provision has been called either historically or during this session. After calling destroy, the resources provisioned by matcha should no longer be active on your chosen provider's UI.
Raises:
Type | Description |
---|---|
Matcha Error
|
where no state has been provisioned. |
Source code in src/matcha_ml/core/core.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
get
get(resource_name, property_name)
Return information regarding a previously provisioned resource based on the resource and property names provided.
The information is returned in the form of a MatchaState
object containing various MatchaStateComponent
objects.
The MatchaStateComponent
objects in turn hold MatchaResource
and MatchaResourceProperty
components.
If no resource name is provided, all resources are returned.
Examples:
>>> get("cloud", "resource-group-name")
MatchaState(components=[MatchaStateComponent(resource=MatchaResource(name='cloud'),
properties=[MatchaResourceProperty(name='resource-group-name', value='test_resources')])])
>>> get("experiment-tracker", "flavor")
MatchaState(components=[MatchaStateComponent(resource=MatchaResource(name='experiment-tracker'),
properties=[MatchaResourceProperty(name='flavor', value='mlflow')])])
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resource_name |
Optional[str]
|
name of the resource to get information for. |
required |
property_name |
Optional[str]
|
the property of the resource to get. |
required |
Returns:
Name | Type | Description |
---|---|---|
MatchaState |
MatchaState
|
the information of the provisioned resource. |
Raises:
Type | Description |
---|---|
MatchaError
|
Raised when the matcha state has not been initialized |
MatchaError
|
Raised when the matcha.state file does not exist |
MatchaInputError
|
Raised when the resource or property name does not exist in the matcha.state file |
Source code in src/matcha_ml/core/core.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|
infer_zenml_version
infer_zenml_version()
Check the zenml version of the local environment against the version matcha is expecting.
Source code in src/matcha_ml/core/core.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
provision
provision(location, prefix, password, verbose=False)
Provision cloud resources using existing Matcha Terraform templates.
Provision cloud resources in the location provided. Provide a prefix for the Azure group's name and a password for the provisioned server. To show more output than the default, set verbose to True.
Examples:
>>> provision(location="ukwest", prefix="myexample", password="example_password", verbose=False)
MatchaState(components=[MatchaStateComponent(resource=MatchaResource(name='cloud'),
properties=[MatchaResourceProperty(name='location', value='ukwest'),
MatchaResourceProperty(name='prefix', value='test')])])
Parameters:
Name | Type | Description | Default |
---|---|---|---|
location |
str
|
Azure location in which all resources will be provisioned. |
required |
prefix |
str
|
Prefix used for all resources. |
required |
password |
str
|
Password for the deployment server. |
required |
verbose |
bool optional
|
additional output is show when True. Defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
MatchaState |
MatchaState
|
the information of the provisioned resources. |
Raises:
Type | Description |
---|---|
MatchaError
|
If resources are already provisioned. |
MatchaError
|
If prefix is not valid. |
MatchaError
|
If region is not valid. |
Source code in src/matcha_ml/core/core.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
|
remove_state_lock
remove_state_lock()
Unlock the remote state.
Note
The remote state is synced to a state file kept locally. The state will be locked when in use, and removing the state lock and making changes could result in a state file not consistent with what Matcha expects.
Source code in src/matcha_ml/core/core.py
218 219 220 221 222 223 224 225 226 |
|
stack_set
stack_set(stack_name)
A function for updating the stack type in the local matcha.config.json file.
Note: This cannot be run once there are provisioned resources.
Examples:
>>> stack_set(stack_name='default')
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stack_name |
str
|
the name of the type of stack to be specified in the config file. |
required |
Raises:
Type | Description |
---|---|
MatchaInputError
|
if the stack_name is not a valid stack type |
MatchaError
|
if there are already resources provisioned. |
Source code in src/matcha_ml/core/core.py
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
|