Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support arm64 #5320

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Support arm64 #5320

wants to merge 1 commit into from

Conversation

harryzcy
Copy link
Contributor

@harryzcy harryzcy commented Feb 24, 2024

Proposed changes

  • Updated workflows to also build arm64 image
  • Conditionally ignores the tools that do not support arm64

Fix #5070
Fix #5339

Readiness checklist

In order to have this pull request merged, complete the following tasks.

Pull request author tasks

  • I included all the needed documentation for this change.
  • I provided the necessary tests.
  • I squashed all the commits into a single commit.
  • I followed the Conventional Commit v1.0.0 spec.
  • I wrote the necessary upgrade instructions in the upgrade guide.
  • If this pull request is about and existing issue,
    I added the Fix #ISSUE_NUMBER label to the description of the pull request.

Super-linter maintainer tasks

  • Label as breaking if this change breaks compatibility with the previous released version.
  • Label as either: automation, bug, documentation, enhancement, infrastructure.

@harryzcy harryzcy force-pushed the support-arm64 branch 3 times, most recently from b287234 to 13d4e30 Compare February 27, 2024 03:50
@ferrarimarco
Copy link
Collaborator

Thanks for this PR!

@harryzcy instead of commenting things as a first step, I would start from making the ci and cd GitHub Actions workflow build the container image for the arm64 platform as well, so you can get continuous feedback.

@harryzcy harryzcy force-pushed the support-arm64 branch 18 times, most recently from 3a5edad to 2b614d7 Compare February 29, 2024 15:19
@harryzcy harryzcy marked this pull request as ready for review February 29, 2024 15:23
Comment on lines +91 to +96
if [[ "${TARGETARCH}" == "amd64" ]]; then
LINTER_NAMES_ARRAY['ENV']="dotenv-linter"
LINTER_NAMES_ARRAY['POWERSHELL']="pwsh"
fi
Copy link
Collaborator

Choose a reason for hiding this comment

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

These two linters are only available in the standard image. I'm wondering if we can start with the slim image only, instead of having to account for these cases here and in the Dockerfile.

Dockerfile Outdated Show resolved Hide resolved
Comment on lines +37 to +43
if [[ "${TARGETARCH}" != "amd64" ]]; then
# Install Rust compiler (required by checkov on arm64) #
# remove this once https://github.com/bridgecrewio/checkov/pull/6045 is merged
apk add --no-cache curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH=$PATH:$HOME/.cargo/bin
fi
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's see if that Checkov PR lands in, so we can skip this part.

Comment on lines 11 to 25
apk add --no-cache --virtual .python-build-deps \
gcc \
linux-headers \
musl-dev \
packages=(
gcc
linux-headers
musl-dev
python3-dev
)

if [[ "${TARGETARCH}" != "amd64" ]]; then
# libffi-dev is required for building wheel for cffi,
# until https://github.com/python-cffi/cffi/issues/69 is merged
packages+=(libffi-dev)
fi

apk add --no-cache --virtual .python-build-deps \
"${packages[@]}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's see if that cffi PR lands, so we can skip this change.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That PR landed, shall we remove this if?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking at the logs, cffi still need to built from source until a release is landed

#71 659.6 Building wheel for cffi (pyproject.toml): started

@@ -58,7 +58,6 @@ LINTER_NAMES_ARRAY['R']="R"
LINTER_NAMES_ARRAY['RAKU']="raku"
LINTER_NAMES_ARRAY['RENOVATE']="renovate-config-validator"
LINTER_NAMES_ARRAY['RUBY']="rubocop"
LINTER_NAMES_ARRAY['SCALAFMT']="scalafmt"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This one is going to be a bit more challenging. Is scalafmt not available on arm64?

Copy link
Contributor Author

@harryzcy harryzcy Mar 1, 2024

Choose a reason for hiding this comment

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

No, not available yet. i don't know anything about scala and is having a hard time contributing a multi-arch image for it

Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems that there's a scalafmt-macos executable available since a few releases? Maybe that's useful in this case?

scripts/install-glibc.sh Outdated Show resolved Hide resolved
@harryzcy harryzcy force-pushed the support-arm64 branch 2 times, most recently from 9e1c809 to afb0efc Compare March 5, 2024 19:17
Copy link
Contributor

github-actions bot commented Apr 5, 2024

This pull request has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this pull request should stay open, please remove the O: stale 🤖 label or comment on the pull request.

If you're a maintainer, you can stop the bot to mark this issue as stale in the future by adding the O: backlog 🤖 label`.

@github-actions github-actions bot added the O: stale 🤖 Stale issue/pr label Apr 5, 2024
@harryzcy

This comment was marked as off-topic.

if [[ "${IMAGE}" == "standard" ]]; then
LINTER_NAMES_ARRAY['ARM']="arm-ttk"
LINTER_NAMES_ARRAY['CSHARP']="dotnet"
LINTER_NAMES_ARRAY['ENV']="dotenv-linter"
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems that dotenv-linter has an arm64 image? dotenv-linter/dotenv-linter#533

if [[ "${IMAGE}" == "standard" ]]; then
LINTER_NAMES_ARRAY['ARM']="arm-ttk"
LINTER_NAMES_ARRAY['CSHARP']="dotnet"
LINTER_NAMES_ARRAY['ENV']="dotenv-linter"
LINTER_NAMES_ARRAY['POWERSHELL']="pwsh"
Copy link
Collaborator

Choose a reason for hiding this comment

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

arm64 request tracked in PowerShell/PowerShell-Docker#795

@@ -25,6 +25,24 @@ function ValidateBooleanConfigurationVariables() {
ValidateBooleanVariable "YAML_ERROR_ON_WARNING" "${YAML_ERROR_ON_WARNING}"
}

function ValidatePlatformArchitecture() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we shouldn't validate this at runtime, but rather when we build the image. Also, we wouldn't want to silently disable linters in the case that they aren't available on a given platform.

I would revert this change and the related function call in linter.sh. We likely need to think a bit more about how to handle this.

Thanks!

@@ -108,6 +108,7 @@ declare -l YAML_ERROR_ON_WARNING
YAML_ERROR_ON_WARNING="${YAML_ERROR_ON_WARNING:-false}"

ValidateBooleanConfigurationVariables
ValidatePlatformArchitecture
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you revert this change as well? See my previous comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request O: backlog 🤖 Backlog, stale ignores this label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parallel cannot identify the default shell Support Arm64
2 participants