Garden-AI / garden

https://garden-ai.readthedocs.io
MIT License
19 stars 4 forks source link

The Ryan Jacobs Heisenbug #414

Closed WillEngler closed 7 months ago

WillEngler commented 7 months ago

Our collaborator Ryan from Wisconsin tried using Garden for the first time yesterday. It was going pretty well, right up until the end of the publish command. In extract_metadata_from_image, Ryan was getting an empty string from the Docker command that cats the metadata.json in the container.

container_stdout = client.containers.run(
        image=image.id,
        entrypoint="/bin/sh",
        command=["-c", "cat /garden/metadata.json"],
        remove=True,
        detach=False,
    )

His container had already been pushed to our ECR repo. I pulled it down and confirmed that the metadata.json was there. I also confirmed that when I run this code against that container, I get the expected JSON. Owen also could not repro the bug.

So there is something particular to Ryan's computer that makes the exchange over stdout from Docker to the Garden host process not work. Maybe his Docker settings, maybe something OS level, we really don't know. But Owen and I theorized that if we could not rely on stdout, maybe that would solve it. We had Ryan run a test script that seems to confirm that theory.

So, the move is probably to use container.get_archive to pull files from a container.

Assumptions:

  1. Confirm this doesn't break things for non-Ryans.
  2. Cut a release and follow up with Ryan

Acceptance Criteria

Given I am using Ryan's laptop, when I publish an entrypoint with Garden, then it doesn't break at the metadata parsing step.

WillEngler commented 7 months ago

We got confirmation from Ryan that this did the trick, phew