Skip to content

Conversation

@xingdi-eric-yuan
Copy link
Collaborator

This pull request enhances the handling of container labels for Docker terminals in the debug_gym project. The main improvement is the addition of support for passing extra_labels to Docker containers, similar to existing support for Kubernetes terminals. This allows for better identification and management of containers, especially during cleanup. The changes also include corresponding updates to the codebase and new tests to ensure correct behavior.

Docker Terminal Label Support:

  • Added an extra_labels parameter to the DockerTerminal class, storing it as an instance variable and documenting its purpose in the docstring. [1] [2] [3]
  • Updated the setup_container method in DockerTerminal to always include an app=debug-gym label and merge any provided extra_labels when creating containers.

Terminal Selection Logic:

  • Modified the select_terminal function to pass extra_labels to both KubernetesTerminal and DockerTerminal, ensuring consistent label support across terminal types.

Testing:

  • Added a new test, test_select_terminal_docker_extra_labels, to verify that extra_labels are correctly passed to the DockerTerminal and that the original config remains unmodified.

xingdi-eric-yuan and others added 4 commits January 22, 2026 10:31
When a pod fails to pull its container image, it stays in Pending phase
with ImagePullBackOff status. Previously this would wait the full 2-hour
timeout. Now we detect persistent ImagePullBackOff and fail after a
configurable timeout (default: 10 minutes).

Key changes:
- Add image_pull_backoff_timeout parameter (default 600s, 0 to disable)
- Add _check_image_pull_status() method to detect ImagePullBackOff
- Track backoff duration and fail if it persists past threshold
- Reset timer if backoff resolves (allows transient failures to recover)

The 10-minute default handles transient issues (registry rate limiting,
network blips) while catching true failures much faster than before.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
xingdi-eric-yuan and others added 2 commits January 23, 2026 13:55
Update pre-commit config to use black 26.1.0 to match CI.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@xingdi-eric-yuan xingdi-eric-yuan merged commit 9f6e59f into main Jan 23, 2026
11 checks passed
@xingdi-eric-yuan xingdi-eric-yuan deleted the docker_labels branch January 23, 2026 19:13
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.

3 participants