Skip to content

Commit c8967f4

Browse files
authored
Update ray to 2.7.2 (#2789)
To address numerous CVE that older Ray releases were affected by see https://www.anyscale.com/blog/update-on-ray-cves-cve-2023-6019-cve-2023-6020-cve-2023-6021-cve-2023-48022-cve-2023-48023 Use legacy APIs by setting `RAY_AIR_NEW_PERSISTENCE_MODE` environment variable to zero. Please note, that this increases tutorial runtime from 4 to 10 min
1 parent 2b7f15e commit c8967f4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

beginner_source/hyperparameter_tuning_tutorial.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
from ray.air import Checkpoint, session
5353
from ray.tune.schedulers import ASHAScheduler
5454

55+
# TODO: Migrate to ray.train.Checkpoint and remove following line
56+
os.environ["RAY_AIR_NEW_PERSISTENCE_MODE"]="0"
57+
5558
######################################################################
5659
# Most of the imports are needed for building the PyTorch model. Only the last three
5760
# imports are for Ray Tune.
@@ -452,8 +455,8 @@ def main(num_samples=10, max_num_epochs=10, gpus_per_trial=2):
452455
# Fixes ``AttributeError: '_LoggingTee' object has no attribute 'fileno'``.
453456
# This is only needed to run with sphinx-build.
454457
import sys
455-
456-
sys.stdout.fileno = lambda: False
458+
if not not hasattr(sys.stdout, "encoding"):
459+
sys.stdout.encoding = "latin1"
457460
# sphinx_gallery_end_ignore
458461
# You can change the number of GPUs per trial here:
459462
main(num_samples=10, max_num_epochs=10, gpus_per_trial=0)

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ bs4
2020
awscliv2==2.1.1
2121
flask
2222
spacy==3.4.1
23-
ray[tune]==2.4.0
23+
ray[tune]==2.7.2
2424
tensorboard
2525
jinja2==3.1.3
2626
pytorch-lightning

0 commit comments

Comments
 (0)