beamable / BeamableProduct

The beamable product suite including com.beamable, com.beamable.server, microservice base image, portal, the installer, and build scripts
Other
5 stars 0 forks source link

C#MS building fails if Docker helpers are not on $PATH #3530

Open allister-beamable opened 1 month ago

allister-beamable commented 1 month ago

Describe the bug

On macOS, upon updating Docker Desktop to version 4.31.0, microservice building fails with an error saying that something like docker-credential-desktop could not be found on PATH. It would appear that something introduced in Docker Desktop 4.31.0 changed the way docker build finds its docker-credential helpers. Coupled with the fact that Unity Hub provides Unity processes with an extremely minimal PATH environment variable, this leads to those helpers not being found.

To Reproduce

Steps to reproduce the behavior:

  1. Have Docker Desktop 4.31.0 installed.
  2. Launch your Unity project from Unity Hub
  3. Go to Beamable Microservices Manager
  4. Attempt to launch a C#MS by hitting Play or hitting Publish

Expected behavior

The C# Microservice builds and runs.

Actual behavior

The C#MS fails to run, and there is an error along these lines:

MyMicroservice - [BUILD]: ERROR: failed to solve: beamableinc/beamservice:prod_1.19.21: failed to resolve source metadata for docker.io/beamableinc/beamservice:prod_1.19.21: error getting credentials - err: exec: "docker-credential-desktop": executable file not found in $PATH, out: ``

Metadata

allister-beamable commented 1 month ago

As a stopgap, developers can work around the issue by including an auto-patch script somewhere under Assets/, such as Assets/Scripts/Editor/

https://gist.github.com/allister-beamable/008498cbd2c64d58ad1b66a3b64f5b4b

allister-beamable commented 1 month ago

It would probably be good to allow the actual added path to be configured in Project Settings. The vast majority of developers on macOS probably have Docker Desktop stuff installed in /usr/local/bin, but it is possible that a few people have it installed in a nonstandard location.

cdhanna commented 1 month ago

The /usr/local/bin thing should be the default value of a new config value that is modifiable via Project Settings. Otherwise, I think we can pretty much copy/paste the sentiment of the workaround snippet. But we wouldn't need to use the DI hook system, we could just inject it into the BeamableEditor bootup sequence.