Skip to content

[Packaging] Support ARM64 on Linux - #24180

Merged
Hang (bebound) merged 31 commits into
Azure:devfrom
bebound:arm64
Feb 14, 2023
Merged

[Packaging] Support ARM64 on Linux#24180
Hang (bebound) merged 31 commits into
Azure:devfrom
bebound:arm64

Conversation

@bebound

@bebound Hang (bebound) commented Oct 13, 2022

Copy link
Copy Markdown
Contributor

Description

The long-awaited feature is finally here. The ARM64 build will be released for current supported Linux distribution.

Close #7368

Related issue: #22875

Main changes:

  1. Artifact folder adds -amd64 or -arm64 suffix.
  2. Deb packages suffixes change from all.deb to amd64.deb/arm64.deb.
  3. Deb packages size decreases by 20MB and becomes 60MB because of Architecture: any in scripts/release/debian/prepare.sh.

This checklist is used to make sure that common guidelines for a pull request are followed.

@yonzhan

Yong Zhang (yonzhan) commented Oct 13, 2022

Copy link
Copy Markdown
Collaborator

Really long-awaited feature to support ARM64, good job!

@wangzelin007

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@bebound
Hang (bebound) marked this pull request as ready for review October 19, 2022 06:15
Comment thread scripts/release/rpm/ubi.dockerfile Outdated
rpmbuild -v -bb --clean scripts/release/rpm/azure-cli.spec && \
cp /root/rpmbuild/RPMS/x86_64/azure-cli-${cli_version}-1.*.x86_64.rpm /azure-cli-dev.rpm
cp /root/rpmbuild/RPMS/**/azure-cli-${cli_version}-1.*.rpm /azure-cli-dev.rpm && \
mkdir /out && cp /root/rpmbuild/RPMS/**/azure-cli-${cli_version}-1.*.rpm /out/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

docker cp does not support wildcard, move target package to out folder.

Package: azure-cli
Architecture: all
Architecture: any
Depends: \${shlibs:Depends}, \${misc:Depends}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This also change deb package name from all.deb to amd64.deb

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The package size also decrease by 20MB.

Specifying only any indicates that the source package isn’t dependent on any particular architecture and should compile fine on any one. The produced binary package(s) will be specific to whatever the current build architecture is.

Specifying only all indicates that the source package will only build architecture-independent packages.
https://www.debian.org/doc/debian-policy/ch-controlfields.html

@yonzhan Yong Zhang (yonzhan) removed this from the Oct 2022 (2022-11-01) milestone Oct 26, 2022
exit 0
fi
# https://docs.docker.com/engine/security/rootless/
/bin/bash -c "$(curl -fsSL https://get.docker.com)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I strongly feel we should persuade 1ES to provide an image with docker, instead of installing docker by ourselves.

@bebound Hang (bebound) Feb 13, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hope this issue will be fixed one day. actions/runner-images#5631

fi
fi
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ ${CLI_REPO} main" \
echo "deb [arch=$(dpkg --print-architecture)] https://packages.microsoft.com/repos/azure-cli/ ${CLI_REPO} main" \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice catch. This may solve #25393.

Comment thread scripts/release/debian/prepare.sh Outdated
${TAB}mkdir -p debian/azure-cli/etc/bash_completion.d/
${TAB}cat ${completion_script} > debian/azure-cli/etc/bash_completion.d/azure-cli
${TAB}dpkg-shlibdeps -v --warnings=7 -Tdebian/azure-cli.substvars -dDepends -edebian/azure-cli/opt/az/bin/python3 debian/azure-cli/opt/az/lib/python3.10/lib-dynload/_ssl.cpython-310-x86_64-linux-gnu.so
${TAB}ssl_file=$(find debian/azure-cli/opt/az/lib/python3.10/ -type f -name '_ssl.cpython-310-*-linux-gnu.so')

@jiasli Jiashuo Li (jiasli) Feb 13, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perhaps we don't need to use find, similar to #24180 (comment).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes indeed!

rpmbuild -v -bb --clean scripts/release/rpm/azure-cli.spec && \
cp /usr/src/mariner/RPMS/x86_64/azure-cli-${cli_version}-1.cm2.x86_64.rpm /azure-cli-dev.rpm
cp /usr/src/mariner/RPMS/*/azure-cli-${cli_version}-1.*.rpm /azure-cli-dev.rpm && \
mkdir /out && cp /usr/src/mariner/RPMS/*/azure-cli-${cli_version}-1.*.rpm /out/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any reason for copying to /out?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In scripts/release/rpm/pipeline.sh, we'll copy the rpm file with docker cp $id:/out/. ${BUILD_STAGINGDIRECTORY} later.
RPMs are in different folders on amd64 and arm64, but docker cp does not support wildcard. I move target package to out folder.

@TravisEz13

Copy link
Copy Markdown
Member

Any timeline for this to be released?

@bebound

Copy link
Copy Markdown
Contributor Author

Travis Plunk (@TravisEz13) On March 07

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot Packaging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support arm64 Linux builds

5 participants