Skip to content

feat(agent): add script data dir for binaries and files #12205

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

Merged
merged 11 commits into from
Feb 20, 2024

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Feb 19, 2024

The agent is extended with a --script-data-dir flag, defaulting to the
OS temp dir. This dir is used for storing coder-script-data/bin and
coder-script/[script uuid]. The former is a place for all scripts to
place executable binaries that will be available by other scripts, SSH
sessions, etc. The latter is a place for the script to store files.

Since we default to OS temp dir, files are ephemeral by default. In the
future, we may consider adding new env vars or changing the default
storage location. Workspace startup speed could potentially benefit from
scripts being able to skip steps that require downloading software. We
may also extend this with more env variables (e.g. persistent storage in
HOME).

Fixes #11131

This can be feature detected by checking if $CODER_SCRIPT_DATA_DIR and/or $CODER_SCRIPT_BIN_DIR is set.

@mafredri mafredri self-assigned this Feb 19, 2024
@mafredri mafredri force-pushed the mafredri/feat-agent-script-paths branch from e804a03 to 02daadd Compare February 19, 2024 11:41
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking!

@mafredri mafredri force-pushed the mafredri/feat-agent-script-paths branch from 7bd2ed0 to f09a284 Compare February 19, 2024 13:17
@mafredri mafredri force-pushed the mafredri/refactor-agentssh-config branch 2 times, most recently from ffae4ad to dd66b45 Compare February 19, 2024 14:02
Base automatically changed from mafredri/refactor-agentssh-config to main February 19, 2024 14:30
The agent is extended with a `--script-data-dir` flag, defaulting to the
OS temp dir. This dir is used for storing `coder-script/bin` and
`coder-script/[script uuid]`. The former is a place for all scripts to
place executable binaries that will be available by other scripts, SSH
sessions, etc. The latter is a place for the script to store files.

Since we default to OS temp dir, files are ephemeral by default. In the
future, we may consider adding new env vars or changing the default
storage location. Workspace startup speed could potentially benefit from
scripts being able to skip steps that require downloading software. We
may also extend this with more env variables (e.g. persistent storage in
HOME).

Fixes #11131
@mafredri mafredri force-pushed the mafredri/feat-agent-script-paths branch from f09a284 to 0f6f254 Compare February 19, 2024 14:34
@mafredri mafredri force-pushed the mafredri/feat-agent-script-paths branch from 3b682e1 to d894786 Compare February 19, 2024 17:03
@mafredri mafredri force-pushed the mafredri/feat-agent-script-paths branch 4 times, most recently from e5858f7 to 89b8297 Compare February 20, 2024 10:28
@mafredri mafredri force-pushed the mafredri/feat-agent-script-paths branch from 19d9582 to 7dbfc2b Compare February 20, 2024 11:08
@mafredri mafredri merged commit b1c0b39 into main Feb 20, 2024
@mafredri mafredri deleted the mafredri/feat-agent-script-paths branch February 20, 2024 11:26
@github-actions github-actions bot locked and limited conversation to collaborators Feb 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow the coder agent to tell modules where they can place data, binaries, etc
3 participants