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

[requirements] Split requirements into different tiers [build_base] #36808

Merged
merged 45 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0f18cce
Move requirements files
Jun 26, 2023
99c8e4b
replace
Jun 26, 2023
2ed7c75
split some files
Jun 26, 2023
e18ec73
ml dockerfile
Jun 26, 2023
dab5995
export [build_base]
Jun 26, 2023
d88f126
fix core-requirements [build_base]
Jun 26, 2023
1397c2e
move core requirements install [build_base]
Jun 26, 2023
d2c5a90
Fix pipeline installs [build_base]
Jun 26, 2023
ec48911
HEBO 0.3.4 [build_base]
Jun 26, 2023
8452351
mosaicml [build_base]
Jun 26, 2023
e858eb6
pymoo [build_base]
Jun 27, 2023
f3f3d28
Merge remote-tracking branch 'upstream/master' into requirements/tiers
Jun 27, 2023
6ef9515
trivial [build_base]
Jun 27, 2023
fff3935
core [build_base]
Jun 27, 2023
bc2427a
doctest mosaic [build_base]
Jun 27, 2023
bb2a99c
Merge branch 'master' into requirements/tiers
Jun 28, 2023
1ebd59b
Move back to ml/
Jun 28, 2023
25879d8
Compile requirements [build_base]
Jun 28, 2023
d0d70c4
move [build_base]
Jun 28, 2023
79e0457
myst
Jun 28, 2023
4cd074b
myst [build_base]
Jun 28, 2023
cd76a02
myst-parser [build_base]
Jun 28, 2023
936c07f
myst-parser [build_base]
Jun 28, 2023
e05e1cb
move to test dockerfile [build_base]
Jun 28, 2023
bc1eb80
pip [build_base]
Jun 28, 2023
698b1b0
bash [build_base]
Jun 28, 2023
9ac12e1
no uninstall [build_base]
Jun 28, 2023
ab5c6e4
install/uninstall torch [build_base]
Jun 28, 2023
1831ca2
not quiet [build_base]
Jun 28, 2023
24ededf
torch again [build_base]
Jun 28, 2023
fab40ef
aim [build_base]
Jun 28, 2023
c33d28b
mxnet [build_base]
Jun 28, 2023
bc52cbc
mxnet [build_base]
Jun 28, 2023
b67a724
skip on arm64 [build_base]
Jun 28, 2023
b87ecbc
Merge remote-tracking branch 'upstream/master' into requirements/tiers
Jun 28, 2023
2fa5917
trivial [build_base]
Jun 28, 2023
0feb3c8
Merge remote-tracking branch 'upstream/master' into requirements/tiers
Jun 29, 2023
39d21db
comments [build_base]
Jun 29, 2023
c252bcb
Doctests [build_base]
Jun 29, 2023
bc2cfe7
Merge remote-tracking branch 'upstream/master' into requirements/tiers
Jun 30, 2023
404cff1
merge, split install into file [build_base]
Jun 30, 2023
88b742d
myst try [build_base]
Jun 30, 2023
3a6a9ed
revert some changes [build_base]
Jun 30, 2023
1a17fa7
myst-nb revert [build_base]
Jun 30, 2023
864be29
chmod [build_base]
Jun 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .buildkite/pipeline.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,11 @@
instance_size: large
commands:
- cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
- ./ci/env/env_info.sh
# Todo (krfricke): Move mosaicml to train-test-requirements.txt
- pip install "mosaicml==0.12.1"
- DOC_TESTING=1 ./ci/env/install-dependencies.sh
- ./ci/env/install-horovod.sh
- ./ci/env/env_info.sh
- bazel test --config=ci $(./scripts/bazel_export_options)
--test_tag_filters=doctest,-gpu
python/ray/... doc/...
Expand Down
12 changes: 6 additions & 6 deletions .buildkite/pipeline.gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# commands:
# - cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
# - TUNE_TESTING=1 ./ci/env/install-dependencies.sh
# - pip install -Ur ./python/requirements/ml/requirements_ml_docker.txt
# - pip install -Ur ./python/requirements/ml/dl-gpu-requirements.txt
# - ./ci/env/env_info.sh
# - bazel test --config=ci $(./ci/run/bazel_export_options) --build_tests_only --test_tag_filters=gpu python/ray/tune/...

