Skip to content

Commit

Permalink
Different sync types for different storage types
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleykleynhans committed Jul 30, 2024
1 parent 7bd5b65 commit 06c6ccc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build/install_a1111.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ pip3 uninstall -y tensorrt
pip3 install --no-cache-dir nvidia-cudnn-cu11==8.9.4.25
pip3 install --no-cache-dir --pre --extra-index-url https://pypi.nvidia.com tensorrt==9.0.1.post11.dev4
pip3 uninstall -y nvidia-cudnn-cu11
pip3 install protobuf==3.20.2
pip3 install polygraphy --extra-index-url https://pypi.ngc.nvidia.com
pip3 install onnx-graphsurgeon --extra-index-url https://pypi.ngc.nvidia.com
pip3 install optimum
pip3 install --force-reinstall protobuf==3.20.2
pip3 cache purge
deactivate

Expand Down
2 changes: 1 addition & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ variable "APP" {
}

variable "RELEASE" {
default = "7.1.0"
default = "7.1.1"
}

variable "CU_VERSION" {
Expand Down
35 changes: 24 additions & 11 deletions scripts/pre_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,30 @@ sync_directory() {
# Ensure destination directory exists
mkdir -p "$dst_dir"

# Get total size of source directory
local total_size=$(du -sb "$src_dir" | cut -f1)

# Use parallel tar with fast compression and exclusions
tar --use-compress-program="pigz -p 4" \
--exclude='*.pyc' \
--exclude='__pycache__' \
--exclude='*.log' \
-cf - -C "$src_dir" . | \
pv -s $total_size | \
tar --use-compress-program="pigz -p 4" -xf - -C "$dst_dir"
# Check whether /workspace is fuse, overlay, or xfs
local workspace_fs=$(df -T /workspace | awk 'NR==2 {print $2}')

if [ "$workspace_fs" = "fuse" ]; then
echo "Using tar and pigz for sync (fuse filesystem detected)"

# Get total size of source directory
local total_size=$(du -sb "$src_dir" | cut -f1)

# Use parallel tar with fast compression and exclusions
tar --use-compress-program="pigz -p 4" \
--exclude='*.pyc' \
--exclude='__pycache__' \
--exclude='*.log' \
-cf - -C "$src_dir" . | \
pv -s $total_size | \
tar --use-compress-program="pigz -p 4" -xf - -C "$dst_dir"
elif [ "$workspace_fs" = "overlay" ] || [ "$workspace_fs" = "xfs" ]; then
echo "Using rsync for sync ($workspace_fs filesystem detected)"
rsync -rlptDu --info=progress2 --stats "$src_dir/" "$dst_dir/"
else
echo "Unknown filesystem type for /workspace: $workspace_fs, defaulting to rsync"
rsync -rlptDu --info=progress2 --stats "$src_dir/" "$dst_dir/"
fi

echo "Sync completed"
}
Expand Down

0 comments on commit 06c6ccc

Please sign in to comment.