Skip to content

Commit

Permalink
Merge pull request #1088 from basetenlabs/bump-version-0.9.28
Browse files Browse the repository at this point in the history
Release 0.9.28
  • Loading branch information
marius-baseten authored Aug 12, 2024
2 parents 6b09b82 + a298ded commit c81e1cc
Show file tree
Hide file tree
Showing 31 changed files with 1,636 additions and 1,211 deletions.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python 3.9.11
poetry 1.5.1
poetry 1.8.0
38 changes: 22 additions & 16 deletions docs/chains/doc_gen/API-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ chainlet instance is provided.
|----------------|----------------------|--------------------------------------------------------------------------------------------------------------|
| `chainlet_cls` | *Type[ChainletBase]* | The chainlet class of the dependency. |
| `retries` | *int* | The number of times to retry the remote chainlet in case of failures (e.g. due to transient network issues). |

| `timeout_sec` | *int* | Timeout for the HTTP request to this chainlet. |
* **Returns:**
A “symbolic marker” to be used as a default argument in a chainlet’s
initializer.
Expand Down Expand Up @@ -131,8 +131,8 @@ Options to customize RPCs to dependency chainlets.
Decorator to mark a chainlet as the entrypoint of a chain.

This decorator can be applied to *one* chainlet in a source file and then the
CLI deploy command simplifies because only the file, but not the chainlet class
in the file needs to be specified.
CLI push command simplifies because only the file, but not the chainlet class
in the file, needs to be specified.

Example usage:

Expand Down Expand Up @@ -305,31 +305,37 @@ for more details on caching.

General framework and helper functions.

### `truss_chains.deploy_remotely`
### `truss_chains.push`

Deploys a chain remotely (with all dependent chainlets).


**Parameters:**

| Name | Type | Description |
|-------------------------|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `entrypoint` | *Type[ChainletBase]* | The chainlet class that serves as the entrypoint to the chain. |
| `chain_name` | *str* | The name of the chain. |
| `publish` | *bool* | Whether to publish the chain as a published deployment (it is a draft deployment otherwise) |
| `promote` | *bool* | Whether to promote the chain to be the production deployment (this implies publishing as well). |
| `user_env` | *Mapping[str,str]\|None* | These values can be provided to the deploy command and customize the behavior of deployed chainlets. E.g. for differentiating between prod and dev version of the same chain. |
| `only_generate_trusses` | *bool* | Used for debugging purposes. If set to True, only the the underlying truss models for the chainlets are generated in `/tmp/.chains_generated`. |
| Name | Type | Description |
|-------------------------|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `entrypoint` | *Type[ChainletBase]* | The chainlet class that serves as the entrypoint to the chain. |
| `chain_name` | *str* | The name of the chain. |
| `publish` | *bool* | Whether to publish the chain as a published deployment (it is a draft deployment otherwise) |
| `promote` | *bool* | Whether to promote the chain to be the production deployment (this implies publishing as well). |
| `user_env` | *Mapping[str,str]\|None* | These values can be provided to the push command and customize the behavior of deployed chainlets. E.g. for differentiating between prod and dev version of the same chain. |
| `only_generate_trusses` | *bool* | Used for debugging purposes. If set to True, only the the underlying truss models for the chainlets are generated in `/tmp/.chains_generated`. |
| `remote` | *str\|None* | name of a remote config in .trussrc. If not provided, it will be inquired. |

