| name | tilelang-submodule-pull |
| description | Automatically pull tilelang repository and its third-party code. Provides scheduled pull script supporting git pull --recurse-submodules and git submodule update --init --recursive with automatic error detection and retry. Triggers when user mentions "重新拉取三方库", "自动重拉", "重新拉取子模块", "auto retry pull", "pull submodules", "update third-party libs", "retry pulling third-party libs", "auto pull code" or similar keywords. |
Tilelang Third-Party Repository Auto-Pull
Overview
This skill provides automatic pulling of tilelang repository and its third-party code:
- Scheduled Pull: Executes pull every hour
- Error Handling: Automatically detects network errors, access failures, etc.
- Multiple Methods: Supports two pull methods with automatic switching
- Real-time Output: Pull process printed to terminal and log file in real-time
- Timeout Protection: Automatically stops after 10 hours of background running to prevent forgetting to close
Script Paths
All paths are relative to the current project root directory:
Assuming the current project is at /mnt/workspace/tilelang-ascend, then:
| File | Path | Description |
|---|
| Pull Script | .agents/skills/tilelang-custom-skill/tilelang-submodule-pull/scripts/auto_pull.sh | Main script |
| Log File | .agents/skills/tilelang-custom-skill/tilelang-submodule-pull/logs/git_pull.log | Pull log |
The script automatically detects the project root directory, no manual configuration needed.
Usage
1. Direct Run (Foreground)
bash .agents/skills/tilelang-custom-skill/tilelang-submodule-pull/scripts/auto_pull.sh
2. Background Run
nohup .agents/skills/tilelang-custom-skill/tilelang-submodule-pull/scripts/auto_pull.sh &
3. View Logs
tail -f .agents/skills/tilelang-custom-skill/tilelang-submodule-pull/logs/git_pull.log
Workflow
1. Configure git mirror source (using ghfast.top for acceleration)
2. Check if running time exceeds 10 hours (background run only)
↓ Exceeds 10 hours
3. Automatically stop script and log
↓ Not exceeded
4. Execute two commands simultaneously:
- git submodule update --init --recursive
- git pull --recurse-submodules
↓ If either fails
5. Wait 1 hour then retry the entire process
↓ Both succeed
6. Stop script
Error Detection
The script automatically detects the following errors:
Could not access: Cannot access submodule
error: General error
fatal: Fatal error
Failed to clone: Clone failed
unable to access: Cannot access URL
Script Content
#!/bin/bash
SKILL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
LOG_DIR="$SKILL_DIR/logs"
LOG_FILE="$LOG_DIR/git_pull.log"
PROJECT_DIR="$(dirname "$(dirname "$(dirname "$SKILL_DIR")")")"
mkdir -p "$LOG_DIR"
echo "Configuring git mirror source..." | tee -a "$LOG_FILE"
git config --global url."https://ghfast.top/https://github.com/".insteadOf "https://github.com/" 2>&1 | tee -a "$LOG_FILE"
cd "$PROJECT_DIR" || exit 1
START_TIME=$(date +%s)
MAX_RUNTIME_SECONDS=36000
while true; do
CURRENT_TIME=$(date +%s)
RUNTIME=$((CURRENT_TIME - START_TIME))
if [ "$RUNTIME" -ge ];
| -a
| -a
| -a
0
| -a
| -a
| -a
| -a
TMP_FILE1=$()
git submodule update --init --recursive 2>&1 | -a |
OUTPUT1=$( )
| -a
TMP_FILE2=$()
git pull --recurse-submodules 2>&1 | -a |
OUTPUT2=$( )
HAS_ERROR1=
| grep -q ;
| -a
HAS_ERROR1=
| -a
HAS_ERROR2=
| grep -q ;
| -a
HAS_ERROR2=
| -a
[ = ] || [ = ];
| -a
3600
| -a
Notes
- The script automatically stops after all code is successfully pulled
- If the network is unstable, the script will automatically retry
- All output is displayed in both terminal and log file
- The log file records detailed process of each pull