Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@
- if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then python .buildkite/copy_files.py --destination docker_login; fi
- python ./ci/travis/build-docker-images.py --py-versions PY38 --build-type BUILDKITE --build-base

- label: ":docker: Build Images: py39"
conditions: ["RAY_CI_LINUX_WHEELS_AFFECTED"]
commands:
- LINUX_WHEELS=1 ./ci/travis/ci.sh build
- pip install -q docker aws_requests_auth boto3
- if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then python .buildkite/copy_files.py --destination docker_login; fi
- python ./ci/travis/build-docker-images.py --py-versions PY39 --build-type BUILDKITE --build-base

- label: ":book: Lint"
commands:
- export LINT=1
Expand Down
52 changes: 40 additions & 12 deletions ci/travis/build-docker-images.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@
"https://hub.docker.com/repository/docker/rayproject/ray-ml")
}

PY_MATRIX = {"-py36": "3.6.12", "-py37": "3.7.7", "-py38": "3.8.5"}
PY_MATRIX = {
"-py36": "3.6.12",
"-py37": "3.7.7",
"-py38": "3.8.5",
"-py39": "3.9.5"
}


def _get_branch():
Expand Down Expand Up @@ -113,6 +118,14 @@ def _build_cpu_gpu_images(image_name, no_cache=True) -> List[str]:
built_images = []
for gpu in ["-cpu", "-gpu"]:
for py_name, py_version in PY_MATRIX.items():
# TODO(https://github.com/ray-project/ray/issues/16599):
# remove below after supporting ray-ml images with Python 3.9
if image_name in ["ray-ml", "autoscaler"
] and py_version.startswith("3.9"):
print(f"{image_name} image is currently unsupported with "
"Python 3.9")
continue

build_args = {}
build_args["PYTHON_VERSION"] = py_version
# I.e. "-py36"[-1] == 6
Expand Down Expand Up @@ -145,24 +158,30 @@ def _build_cpu_gpu_images(image_name, no_cache=True) -> List[str]:
nocache=no_cache,
buildargs=build_args)

full_output = ""
cmd_output = []
try:
start = datetime.datetime.now()
current_iter = start
for line in output:
cmd_output.append(line.decode("utf-8"))
if datetime.datetime.now(
) - current_iter >= datetime.timedelta(minutes=5):
current_iter = datetime.datetime.now()
elapsed = datetime.datetime.now() - start
print(f"Still building {tagged_name} after "
f"{elapsed.seconds} seconds")
full_output += line.decode("utf-8")
if elapsed >= datetime.timedelta(minutes=15):
print("Additional build output:")
print(*cmd_output, sep="\n")
# Clear cmd_output after printing, so the next
# iteration will not print out the same lines.
cmd_output = []
except Exception as e:
print(f"FAILURE with error {e}")

if len(DOCKER_CLIENT.api.images(tagged_name)) == 0:
print(f"ERROR building: {tagged_name} & error below:")
print(full_output)
print(f"ERROR building: {tagged_name}. Output below:")
print(*cmd_output, sep="\n")
if (i == 1):
raise Exception("FAILED TO BUILD IMAGE")
print("TRYING AGAIN")
Expand Down Expand Up @@ -294,17 +313,25 @@ def get_new_tag(old_tag, new_tag):
image_list.extend(["base-deps", "ray-deps"])

for image in image_list:
for py_version in PY_MATRIX.keys():
for py_name, py_version in PY_MATRIX.items():
# TODO(https://github.com/ray-project/ray/issues/16599):
# remove below after supporting ray-ml images with Python 3.9
if image in ["ray-ml", "autoscaler"
] and py_version.startswith("3.9"):
print(
f"{image} image is currently unsupported with Python 3.9")
continue

full_image = f"rayproject/{image}"

# Tag "nightly-py3x" from "nightly-py3x-cpu"
DOCKER_CLIENT.api.tag(
image=f"{full_image}:nightly{py_version}-cpu",
image=f"{full_image}:nightly{py_name}-cpu",
repository=full_image,
tag=f"nightly{py_version}")
tag=f"nightly{py_name}")

for arch_tag in ["-cpu", "-gpu", ""]:
full_arch_tag = f"nightly{py_version}{arch_tag}"
full_arch_tag = f"nightly{py_name}{arch_tag}"

# Tag and push rayproject/<image>:nightly<py_tag><arch_tag>
docker_push(full_image, full_arch_tag)
Expand All @@ -320,7 +347,7 @@ def get_new_tag(old_tag, new_tag):
tag=specific_tag)
docker_push(full_image, specific_tag)

if "-py37" in py_version:
if "-py37" in py_name:
non_python_specific_tag = specific_tag.replace("-py37", "")
DOCKER_CLIENT.api.tag(
image=f"{full_image}:{full_arch_tag}",
Expand Down Expand Up @@ -385,10 +412,11 @@ def push_readmes(merge_build: bool):
parser = argparse.ArgumentParser()
parser.add_argument(
"--py-versions",
choices=["PY36", "PY37", "PY38"],
choices=["PY36", "PY37", "PY38", "PY39"],
default="PY37",
nargs="*",
help="Which python versions to build. Must be in (PY36, PY37, PY38)")
help="Which python versions to build. "
"Must be in (PY36, PY37, PY38, PY39)")
parser.add_argument(
"--build-type",
choices=BUILD_TYPES,
Expand Down
4 changes: 2 additions & 2 deletions docker/base-deps/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ RUN sudo apt-get update -y && sudo apt-get upgrade -y \
&& $HOME/anaconda3/bin/conda clean -y --all \
&& $HOME/anaconda3/bin/pip install --no-cache-dir \
flatbuffers \
cython==0.29.0 \
numpy==1.15.4 \
cython==0.29.23 \
numpy==1.19.5 \
psutil \
blist \
atari-py \
Expand Down