Skip to content

Clarify Codespaces Breeze startup context and improve Docker guidance - #64192

Closed
linxi507 wants to merge 4 commits into
apache:mainfrom
linxi507:fix/62405-codespaces-docker-error
Closed

linxi507 wants to merge 4 commits into
apache:mainfrom
linxi507:fix/62405-codespaces-docker-error

Conversation

@linxi507

Copy link
Copy Markdown

This PR improves GitHub Codespaces onboarding for Breeze and makes the related Docker guidance less misleading.

It updates the beginner quick start and the dedicated Codespaces guide to clarify that:

  • GitHub Codespaces already runs inside a containerized development environment
  • breeze start-airflow should be run from the initial Codespaces terminal / outer shell with Docker access
  • running it from inside an already-entered breeze shell or nested container shell can lead to misleading Docker-related errors

It also improves the Breeze error guidance shown when Docker checks fail in a container/devcontainer/Codespaces-like environment. Instead of only showing the generic "Docker is not running" message, Breeze now adds a more targeted explanation about the execution context.

Tests:

  • added unit tests for the containerized-environment guidance path
  • preserved coverage for the generic non-containerized path

Closes: #62405


Was generative AI tooling used to co-author this PR?
  • Yes — Chat GPT-5

Generated-by: Chat GPT-5 following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

@potiuk

potiuk commented Mar 24, 2026

Copy link
Copy Markdown
Member

BTW. There should be rather easy way to "start-airflow" from the container - if you run in entrypoin_ci.sh - everythint that happens when START_AIRFLOW is set to a non-empty value is what happen when you do "start-airflow" - so maybe a good idea might be to write bash function (in_container_start_airflow)- extract it in entrypoint_ci.sh and run both during entrypoint_ci.sh of breeze start-airflow and when you rin in_container_start_airflow (or similar) in the devcontainer?

That might be a good way to give "start-airflow" functionality to devcontainer users.

@linxi507

Copy link
Copy Markdown
Author

Thanks for the suggestion — that makes sense, especially for improving the developer experience inside devcontainers.

For this PR, I focused on clarifying the execution context and improving the guidance for the existing workflow, since the current error message can be misleading in Codespaces.

I agree that supporting a "start-airflow" flow directly inside the container (via something like in_container_start_airflow) could be a valuable enhancement. I’d be happy to explore that in a follow-up PR to keep this one focused and easier to review.

Let me know if that sounds reasonable.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the GitHub Codespaces onboarding experience for Breeze by clarifying the correct execution context for Docker-dependent Breeze commands and by enhancing Breeze’s Docker-not-running guidance when executed inside containerized/devcontainer-like shells.

Changes:

  • Added containerized-development-environment detection and printed more targeted guidance when Docker checks fail in that context.
  • Added unit tests covering the containerized-environment guidance path and the generic non-containerized path.
  • Updated Codespaces and beginner quick-start docs to clarify where breeze start-airflow should be run to avoid misleading Docker errors.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
dev/breeze/src/airflow_breeze/utils/docker_command_utils.py Adds containerized environment detection and prints additional context-specific troubleshooting guidance on Docker failures.
dev/breeze/tests/test_docker_command_utils.py Adds unit tests verifying the new guidance behavior (containerized vs non-containerized).
contributing-docs/quick-start-ide/contributors_quick_start_codespaces.rst Clarifies Codespaces terminal context and adds more precise Docker troubleshooting instructions.
contributing-docs/03a_contributors_quick_start_beginners.rst Updates beginner Codespaces steps to emphasize running breeze start-airflow from the initial Codespaces terminal (not nested shells).

Comment on lines +205 to +211
"[warning]`breeze start-airflow` should be run from the outer Docker-accessible shell for "
"your environment, not from inside an already-entered Breeze/devcontainer shell unless the "
"documentation explicitly says to do so.[/]\n"
"[info]In GitHub Codespaces, run it from the initial Codespaces terminal opened on the "
"repository workspace.[/]\n"
"[info]Running the command from a nested container shell can produce a misleading "
"`Docker is not running` error.[/]"

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

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

The containerized-environment hint hard-codes breeze start-airflow, but check_docker_is_running() is invoked by perform_environment_checks() across many Breeze commands. This can lead to confusing guidance when the user was running a different command. Consider rephrasing to be command-agnostic (or describe it as an example), e.g. “Breeze commands that need Docker (such as start-airflow) should be run from the outer Docker-accessible shell …”