* **Returns:**
A chain service handle to the deployed chain.
* **Return type:**
[*ChainService*](#class-truss-chains-deploy-chainservice)
[*ChainService*](#class-truss-chains-remote-chainservice)

### `truss_chains.deploy_remotely`

Deprecated, use [`push`](#truss-chains-push) instead.

### *class* `truss_chains.deploy.ChainService`
### *class* `truss_chains.remote.ChainService`

Handle for a deployed chain.

A `ChainService` is created and returned when using `deploy_remotely`. It
A `ChainService` is created and returned when using `push`. It
bundles the individual services for each chainlet in the chain, and provides
utilities to query their status, invoke the entrypoint etc.

Expand Down Expand Up @@ -445,7 +451,7 @@ corresponding fields of
| `secrets` | *Mapping[str,str]\|None* | A dict of secrets keys and values to provide to the chainlets. |
| `data_dir` | *Path\|str\|None* | Path to a directory with data files. |
| `chainlet_to_service` | *Mapping[str,[ServiceDescriptor](#class-truss-chains-servicedescriptor)* | A dict of chainlet names to service descriptors. |
| `user_env` | *Mapping[str,str]\|None* | see [`deploy_remotely`](#truss-chains-deploy-remotely). |
| `user_env` | *Mapping[str,str]\|None* | see [`push`](#truss-chains-push). |

* **Return type:**
*ContextManager*[None]
Expand Down
4 changes: 4 additions & 0 deletions docs/chains/doc_gen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ This generation process of the documentation is *extremely* scrappy and just
an interim solution. It requires significant manual oversight and the code
quality in this directory is non-existent.

Extra deps required:
`sphinx sphinx_rtd_theme sphinx_markdown_builder sphinx-pydantic`


The general process is:
1. Document as much as possible in the code, including usage examples, links
etc.
Expand Down
5 changes: 3 additions & 2 deletions docs/chains/doc_gen/generate_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
NON_PUBLIC_SYMBOLS = [
# "truss_chains.definitions.AssetSpec",
# "truss_chains.definitions.ComputeSpec",
"truss_chains.deploy.ChainService",
"truss_chains.remote.ChainService",
]


Expand Down Expand Up @@ -65,8 +65,9 @@
"Core",
"General framework and helper functions.",
[
"truss_chains.push",
"truss_chains.deploy_remotely",
"truss_chains.deploy.ChainService",
"truss_chains.remote.ChainService",
"truss_chains.make_abs_path_here",
"truss_chains.run_local",
"truss_chains.ServiceDescriptor",
Expand Down
35 changes: 28 additions & 7 deletions docs/chains/doc_gen/generated-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ chainlet instance is provided.
|------|------|-------------|
| `chainlet_cls` | *Type[ChainletT]* | The chainlet class of the dependency. |
| `retries` | *int* | The number of times to retry the remote chainlet in case of failures (e.g. due to transient network issues). |
| `timeout_sec` | *int* | Timeout for the HTTP request to this chainlet. |

* **Returns:**
A “symbolic marker” to be used as a default argument in a chainlet’s
Expand Down Expand Up @@ -134,8 +135,8 @@ Options to customize RPCs to dependency chainlets.
Decorator to mark a chainlet as the entrypoint of a chain.

This decorator can be applied to *one* chainlet in a source file and then the
CLI deploy command simplifies because only the file, but not the chainlet class
in the file needs to be specified.
CLI push command simplifies because only the file, but not the chainlet class
in the file, needs to be specified.

Example usage:

Expand Down Expand Up @@ -360,7 +361,7 @@ Returns parsed and validated assets.

General framework and helper functions.

### `truss_chains.deploy_remotely`
### `truss_chains.push`

Deploys a chain remotely (with all dependent chainlets).

Expand All @@ -373,22 +374,42 @@ Deploys a chain remotely (with all dependent chainlets).
| `chain_name` | *str* | The name of the chain. |
| `publish` | *bool* | Whether to publish the chain as a published deployment (it is a draft deployment otherwise) |
| `promote` | *bool* | Whether to promote the chain to be the production deployment (this implies publishing as well). |
| `user_env` | *Mapping[str,str]\|None* | These values can be provided to the deploy command and customize the behavior of deployed chainlets. E.g. for differentiating between prod and dev version of the same chain. |
| `user_env` | *Mapping[str,str]\|None* | These values can be provided to the push command and customize the behavior of deployed chainlets. E.g. for differentiating between prod and dev version of the same chain. |
| `only_generate_trusses` | *bool* | Used for debugging purposes. If set to True, only the the underlying truss models for the chainlets are generated in `/tmp/.chains_generated`. |
| `remote` | *str\|None* | |
| `remote` | *str\|None* | name of a remote config in .trussrc. If not provided, it will be inquired. |

* **Returns:**
A chain service handle to the deployed chain.
* **Return type:**
*BasetenChainService*

### *class* `truss_chains.deploy.ChainService`
### `truss_chains.deploy_remotely`

Deprecated, use `push` instead.


**Parameters:**

| Name | Type | Description |
|------|------|-------------|
| `entrypoint` | *Type[ABCChainlet]* | |
| `chain_name` | *str* | |
| `publish` | *bool* | |
| `promote` | *bool* | |
| `user_env` | *Mapping[str,str]\|None* | |
| `only_generate_trusses` | *bool* | |
| `remote` | *str\|None* | |

* **Return type:**
*BasetenChainService*

### *class* `truss_chains.remote.ChainService`

Bases: `ABC`

Handle for a deployed chain.

A `ChainService` is created and returned when using `deploy_remotely`. It
A `ChainService` is created and returned when using `push`. It
bundles the individual services for each chainlet in the chain, and provides
utilities to query their status, invoke the entrypoint etc.

Expand Down
Loading

0 comments on commit c81e1cc

Please sign in to comment.