Skip to content

Conversation

@supernovahs
Copy link
Contributor

@supernovahs supernovahs commented May 23, 2025

Motivation:

Support running devnet on both linux and mac

Modifications:

  • Added GetDockerHost() function that detects the operating system and returns the appropriate Docker host:
    Linux: localhost (containers can access host via localhost)
    macOS/Windows: host.docker.internal (required for Docker Desktop)
  • Supports DOCKERS_HOST environment variable override
    Added EnsureDockerHost() function that intelligently converts localhost URLs for container→host communication:
  • Uses URL parsing to avoid breaking domains like localhost.mydomain.com
    Includes regex fallback for malformed URLs
  • Only replaces exact hostname matches for localhost and 127.0.0.1

Result:

Testing:

unit tests

Open questions:

@supernovahs supernovahs changed the title WIP : linux compatibility and testing fix : linux compatibility and testing May 23, 2025
@supernovahs supernovahs marked this pull request as ready for review May 23, 2025 18:47
@supernovahs supernovahs requested a review from a team as a code owner May 23, 2025 18:47
@supernovahs supernovahs changed the title fix : linux compatibility and testing fix: linux compatibility and testing May 23, 2025
Copy link
Collaborator

@bdchatham bdchatham left a comment

Choose a reason for hiding this comment

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

My gut thinking is we should just have a workflow that goes through the happy path of setting up a project via devkit commands. I might have seen we already have something like this. It could be a standard set of commands that run across all platforms we support. Then we can move this hand-rolled go execution into the unit test suite.

@supernovahs
Copy link
Contributor Author

My gut thinking is we should just have a workflow that goes through the happy path of setting up a project via devkit commands. I might have seen we already have something like this. It could be a standard set of commands that run across all platforms we support. Then we can move this hand-rolled go execution into the unit test suite.

we have a e2e test in the ci for this . But i don't why it didn't capture the issue. even though it runs on ubuntu

@bdchatham
Copy link
Collaborator

That CI works because it's using the DOCKERS_HOST field which Graham looks to have added to support selecting the network based on.

@supernovahs supernovahs merged commit 3276664 into main May 28, 2025
9 checks passed
@supernovahs supernovahs deleted the nova/linux_support branch May 28, 2025 10:17
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.

4 participants