Skip to content

_v1: support running a task without the session environment (embedded files + Task.File resolution) #332

Description

@seant-aws

Use case

The deadline-cloud-worker-agent runs its job-attachment sync scripts as OpenJD tasks outside the session environment (use_session_env_vars=False) so that job environments (e.g. a conda virtual environment) cannot interfere with them.

What v0 provides

On the v0 openjd.sessions.Session path this capability lives inside the library: StepScriptRunner materializes the script's embedded files via write_file_for_user (handling both POSIX permissions and Windows ACLs) and resolves {{ Task.File.* }} references through the format-string engine against the session's symbol table.

The gap in _v1

The _v1 wrapper exposes:

  • run_task(...) — full embedded-file and format-string handling, but no way to opt out of the session environment
  • run_subprocess(...) — opts out of the session environment, but internally builds a StepScript with embeddedFiles=None and performs no format-string substitution

A caller that needs both must therefore reimplement embedded-file materialization and Task.File.* resolution itself.

Current stopgap

aws-deadline/deadline-cloud-worker-agent#1002 carries this reimplementation in its RustSessionRuntime adapter (a port of the attachment-sync recipe from the bindings-rs prototype: aws-deadline/deadline-cloud-worker-agent@mainline...mwiebe:deadline-cloud-worker-agent:bindings-rs).

Known limitation of doing this outside the library, which write_file_for_user already solves: no Windows ACL grant is applied to the materialized files, so an impersonated Windows job user cannot read them.

Proposal

Expose the capability in the _v1 wrapper (or the underlying crate) — e.g. run_task(..., use_session_env_vars=False) — so adapters can delegate, keeping embedded-file materialization and format-string resolution in one place across both implementations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions