Skip to content

Commit

Permalink
added store spec objects
Browse files Browse the repository at this point in the history
  • Loading branch information
h4ck3rk3y committed Feb 19, 2024
1 parent d3b3de9 commit a40a9ed
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
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
25 changes: 25 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,25 @@
---
title: StoreSpec
sidebar_label: StoreSpec
---

The `StoreSpec` is used to configure how to store a file on the a [`run_sh`][run-sh-reference] and 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
name = "divine-pool"
)
```

Note the `StoreSpec` object is provided as a list to `run_sh` and `run_python` instructions to the `store` attribtute. Within
one list both 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

0 comments on commit a40a9ed

Please sign in to comment.