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

feat: configurable session root directory #513

Draft
wants to merge 3 commits into
base: mainline
Choose a base branch
from

Conversation

jusiskin
Copy link
Contributor

@jusiskin jusiskin commented Dec 17, 2024

Depends on:

What was the problem/requirement? (What/Why)

Currently the Worker Agent has a hard-coded root directory under which session directories are created.

Operating System Session Root Directory
Linux /sessions
Windows %PROGRAMDATA%\Amazon\OpenJD

Those using the worker agent may want to customize the directory where the sessions are created.

What was the solution? (How)

Added a new session root directory setting to the worker agent configuration. As with other worker agent settings, this can be set using multiple sources in the following order of precedence (first is higher priority):

  1. Command-line argument: --session-root-dir
  2. Environment variable: DEADLINE_WORKER_SESSION_ROOT_DIR
  3. Configuration file: [worker]session_root_dir
  4. Defaults:
    • /sessions on Linux
    • %PROGRAMDATA%\Amazon\OpenJD on Windows

The setting is supplied in the install-deadline-worker command using the --session-root-dir CLI argument which will create (if needed) the worker agent configuration file and modify the session_root_dir setting. The installer will also provision the directory as needed and ensure it has the correct file-system ACLs.

The setting is now loaded on launch and passed down through the call stack and supplied to session_root_directory kwarg of the Session class in openjd-sessions (code ref).

What is the impact of this change?

Those using the worker agent can configure where session directories will be created on the worker host.

How was this change tested?

  • Integration test cases were added for the worker agent configuration file modification for the session root directory
  • End-to-end test was added that verifies the configured session root directory is applied. This test succeeded

Was this change documented?

The new session_root_dir was added to the worker.toml.example file with documentation comments

Is this a breaking change?

No


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@jusiskin jusiskin force-pushed the configurable_session_dir branch from 399021a to 0c0a98c Compare December 19, 2024 17:40
@jusiskin jusiskin force-pushed the configurable_session_dir branch from 0c0a98c to 9a7041c Compare December 19, 2024 22:54
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant