Skip to content

Deploy: Implement internet connectivity checks#954

Open
jaagut wants to merge 1 commit into
mainfrom
fix/deploy_no_internet
Open

Deploy: Implement internet connectivity checks#954
jaagut wants to merge 1 commit into
mainfrom
fix/deploy_no_internet

Conversation

@jaagut

@jaagut jaagut commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Checks whether the robot can reach data.bit-bots.de (curl -sSfLI --max-time 5 https://data.bit-bots.de/conda-misc/output/)
    • If connection can be established, pixi install as normal
    • If no connection, use pixi with --as-is to prevent install failures

Why? We now have a default gateway configured on the robots.
Thus, pixi thinks, we should have an internet connection and tries to sync/install on every command and fails, if there is no true internet connection.

Proposed changes

Related issues

Checklist

  • Run pixi run build
  • Write documentation
  • Test on your machine
  • Test on the robot
  • Create issues for future work
  • Triage this PR and label it

@github-project-automation github-project-automation Bot moved this to 🆕 New in Software Jul 1, 2026
@jaagut jaagut self-assigned this Jul 1, 2026
@jaagut jaagut moved this from 🆕 New to 👀 In review in Software Jul 1, 2026
@jaagut jaagut requested review from Flova, Copilot and texhnolyze July 1, 2026 04:10

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 adds an internet-connectivity probe to the deployment tooling so Pixi commands on robots can avoid failing when a default gateway exists but no real internet route is available. It centralizes Pixi command construction (including conditional --as-is) and updates deploy tasks to use the new helper.

Changes:

  • Introduce deploy/pixi.py with robot_has_internet() caching, pixi_run_command(), pixi_install_if_online(), and a parallel run_for_connections() helper.
  • Update deploy tasks (sync, launch, build, configure) to use the new Pixi helpers for consistent offline behavior.
  • Add unit tests for the Pixi connectivity/command behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scripts/deploy/pixi.py New shared helpers for connectivity probing, offline-safe Pixi commands, and parallel execution.
scripts/deploy/tasks/sync.py Replaces unconditional pixi install verification with conditional pixi_install_if_online().
scripts/deploy/tasks/launch.py Switches Pixi invocations to pixi_run_command() and uses run_for_connections() for execution.
scripts/deploy/tasks/build.py Uses pixi_run_command() + run_for_connections() for clean/build steps.
scripts/deploy/tasks/configure.py Routes Pixi execution through pixi_run_command() and clears cached internet status after wifi priority changes.
scripts/deploy/tests/test_pixi.py Adds tests covering offline/online command selection and connectivity caching.
scripts/deploy/init.py Marks deploy as a Python package for importability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


from deploy import pixi # noqa: E402

_PIXI_REPOSITORY_CHECK_COMMAND = "curl -sSfLI --max-time 2 https://data.bit-bots.de/conda-misc/output/"
@Flova

Flova commented Jul 1, 2026

Copy link
Copy Markdown
Member

Is there no other way around this? This seems very risky, as it is not refusing do build without an up to date environment. I am totally for being able to override this behavior, but I have the concern that this leads to outdated/diverging robot env and weird behavior really quickly.

I also don't understand why it wants internet access for an up to date lock file?

@Flova

Flova commented Jul 1, 2026

Copy link
Copy Markdown
Member

Maybe the frozen flag is more appropriate. Imo we should always use --frozen on the robot when using the deployment. If the lock file is out of date we need to regenerate it on the host.

@jaagut

jaagut commented Jul 1, 2026

Copy link
Copy Markdown
Member Author
Update Options:
      --no-install
          Don't modify the environment, only modify the lock file
          
          [env: PIXI_NO_INSTALL=]

      --frozen
          Install the environment as defined in the lock file, doesn't update lock file if it isn't up-to-date with the manifest file
          
          [env: PIXI_FROZEN=]

      --locked
          Check if lock file is up-to-date before installing the environment, aborts when lock file isn't up-to-date with the manifest file
          
          [env: PIXI_LOCKED=]

      --as-is
          Shorthand for the combination of --no-install and --frozen

We assume, pixi errors "correctly" when the lock doesn't match the env and requires updates

@jaagut

jaagut commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

@Flova

I am totally for being able to override this behavior
What do you mean by that?

@Flova

Flova commented Jul 1, 2026

Copy link
Copy Markdown
Member

That you should be able to e.g. manually override using as-is if you are sure that nothing significantly changed.

@Flova

Flova commented Jul 1, 2026

Copy link
Copy Markdown
Member

Maybe we also need locked.

@jaagut

jaagut commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

That you should be able to e.g. manually override using as-is if you are sure that nothing significantly changed.

You want an argument to do the normal install behavior without --as-is independent of the current internet connection?

@Flova

Flova commented Jul 1, 2026

Copy link
Copy Markdown
Member

That you should be able to e.g. manually override using as-is if you are sure that nothing significantly changed.

You want an argument to do the normal install behavior without --as-is independent of the current internet connection?

No. I mean I think as-is is okay to have as long as it is not the default and used with caution.

@Flova

Flova commented Jul 1, 2026

Copy link
Copy Markdown
Member

After talking with Jan we came to the conclusion that we probably want to have --frozen and --locked always on the robot by default. --no-install is the one that's dangerous imo and --as-is combines --frozen and --no-install. Why pixie tries to regenerate the lock file is a different story and I suspect it may be related to the way bitbots_rust_nav is compiled. Sometimes the hash of the build changes for whatever reason triggering a rebuilt and update of the lock file. There is a way around this by building it with colcon, which is cleaner imo. that is pr #X with bitbots_cargo, which works on my machine, but had some llvm compatibility error on Cornelius one.

@jaagut jaagut changed the title Implement internet connectivity checks and commands for Pixi deployment Deploy: Implement internet connectivity checks Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

3 participants