Skip to content

feat: configure containers via CLI args#175

Merged
briangreunke merged 12 commits intomainfrom
brian/eng-2981-feature-edit-env-files-via-passed-args
Sep 15, 2025
Merged

feat: configure containers via CLI args#175
briangreunke merged 12 commits intomainfrom
brian/eng-2981-feature-edit-env-files-via-passed-args

Conversation

@briangreunke
Copy link
Contributor

@briangreunke briangreunke commented Sep 11, 2025

Configurations via CLI args

This change allows users to configure the install via the CLI like dreadnode platform start --key value

Key Changes:

  • removed extraneous creation of a .env file and instead pass in both existing .env files for compose interpolation
  • added kwarg processing into env vars for the start command

Generated Summary:

  • Added support for environment variable overrides in the CLI platform.
  • Modified the start command to accept **env_overrides for dynamic environment variable assignment.
  • Enhanced docker_run to include an optional overrides environment file when launching Docker containers.
  • Introduced write_overrides_env and remove_overrides_env functions for managing the overrides environment file.
  • Removed unused generate_env_file and remove_generated_env_file functions for cleaner codebase.
  • Updated start_platform and stop_platform functions to handle new environment variables and file overrides effectively.
  • Added a new property overrides_env_file to LocalVersionSchema to facilitate the path to the overrides file.
  • Overall, these changes improve flexibility and reduce the need for manual environment configuration, making platform starts and stops more efficient.

This summary was generated with ❤️ by rigging

Copy link
Contributor

@rdheekonda rdheekonda left a comment

Choose a reason for hiding this comment

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

Great work, @briangreunke !

Copy link
Contributor Author

Good call. The comment was a remnant before a refactor. Will fix.

@dreadnode-renovate-bot dreadnode-renovate-bot bot added the area/python Changes to Python package configuration and dependencies label Sep 12, 2025
@briangreunke briangreunke changed the title Feat: configure containers via CLI args feat: configure containers via CLI args Sep 12, 2025
@briangreunke briangreunke marked this pull request as ready for review September 12, 2025 05:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This change enables users to configure the Dreadnode platform via CLI arguments using the format dreadnode platform start --key value, providing a more flexible alternative to manual environment file editing.

  • Removed automatic .env file generation and switched to passing existing environment files directly to Docker Compose
  • Added support for environment variable overrides through CLI arguments on the start command
  • Enhanced configure command to accept key-value pairs for persistent configuration management

Reviewed Changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pyproject.toml Added types-pyyaml dependency for better YAML type checking
dreadnode/eval/dataset.py Removed type ignore comment for yaml import after adding proper typing
dreadnode/cli/platform/utils/versions.py Added get_local_version function for retrieving specific platform versions
dreadnode/cli/platform/utils/env_mgmt.py Replaced env file merging with new override system and added utilities for managing override files
dreadnode/cli/platform/upgrade.py Simplified upgrade process to copy override files instead of merging
dreadnode/cli/platform/stop.py Updated to use new docker_stop signature
dreadnode/cli/platform/start.py Added support for environment overrides via CLI arguments
dreadnode/cli/platform/schemas.py Added properties for override file paths and version details
dreadnode/cli/platform/download.py Fixed services parameter type conversion
dreadnode/cli/platform/docker_.py Refactored to support multiple compose and env files with override capabilities
dreadnode/cli/platform/constants.py Added type safety for platform services
dreadnode/cli/platform/configure.py Completely rewritten to support key-value configuration pairs
dreadnode/cli/platform/cli.py Enhanced start and configure commands with CLI argument support
Comments suppressed due to low confidence (3)

dreadnode/cli/platform/configure.py:1

  • When unset is True, this code attempts to access args[i + 1] which may not exist. The code should only access args[i + 1] when not unset is True.
from dreadnode.cli.platform.constants import SERVICES

dreadnode/cli/platform/configure.py:1

  • When unset is True, the code doesn't validate that args length is correct. For unset operations, you likely need exactly one argument per key to unset, so this should validate len(args) == 0 when unset is True with no keys provided.
from dreadnode.cli.platform.constants import SERVICES

dreadnode/cli/platform/configure.py:1

  • When unset is True, the loop still increments by 2, but it should increment by 1 since unset operations only need keys, not key-value pairs.
from dreadnode.cli.platform.constants import SERVICES

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@briangreunke briangreunke merged commit ac503c4 into main Sep 15, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/python Changes to Python package configuration and dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants