All checks were successful
Release Tag / release (push) Successful in 17s
- Modified the jiggablend-runner script to allow passing extra flags during execution, enhancing flexibility for users. - Updated usage instructions to reflect the new syntax, providing examples for better clarity on how to utilize the runner with various options.
113 lines
3.5 KiB
Bash
113 lines
3.5 KiB
Bash
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
# Simple script to install the latest jiggablend binary for Linux AMD64
|
|
# and create wrapper scripts for manager and runner using test setup
|
|
|
|
# Dependencies: curl, jq, tar, sha256sum, sudo (for installation to /usr/local/bin)
|
|
|
|
REPO="s1d3sw1ped/jiggablend"
|
|
API_URL="https://git.s1d3sw1ped.com/api/v1/repos/${REPO}/releases/latest"
|
|
ASSET_NAME="jiggablend-linux-amd64.tar.gz"
|
|
|
|
echo "Fetching latest release information..."
|
|
RELEASE_JSON=$(curl -s "$API_URL")
|
|
|
|
TAG=$(echo "$RELEASE_JSON" | jq -r '.tag_name')
|
|
echo "Latest version: $TAG"
|
|
|
|
ASSET_URL=$(echo "$RELEASE_JSON" | jq -r ".assets[] | select(.name == \"$ASSET_NAME\") | .browser_download_url")
|
|
if [ -z "$ASSET_URL" ]; then
|
|
echo "Error: Asset $ASSET_NAME not found in latest release."
|
|
exit 1
|
|
fi
|
|
|
|
CHECKSUM_URL=$(echo "$RELEASE_JSON" | jq -r '.assets[] | select(.name == "checksums.txt") | .browser_download_url')
|
|
if [ -z "$CHECKSUM_URL" ]; then
|
|
echo "Error: checksums.txt not found in latest release."
|
|
exit 1
|
|
fi
|
|
|
|
echo "Downloading $ASSET_NAME..."
|
|
curl -L -o "$ASSET_NAME" "$ASSET_URL"
|
|
|
|
echo "Downloading checksums.txt..."
|
|
curl -L -o "checksums.txt" "$CHECKSUM_URL"
|
|
|
|
echo "Verifying checksum..."
|
|
if ! sha256sum --ignore-missing --quiet -c checksums.txt; then
|
|
echo "Error: Checksum verification failed."
|
|
rm -f "$ASSET_NAME" checksums.txt
|
|
exit 1
|
|
fi
|
|
|
|
echo "Extracting..."
|
|
tar -xzf "$ASSET_NAME"
|
|
|
|
echo "Installing binary to /usr/local/bin (requires sudo)..."
|
|
sudo install -m 0755 jiggablend /usr/local/bin/
|
|
|
|
echo "Creating manager wrapper script..."
|
|
cat << 'EOF' > jiggablend-manager.sh
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
# Wrapper to run jiggablend manager with test setup
|
|
# Run this in a directory where you want the db, storage, and logs
|
|
|
|
mkdir -p logs
|
|
rm -f logs/manager.log
|
|
|
|
# Initialize test configuration
|
|
jiggablend manager config enable localauth
|
|
jiggablend manager config set fixed-apikey jk_r0_test_key_123456789012345678901234567890 -f -y
|
|
jiggablend manager config add user test@example.com testpassword --admin -f -y
|
|
|
|
# Run manager
|
|
jiggablend manager -l logs/manager.log
|
|
EOF
|
|
chmod +x jiggablend-manager.sh
|
|
sudo install -m 0755 jiggablend-manager.sh /usr/local/bin/jiggablend-manager
|
|
rm -f jiggablend-manager.sh
|
|
|
|
echo "Creating runner wrapper script..."
|
|
cat << 'EOF' > jiggablend-runner.sh
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
# Wrapper to run jiggablend runner with test setup
|
|
# Usage: jiggablend-runner [MANAGER_URL] [RUNNER_FLAGS...]
|
|
# Default MANAGER_URL: http://localhost:8080
|
|
# Run this in a directory where you want the logs
|
|
|
|
MANAGER_URL="http://localhost:8080"
|
|
if [[ $# -gt 0 && "$1" != -* ]]; then
|
|
MANAGER_URL="$1"
|
|
shift
|
|
fi
|
|
|
|
EXTRA_ARGS=("$@")
|
|
|
|
mkdir -p logs
|
|
rm -f logs/runner.log
|
|
|
|
# Run runner
|
|
jiggablend runner -l logs/runner.log --api-key=jk_r0_test_key_123456789012345678901234567890 --manager "$MANAGER_URL" "${EXTRA_ARGS[@]}"
|
|
EOF
|
|
chmod +x jiggablend-runner.sh
|
|
sudo install -m 0755 jiggablend-runner.sh /usr/local/bin/jiggablend-runner
|
|
rm -f jiggablend-runner.sh
|
|
|
|
echo "Cleaning up..."
|
|
rm -f "$ASSET_NAME" checksums.txt jiggablend
|
|
|
|
echo "Installation complete!"
|
|
echo "Binary: jiggablend"
|
|
echo "Wrappers: jiggablend-manager, jiggablend-runner"
|
|
echo "Run 'jiggablend-manager' to start the manager with test config."
|
|
echo "Run 'jiggablend-runner [url] [runner flags...]' to start the runner."
|
|
echo "Example: jiggablend-runner http://your-manager:8080 --force-cpu-rendering --disable-hiprt"
|
|
echo "Note: Depending on whether you're running the manager or runner, additional dependencies like Blender, ImageMagick, or FFmpeg may be required. See the project README for details." |