Skip to content

Conversation

@crypdick
Copy link
Contributor

Description

Automatically exclude common directories (.git, .venv, venv, pycache) when uploading working_dir in runtime environment packages.

At a minimum we need to exclude .git/ because unlike the others, nobody includes .git/ in .gitignore. This causes Ray to throw a ray.exceptions.RuntimeEnvSetupError if your .git dir is larger than 512 MiB.

I also updated the documentation in handling-dependencies.rst and improved the error message if the env exceeds the GCS_STORAGE_MAX_SIZE limit.

Related issues

N/A

Additional information

This PR pytorch/tutorials#3709 was failing to run because the PyTorch tutorials .git/ folder is huge.

@crypdick crypdick requested review from a team as code owners December 19, 2025 03:28
Ricardo Decal added 2 commits December 18, 2025 19:29
Signed-off-by: Ricardo Decal <[email protected]>
@crypdick crypdick force-pushed the bugfix/default-excludes-working-dir branch from 57c19af to 631fa2e Compare December 19, 2025 03:29
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 introduces a helpful feature to automatically exclude common directories like .git and venv from working_dir uploads, preventing common errors with large repositories. The implementation is clean, and it's great to see that it's accompanied by thorough documentation updates and both unit and integration tests. My only suggestion is a minor improvement to the type hinting for better code clarity.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Ricardo Decal <[email protected]>
@ray-gardener ray-gardener bot added docs An issue or change related to documentation core Issues that should be addressed in Ray Core labels Dec 19, 2025
Signed-off-by: Ricardo Decal <[email protected]>
@iamjustinhsu
Copy link
Contributor

Nice nice. Just some questions:

Can you clarify the following scenarios in these scenarios:

  • excludes=[], .rayignore=["file.txt"]
  • excludes=["file.txt"], .rayignore=[]
  • excludes=["file.txt"], .rayignore=["file.txt"]
  • excludes=["file.txt"], .rayignore=["file2.txt"]

I'm wondering

  1. Why do have "excludes" when we had ".gitignore" previously?
  2. Is the use-case necessary if users can specify venv, .git, pycache in their .rayignore file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core docs An issue or change related to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants