Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ runs:
- name: Set up Docker buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
with:
use: 'false'
Copy link
Member

Choose a reason for hiding this comment

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

What does this do?

Copy link
Member

Choose a reason for hiding this comment

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

@EduarteXD I see this:

https://github.com/docker/setup-buildx-action/blob/5138f76647652447004da686b2411557eaf65f33/README.md#L97

Screenshot 2024-05-21 at 09 22 43@2x

.. but I don't know enough about how Docker or buildx works to know what "Switch to this builder instance" means or what effect it might have.

Copy link
Author

Choose a reason for hiding this comment

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

In buildx, the --use parameter is used to specify an existing builder.

In the setup-buildx-action script, passing use: true will make each build step use a new builder instance, each builder has its own context, cache, and storage space.

Therefore, the artifacts (such as intermediate layer cache, final images, etc.) between different builders are isolated by default and cannot directly access each other’s artifacts.

In each step of the cog's build, it is necessary to use --load to directly load the built image into the Docker engine, which can take a considerable amount of time.

Copy link
Member

Choose a reason for hiding this comment

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

Gotcha! Thanks for explaining in detail. I can set up a test workflow that combines this change plus replicate/cog#1656 and see how it goes. If everything is smooth I'll merge and ship these changes.

driver: "docker"

- name: Install NVIDIA CUDA Toolkit
Expand All @@ -48,4 +49,4 @@ runs:
REPLICATE_API_TOKEN: ${{ inputs.token }}
run: |
echo "Found REPLICATE_API_TOKEN in the environment; Authenticating..."
echo $REPLICATE_API_TOKEN | cog login --token-stdin
echo $REPLICATE_API_TOKEN | cog login --token-stdin