Expand All @@ -16,7 +16,7 @@
commands:
- cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
- RLLIB_TESTING=1 ./ci/env/install-dependencies.sh
- pip install -Ur ./python/requirements/ml/requirements_ml_docker.txt
- pip install -Ur ./python/requirements/ml/dl-gpu-requirements.txt
- ./ci/env/env_info.sh
# --jobs 1 is necessary as we only have 1 GPU on the machine and running tests in parallel
# would cause timeouts as the other scripts would wait for the GPU to become available.
Expand All @@ -40,7 +40,7 @@
commands:
- cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
- ./ci/env/install-dependencies.sh
- pip install -Ur ./python/requirements/ml/requirements_ml_docker.txt
- pip install -Ur ./python/requirements/ml/dl-gpu-requirements.txt
- bazel test --config=ci $(./ci/run/bazel_export_options) --test_tag_filters=gpu python/ray/serve/...

# Todo: enable once tests pass
Expand All @@ -49,7 +49,7 @@
# commands:
# - cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
# - RLLIB_TESTING=1 ./ci/env/install-dependencies.sh
# - pip install -Ur ./python/requirements/ml/requirements_ml_docker.txt
# - pip install -Ur ./python/requirements/ml/dl-gpu-requirements.txt
# - ./ci/env/env_info.sh
# - bazel test --config=ci $(./ci/run/bazel_export_options) --build_tests_only
# --test_tag_filters=examples_C,examples_D --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 --test_env=RLLIB_NUM_GPUS=1 rllib/...
Expand All @@ -60,7 +60,7 @@
# commands:
# - cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
# - RLLIB_TESTING=1 ./ci/env/install-dependencies.sh
# - pip install -Ur ./python/requirements/ml/requirements_ml_docker.txt
# - pip install -Ur ./python/requirements/ml/dl-gpu-requirements.txt
# - ./ci/env/env_info.sh
# - bazel test --config=ci $(./ci/run/bazel_export_options) --build_tests_only
# --test_tag_filters=examples_E,examples_F,examples_G,examples_H,examples_I,examples_J,examples_K,examples_L,examples_M,examples_N,examples_O,examples_P --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 --test_env=RLLIB_NUM_GPUS=1
Expand All @@ -72,7 +72,7 @@
# commands:
# - cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
# - RLLIB_TESTING=1 ./ci/env/install-dependencies.sh
# - pip install -Ur ./python/requirements/ml/requirements_ml_docker.txt
# - pip install -Ur ./python/requirements/ml/dl-gpu-requirements.txt
# - ./ci/env/env_info.sh
# - bazel test --config=ci $(./ci/run/bazel_export_options) --build_tests_only
# --test_tag_filters=examples_Q,examples_R,examples_S,examples_T,examples_U,examples_V,examples_W,examples_X,examples_Y,examples_Z --test_env=RAY_USE_MULTIPROCESSING_CPU_COUNT=1 --test_env=RLLIB_NUM_GPUS=1
Expand Down
14 changes: 7 additions & 7 deletions .buildkite/pipeline.gpu_large.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
commands:
- cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
- TRAIN_TESTING=1 TUNE_TESTING=1 ./ci/env/install-dependencies.sh
- pip install -Ur ./python/requirements/ml/requirements_ml_docker.txt
- pip install -Ur ./python/requirements/ml/dl-gpu-requirements.txt
- ./ci/env/install-horovod.sh
- ./ci/env/env_info.sh
- bazel test --config=ci $(./ci/run/bazel_export_options) --build_tests_only --test_tag_filters=gpu,gpu_only,-ray_air python/ray/train/...
Expand All @@ -15,7 +15,7 @@
commands:
- cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
- TRAIN_TESTING=1 DATA_PROCESSING_TESTING=1 ./ci/env/install-dependencies.sh
- pip install -Ur ./python/requirements/ml/requirements_ml_docker.txt
- pip install -Ur ./python/requirements/ml/dl-gpu-requirements.txt
- ./ci/env/env_info.sh
- bazel test --config=ci $(./ci/run/bazel_export_options) --build_tests_only --test_tag_filters=datasets_train,-doctest doc/...

Expand All @@ -25,7 +25,7 @@
commands:
- cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
- RLLIB_TESTING=1 ./ci/env/install-dependencies.sh
- pip install -Ur ./python/requirements/ml/requirements_ml_docker.txt
- pip install -Ur ./python/requirements/ml/dl-gpu-requirements.txt
- ./ci/env/env_info.sh
# --jobs 2 is necessary as we only need to have at least 2 gpus on the machine
# and running tests in parallel would cause timeouts as the other scripts would
Expand All @@ -42,7 +42,7 @@
commands:
- cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
- DATA_PROCESSING_TESTING=1 TRAIN_TESTING=1 TUNE_TESTING=1 ./ci/env/install-dependencies.sh
- pip install -Ur ./python/requirements/ml/requirements_ml_docker.txt
- pip install -Ur ./python/requirements/ml/dl-gpu-requirements.txt
- ./ci/env/install-horovod.sh
- ./ci/env/env_info.sh
- bazel test --config=ci $(./ci/run/bazel_export_options) --build_tests_only --test_tag_filters=gpu python/ray/air/... python/ray/train/...
Expand All @@ -53,7 +53,7 @@
commands:
- cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
- DOC_TESTING=1 TRAIN_TESTING=1 TUNE_TESTING=1 ./ci/env/install-dependencies.sh
- pip install -Ur ./python/requirements/ml/requirements_ml_docker.txt
- pip install -Ur ./python/requirements/ml/dl-gpu-requirements.txt
- ./ci/env/env_info.sh
# Test examples with newer version of `transformers`
# TODO(amogkam): Remove when https://github.com/ray-project/ray/issues/36011
Expand All @@ -65,7 +65,7 @@
commands:
- cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
- DOC_TESTING=1 TRAIN_TESTING=1 TUNE_TESTING=1 ./ci/env/install-dependencies.sh
- pip install -Ur ./python/requirements/ml/requirements_ml_docker.txt
- pip install -Ur ./python/requirements/ml/dl-gpu-requirements.txt
- ./ci/env/install-horovod.sh
- ./ci/env/env_info.sh
# Test examples with newer version of `transformers`
Expand All @@ -82,7 +82,7 @@
- cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
- NO_DASHBOARD=1 ./ci/env/install-minimal.sh 3.8
- PYTHON=3.8 DOC_TESTING=1 TRAIN_TESTING=1 TUNE_TESTING=1 ./ci/env/install-dependencies.sh
- pip install -Ur ./python/requirements/ml/requirements_ml_docker.txt
- pip install -Ur ./python/requirements/ml/dl-gpu-requirements.txt
- pip uninstall -y pytorch-lightning
- pip install lightning==2.0.0
- ./ci/env/env_info.sh
Expand Down
2 changes: 2 additions & 0 deletions .buildkite/pipeline.ml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
parallelism: 4
commands:
- cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
# Todo (krfricke): Move mosaicml to train-test-requirements.txt
- pip install "mosaicml==0.12.1"
- TRAIN_TESTING=1 DATA_PROCESSING_TESTING=1 INSTALL_HOROVOD=1 ./ci/env/install-dependencies.sh
- ./ci/env/env_info.sh
- ./ci/run/run_bazel_test_with_sharding.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@
/doc/source/ray-air/ @richardliaw @gjoliver @krfricke @xwjiang2010 @amogkam @matthewdeng @Yard1 @maxpumperla @ray-project/ray-docs

# ML Docker Dependencies
/python/requirements/ml/requirements_dl.txt @amogkam @krfricke @richardliaw @matthewdeng
/python/requirements/ml/requirements_ml_docker.txt @amogkam @krfricke @richardliaw @matthewdeng
/python/requirements/ml/dl-cpu-requirements.txt @amogkam @krfricke @richardliaw @matthewdeng
/python/requirements/ml/dl-gpu-requirements.txt @amogkam @krfricke @richardliaw @matthewdeng

# Ray symbol export
/src/ray/ray_version_script.lds @iycheng @ericl @scv119
Expand Down
25 changes: 16 additions & 9 deletions ci/build/build-docker-images.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,20 +426,27 @@ def prep_ray_ml():
"python/requirements.txt",
]
ml_requirements_files = [
"python/requirements/ml/requirements_ml_docker.txt",
"python/requirements/ml/requirements_dl.txt",
"python/requirements/ml/requirements_tune.txt",
"python/requirements/ml/requirements_rllib.txt",
"python/requirements/ml/requirements_train.txt",
"python/requirements/ml/requirements_upstream.txt",
"python/requirements/ml/requirements_no_deps.txt",
"python/requirements/docker/ray-docker-requirements.txt",
"python/requirements/ml/core-requirements.txt",
"python/requirements/ml/data-requirements.txt",
"python/requirements/ml/dl-gpu-requirements.txt",
"python/requirements/ml/dl-cpu-requirements.txt",
"python/requirements/ml/tune-requirements.txt",
"python/requirements/ml/tune-test-requirements.txt",
"python/requirements/ml/rllib-requirements.txt",
"python/requirements/ml/rllib-test-requirements.txt",
"python/requirements/ml/train-requirements.txt",
"python/requirements/ml/train-test-requirements.txt",
]
# We don't need these in the ml docker image
# We don't need these in the ml docker image (or they are installed elsewhere)
ignore_requirements = [
"python/requirements/compat/requirements_legacy_compat.txt",
"python/requirements/ml/data-test-requirements.txt",
]

