Skip to content
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

docs: added docs for storespec #2178

Merged
merged 3 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/docs/api-reference/starlark-reference/plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ The `run_python` instruction executes a one-time execution task. It runs the Pyt

The `files` dictionary argument accepts a key value pair, where `key` is the path where the contents of the artifact will be mounted to and `value` is a [file artifact][files-artifacts-reference] name.

The `store` atrribute expects a list of paths or [`StoreSpec`][store-spec-reference] objects.

The instruction returns a `struct` with [future references][future-references-reference] to the output and exit code of the Python script, alongside with future-reference to the file artifact names that were generated.
* `result.output` is a future reference to the output of the command
* `result.code` is a future reference to the exit code
Expand Down Expand Up @@ -530,6 +532,8 @@ The `run_sh` instruction executes a one-time execution task. It runs the bash co

The `files` dictionary argument accepts a key value pair, where `key` is the path where the contents of the artifact will be mounted to and `value` is a [file artifact][files-artifacts-reference] name.

The `store` atrribute expects a list of paths or [`StoreSpec`][store-spec-reference] objects.

The instruction returns a `struct` with [future references][future-references-reference] to the output and exit code of the command, alongside with future-reference to the file artifact names that were generated.
* `result.output` is a future reference to the output of the command
* `result.code` is a future reference to the exit code
Expand Down Expand Up @@ -725,3 +729,4 @@ plan.print(recipe_result["code"])
[starlark-types-get-http-recipe]: ./get-http-request-recipe.md
[service-starlark-reference]: ./service.md
[starlark-types-port-spec]: ./port-spec.md
[store-spec-reference]: ./store-spec.md
26 changes: 26 additions & 0 deletions docs/docs/api-reference/starlark-reference/store-spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: StoreSpec
sidebar_label: StoreSpec
---

The `StoreSpec` is used to configure how to store a file on a [`run_sh`][run-sh-reference] or a [`run_python`][run-python-reference] container as a files artifact

```python
config = StoreSpec(
# The path on the task container that needs to be stored in a files artifact
# MANDATORY
src = "/foo/bar",

# The name of the files artifact; needs to be unique in the enclave
# This is optional; if not provided Kurtosis will create a nature themed name
# OPTIONAL
name = "divine-pool"
)
```

Note the `StoreSpec` object is provided as a list to the `store` attribute of the `run_sh` and `run_python` instructions. Within
one list the `src` needs to be unique; while the `name` needs to be `unique` for the entire enclave.

<!--------------- ONLY LINKS BELOW THIS POINT ---------------------->
[run-python-reference]: ./plan.md#run_python
[run-sh-reference]: ./plan.md#run_sh
Loading