Skip to content
Merged
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
24 changes: 16 additions & 8 deletions runpod/cli/groups/project/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,18 @@ def start_project(): # pylint: disable=too-many-locals, too-many-branches
fi

exclude_pattern='(__pycache__|\\.pyc$)'
if [[ -f .runpodignore ]]; then
while IFS= read -r line; do
line=$(echo "$line" | tr -d '[:space:]')
[[ "$line" =~ ^#.*$ || -z "$line" ]] && continue # Skip comments and empty lines
exclude_pattern="${{exclude_pattern}}|(${{line}})"
done < .runpodignore
echo -e "- Ignoring files matching pattern: $exclude_pattern"
fi
function update_exclude_pattern {{
exclude_pattern='(__pycache__|\\.pyc$)'
if [[ -f .runpodignore ]]; then
while IFS= read -r line; do
line=$(echo "$line" | tr -d '[:space:]')
[[ "$line" =~ ^#.*$ || -z "$line" ]] && continue # Skip comments and empty lines
exclude_pattern="${{exclude_pattern}}|(${{line}})"
done < .runpodignore
echo -e "- Ignoring files matching pattern: $exclude_pattern"
fi
}}
update_exclude_pattern

# Start the API server in the background, and save the PID
python {handler_path} --rp_serve_api --rp_api_host="0.0.0.0" --rp_api_port=8080 --rp_api_concurrency=1 &
Expand All @@ -266,6 +270,10 @@ def start_project(): # pylint: disable=too-many-locals, too-many-branches
python -m pip install --upgrade pip && python -m pip install -r {requirements_path}
fi

if [[ $changed_file == *".runpodignore"* ]]; then
update_exclude_pattern
fi

python {handler_path} --rp_serve_api --rp_api_host="0.0.0.0" --rp_api_port=8080 --rp_api_concurrency=1 &
last_pid=$!

Expand Down