Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always pass --load flag to docker buildx build command #1621

Merged
merged 1 commit into from
Apr 17, 2024
Merged

Conversation

mattt
Copy link
Member

@mattt mattt commented Apr 17, 2024

Related to #1620

Some customers have observed the replicate/setup-cog action failing to push new versions of images to Replicate.

In logs for such failing GitHub Actions runs, the following is printed:

No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load

We currently do pass --load, but only when building on macOS:

args = append(args, "--platform", "linux/amd64", "--load")

I believe this code was leftover from when cog build didn't always imply docker buildx build, and BuildKit was used only when building linux/amd64 on linux/arm64/v8.

From https://docs.docker.com/reference/cli/docker/buildx/create/#docker-driver:

docker driver - Uses the builder that is built into the Docker daemon. With this driver, the --load flag is implied by default on buildx build. However, building multi-platform images or exporting cache is not currently supported.

docker-container driver - Uses a BuildKit container that will be spawned via Docker. With this driver, both building multi-platform images and exporting cache are supported.

This PR adds the --load flag to the docker buildx build command invocation for all code paths. Since that's the implied default for the docker driver, this change shouldn't affect anyone getting the correct behavior.

Signed-off-by: Mattt Zmuda <mattt@replicate.com>
@mattt mattt merged commit 0473e6a into main Apr 17, 2024
15 checks passed
@mattt mattt deleted the mattt/buildx-load branch April 17, 2024 13:46
@jlalmes
Copy link

jlalmes commented Apr 17, 2024

RE. #1620 - I am running cog build & cog push on a GitHub action (ubuntu-latest-8-cores), so don't believe this PR solves the issue 🤔

@mattt
Copy link
Member Author

mattt commented Apr 17, 2024

@jlalmes Correct. These changes haven't been released yet, so this won't work until they are. Working to get those out tomorrow.

@joe-aivatarz
Copy link

I updated cog to v0.9.6 and still getting this error on ubuntu-22.04 using replicate/setup-cog github action:
WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
Validating model schema...
Unable to find image 'r8.im/joe-aivatarz/comfyui-runner:latest' locally
docker: Error response from daemon: manifest for r8.im/joe-aivatarz/comfyui-runner:latest not found: manifest unknown: Failed to fetch "latest".

@zeke
Copy link
Member

zeke commented Apr 22, 2024

@joe-aivatarz this PR has not been included in a Cog release yet, but we're working on it.

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.

5 participants