calibreapp / image-actions

A Github Action that automatically compresses JPEGs, PNGs and WebPs in Pull Requests.
https://calibreapp.com/blog/compress-images-in-prs
GNU General Public License v3.0
1.42k stars 67 forks source link

[Bug] Unable to run on ARM64 based Unbuntu 22.04 self-hosted agent #293

Open 22367rh opened 3 days ago

22367rh commented 3 days ago

Describe the bug

When trying to run the example workflow_trigger on a self hosted ARM64 Ununtu 22.04 agent I get an error that the docker image wants to run on x64 but obviously as it is an ARM64 SBC this doesn't work. (Error in the relevant section)

How To Reproduce

  1. Setup workflow.yml with the following example settings:
name: Compress Images Now
on:
  workflow_dispatch:
jobs:
  build:
    name: Run calibreapp/image-actions
    runs-on: [self-hosted, ARM64]
    steps:
      - name: Checkout Repo
        uses: actions/checkout@v4
      - name: Compress Images
        id: calibre
        uses: calibreapp/image-actions@main
        with:
          githubToken: ${{ secrets.GITHUB_TOKEN }}
          compressOnly: true
      - name: Create New Pull Request If Needed
        if: steps.calibre.outputs.markdown != ''
        uses: peter-evans/create-pull-request@v4
        with:
          title: Compressed Images On Demand Result
          branch-suffix: timestamp
          commit-message: Compressed Images
          body: ${{ steps.calibre.outputs.markdown }}
  1. Trigger workflow on repo

Screenshots

image

Relevant Log Output

Run calibreapp/image-actions@main
  with:
    githubToken: ***
    compressOnly: true
    jpegQuality: 80
    jpegProgressive: false
    pngQuality: 80
    webpQuality: 80
    ignorePaths: node_modules/**
/usr/bin/docker run --name ghcriocalibreappimageactionsimageactionsmain_5bb34c --label e9f556 --workdir /github/workspace --rm -e "INPUT_GITHUBTOKEN" -e "INPUT_COMPRESSONLY" -e "INPUT_JPEGQUALITY" -e "INPUT_JPEGPROGRESSIVE" -e "INPUT_PNGQUALITY" -e "INPUT_WEBPQUALITY" -e "INPUT_IGNOREPATHS" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "
WARNING: The requested image's platform (linux/amd64)) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
exec /usr/local/src/image-actions/entrypoint.js: exec format error

Code of Conduct

benschwarz commented 3 days ago

@22367rh it's expected that ARM doesn't work, as we currently only build a single docker image for x86. However, good news on that front — we're planning on ditching docker and having a JS only runtime for an upcoming release of image-actions.

That work should enable Arm64 (and other architectures), there shouldn't be anything else blocking afaik.

Refs: