Skip to content

Adding a direct backend option of the self hosted runner #33

Open
ianhodge wants to merge 1 commit intomainfrom
03-16-ian_direct_backend
Open

Adding a direct backend option of the self hosted runner #33
ianhodge wants to merge 1 commit intomainfrom
03-16-ian_direct_backend

Conversation

@ianhodge
Copy link
Member

@ianhodge ianhodge commented Mar 16, 2026

As a Direct option for the backend with relevant parameters. This does not actually mount a docker container but allows for users to run the oz-agent in their own way with setup and teardown commands

@ianhodge ianhodge changed the title mvp Adding a direct backend option of the self hosted runner Mar 17, 2026
@ianhodge ianhodge requested a review from bnavetta March 17, 2026 15:24
@ianhodge ianhodge marked this pull request as ready for review March 17, 2026 15:24
// must take precedence over the worker's own WARP_API_KEY).
cmd := exec.CommandContext(ctx, b.ozPath, params.BaseArgs...)
cmd.Dir = workspaceDir
cmd.Env = mergeEnvVars(os.Environ(), envVars)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of automatically inheriting env vars, I think it's safer to start with an empty set and use the backend config to opt in specific variables. The worker environment may have sensitive values that individual tasks shouldn't get access to.

We can default to inheriting standard variables like HOME, TMPDIR, and PATH for convenience.

@ianhodge ianhodge force-pushed the 03-16-ian_yaml_config_file_support branch from 967e674 to f028895 Compare March 18, 2026 15:11
@ianhodge ianhodge force-pushed the 03-16-ian_direct_backend branch from f6d01ef to 99cce2b Compare March 18, 2026 15:11
@ianhodge ianhodge force-pushed the 03-16-ian_yaml_config_file_support branch from f028895 to 19c51d4 Compare March 18, 2026 18:07
@ianhodge ianhodge force-pushed the 03-16-ian_direct_backend branch from 99cce2b to d0ad4cf Compare March 18, 2026 18:07
Base automatically changed from 03-16-ian_yaml_config_file_support to main March 18, 2026 18:30
func (b *DirectBackend) runCommand(ctx context.Context, command, dir string, env []string) error {
cmd := exec.CommandContext(ctx, "/bin/sh", "-c", command)
cmd.Dir = dir
cmd.Env = mergeEnvVars(hostBaseEnv(), env)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think setup/teardown commands should probably inherit the worker env, unlike the agent process - that way, they can decide to pass along certain variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants