Skip to content

Commit 0f38cec

Browse files
authored
[image] update manual docker build script (#51990)
moving `python/requirements_compiled.txt` to build context of `base-deps`. --------- Signed-off-by: Lonnie Liu <[email protected]>
1 parent 066b470 commit 0f38cec

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

.buildkite/build.rayci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,16 @@ steps:
109109
- "3.9"
110110
- "3.10"
111111
- "3.11"
112+
- label: ":tapioca: smoke test build-docker.sh"
113+
tags:
114+
- python_dependencies
115+
- docker
116+
- oss
117+
instance_type: medium
118+
commands:
119+
- export WHEEL_URL="https://files.pythonhosted.org/packages/7e/7c/3544cca730265bb6f7a4900b7b7018c08ce5ec89bf7b6102901fe0bcd67b/ray-2.44.1-cp39-cp39-manylinux2014_x86_64.whl"
120+
- export CPP_WHEEL_URL="https://files.pythonhosted.org/packages/50/ae/c094818fd526bfb0a361a76bda5708a73cbc888b51edfc7d6aab9de837cd/ray_cpp-2.44.1-cp39-cp39-manylinux2014_x86_64.whl"
121+
- bash build-docker.sh --progress-plain
122+
- docker run -ti --rm rayproject/ray:dev python -c "import ray; print(ray.__version__)"
123+
depends_on:
124+
- forge

build-docker.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ while [[ $# -gt 0 ]]; do
2222
shift
2323
BASE_IMAGE="$1"
2424
;;
25+
--progress-plain)
26+
# Use plain progress output instead of fancy output.
27+
# This is useful for CI systems that don't support fancy output.
28+
BUILD_ARGS+=("--progress=plain")
29+
;;
2530
--no-cache-build)
2631
BUILD_ARGS+=("--no-cache")
2732
;;
@@ -40,7 +45,7 @@ while [[ $# -gt 0 ]]; do
4045
PYTHON_VERSION="$1"
4146
;;
4247
*)
43-
echo "Usage: build-docker.sh [ --gpu ] [ --base-image ] [ --no-cache-build ] [ --shas-only ] [ --build-development-image ] [ --build-examples ] [ --python-version ]"
48+
echo "Usage: build-docker.sh [ --gpu ] [ --base-image ] [ --no-cache-build ] [ --shas-only ] [ --progress-plain] [ --python-version ]"
4449
exit 1
4550
esac
4651
shift
@@ -54,11 +59,17 @@ if [[ "$OUTPUT_SHA" != "YES" ]]; then
5459
echo "=== Building base-deps image ===" >/dev/stderr
5560
fi
5661

62+
RAY_DEPS_BUILD_DIR="$(mktemp -d)"
63+
64+
cp docker/base-deps/Dockerfile "${RAY_DEPS_BUILD_DIR}/."
65+
mkdir -p "${RAY_DEPS_BUILD_DIR}/python"
66+
cp python/requirements_compiled.txt "${RAY_DEPS_BUILD_DIR}/python/requirements_compiled.txt"
67+
5768
BUILD_CMD=(
5869
docker build "${BUILD_ARGS[@]}"
5970
--build-arg BASE_IMAG="$BASE_IMAGE"
6071
--build-arg PYTHON_VERSION="${PYTHON_VERSION}"
61-
-t "rayproject/base-deps:dev$GPU" "docker/base-deps"
72+
-t "rayproject/base-deps:dev$GPU" "${RAY_DEPS_BUILD_DIR}"
6273
)
6374

6475
if [[ "$OUTPUT_SHA" == "YES" ]]; then
@@ -78,7 +89,6 @@ RAY_BUILD_DIR="$(mktemp -d)"
7889
mkdir -p "$RAY_BUILD_DIR/.whl"
7990
wget --quiet "$WHEEL_URL" -P "$RAY_BUILD_DIR/.whl"
8091
wget --quiet "$CPP_WHEEL_URL" -P "$RAY_BUILD_DIR/.whl"
81-
cp python/requirements_compiled.txt "$RAY_BUILD_DIR"
8292
cp docker/ray/Dockerfile "$RAY_BUILD_DIR"
8393

8494
WHEEL="$(basename "$WHEEL_DIR"/.whl/ray-*.whl)"
@@ -87,7 +97,7 @@ BUILD_CMD=(
8797
docker build "${BUILD_ARGS[@]}"
8898
--build-arg FULL_BASE_IMAGE="rayproject/base-deps:dev$GPU"
8999
--build-arg WHEEL_PATH=".whl/${WHEEL}"
90-
-t "rayproject/ray:dev$GPU" "$RAY_BUILD_DIR"
100+
-t "rayproject/ray:dev$GPU" "${RAY_BUILD_DIR}"
91101
)
92102

93103
if [[ "$OUTPUT_SHA" == "YES" ]]; then

ci/pipeline/test_rules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ ci/docker/ray.cuda.base.wanda.yaml
191191
ci/docker/ray.cuda.base.aarch64.wanda.yaml
192192
ci/docker/windows.build.Dockerfile
193193
ci/docker/windows.build.wanda.yaml
194+
build-docker.sh
194195
@ docker linux_wheels tools
195196
;
196197

@@ -217,6 +218,5 @@ setup_hooks.sh
217218
.isort.cfg
218219
.prettierrc.toml
219220
build.sh
220-
build-docker.sh
221221
# pass
222222
;

0 commit comments

Comments
 (0)