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

[anaconda] support ARM architecture and install latest version #943

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

r3dpoint
Copy link

  • The anaconda installer is available for ARM and dev containers work on ARM; therefore, elaborate on architecture detection in the anaconda feature to support ARM.
  • Update to default to latest version of anaconda.

@r3dpoint r3dpoint requested a review from a team as a code owner April 13, 2024 13:16
@r3dpoint
Copy link
Author

@microsoft-github-policy-service agree

Copy link
Member

@samruddhikhandale samruddhikhandale left a comment

Choose a reason for hiding this comment

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

Thank you so much for contributing these changes, they look great.

Left some minor comments!

Comment on lines +50 to 61
if [ "${architecture}" == "amd64" ]; then
CONDA_ARCH="x86_64"
elif [ "${architecture}" == "x86_64" ]; then
CONDA_ARCH="x86_64"
elif [ "${architecture}" == "arm64" ]; then
CONDA_ARCH="aarch64"
elif [ "${architecture}" == "aarch64" ]; then
CONDA_ARCH="aarch64"
else
echo "(!) Architecture $architecture unsupported"
exit 1
fi
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if [ "${architecture}" == "amd64" ]; then
CONDA_ARCH="x86_64"
elif [ "${architecture}" == "x86_64" ]; then
CONDA_ARCH="x86_64"
elif [ "${architecture}" == "arm64" ]; then
CONDA_ARCH="aarch64"
elif [ "${architecture}" == "aarch64" ]; then
CONDA_ARCH="aarch64"
else
echo "(!) Architecture $architecture unsupported"
exit 1
fi
case "${architecture}" in
amd64) architecture=x86_64 ;;
arm64) architecture=aarch64 ;;
*)
echo "Anaconda does not support machine architecture '$architecture'. Please use an x86-64 or ARM64 machine."
exit 1
esac

How about we simplify the code?

Copy link
Author

@r3dpoint r3dpoint Apr 16, 2024

Choose a reason for hiding this comment

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

happy to implement though as i read your suggestion it accomplishes a different goal. the goal is to support amd64, x86_64, arm64, and aarch64. and in the case of amd64 use the x86_64 URL and in the case of the arm64 use the aarch64 URL. are you ok with preserving this goal?

Copy link
Member

Choose a reason for hiding this comment

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

I was hoping to keep the goal in tact but didn't realize that we are using architecture="$(uname -m)" to compute architecture. Thanks for catching that!

How about we use 👇 instead? That way I believe it only returns amd64 of arm64. Hence, we'd skip another conditions.

architecture=$(dpkg --print-architecture)

Copy link
Author

Choose a reason for hiding this comment

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

nice that makes sense. i'll work up a commit.

fi

su --login -c "export http_proxy=${http_proxy:-} && export https_proxy=${https_proxy:-} \
&& wget -q https://repo.anaconda.com/archive/Anaconda3-${CONDA_VERSION}-Linux-x86_64.sh -O /tmp/anaconda-install.sh \
&& wget -q https://repo.anaconda.com/archive/Anaconda3-${CONDA_VERSION}-Linux-${CONDA_ARCH}.sh -O /tmp/anaconda-install.sh \
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
&& wget -q https://repo.anaconda.com/archive/Anaconda3-${CONDA_VERSION}-Linux-${CONDA_ARCH}.sh -O /tmp/anaconda-install.sh \
&& wget -q https://repo.anaconda.com/archive/Anaconda3-${CONDA_VERSION}-Linux-${architecture}.sh -O /tmp/anaconda-install.sh \

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.

None yet

2 participants