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

[Packaging] Support ARM64 on Linux #24180

Merged
merged 31 commits into from
Feb 14, 2023
Merged

[Packaging] Support ARM64 on Linux #24180

merged 31 commits into from
Feb 14, 2023

Conversation

bebound
Copy link
Contributor

@bebound bebound commented Oct 13, 2022

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.

@ghost ghost requested review from jiasli, wangzelin007, yonzhan and kairu-ms October 13, 2022 07:43
@ghost ghost added the Auto-Assign Auto assign by bot label Oct 13, 2022
@ghost ghost assigned jiasli Oct 13, 2022
@ghost ghost added this to the Oct 2022 (2022-11-01) milestone Oct 13, 2022
@ghost ghost added the Packaging label Oct 13, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Oct 13, 2022

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

@wangzelin007
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@bebound bebound marked this pull request as ready for review October 19, 2022 06:15
@@ -19,7 +19,8 @@ COPY . .
RUN dos2unix ./scripts/release/rpm/azure-cli.spec && \
REPO_PATH=$(pwd) CLI_VERSION=$cli_version PYTHON_PACKAGE=$python_package PYTHON_CMD=python3.9 \
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
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.

@@ -57,7 +57,7 @@ Standards-Version: 3.9.5
Homepage: https://github.com/azure/azure-cli

Package: azure-cli
Architecture: all
Architecture: any
Depends: \${shlibs:Depends}, \${misc:Depends}
Copy link
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
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 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
Member

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.

Copy link
Contributor Author

@bebound bebound Feb 13, 2023

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

@@ -81,7 +81,7 @@ setup() {
exit 1
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
Member

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.

@@ -110,7 +110,8 @@ ${TAB}echo "\043!/usr/bin/env bash\nbin_dir=\140cd \"\044(dirname \"\044BASH_SOU
${TAB}chmod 0755 debian/azure-cli/usr/bin/az
${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')
Copy link
Member

@jiasli jiasli Feb 13, 2023

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
Contributor Author

Choose a reason for hiding this comment

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

Yes indeed!

@@ -15,13 +16,13 @@ COPY . .
RUN dos2unix ./scripts/release/rpm/azure-cli.spec && \
REPO_PATH=$(pwd) CLI_VERSION=$cli_version PYTHON_PACKAGE=python3 PYTHON_CMD=python3 \
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
Member

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
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.

@bebound bebound merged commit e0883f1 into Azure:dev Feb 14, 2023
bebound added a commit to bebound/azure-cli that referenced this pull request Feb 14, 2023
@TravisEz13
Copy link
Member

Any timeline for this to be released?

@bebound
Copy link
Contributor Author

bebound commented Feb 28, 2023

@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