Skip to content

packages almalinux: add --platform linux/arm64 when building arm64's image - #1807

Merged
kou merged 5 commits into
groonga:mainfrom
otegami:add-platform-option-when-building-image
Jul 1, 2024
Merged

kou merged 5 commits into
groonga:mainfrom
otegami:add-platform-option-when-building-image

Conversation

@otegami

@otegami otegami commented Jun 28, 2024 •

Copy link
Copy Markdown
Contributor

ref: #1806

This change solves the following error on CI.
Because Docker build process does not automatically detect the correct platform for the image. As a result, the platform information defaults to the host platform. So in this case, platform infromation wasn't as a arm64.

To resolve this issue, we need to specify the platform explicitly in the Docker build command.
ref: https://docs.docker.com/build/building/multi-platform/

Here is the error log:

https://github.com/groonga/groonga/actions/runs/9705591558/job/26788067581#step:9:42

------
#3 [internal] load metadata for docker.io/arm64v8/almalinux:8
#3 ERROR: no match for platform in manifest: not found
------
Dockerfile:2
--------------------
   1 |     ARG FROM=almalinux:8
   2 | >>> FROM ${FROM}
   3 |
   4 |     ARG DEBUG
--------------------
ERROR: failed to solve: arm64v8/almalinux:8: failed to resolve source metadata for docker.io/arm64v8/almalinux:8: no match for platform in manifest: not found
rake aborted!#1 [internal] load build definition from Dockerfile

…image

ref: groonga#1806

This change solves the following error on CI.
Because Docker build process does not automatically detect the correct platform for the image.
As a result, the platform information defaults to the host platform.
So in this case, platform infromation wasn't the arm64.

To resolve this issue, we need to specify the platform explicitly in the Docker build command.
ref: https://docs.docker.com/build/building/multi-platform/

```

------
 > [internal] load metadata for docker.io/arm64v8/almalinux:8:
------
Dockerfile:2
--------------------
   1 |     ARG FROM=almalinux:8
   2 | >>> FROM ${FROM}
   3 |
   4 |     ARG DEBUG
--------------------
ERROR: failed to solve: arm64v8/almalinux:8: failed to resolve source metadata for docker.io/arm64v8/almalinux:8: no match for platform in manifest: not found
rake aborted!#1 [internal] load build definition from Dockerfile
```

ref: ref: https://github.com/groonga/groonga/actions/runs/9705591558/job/26788067581
@otegami otegami changed the title packages almalinux: add --platform linux/arm64 when building arm64's image packages almalinux: add --platform linux/arm64 when building arm64's image Jun 28, 2024
@otegami

otegami commented Jun 28, 2024

Copy link
Copy Markdown
Contributor Author

--platform linux/arm64 がうまく渡せていなさそうなので、再度確認する。

@otegami
otegami force-pushed the add-platform-option-when-building-image branch from 9418830 to 47165b5 Compare June 28, 2024 07:38
@otegami

otegami commented Jun 28, 2024 •

Copy link
Copy Markdown
Contributor Author

test ステップ側でも明示的に指定してあげる必要がありそうなので、対応する。
ref: https://github.com/groonga/groonga/actions/runs/9709233851/job/26797698122

Run docker run \
  docker run \
    --rm \
    --volume ${PWD}:/groonga:ro \
    arm64v8/almalinux:8 \
    /groonga/packages/yum/test.sh
  shell: /usr/bin/bash -e {0}
  env:
    APACHE_ARROW_REPOSITORY: /home/runner/work/groonga/groonga/apache-arrow
Unable to find image 'arm64v8/almalinux:8' locally
8: Pulling from arm64v8/almalinux
docker: no matching manifest for linux/amd64 in the manifest list entries.
See 'docker run --help'.
Error: Process completed with exit code 125.

@kou

kou commented Jun 28, 2024

Copy link
Copy Markdown
Contributor

テストの同じ問題の対応はこのPRの範囲外ですか?

@otegami

otegami commented Jun 28, 2024

Copy link
Copy Markdown
Contributor Author

範囲内で対応しようと思っています。

@otegami

otegami commented Jun 28, 2024

Copy link
Copy Markdown
Contributor Author

修正方針に悩んでいます。
matrix に platform: linux/amd64 見たいなのを突っ込むのは少し強引ですかね?

@komainu8

Copy link
Copy Markdown
Member

修正方針に悩んでいます。 matrix に platform: linux/amd64 見たいなのを突っ込むのは少し強引ですかね?

私はその方針で良いと思います。

@kou

kou commented Jun 28, 2024

Copy link
Copy Markdown
Contributor

いやぁ、test-docker-imageを見て自動でやれません?
ちょっと、パラメーターを増やしてメンテナンスするのはいやかなぁ。

@otegami
otegami force-pushed the add-platform-option-when-building-image branch from a185ee2 to d93422b Compare June 28, 2024 09:05
Comment thread .github/workflows/package.yml Resolved
Co-authored-by: Sutou Kouhei <[email protected]>
@otegami
otegami requested review from komainu8 and kou July 1, 2024 01:09
@kou
kou merged commit fa62389 into groonga:main Jul 1, 2024
@otegami
otegami deleted the add-platform-option-when-building-image branch July 1, 2024 02:09
@kou

kou commented Jul 1, 2024

Copy link
Copy Markdown
Contributor

今度から、説明にref: https://github.com/groonga/groonga/issues/1806と書くんじゃなくてfix GH-1806と書いて自動でクローズするようにしましょうか。

コミットメッセージを見るとわかるんですが、GroongaではGitHub: fix GH-XXXという書き方を使っています。
GitHub: とつけているのは、今はたまたまGitHubを使っていますが、今後は違うチケット管理システムを使うからかもしれないからです。

@otegami

otegami commented Jul 1, 2024

Copy link
Copy Markdown
Contributor Author

了解しました!

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.

3 participants