Skip to content

Commit c2fb830

Browse files
authored
Merge branch 'main' into patch-1
2 parents 188f0a3 + ad22101 commit c2fb830

File tree

92 files changed

+3675
-2239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+3675
-2239
lines changed

.ci/docker/Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
ARG BASE_IMAGE
2+
FROM ${BASE_IMAGE}
3+
4+
ENV DEBIAN_FRONTEND noninteractive
5+
6+
# Install common dependencies (so that this step can be cached separately)
7+
COPY ./common/install_base.sh install_base.sh
8+
RUN bash ./install_base.sh && rm install_base.sh
9+
10+
# Setup user
11+
# TODO: figure out how to remove this part
12+
COPY ./common/install_user.sh install_user.sh
13+
RUN bash ./install_user.sh && rm install_user.sh
14+
15+
COPY ./common/install_docs_reqs.sh install_docs_reqs.sh
16+
RUN bash ./install_docs_reqs.sh && rm install_docs_reqs.sh
17+
18+
# Install conda and other packages
19+
ENV ANACONDA_PYTHON_VERSION=3.10
20+
ENV CONDA_CMAKE yes
21+
ENV DOCS yes
22+
ENV PATH /opt/conda/envs/py_$ANACONDA_PYTHON_VERSION/bin:/opt/conda/bin:$PATH
23+
COPY ./requirements.txt /opt/conda/
24+
COPY ./common/install_conda.sh install_conda.sh
25+
COPY ./common/common_utils.sh common_utils.sh
26+
RUN bash ./install_conda.sh && rm install_conda.sh common_utils.sh /opt/conda/requirements.txt
27+
28+
USER ci-user
29+
CMD ["bash"]

.ci/docker/build.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
set -exu
9+
10+
IMAGE_NAME="$1"
11+
shift
12+
13+
export UBUNTU_VERSION="20.04"
14+
15+
export BASE_IMAGE="ubuntu:${UBUNTU_VERSION}"
16+
echo "Building ${IMAGE_NAME} Docker image"
17+
18+
docker build \
19+
--no-cache \
20+
--progress=plain \
21+
-f Dockerfile \
22+
--build-arg BASE_IMAGE="${BASE_IMAGE}" \
23+
"$@" \
24+
.

.ci/docker/common/common_utils.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
# Work around bug where devtoolset replaces sudo and breaks it.
4+
as_ci_user() {
5+
# NB: unsetting the environment variables works around a conda bug
6+
# https://github.com/conda/conda/issues/6576
7+
# NB: Pass on PATH and LD_LIBRARY_PATH to sudo invocation
8+
# NB: This must be run from a directory that the user has access to,
9+
# works around https://github.com/conda/conda-package-handling/pull/34
10+
sudo -E -H -u ci-user env -u SUDO_UID -u SUDO_GID -u SUDO_COMMAND -u SUDO_USER env "PATH=$PATH" "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" $*
11+
}
12+
13+
conda_install() {
14+
# Ensure that the install command don't upgrade/downgrade Python
15+
# This should be called as
16+
# conda_install pkg1 pkg2 ... [-c channel]
17+
as_ci_user conda install -q -n py_$ANACONDA_PYTHON_VERSION -y python="$ANACONDA_PYTHON_VERSION" $*
18+
}
19+
20+
conda_run() {
21+
as_ci_user conda run -n py_$ANACONDA_PYTHON_VERSION --no-capture-output $*
22+
}
23+
24+
pip_install() {
25+
as_ci_user conda run -n py_$ANACONDA_PYTHON_VERSION pip install --progress-bar off $*
26+
}

.ci/docker/common/install_base.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
# Based off of https://github.com/pytorch/pytorch/tree/b52e0bf131a4e55cd987176f9c5a8d2ad6783b4f/.ci/docker
3+
4+
set -ex
5+
6+
install_ubuntu() {
7+
# Install common dependencies
8+
apt-get update
9+
# TODO: Some of these may not be necessary
10+
apt-get install -y --no-install-recommends \
11+
build-essential \
12+
ca-certificates \
13+
cmake=3.16* \
14+
curl \
15+
git \
16+
wget \
17+
sudo \
18+
vim \
19+
jq \
20+
vim \
21+
unzip \
22+
gdb \
23+
rsync \
24+
libssl-dev \
25+
p7zip-full \
26+
libglfw3 \
27+
libglfw3-dev \
28+
sox \
29+
libsox-dev \
30+
libsox-fmt-all
31+
32+
# Cleanup package manager
33+
apt-get autoclean && apt-get clean
34+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
35+
}
36+
37+
# Install base packages depending on the base OS
38+
ID=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
39+
case "$ID" in
40+
ubuntu)
41+
install_ubuntu
42+
;;
43+
*)
44+
echo "Unable to determine OS..."
45+
exit 1
46+
;;
47+
esac

