Skip to content

Conversation

@aslonnie
Copy link
Collaborator

@aslonnie aslonnie commented Oct 18, 2025

so that we are not tied to using public s3 buckets

@aslonnie aslonnie requested a review from a team as a code owner October 18, 2025 08:24
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the documentation build cache fetching mechanism to use a URL endpoint instead of direct S3 access via boto3. This is a good simplification. My review includes two main points: improving an error message to be more accurate and robust, and fixing a potential performance issue in the file download logic by streaming the response to avoid high memory usage. Overall, the changes are in the right direction.

except botocore.exceptions.ClientError as e:
print(f"Failed to download {s3_file_path} from S3: {str(e)}")
raise e
with requests.get(f"{DOC_BUILD_S3_URL}/{commit}.tgz", allow_redirects=True) as response:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

When downloading files with requests, it's important to use the stream=True parameter in the get request. Without it, the entire file content is loaded into memory at once. For large cache files, this can lead to high memory consumption and potential performance issues. By using stream=True, the response content is streamed, and iter_content can process it in chunks, which is much more memory-efficient.

Suggested change
with requests.get(f"{DOC_BUILD_S3_URL}/{commit}.tgz", allow_redirects=True) as response:
with requests.get(f"{DOC_BUILD_S3_URL}/{commit}.tgz", allow_redirects=True, stream=True) as response:

@aslonnie aslonnie requested a review from khluu October 18, 2025 08:41
@aslonnie aslonnie force-pushed the lonnie-251017-docbuild branch from 5991c65 to 8a51261 Compare October 18, 2025 08:43
cursor[bot]

This comment was marked as outdated.

@ray-gardener ray-gardener bot added docs An issue or change related to documentation devprod labels Oct 18, 2025
@aslonnie aslonnie force-pushed the lonnie-251017-docbuild branch from 8a51261 to 0a58e0a Compare October 18, 2025 18:21
cursor[bot]

This comment was marked as outdated.

@aslonnie aslonnie force-pushed the lonnie-251017-docbuild branch from 0a58e0a to 9dae4be Compare October 18, 2025 18:25
@aslonnie aslonnie added the go add ONLY when ready to merge, run all tests label Oct 18, 2025
stop fetching from s3 directly

Signed-off-by: Lonnie Liu <[email protected]>
@aslonnie aslonnie force-pushed the lonnie-251017-docbuild branch from 4009dbc to c8b8085 Compare October 18, 2025 18:43
@aslonnie aslonnie requested a review from a team October 20, 2025 21:43
@aslonnie aslonnie merged commit 4badd82 into master Oct 20, 2025
6 checks passed
@aslonnie aslonnie deleted the lonnie-251017-docbuild branch October 20, 2025 23:43
xinyuangui2 pushed a commit to xinyuangui2/ray that referenced this pull request Oct 22, 2025
…ect#57877)

so that we are not tied to using public s3 buckets

Signed-off-by: Lonnie Liu <[email protected]>
Signed-off-by: xgui <[email protected]>
elliot-barn pushed a commit that referenced this pull request Oct 23, 2025
so that we are not tied to using public s3 buckets

Signed-off-by: Lonnie Liu <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
landscapepainter pushed a commit to landscapepainter/ray that referenced this pull request Nov 17, 2025
…ect#57877)

so that we are not tied to using public s3 buckets

Signed-off-by: Lonnie Liu <[email protected]>
Aydin-ab pushed a commit to Aydin-ab/ray-aydin that referenced this pull request Nov 19, 2025
…ect#57877)

so that we are not tied to using public s3 buckets

Signed-off-by: Lonnie Liu <[email protected]>
Signed-off-by: Aydin Abiar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devprod docs An issue or change related to documentation go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants