This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # --------- Requirements / Config ---------- | |
| : "${S3_ENDPOINT_URL:?Set S3_ENDPOINT_URL (e.g., https://<accountid>.r2.cloudflarestorage.com)}" | |
| : "${AWS_ACCESS_KEY_ID:?Set AWS_ACCESS_KEY_ID}" | |
| : "${AWS_SECRET_ACCESS_KEY:?Set AWS_SECRET_ACCESS_KEY}" | |
| INPUT_BUCKET="${INPUT_BUCKET:-inputs-bucket}" | |
| OUTPUT_BUCKET="${OUTPUT_BUCKET:-outputs-bucket}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import os, time, subprocess, requests, socket | |
| SERVER = os.environ["JOB_SERVER_URL"] | |
| INSTANCE_ID = os.environ.get("INSTANCE_ID", socket.gethostname()) | |
| POLL = int(os.environ.get("JOB_POLL_SECONDS", "20")) | |
| print(f"[worker] instance={INSTANCE_ID}") | |
| print(f"[worker] server={SERVER}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| : "${R2_BUCKET:?R2_BUCKET is required}" | |
| DEST_BASE="${DEST_BASE:-$HOME}" | |
| PARALLEL_DOWNLOADS="${PARALLEL_DOWNLOADS:-4}" | |
| REMOTE="r2:${R2_BUCKET}" | |
| current_path="" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # -------------------------------------------------- | |
| # VERY EARLY LOGGING (NO strict mode yet) | |
| # -------------------------------------------------- | |
| LOG_FILE="/var/log/qp-init.log" | |
| mkdir -p /var/log | |
| touch "$LOG_FILE" | |
| chmod 644 "$LOG_FILE" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt install software-properties-common -y | |
| sudo add-apt-repository ppa:ondrej/php -y | |
| wget http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/multiarch-support_2.27-3ubuntu1.6_amd64.deb | |
| sudo dpkg -i multiarch-support_2.27-3ubuntu1.6_amd64.deb | |
| echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list |