diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 94ff1ea103..bdc53a6f22 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -199,17 +199,10 @@ jobs: image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee:${{ env.DEV_SHA }} path: "/usr/src/app/windmill" - - uses: shrink/actions-docker-extract@v3 - id: extract-ee-debug - with: - image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee:${{ env.DEV_SHA }} - path: "/usr/src/app/windmill.debug" - - name: Rename binary with corresponding architecture run: | mv "${{ steps.extract.outputs.destination }}/windmill" "${{ steps.extract.outputs.destination }}/windmill-${ARCH}" mv "${{ steps.extract-ee.outputs.destination }}/windmill" "${{ steps.extract-ee.outputs.destination }}/windmill-ee-${ARCH}" - mv "${{ steps.extract-ee-debug.outputs.destination }}/windmill.debug" "${{ steps.extract-ee-debug.outputs.destination }}/windmill-ee-${ARCH}.debug" - name: Attach binary to release uses: softprops/action-gh-release@v2 @@ -217,35 +210,60 @@ jobs: files: | ${{ steps.extract.outputs.destination }}/* ${{ steps.extract-ee.outputs.destination }}/* - ${{ steps.extract-ee-debug.outputs.destination }}/* ${{ steps.extract-duckdb-ffi-internal.outputs.destination }}/* - attach_arm64_ee_debug_to_release: + attach_ee_debug_to_release: needs: [build_ee] - runs-on: ubicloud-standard-2-arm + runs-on: ubicloud if: ${{ startsWith(github.ref, 'refs/tags/v') }} - env: - ARCH: arm64 + strategy: + matrix: + platform: [linux/amd64, linux/arm64] + include: + - platform: linux/amd64 + arch: amd64 + - platform: linux/arm64 + arch: arm64 steps: - uses: actions/checkout@v4 - - run: | - docker pull --platform "linux/$ARCH" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee:${{ env.DEV_SHA }} - - - uses: shrink/actions-docker-extract@v3 - id: extract-ee-debug with: - image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee:${{ env.DEV_SHA }} - path: "/usr/src/app/windmill.debug" + ref: ${{ github.ref }} + + - name: Read EE repo commit hash + run: | + echo "ee_repo_ref=$(cat ./backend/ee-repo-ref.txt)" >> "$GITHUB_ENV" + + - uses: actions/checkout@v4 + with: + repository: windmill-labs/windmill-ee-private + path: ./windmill-ee-private + ref: ${{ env.ee_repo_ref }} + token: ${{ secrets.WINDMILL_EE_PRIVATE_ACCESS }} + + - name: Substitute EE code + run: | + ./backend/substitute_ee_code.sh --copy --dir ./windmill-ee-private + + - uses: depot/setup-action@v1 + + - name: Extract EE debug info from builder stage (depot cache hit) + uses: depot/build-push-action@v1 + with: + context: . + platforms: ${{ matrix.platform }} + target: debuginfo + build-args: | + features=ee + outputs: type=local,dest=./debuginfo - name: Rename debug file with corresponding architecture run: | - mv "${{ steps.extract-ee-debug.outputs.destination }}/windmill.debug" "${{ steps.extract-ee-debug.outputs.destination }}/windmill-ee-${ARCH}.debug" + mv ./debuginfo/windmill.debug ./debuginfo/windmill-ee-${{ matrix.arch }}.debug - name: Attach debug file to release uses: softprops/action-gh-release@v2 with: - files: | - ${{ steps.extract-ee-debug.outputs.destination }}/* + files: ./debuginfo/windmill-ee-${{ matrix.arch }}.debug # attach_arm64_binary_to_release: # needs: [build, build_ee] diff --git a/Dockerfile b/Dockerfile index f84afcc888..d312d3a823 100644 --- a/Dockerfile +++ b/Dockerfile @@ -120,8 +120,15 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \ # Split debug info into a separate file, then strip the binary. # The .debug file can be extracted as a CI artifact for production debugging. +# The debuglink allows gdb to auto-discover the debug file when placed next to the binary. RUN objcopy --only-keep-debug /windmill/target/release/windmill /windmill/target/release/windmill.debug \ - && strip /windmill/target/release/windmill + && strip /windmill/target/release/windmill \ + && objcopy --add-gnu-debuglink=/windmill/target/release/windmill.debug /windmill/target/release/windmill + +# Standalone stage for extracting the .debug file without including it in the final image. +# Build with: docker build --target debuginfo --output type=local,dest=./out . +FROM scratch AS debuginfo +COPY --from=builder /windmill/target/release/windmill.debug /windmill.debug FROM ${DEBIAN_IMAGE} @@ -257,7 +264,6 @@ ENV TZ=Etc/UTC COPY --from=builder /frontend/build /static_frontend COPY --from=builder /windmill/target/release/windmill ${APP}/windmill -COPY --from=builder /windmill/target/release/windmill.debug ${APP}/windmill.debug COPY --from=windmill_duckdb_ffi_internal_builder /windmill-duckdb-ffi-internal/target/release/libwindmill_duckdb_ffi_internal.so ${APP}/libwindmill_duckdb_ffi_internal.so COPY --from=denoland/deno:2.2.1 --chmod=755 /usr/bin/deno /usr/bin/deno