files_on_disk = glob.glob(f"{root_dir}/python/**/requirements*.txt", recursive=True)
files_on_disk = glob.glob(
f"{root_dir}/python/**/*-requirements.txt", recursive=True
)
for file_on_disk in files_on_disk:
rel = os.path.relpath(file_on_disk, start=root_dir)
print(rel)
Expand Down
2 changes: 1 addition & 1 deletion ci/build/upload_build_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if [[ -z "${BUILDKITE-}" ]]; then
aws s3 cp --recursive /tmp/bazel_event_logs "${DST}"
else
# Codepath for Buildkite
# Keep cryptography/openssl in sync with `requirements_test.txt`
# Keep cryptography/openssl in sync with `requirements/test-requirements.txt`
pip install -q -c "${RAY_DIR}/python/requirements.txt" docker aws_requests_auth boto3 cryptography==38.0.1 PyOpenSSL==22.1.0
python .buildkite/copy_files.py --destination logs --path /tmp/bazel_event_logs
fi
50 changes: 50 additions & 0 deletions ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,56 @@ upload_wheels() {
)
}


compile_pip_dependencies() {
# Compile boundaries

if [[ "${HOSTTYPE}" == "aarch64" || "${HOSTTYPE}" = "arm64" ]]; then
# Resolution currently does not work on aarch64 as some pinned packages
# are not available. Once they are reasonably upgraded we should be able
# to enable this here.p
echo "Skipping for aarch64"
return 0
fi

# shellcheck disable=SC2262
alias pip="python -m pip"
pip install pip-tools

# Required packages to lookup e.g. dragonfly-opt
HAS_TORCH=0
python -c "import torch" 2>/dev/null && HAS_TORCH=1
pip install --no-cache-dir numpy torch

if [ -f "${WORKSPACE_DIR}/python/requirements_compiled.txt" ]; then
echo requirements_compiled already exists
else
pip-compile --resolver=backtracking -q \
--pip-args --no-deps --strip-extras --no-annotate --no-header -o \
"${WORKSPACE_DIR}/python/requirements_compiled.txt" \
"${WORKSPACE_DIR}/python/requirements.txt" \
"${WORKSPACE_DIR}/python/requirements/lint-requirements.txt" \
"${WORKSPACE_DIR}/python/requirements/test-requirements.txt" \
"${WORKSPACE_DIR}/python/requirements/docker/ray-docker-requirements.txt" \
"${WORKSPACE_DIR}/python/requirements/ml/core-requirements.txt" \
"${WORKSPACE_DIR}/python/requirements/ml/data-requirements.txt" \
"${WORKSPACE_DIR}/python/requirements/ml/data-test-requirements.txt" \
"${WORKSPACE_DIR}/python/requirements/ml/dl-cpu-requirements.txt" \
"${WORKSPACE_DIR}/python/requirements/ml/rllib-requirements.txt" \
"${WORKSPACE_DIR}/python/requirements/ml/rllib-test-requirements.txt" \
"${WORKSPACE_DIR}/python/requirements/ml/train-requirements.txt" \
"${WORKSPACE_DIR}/python/requirements/ml/train-test-requirements.txt" \
"${WORKSPACE_DIR}/python/requirements/ml/tune-requirements.txt" \
"${WORKSPACE_DIR}/python/requirements/ml/tune-test-requirements.txt"
fi

cat "${WORKSPACE_DIR}/python/requirements_compiled.txt"

if [ "$HAS_TORCH" -eq 0 ]; then
pip uninstall -y torch
fi
}

test_core() {
local args=(
"//:*"
Expand Down
1 change: 1 addition & 0 deletions ci/docker/base.test.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ WORKDIR /ray
COPY . .

RUN ./ci/env/install-dependencies.sh init
RUN bash --login -i ./ci/ci.sh compile_pip_dependencies
Loading