mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
This PR enables Ubuntu24.04 testing on CI: * Builds a base docker image using Noble (Ubuntu24.04) and py3.12 for ROCm N version * Builds and tests PyTorch on Ubuntu24.04 as part of the `rocm-mi300` workflow Pull Request resolved: https://github.com/pytorch/pytorch/pull/152240 Approved by: https://github.com/jeffdaily, https://github.com/malfet
41 lines
1.3 KiB
Bash
41 lines
1.3 KiB
Bash
#!/bin/bash
|
|
|
|
# Work around bug where devtoolset replaces sudo and breaks it.
|
|
if [ -n "$DEVTOOLSET_VERSION" ]; then
|
|
export SUDO=/bin/sudo
|
|
else
|
|
export SUDO=sudo
|
|
fi
|
|
|
|
as_jenkins() {
|
|
# NB: unsetting the environment variables works around a conda bug
|
|
# https://github.com/conda/conda/issues/6576
|
|
# NB: Pass on PATH and LD_LIBRARY_PATH to sudo invocation
|
|
# NB: This must be run from a directory that jenkins has access to,
|
|
# works around https://github.com/conda/conda-package-handling/pull/34
|
|
$SUDO -E -H -u jenkins env -u SUDO_UID -u SUDO_GID -u SUDO_COMMAND -u SUDO_USER env "PATH=$PATH" "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" $*
|
|
}
|
|
|
|
conda_install() {
|
|
# Ensure that the install command don't upgrade/downgrade Python
|
|
# This should be called as
|
|
# conda_install pkg1 pkg2 ... [-c channel]
|
|
as_jenkins conda install -q -n py_$ANACONDA_PYTHON_VERSION -y python="$ANACONDA_PYTHON_VERSION" $*
|
|
}
|
|
|
|
conda_install_through_forge() {
|
|
as_jenkins conda install -c conda-forge -q -n py_$ANACONDA_PYTHON_VERSION -y python="$ANACONDA_PYTHON_VERSION" $*
|
|
}
|
|
|
|
conda_run() {
|
|
as_jenkins conda run -n py_$ANACONDA_PYTHON_VERSION --no-capture-output $*
|
|
}
|
|
|
|
pip_install() {
|
|
as_jenkins conda run -n py_$ANACONDA_PYTHON_VERSION pip install --progress-bar off $*
|
|
}
|
|
|
|
get_pinned_commit() {
|
|
cat "${1}".txt
|
|
}
|