.ci/docker/common/install_conda.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
# Optionally install conda
6+
if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
7+
BASE_URL="https://repo.anaconda.com/miniconda"
8+
9+
MAJOR_PYTHON_VERSION=$(echo "$ANACONDA_PYTHON_VERSION" | cut -d . -f 1)
10+
MINOR_PYTHON_VERSION=$(echo "$ANACONDA_PYTHON_VERSION" | cut -d . -f 2)
11+
12+
CONDA_FILE="Miniconda3-latest-Linux-x86_64.sh"
13+
14+
mkdir -p /opt/conda
15+
chown ci-user:ci-user /opt/conda
16+
17+
source "$(dirname "${BASH_SOURCE[0]}")/common_utils.sh"
18+
19+
pushd /tmp
20+
wget -q "${BASE_URL}/${CONDA_FILE}"
21+
# NB: Manually invoke bash per https://github.com/conda/conda/issues/10431
22+
as_ci_user bash "${CONDA_FILE}" -b -f -p "/opt/conda"
23+
popd
24+
25+
# NB: Don't do this, rely on the rpath to get it right
26+
#echo "/opt/conda/lib" > /etc/ld.so.conf.d/conda-python.conf
27+
#ldconfig
28+
sed -e 's|PATH="\(.*\)"|PATH="/opt/conda/bin:\1"|g' -i /etc/environment
29+
export PATH="/opt/conda/bin:$PATH"
30+
31+
# Ensure we run conda in a directory that the user has write access to
32+
pushd /opt/conda
33+
34+
# Prevent conda from updating to 4.14.0, which causes docker build failures
35+
# See https://hud.pytorch.org/pytorch/pytorch/commit/754d7f05b6841e555cea5a4b2c505dd9e0baec1d
36+
# Uncomment the below when resolved to track the latest conda update
37+
# as_ci_user conda update -y -n base conda
38+
39+
# Install correct Python version
40+
as_ci_user conda create -n py_$ANACONDA_PYTHON_VERSION -y python="$ANACONDA_PYTHON_VERSION"
41+
42+
# Use conda cmake in some cases. Conda cmake will be newer than our supported
43+
# min version (3.5 for xenial and 3.10 for bionic), so we only do it in those
44+
# following builds that we know should use conda. Specifically, Ubuntu bionic
45+
# and focal cannot find conda mkl with stock cmake, so we need a cmake from conda
46+
conda_install cmake
47+
48+
# Install pip packages
49+
pip_install -r /opt/conda/requirements.txt
50+
51+
apt-get update
52+
apt-get -y install expect-dev
53+
54+
popd
55+
fi
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
# Based off of https://github.com/pytorch/pytorch/tree/b52e0bf131a4e55cd987176f9c5a8d2ad6783b4f/.ci/docker
3+
set -ex
4+
5+
apt-get update
6+
apt-get install -y gpg-agent
7+
8+
curl --retry 3 -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -
9+
sudo apt-get install -y nodejs
10+
11+
curl --retry 3 -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
12+
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
13+
14+
apt-get update
15+
apt-get install -y --no-install-recommends yarn
16+
yarn global add katex --prefix /usr/local
17+
18+
sudo apt-get -y install doxygen
19+
20+
apt-get autoclean && apt-get clean
21+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

.ci/docker/common/install_user.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
# Copied from https://github.com/pytorch/executorch/blob/6e431355a554e5f84c3a05dfa2b981ead90c2b48/.ci/docker/common/install_user.sh#L1
9+
10+
set -ex
11+
12+
# Same as ec2-user
13+
echo "ci-user:x:1000:1000::/var/lib/ci-user:" >> /etc/passwd
14+
echo "ci-user:x:1000:" >> /etc/group
15+
# Needed on Focal or newer
16+
echo "ci-user:*:19110:0:99999:7:::" >> /etc/shadow
17+
18+
# Create $HOME
19+
mkdir -p /var/lib/ci-user
20+
chown ci-user:ci-user /var/lib/ci-user
21+
22+
# Allow sudo
23+
echo 'ci-user ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/ci-user
24+
25+
# Test that sudo works
26+
sudo -u ci-user sudo -v

.ci/docker/requirements.txt

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# --extra-index-url https://download.pytorch.org/whl/cu117/index.html # Use this to run/publish tutorials against the latest binaries during the RC stage. Comment out after the release. Each release verify the correct cuda version.
2+
# Refer to ./jenkins/build.sh for tutorial build instructions
3+
4+
sphinx==5.0.0
5+
sphinx-gallery==0.11.1
6+
sphinx_design
7+
docutils==0.16
8+
sphinx-copybutton
9+
pypandoc==1.12
10+
pandocfilters
11+
markdown
12+
tqdm==4.66.1
13+
numpy==1.24.4
14+
matplotlib
15+
librosa
16+
torch==2.3
17+
torchvision
18+
torchtext
19+
torchdata
20+
networkx
21+
PyHamcrest
22+
bs4
23+
awscliv2==2.1.1
24+
flask
25+
spacy==3.4.1
26+
ray[tune]==2.7.2
27+
tensorboard
28+
jinja2==3.1.3
29+
pytorch-lightning
30+
torchx
31+
torchrl==0.3.0
32+
tensordict==0.3.0
33+
ax-platform
34+
nbformat>==5.9.2
35+
datasets
36+
transformers
37+
torchmultimodal-nightly # needs to be updated to stable as soon as it's avaialable
38+
onnx
39+
onnxscript
40+
onnxruntime
41+
evaluate
42+
accelerate>=0.20.1
43+
44+
importlib-metadata==6.8.0
45+
46+
# PyTorch Theme
47+
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
48+
49+
ipython
50+
51+
sphinxcontrib.katex
52+
# to run examples
53+
boto3
54+
pandas
55+
requests
56+
scikit-image
57+
scipy==1.11.1
58+
numba==0.57.1
59+
pillow==10.2.0
60+
wget
61+
gym==0.26.2
62+
gym-super-mario-bros==7.4.0
63+
pyopengl
64+
gymnasium[mujoco]==0.27.0
65+
timm
66+
iopath
67+
pygame==2.1.2
68+
pycocotools
69+
semilearn==0.3.2
70+
torchao==0.0.3
71+
segment_anything==1.0

.circleci/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)