setup-buildx-action icon indicating copy to clipboard operation
setup-buildx-action copied to clipboard

Feature request: append builder

Open febus982 opened this issue 2 years ago • 4 comments

There are certain scenarios where QEMU performance is simply terrible.

A much performant approach is to use multiple native buildx ~builders~ nodes.

We can already do it using a bash script :

      - name: Set up Docker Buildx
        id: builder
        uses: docker/setup-buildx-action@v1

      - name: Append kubernetes buildx builder
        shell: bash
        run: |
          docker buildx create --append --name ${{ steps.builder.outputs.name }} \
          --driver kubernetes \
          --platform linux/arm64 \
          --driver-opt nodeselector=kubernetes.io/arch=arm64

Would it be possible to introduce an append boolean parameter? Eventually it could be an append_to accepting a step id (or the builder instance name from the output)

febus982 avatar Nov 18 '21 22:11 febus982

@febus982 Sgtm. I think instead of a boolean parameter for append, it should be the name of the builder we want to append to. We should also have a platform input if we want to restrict a specific node.

crazy-max avatar Nov 29 '21 09:11 crazy-max

Great idea. I would use that to append another remote "node" (i.e. an AWS graviton instance for example to build my ARM images) accesible via SSH, like:

      -
        name: "Set up Docker Buildx"
        uses: docker/setup-buildx-action@v1

      - name: "Append ARM buildx builder from AWS"
        shell: bash
        run: |
          docker buildx create --append --name ${{ steps.builder.outputs.name }} \
              --node aws_graviton \
              --platform linux/arm64 \
              ssh://[email protected]

So having options to do that in the docker/setup-buildx-action directly without requiring an additional shell step would be cool.

baschny avatar Jan 18 '22 10:01 baschny

I created an action out of it for our particular use-case (should also work for the kubernetes case). It also loads an SSH key before if we need that.

https://github.com/marketplace/actions/append-buildx-nodes

baschny avatar Jan 19 '22 14:01 baschny

@baschny You saved my time. Thanks a lot.

sinwoobang avatar Sep 04 '22 09:09 sinwoobang

You can now append nodes to existing builder, see https://github.com/docker/setup-buildx-action/blob/master/docs/advanced/append-nodes.md for more info.

crazy-max avatar Oct 17 '22 13:10 crazy-max