Suggested change
"[warning]`breeze start-airflow` should be run from the outer Docker-accessible shell for "
"your environment, not from inside an already-entered Breeze/devcontainer shell unless the "
"documentation explicitly says to do so.[/]\n"
"[info]In GitHub Codespaces, run it from the initial Codespaces terminal opened on the "
"repository workspace.[/]\n"
"[info]Running the command from a nested container shell can produce a misleading "
"`Docker is not running` error.[/]"
"[warning]Breeze commands that need Docker (such as `breeze start-airflow`) should be run "
"from the outer Docker-accessible shell for your environment, not from inside an "
"already-entered Breeze/devcontainer shell unless the documentation explicitly says to do "
"so.[/]\n"
"[info]In GitHub Codespaces, for example, run such commands from the initial Codespaces "
"terminal opened on the repository workspace, not from within a nested container shell.[/]\n"
"[info]Running Docker-dependent Breeze commands from a nested container shell can produce "
"misleading errors like `Docker is not running`.[/]"

Copilot uses AI. Check for mistakes.
Comment on lines +235 to +241
assert mock_console_print.call_args_list[0] == call(
"[error]Docker is not running.[/]\n[warning]Please make sure Docker is installed and running.[/]"
)
assert "containerized development shell" in mock_console_print.call_args_list[1].args[0]
assert "initial Codespaces terminal" in mock_console_print.call_args_list[1].args[0]
assert "Docker error output" in mock_console_print.call_args_list[3].args[0]
assert "GitHub Codespace" in mock_console_print.call_args_list[4].args[0]

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

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

These assertions depend on specific console_print call indices (e.g. [1], [3], [4]), which makes the test brittle if output ordering changes or an extra line is added. Consider asserting with assert_has_calls for the ordered subset you care about and using assert_any_call/substring checks without relying on exact positions.

Suggested change
assert mock_console_print.call_args_list[0] == call(
"[error]Docker is not running.[/]\n[warning]Please make sure Docker is installed and running.[/]"
)
assert "containerized development shell" in mock_console_print.call_args_list[1].args[0]
assert "initial Codespaces terminal" in mock_console_print.call_args_list[1].args[0]
assert "Docker error output" in mock_console_print.call_args_list[3].args[0]
assert "GitHub Codespace" in mock_console_print.call_args_list[4].args[0]
mock_console_print.assert_any_call(
"[error]Docker is not running.[/]\n[warning]Please make sure Docker is installed and running.[/]"
)
messages = [c.args[0] for c in mock_console_print.call_args_list]
assert any("containerized development shell" in msg for msg in messages)
assert any("initial Codespaces terminal" in msg for msg in messages)
assert any("Docker error output" in msg for msg in messages)
assert any("GitHub Codespace" in msg for msg in messages)

Copilot uses AI. Check for mistakes.
@jason810496
jason810496 marked this pull request as draft April 12, 2026 14:47
@potiuk

potiuk commented Apr 23, 2026

Copy link
Copy Markdown
Member

@linxi507 This draft PR has not had author activity for 21 days. Before anyone can review it, it needs to meet our Pull Request quality criteria. Here is a summary of what still needs work; once those items are addressed, mark the PR ready for review.

Issues found:

  • ❌ Failing CI: Additional PROD image tests / Test e2e integration tests with PROD image / Regular e2e test. Please investigate and fix.
  • ❌ Unresolved review comments (2 threads): please walk through each unresolved review thread. Even if a suggestion looks incorrect or irrelevant — and some of them will be, especially any comments left by automated reviewers like GitHub Copilot — it is still the author's responsibility to respond: apply the fix, reply in-thread with a brief explanation of why the suggestion does not apply, or resolve the thread if the feedback is no longer relevant. Once you believe a thread is resolved — whether by pushing a fix or by explaining why the suggestion doesn't apply — please mark it as resolved yourself by clicking the 'Resolve conversation' button at the bottom of each thread. Reviewers don't auto-close their own threads, so an addressed-but-unresolved thread reads as 'still waiting on the author' and keeps the PR from moving forward.

What to do next:

  • Address the items above.
  • Make sure static checks pass locally: prek run --from-ref main --stage pre-commit.
  • Mark the PR as "Ready for review" when you are done.

There is no rush — take your time and work at your own pace. We appreciate your contribution and are happy to wait for updates. If you have questions, feel free to ask on the Airflow Slack.

@potiuk

potiuk commented May 5, 2026

Copy link
Copy Markdown
Member

@linxi507 This draft PR has been inactive for 12 days since the last triage comment and no response from the author. Closing to keep the queue clean.

You are welcome to reopen this PR when you resume work, or to open a new one addressing the issues previously raised. There is no rush — take your time.


Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you.

@potiuk potiuk closed this May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The "docker is not running" error when using a GitHub codespace

3 participants