From 4b7816e117976e454cac3d336f2ded8894faedd6 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 22 Jul 2026 17:20:37 -0400 Subject: [PATCH 01/91] Adding image to store data --- docker-compose.yaml | 18 ++++++++++++++++++ garage.toml | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 garage.toml diff --git a/docker-compose.yaml b/docker-compose.yaml index bb2612c..cddeede 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -56,6 +56,22 @@ services: - auth_db networks: - soaricarus-network + # --- storage service --- + maze: + image: dxflrs/garage:v2.3.0 + container_name: maze + restart: unless-stopped + ports: + - "3900:3900" # S3 API + - "3901:3901" # RPC for cluster communication + - "3902:3902" # S3 web interface + - "3903:3903" # Admin API + volumes: + - ./garage.toml:/etc/garage.toml:ro + - object_data:/var/lib/garage/meta + - object_data:/var/lib/garage/data + env_file: + - .env # PostgreSQL Database Service @@ -113,6 +129,8 @@ volumes: driver: local # Use the default local driver postgres_data_auth: driver: local # Use the default local driver + object_data: + driver: local # Use the default local driver networks: soaricarus-network: diff --git a/garage.toml b/garage.toml new file mode 100644 index 0000000..6c3d0ba --- /dev/null +++ b/garage.toml @@ -0,0 +1,16 @@ +metadata_dir = "/var/lib/garage/meta" +data_dir = "/var/lib/garage/data" +db_engine = "sqlite" +replication_factor = 1 + +rpc_bind_addr = "[::]:3901" +rpc_secret = "${GARAGE_RPC_SECRET}" + +[s3_api] +s3_region = "maze" +api_bind_addr = "[::]:3900" +root_domain = ".localhost" + +[s3_web] +bind_addr = "[::]:3902" +root_domain = ".localhost" -- 2.47.3 From 7460f0d157f0028f3ec57bde624b5c85bdc58644 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 22 Jul 2026 17:20:58 -0400 Subject: [PATCH 02/91] Updating some of the sample env --- .env.docker.sample | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.env.docker.sample b/.env.docker.sample index e69d0fe..a93b670 100644 --- a/.env.docker.sample +++ b/.env.docker.sample @@ -11,3 +11,17 @@ POSTGRES_MAIN_DB=soaricarus_db POSTGRES_MAIN_HOST=main_db POSTGRES_MAIN_PORT=5432 DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:${POSTGRES_MAIN_PORT}/${POSTGRES_MAIN_DB} + +GARAGE_RPC_SECRET=c2bde5c3f9c04116a7563e25ea5ba6fab25319daa2fe8a952ad57d0b8159b590 +GARAGE_METADATA_DIR=/var/lib/garage/meta +GARAGE_DATA_DIR=/var/lib/garage/data +GARAGE_DB_ENGINE=sqlite +GARAGE_REPLICATION_FACTOR=1 +GARAGE_RPC_BIND_ADDR=[::]:3901 +GARAGE_S3_API_BIND_ADDR=[::]:3900 +GARAGE_S3_WEB_BIND_ADDR=[::]:3902 +GARAGE_S3_REGION=maze +GARAGE_ROOT_DOMAIN=.localhost +AWS_DEFAULT_REGION=maze +AWS_SECRET_ACCESS_KEY=3o4n7yfo34985yrfcq9238765ry3928475rcy349857ty394578cy +AWS_ACCESS_KEY_ID=2q39fnoy59q2347yfdrc327894ryfc0q2834rcyq023897 -- 2.47.3 From 7a209eeb5e121fadbae3f8d8b6ef2dc47550c58b Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 23 Jul 2026 15:15:11 -0400 Subject: [PATCH 03/91] Removing garage.toml --- garage.toml | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 garage.toml diff --git a/garage.toml b/garage.toml deleted file mode 100644 index 6c3d0ba..0000000 --- a/garage.toml +++ /dev/null @@ -1,16 +0,0 @@ -metadata_dir = "/var/lib/garage/meta" -data_dir = "/var/lib/garage/data" -db_engine = "sqlite" -replication_factor = 1 - -rpc_bind_addr = "[::]:3901" -rpc_secret = "${GARAGE_RPC_SECRET}" - -[s3_api] -s3_region = "maze" -api_bind_addr = "[::]:3900" -root_domain = ".localhost" - -[s3_web] -bind_addr = "[::]:3902" -root_domain = ".localhost" -- 2.47.3 From 327d04e8a952fa4559d4d1205b7d3b3efd465ec0 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 23 Jul 2026 15:28:58 -0400 Subject: [PATCH 04/91] Revert "Removing garage.toml" This reverts commit 7a209eeb5e121fadbae3f8d8b6ef2dc47550c58b. --- garage.toml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 garage.toml diff --git a/garage.toml b/garage.toml new file mode 100644 index 0000000..6c3d0ba --- /dev/null +++ b/garage.toml @@ -0,0 +1,16 @@ +metadata_dir = "/var/lib/garage/meta" +data_dir = "/var/lib/garage/data" +db_engine = "sqlite" +replication_factor = 1 + +rpc_bind_addr = "[::]:3901" +rpc_secret = "${GARAGE_RPC_SECRET}" + +[s3_api] +s3_region = "maze" +api_bind_addr = "[::]:3900" +root_domain = ".localhost" + +[s3_web] +bind_addr = "[::]:3902" +root_domain = ".localhost" -- 2.47.3 From 2bfb8c6aeeb0a8df78b693c4fdde72f82700cc05 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 23 Jul 2026 15:31:41 -0400 Subject: [PATCH 05/91] Got garage to run in docker --- docker-compose.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index cddeede..951ef58 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -68,10 +68,17 @@ services: - "3903:3903" # Admin API volumes: - ./garage.toml:/etc/garage.toml:ro - - object_data:/var/lib/garage/meta - - object_data:/var/lib/garage/data + - object_data:/var/lib/garage env_file: - .env + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost:3901/v0/status || exit 1"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 30s + networks: + - soaricarus-network # PostgreSQL Database Service -- 2.47.3 From 8fae71b08665b5084f9b5ada4fb0219dc56d182a Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 23 Jul 2026 16:05:21 -0400 Subject: [PATCH 06/91] Getting somewhere. Object Storage is initialized but not initializing hangs --- Dockerfile | 4 ++ docker-compose.yaml | 22 +++++++++++ scripts/init-garage.sh | 85 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100755 scripts/init-garage.sh diff --git a/Dockerfile b/Dockerfile index 11cfe6b..0c2ac50 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,6 +30,10 @@ RUN --mount=type=ssh mkdir src && \ COPY src ./src COPY .env ./.env COPY migrations ./migrations +COPY scripts/init-garage.sh /scripts/init-garage.sh + +# Make it executable +RUN chmod +x /scripts/init-garage.sh RUN --mount=type=ssh \ cargo build --release --quiet diff --git a/docker-compose.yaml b/docker-compose.yaml index 951ef58..10eaefb 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -80,6 +80,28 @@ services: networks: - soaricarus-network + # --- Storage Initialization --- + maze-init: + # image: dxflrs/garage:v2.3.0 + image: alpine:latest + container_name: maze-init + depends_on: + maze: + condition: service_started + volumes: + - ./scripts:/scripts:ro + - object_data:/var/lib/garage + environment: + - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} + - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} + - GARAGE_RPC_SECRET=${GARAGE_RPC_SECRET} + env_file: + - .env + # entrypoint: ["/bin/bash"] + command: ["sh", "/scripts/init-garage.sh"] + restart: "no" # Run once and exit + networks: + - soaricarus-network # PostgreSQL Database Service main_db: diff --git a/scripts/init-garage.sh b/scripts/init-garage.sh new file mode 100755 index 0000000..87e399f --- /dev/null +++ b/scripts/init-garage.sh @@ -0,0 +1,85 @@ +#!/bin/bash +set -e + +# Use the credentials from your .env +BUCKET_NAME="soaricarus-storage" + +echo "âŗ Waiting for Garage to be ready..." +until curl -s -f "http://localhost:3901/v0/status" > /dev/null 2>&1; do + echo " Garage not ready yet, retrying in 2s..." + sleep 2 +done +echo "✅ Garage API is responding!" + +# Wait a bit more for Garage to fully initialize +sleep 5 + +# Check if layout is already applied +if garage layout show 2>/dev/null | grep -q "Current cluster layout"; then + echo "â„šī¸ Layout already applied, checking bucket..." +else + echo "đŸ“Ļ Applying cluster layout..." + + # Get node ID - this might need multiple attempts + MAX_RETRIES=10 + RETRY_COUNT=0 + while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do + NODE_ID=$(garage node id 2>/dev/null | head -n1) + if [ -n "$NODE_ID" ]; then + break + fi + RETRY_COUNT=$((RETRY_COUNT + 1)) + echo " Waiting for node ID (attempt $RETRY_COUNT/$MAX_RETRIES)..." + sleep 2 + done + + if [ -z "$NODE_ID" ]; then + echo "❌ Failed to get node ID after $MAX_RETRIES attempts" + exit 1 + fi + + echo " Node ID: $NODE_ID" + garage layout assign --version 1 "$NODE_ID" + garage layout apply --version 1 + echo " ✅ Layout applied" + + # Wait for layout to stabilize + sleep 3 +fi + +# Check if bucket already exists +if garage bucket info "${BUCKET_NAME}" 2>/dev/null; then + echo "â„šī¸ Bucket '${BUCKET_NAME}' already exists. Skipping setup." + exit 0 +fi + +echo "đŸ“Ļ Creating bucket and configuring permissions..." + +# 1. Create the bucket +garage bucket create "${BUCKET_NAME}" +echo " ✅ Bucket created: ${BUCKET_NAME}" + +# 2. Check if key exists +if garage key info "${AWS_ACCESS_KEY_ID}" 2>/dev/null; then + echo " â„šī¸ Key already exists: ${AWS_ACCESS_KEY_ID}" +else + garage key create \ + --name "app-key" \ + "${AWS_ACCESS_KEY_ID}" \ + "${AWS_SECRET_ACCESS_KEY}" + echo " ✅ Key created: ${AWS_ACCESS_KEY_ID}" +fi + +# 3. Grant full permissions +garage bucket allow \ + --read \ + --write \ + --owner \ + "${BUCKET_NAME}" \ + --key "${AWS_ACCESS_KEY_ID}" +echo " ✅ Permissions granted" + +echo "🎉 Setup complete!" +echo " Bucket: ${BUCKET_NAME}" +echo " Access Key: ${AWS_ACCESS_KEY_ID}" +echo " Endpoint: http://maze:3900" -- 2.47.3 From 3965d86d54dd7ee6ee4ad14545acefe2c2a914e4 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 23 Jul 2026 16:21:40 -0400 Subject: [PATCH 07/91] Saving script --- scripts/init-garage.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/init-garage.sh b/scripts/init-garage.sh index 87e399f..e519483 100755 --- a/scripts/init-garage.sh +++ b/scripts/init-garage.sh @@ -5,11 +5,13 @@ set -e BUCKET_NAME="soaricarus-storage" echo "âŗ Waiting for Garage to be ready..." -until curl -s -f "http://localhost:3901/v0/status" > /dev/null 2>&1; do - echo " Garage not ready yet, retrying in 2s..." - sleep 2 -done +# until curl -s -f "http://localhost:3901/v0/status" > /dev/null 2>&1; do + # echo " Garage not ready yet, retrying in 2s..." + # sleep 2 +# done +sleep 20 echo "✅ Garage API is responding!" +echo "... I think..." # Wait a bit more for Garage to fully initialize sleep 5 -- 2.47.3 From f116adffdbc21c893f59801c6c86f954fa7b4c64 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 23 Jul 2026 16:26:14 -0400 Subject: [PATCH 08/91] Saving changes. Nothing yet --- docker-compose.yaml | 9 +++++---- scripts/init-garage.sh | 46 +++++++++++++++++++----------------------- 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 10eaefb..a78b754 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -83,22 +83,23 @@ services: # --- Storage Initialization --- maze-init: # image: dxflrs/garage:v2.3.0 - image: alpine:latest + image: docker:latest container_name: maze-init depends_on: maze: condition: service_started volumes: - - ./scripts:/scripts:ro + - /var/run/docker.sock:/var/run/docker.sock # Mount Docker socket - object_data:/var/lib/garage environment: - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} - GARAGE_RPC_SECRET=${GARAGE_RPC_SECRET} + - BUCKET_NAME=${S3_BUCKET_NAME} env_file: - .env - # entrypoint: ["/bin/bash"] - command: ["sh", "/scripts/init-garage.sh"] + entrypoint: ["/bin/sh"] + command: ["/scripts/init-garage.sh"] restart: "no" # Run once and exit networks: - soaricarus-network diff --git a/scripts/init-garage.sh b/scripts/init-garage.sh index e519483..2f26dd7 100755 --- a/scripts/init-garage.sh +++ b/scripts/init-garage.sh @@ -1,32 +1,29 @@ -#!/bin/bash +#!/bin/sh set -e -# Use the credentials from your .env BUCKET_NAME="soaricarus-storage" echo "âŗ Waiting for Garage to be ready..." -# until curl -s -f "http://localhost:3901/v0/status" > /dev/null 2>&1; do - # echo " Garage not ready yet, retrying in 2s..." - # sleep 2 -# done -sleep 20 +until docker exec maze curl -s -f "http://localhost:3901/v0/status" > /dev/null 2>&1; do + echo " Garage not ready yet, retrying in 2s..." + sleep 2 +done echo "✅ Garage API is responding!" -echo "... I think..." -# Wait a bit more for Garage to fully initialize -sleep 5 +sleep 3 # Check if layout is already applied -if garage layout show 2>/dev/null | grep -q "Current cluster layout"; then +if docker exec maze garage layout show 2>/dev/null | grep -q "Current cluster layout"; then echo "â„šī¸ Layout already applied, checking bucket..." else echo "đŸ“Ļ Applying cluster layout..." - # Get node ID - this might need multiple attempts + # Get node ID MAX_RETRIES=10 RETRY_COUNT=0 + NODE_ID="" while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do - NODE_ID=$(garage node id 2>/dev/null | head -n1) + NODE_ID=$(docker exec maze garage node id 2>/dev/null | head -n1) if [ -n "$NODE_ID" ]; then break fi @@ -41,39 +38,38 @@ else fi echo " Node ID: $NODE_ID" - garage layout assign --version 1 "$NODE_ID" - garage layout apply --version 1 + docker exec maze garage layout assign --version 1 "$NODE_ID" + docker exec maze garage layout apply --version 1 echo " ✅ Layout applied" - # Wait for layout to stabilize sleep 3 fi -# Check if bucket already exists -if garage bucket info "${BUCKET_NAME}" 2>/dev/null; then +# Check if bucket exists +if docker exec maze garage bucket info "${BUCKET_NAME}" 2>/dev/null; then echo "â„šī¸ Bucket '${BUCKET_NAME}' already exists. Skipping setup." exit 0 fi echo "đŸ“Ļ Creating bucket and configuring permissions..." -# 1. Create the bucket -garage bucket create "${BUCKET_NAME}" +# Create the bucket +docker exec maze garage bucket create "${BUCKET_NAME}" echo " ✅ Bucket created: ${BUCKET_NAME}" -# 2. Check if key exists -if garage key info "${AWS_ACCESS_KEY_ID}" 2>/dev/null; then +# Check if key exists +if docker exec maze garage key info "${AWS_ACCESS_KEY_ID}" 2>/dev/null; then echo " â„šī¸ Key already exists: ${AWS_ACCESS_KEY_ID}" else - garage key create \ + docker exec maze garage key create \ --name "app-key" \ "${AWS_ACCESS_KEY_ID}" \ "${AWS_SECRET_ACCESS_KEY}" echo " ✅ Key created: ${AWS_ACCESS_KEY_ID}" fi -# 3. Grant full permissions -garage bucket allow \ +# Grant permissions +docker exec maze garage bucket allow \ --read \ --write \ --owner \ -- 2.47.3 From 3de818f28050a0dc4a164584ae6f6bd643857aec Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 23 Jul 2026 17:19:29 -0400 Subject: [PATCH 09/91] Saving changes --- .env.docker.sample | 2 ++ docker-compose.yaml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.env.docker.sample b/.env.docker.sample index a93b670..b21b599 100644 --- a/.env.docker.sample +++ b/.env.docker.sample @@ -25,3 +25,5 @@ GARAGE_ROOT_DOMAIN=.localhost AWS_DEFAULT_REGION=maze AWS_SECRET_ACCESS_KEY=3o4n7yfo34985yrfcq9238765ry3928475rcy349857ty394578cy AWS_ACCESS_KEY_ID=2q39fnoy59q2347yfdrc327894ryfc0q2834rcyq023897 + +S3_BUCKET_NAME=soaricarus-storage diff --git a/docker-compose.yaml b/docker-compose.yaml index a78b754..6f141c5 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -83,7 +83,7 @@ services: # --- Storage Initialization --- maze-init: # image: dxflrs/garage:v2.3.0 - image: docker:latest + image: docker:dind container_name: maze-init depends_on: maze: @@ -91,6 +91,7 @@ services: volumes: - /var/run/docker.sock:/var/run/docker.sock # Mount Docker socket - object_data:/var/lib/garage + - ./scripts:/scripts:ro # ← ADD THIS - mount the scripts directory environment: - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} -- 2.47.3 From 75f4d9fa76fcb65fc5d1d16668f46766acc44cdb Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 24 Jul 2026 12:23:48 -0400 Subject: [PATCH 10/91] Saving changes. No real progress yet --- docker-compose.yaml | 41 ++++++-------- garage/Dockerfile | 21 +++++++ garage/full-init-garage.sh | 109 +++++++++++++++++++++++++++++++++++++ garage/init-garage.sh | 36 ++++++++++++ scripts/init-garage.sh | 3 +- 5 files changed, 184 insertions(+), 26 deletions(-) create mode 100644 garage/Dockerfile create mode 100644 garage/full-init-garage.sh create mode 100755 garage/init-garage.sh diff --git a/docker-compose.yaml b/docker-compose.yaml index 6f141c5..e920bcf 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -11,6 +11,8 @@ services: - "8000:8000" env_file: - .env + volumes: + - shared_credentials:/shared:ro # Mount as read-only depends_on: main_db: condition: service_healthy @@ -58,7 +60,9 @@ services: - soaricarus-network # --- storage service --- maze: - image: dxflrs/garage:v2.3.0 + build: + context: ./garage + dockerfile: Dockerfile container_name: maze restart: unless-stopped ports: @@ -68,11 +72,20 @@ services: - "3903:3903" # Admin API volumes: - ./garage.toml:/etc/garage.toml:ro + - shared_credentials:/shared - object_data:/var/lib/garage + # - ./scripts:/scripts:ro # ← ADD THIS - mount the scripts directory env_file: - .env + environment: + - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} + - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} + - GARAGE_RPC_SECRET=${GARAGE_RPC_SECRET} + - BUCKET_NAME=${S3_BUCKET_NAME} healthcheck: test: ["CMD-SHELL", "curl -f http://localhost:3901/v0/status || exit 1"] + # test: ["CMD-SHELL", "echo 'What is to be done?'"] + # test: ["CMD-SHELL", "nc -z localhost 3900 || exit 1"] interval: 10s timeout: 5s retries: 5 @@ -80,30 +93,6 @@ services: networks: - soaricarus-network - # --- Storage Initialization --- - maze-init: - # image: dxflrs/garage:v2.3.0 - image: docker:dind - container_name: maze-init - depends_on: - maze: - condition: service_started - volumes: - - /var/run/docker.sock:/var/run/docker.sock # Mount Docker socket - - object_data:/var/lib/garage - - ./scripts:/scripts:ro # ← ADD THIS - mount the scripts directory - environment: - - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} - - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} - - GARAGE_RPC_SECRET=${GARAGE_RPC_SECRET} - - BUCKET_NAME=${S3_BUCKET_NAME} - env_file: - - .env - entrypoint: ["/bin/sh"] - command: ["/scripts/init-garage.sh"] - restart: "no" # Run once and exit - networks: - - soaricarus-network # PostgreSQL Database Service main_db: @@ -162,6 +151,8 @@ volumes: driver: local # Use the default local driver object_data: driver: local # Use the default local driver + shared_credentials: # New shared volume + driver: local networks: soaricarus-network: diff --git a/garage/Dockerfile b/garage/Dockerfile new file mode 100644 index 0000000..a0a6e15 --- /dev/null +++ b/garage/Dockerfile @@ -0,0 +1,21 @@ +# FROM dxflrs/garage:v2.3.0 +# Stage 1: Extract the garage binary from the official image +FROM dxflrs/garage:v2.3.0 as garage-base + +# Stage 2: Create a new image with a shell +FROM alpine:latest + +# Install necessary tools (curl, busybox for sh, etc.) +# The Garage image is based on Alpine, so we use apk +RUN apk add --no-cache curl busybox + +# Copy the garage binary from the official image +COPY --from=garage-base /garage /usr/local/bin/garage + +# Copy the init script +COPY init-garage.sh /init-garage.sh +RUN chmod +x /init-garage.sh + +# Use the init script as the entrypoint +# It will run setup, then exec garage +ENTRYPOINT ["/init-garage.sh"] diff --git a/garage/full-init-garage.sh b/garage/full-init-garage.sh new file mode 100644 index 0000000..c93be4b --- /dev/null +++ b/garage/full-init-garage.sh @@ -0,0 +1,109 @@ +#!/bin/sh +set -e + +BUCKET_NAME="${BUCKET_NAME:-soaricarus-storage}" +CREDENTIALS_FILE="/shared/garage-credentials.env" +SETUP_DONE="/shared/setup.done" + +# Function to write credentials to shared volume +write_credentials() { + local access_key="$1" + local secret_key="$2" + mkdir -p "$(dirname "$CREDENTIALS_FILE")" + cat > "$CREDENTIALS_FILE" << EOF +GARAGE_ACCESS_KEY_ID=$access_key +GARAGE_SECRET_ACCESS_KEY=$secret_key +GARAGE_BUCKET_NAME=$BUCKET_NAME +GARAGE_ENDPOINT=http://maze:3900 +EOF + touch "$SETUP_DONE" + echo "✅ Credentials saved to $CREDENTIALS_FILE" +} + +# Check if setup already done +if [ -f "$SETUP_DONE" ]; then + echo "â„šī¸ Setup already completed. Starting Garage..." + # Source credentials if needed for the main Garage process + # shellcheck source=/dev/null + [ -f "$CREDENTIALS_FILE" ] && . "$CREDENTIALS_FILE" + exec /usr/local/bin/garage "$@" +fi + +echo "🔧 Running initial setup..." + +# Start Garage in background for setup +echo "âŗ Starting Garage in background..." +/usr/local/bin/garage "$@" & +GARAGE_PID=$! + +# Wait for Garage API to be ready +echo "âŗ Waiting for Garage API..." +# until curl -s -f "http://localhost:3900/v0/status" > /dev/null 2>&1; do +# echo " Not ready yet, sleeping 2s..." +# sleep 2 +#done +echo "✅ Garage API is responding!" + +# Apply layout if not already applied +if ! /usr/local/bin/garage layout show 2>/dev/null | grep -q "Current cluster layout"; then + echo "đŸ“Ļ Applying cluster layout..." + NODE_ID=$(/usr/local/bin/garage node id | head -n1) + /usr/local/bin/garage layout assign --version 1 "$NODE_ID" + /usr/local/bin/garage layout apply --version 1 + echo " ✅ Layout applied" + sleep 3 +else + echo "â„šī¸ Layout already applied" +fi + +echo "Laid out" + +# Create bucket if it doesn't exist +if ! /usr/local/bin/garage bucket info "$BUCKET_NAME" 2>/dev/null; then + echo "đŸ“Ļ Creating bucket: $BUCKET_NAME" + /usr/local/bin/garage bucket create "$BUCKET_NAME" +else + echo "â„šī¸ Bucket $BUCKET_NAME already exists" +fi + +# Create or import key +# We'll use the credentials from .env if provided, otherwise generate new ones +if [ -n "$AWS_ACCESS_KEY_ID" ] && [ -n "$AWS_SECRET_ACCESS_KEY" ]; then + echo "🔑 Using pre-defined AWS credentials from .env" + if ! /usr/local/bin/garage key info "$AWS_ACCESS_KEY_ID" 2>/dev/null; then + # Key doesn't exist, import it + /usr/local/bin/garage key import "$AWS_ACCESS_KEY_ID" "$AWS_SECRET_ACCESS_KEY" "app-key" + echo " ✅ Key imported: $AWS_ACCESS_KEY_ID" + else + echo " â„šī¸ Key already exists: $AWS_ACCESS_KEY_ID" + fi + ACCESS_KEY="$AWS_ACCESS_KEY_ID" + SECRET_KEY="$AWS_SECRET_ACCESS_KEY" +else + echo "🔑 Generating new key..." + KEY_OUTPUT=$(/usr/local/bin/garage key create --name "app-key") + echo "$KEY_OUTPUT" + ACCESS_KEY=$(echo "$KEY_OUTPUT" | grep 'Key ID:' | awk '{print $3}') + SECRET_KEY=$(echo "$KEY_OUTPUT" | grep 'Secret key:' | awk '{print $3}') + echo " ✅ Key generated: $ACCESS_KEY" +fi + +# Grant permissions +/usr/local/bin/garage bucket allow --read --write --owner "$BUCKET_NAME" --key "$ACCESS_KEY" +echo " ✅ Permissions granted" + +# Write credentials to shared volume +write_credentials "$ACCESS_KEY" "$SECRET_KEY" + +echo "🎉 Setup complete!" +echo " Bucket: $BUCKET_NAME" +echo " Access Key: $ACCESS_KEY" + +# Stop the background Garage process +echo "âšī¸ Stopping background Garage process..." +kill "$GARAGE_PID" +wait "$GARAGE_PID" 2>/dev/null || true + +echo "🚀 Starting Garage in foreground..." +exec /usr/local/bin/garage "$@" + diff --git a/garage/init-garage.sh b/garage/init-garage.sh new file mode 100755 index 0000000..1650ede --- /dev/null +++ b/garage/init-garage.sh @@ -0,0 +1,36 @@ +#!/bin/sh +set -e + +BUCKET_NAME="${BUCKET_NAME:-soaricarus-storage}" +CREDENTIALS_FILE="/shared/garage-credentials.env" +SETUP_DONE="/shared/setup.done" + +echo "🔧 Running initial setup..." + +# Start Garage in background for setup +echo "âŗ Starting Garage in background..." +/usr/local/bin/garage "$@" & +GARAGE_PID=$! + +# Wait for Garage API to be ready +echo "âŗ Waiting for Garage API..." +# until curl -s -f "http://localhost:3900/v0/status" > /dev/null 2>&1; do +# echo " Not ready yet, sleeping 2s..." +# sleep 2 +#done +echo "✅ Garage API is responding!" + +# Apply layout if not already applied +#if ! /usr/local/bin/garage layout show 2>/dev/null | grep -q "Current cluster layout"; then +# echo "đŸ“Ļ Applying cluster layout..." +# NODE_ID=$(/usr/local/bin/garage node id | head -n1) +# echo $NODE_ID + # /usr/local/bin/garage layout assign --version 1 "$NODE_ID" + # /usr/local/bin/garage layout apply --version 1 +# echo " ✅ Layout applied" +# sleep 3 +#else + # echo "â„šī¸ Layout already applied" +# fi + +echo "Laid out" diff --git a/scripts/init-garage.sh b/scripts/init-garage.sh index 2f26dd7..b6b3792 100755 --- a/scripts/init-garage.sh +++ b/scripts/init-garage.sh @@ -4,7 +4,8 @@ set -e BUCKET_NAME="soaricarus-storage" echo "âŗ Waiting for Garage to be ready..." -until docker exec maze curl -s -f "http://localhost:3901/v0/status" > /dev/null 2>&1; do +# until docker exec maze curl -s -f "http://localhost:3901/v0/status" > /dev/null 2>&1; do +until docker exec maze nc -z "localhost 3900" > /dev/null 2>&1; do echo " Garage not ready yet, retrying in 2s..." sleep 2 done -- 2.47.3 From 6574d0ee8f5b6f7291776e4011a86b8b5b33c505 Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 24 Jul 2026 15:33:18 -0400 Subject: [PATCH 11/91] I am tired boss --- docker-compose.yaml | 10 ++-- garage/entrypoint.sh | 126 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 4 deletions(-) create mode 100755 garage/entrypoint.sh diff --git a/docker-compose.yaml b/docker-compose.yaml index e920bcf..a91c80a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -60,9 +60,7 @@ services: - soaricarus-network # --- storage service --- maze: - build: - context: ./garage - dockerfile: Dockerfile + image: dxflrs/garage:v2.3.0 container_name: maze restart: unless-stopped ports: @@ -72,6 +70,7 @@ services: - "3903:3903" # Admin API volumes: - ./garage.toml:/etc/garage.toml:ro + - ./garage/entrypoint.sh:/entrypoint.sh:ro - shared_credentials:/shared - object_data:/var/lib/garage # - ./scripts:/scripts:ro # ← ADD THIS - mount the scripts directory @@ -82,10 +81,13 @@ services: - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} - GARAGE_RPC_SECRET=${GARAGE_RPC_SECRET} - BUCKET_NAME=${S3_BUCKET_NAME} + entrypoint: ["/entrypoint.sh"] + command: [] healthcheck: - test: ["CMD-SHELL", "curl -f http://localhost:3901/v0/status || exit 1"] + # test: ["CMD-SHELL", "curl -f http://localhost:3901/v0/status || exit 1"] # test: ["CMD-SHELL", "echo 'What is to be done?'"] # test: ["CMD-SHELL", "nc -z localhost 3900 || exit 1"] + test: ["CMD-SHELL", "/garage status | grep -q 'Health: ok' || exit 1"] interval: 10s timeout: 5s retries: 5 diff --git a/garage/entrypoint.sh b/garage/entrypoint.sh new file mode 100755 index 0000000..a614ab2 --- /dev/null +++ b/garage/entrypoint.sh @@ -0,0 +1,126 @@ +#!/garage +# This script runs as a garage command +# It will check if setup is needed and run initialization + +# Check if we should run setup (first run) +SETUP_MARKER="/var/lib/garage/.setup_done" +BUCKET_NAME="${BUCKET_NAME:-soaricarus-storage}" +CREDENTIALS_FILE="/shared/garage-credentials.env" + +# Function to check if Garage API is ready +is_garage_ready() { + # Try to get status, if it works, Garage is ready + /garage status 2>/dev/null | grep -q "Health: ok" + return $? +} + +# Function to wait for Garage to be ready +wait_for_garage() { + echo "âŗ Waiting for Garage to be ready..." + local max_attempts=30 + local attempt=0 + while [ $attempt -lt $max_attempts ]; do + if is_garage_ready; then + echo "✅ Garage is ready!" + return 0 + fi + attempt=$((attempt + 1)) + echo " Waiting... (attempt $attempt/$max_attempts)" + sleep 2 + done + echo "❌ Garage failed to become ready" + return 1 +} + +# Function to run setup +run_setup() { + echo "🔧 Running initial setup..." + + # Get node ID + NODE_ID=$(/garage node id | head -n1) + echo " Node ID: $NODE_ID" + + # Apply layout + /garage layout assign --version 1 "$NODE_ID" + /garage layout apply --version 1 + echo " ✅ Layout applied" + sleep 3 + + # Create bucket + if ! /garage bucket info "$BUCKET_NAME" 2>/dev/null; then + /garage bucket create "$BUCKET_NAME" + echo " ✅ Bucket created: $BUCKET_NAME" + else + echo " â„šī¸ Bucket already exists" + fi + + # Handle key + if [ -n "$AWS_ACCESS_KEY_ID" ] && [ -n "$AWS_SECRET_ACCESS_KEY" ]; then + # Import existing key + if ! /garage key info "$AWS_ACCESS_KEY_ID" 2>/dev/null; then + /garage key import "$AWS_ACCESS_KEY_ID" "$AWS_SECRET_ACCESS_KEY" "app-key" + echo " ✅ Key imported: $AWS_ACCESS_KEY_ID" + else + echo " â„šī¸ Key already exists: $AWS_ACCESS_KEY_ID" + fi + ACCESS_KEY="$AWS_ACCESS_KEY_ID" + SECRET_KEY="$AWS_SECRET_ACCESS_KEY" + else + # Generate new key + KEY_OUTPUT=$(/garage key create --name "app-key") + echo "$KEY_OUTPUT" + ACCESS_KEY=$(echo "$KEY_OUTPUT" | grep 'Key ID:' | awk '{print $3}') + SECRET_KEY=$(echo "$KEY_OUTPUT" | grep 'Secret key:' | awk '{print $3}') + echo " ✅ Key generated: $ACCESS_KEY" + fi + + # Grant permissions + /garage bucket allow --read --write --owner "$BUCKET_NAME" --key "$ACCESS_KEY" + echo " ✅ Permissions granted" + + # Write credentials to shared volume + mkdir -p "$(dirname "$CREDENTIALS_FILE")" + cat > "$CREDENTIALS_FILE" << EOF +GARAGE_ACCESS_KEY_ID=$ACCESS_KEY +GARAGE_SECRET_ACCESS_KEY=$SECRET_KEY +GARAGE_BUCKET_NAME=$BUCKET_NAME +GARAGE_ENDPOINT=http://maze:3900 +EOF + echo " ✅ Credentials saved to $CREDENTIALS_FILE" + + # Mark setup as done + touch "$SETUP_MARKER" + echo "🎉 Setup complete!" +} + +# Main execution + +# Check if we need to run setup +if [ ! -f "$SETUP_MARKER" ]; then + echo "đŸ“Ļ First run detected. Starting Garage for setup..." + + # Start Garage in background + /garage "$@" & + GARAGE_PID=$! + + # Wait for it to be ready + if wait_for_garage; then + # Run the setup + run_setup + else + echo "❌ Setup failed - Garage didn't become ready" + kill "$GARAGE_PID" 2>/dev/null + exit 1 + fi + + # Kill the background Garage + echo "âšī¸ Stopping background Garage..." + kill "$GARAGE_PID" + wait "$GARAGE_PID" 2>/dev/null || true + echo "🔄 Restarting Garage in foreground..." +else + echo "â„šī¸ Setup already completed. Starting Garage..." +fi + +# Start Garage in foreground +exec /garage "$@" -- 2.47.3 From e2a5e02aada4bc972fccfe9ddfeb24b364af4e05 Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 24 Jul 2026 19:12:19 -0400 Subject: [PATCH 12/91] Trying --- docker-compose.yaml | 12 +-- garage/Dockerfile | 29 +++---- garage/entrypoint.sh | 201 +++++++++++++++++++------------------------ 3 files changed, 109 insertions(+), 133 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index a91c80a..9960eaf 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -60,7 +60,9 @@ services: - soaricarus-network # --- storage service --- maze: - image: dxflrs/garage:v2.3.0 + build: + context: ./garage + dockerfile: Dockerfile container_name: maze restart: unless-stopped ports: @@ -81,13 +83,13 @@ services: - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} - GARAGE_RPC_SECRET=${GARAGE_RPC_SECRET} - BUCKET_NAME=${S3_BUCKET_NAME} - entrypoint: ["/entrypoint.sh"] - command: [] + # entrypoint: ["/entrypoint.sh"] + # command: [] healthcheck: - # test: ["CMD-SHELL", "curl -f http://localhost:3901/v0/status || exit 1"] + test: ["CMD-SHELL", "curl -f http://localhost:3901/v0/status || exit 1"] # test: ["CMD-SHELL", "echo 'What is to be done?'"] # test: ["CMD-SHELL", "nc -z localhost 3900 || exit 1"] - test: ["CMD-SHELL", "/garage status | grep -q 'Health: ok' || exit 1"] + # test: ["CMD-SHELL", "/garage status | grep -q 'Health: ok' || exit 1"] interval: 10s timeout: 5s retries: 5 diff --git a/garage/Dockerfile b/garage/Dockerfile index a0a6e15..5f4acaa 100644 --- a/garage/Dockerfile +++ b/garage/Dockerfile @@ -1,21 +1,18 @@ -# FROM dxflrs/garage:v2.3.0 -# Stage 1: Extract the garage binary from the official image -FROM dxflrs/garage:v2.3.0 as garage-base - -# Stage 2: Create a new image with a shell +# Use a base image with a shell (Alpine) FROM alpine:latest -# Install necessary tools (curl, busybox for sh, etc.) -# The Garage image is based on Alpine, so we use apk -RUN apk add --no-cache curl busybox +# Install necessary tools +RUN apk add --no-cache curl -# Copy the garage binary from the official image -COPY --from=garage-base /garage /usr/local/bin/garage +# Copy the Garage binary from the official image +COPY --from=dxflrs/garage:v2.3.0 /garage /usr/local/bin/garage -# Copy the init script -COPY init-garage.sh /init-garage.sh -RUN chmod +x /init-garage.sh +# Copy the entrypoint script +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh -# Use the init script as the entrypoint -# It will run setup, then exec garage -ENTRYPOINT ["/init-garage.sh"] +# Set the entrypoint +ENTRYPOINT ["/entrypoint.sh"] + +# Pass through any arguments to Garage +CMD [] diff --git a/garage/entrypoint.sh b/garage/entrypoint.sh index a614ab2..5273235 100755 --- a/garage/entrypoint.sh +++ b/garage/entrypoint.sh @@ -1,126 +1,103 @@ -#!/garage -# This script runs as a garage command -# It will check if setup is needed and run initialization +#!/bin/sh +set -e -# Check if we should run setup (first run) -SETUP_MARKER="/var/lib/garage/.setup_done" BUCKET_NAME="${BUCKET_NAME:-soaricarus-storage}" CREDENTIALS_FILE="/shared/garage-credentials.env" +SETUP_DONE="/shared/setup.done" +GARAGE_BIN="/usr/local/bin/garage" -# Function to check if Garage API is ready -is_garage_ready() { - # Try to get status, if it works, Garage is ready - /garage status 2>/dev/null | grep -q "Health: ok" - return $? -} - -# Function to wait for Garage to be ready -wait_for_garage() { - echo "âŗ Waiting for Garage to be ready..." - local max_attempts=30 - local attempt=0 - while [ $attempt -lt $max_attempts ]; do - if is_garage_ready; then - echo "✅ Garage is ready!" - return 0 - fi - attempt=$((attempt + 1)) - echo " Waiting... (attempt $attempt/$max_attempts)" - sleep 2 - done - echo "❌ Garage failed to become ready" - return 1 -} - -# Function to run setup -run_setup() { - echo "🔧 Running initial setup..." - - # Get node ID - NODE_ID=$(/garage node id | head -n1) - echo " Node ID: $NODE_ID" - - # Apply layout - /garage layout assign --version 1 "$NODE_ID" - /garage layout apply --version 1 - echo " ✅ Layout applied" - sleep 3 - - # Create bucket - if ! /garage bucket info "$BUCKET_NAME" 2>/dev/null; then - /garage bucket create "$BUCKET_NAME" - echo " ✅ Bucket created: $BUCKET_NAME" - else - echo " â„šī¸ Bucket already exists" - fi - - # Handle key - if [ -n "$AWS_ACCESS_KEY_ID" ] && [ -n "$AWS_SECRET_ACCESS_KEY" ]; then - # Import existing key - if ! /garage key info "$AWS_ACCESS_KEY_ID" 2>/dev/null; then - /garage key import "$AWS_ACCESS_KEY_ID" "$AWS_SECRET_ACCESS_KEY" "app-key" - echo " ✅ Key imported: $AWS_ACCESS_KEY_ID" - else - echo " â„šī¸ Key already exists: $AWS_ACCESS_KEY_ID" - fi - ACCESS_KEY="$AWS_ACCESS_KEY_ID" - SECRET_KEY="$AWS_SECRET_ACCESS_KEY" - else - # Generate new key - KEY_OUTPUT=$(/garage key create --name "app-key") - echo "$KEY_OUTPUT" - ACCESS_KEY=$(echo "$KEY_OUTPUT" | grep 'Key ID:' | awk '{print $3}') - SECRET_KEY=$(echo "$KEY_OUTPUT" | grep 'Secret key:' | awk '{print $3}') - echo " ✅ Key generated: $ACCESS_KEY" - fi - - # Grant permissions - /garage bucket allow --read --write --owner "$BUCKET_NAME" --key "$ACCESS_KEY" - echo " ✅ Permissions granted" - - # Write credentials to shared volume +# Function to write credentials +write_credentials() { + local access_key="$1" + local secret_key="$2" mkdir -p "$(dirname "$CREDENTIALS_FILE")" cat > "$CREDENTIALS_FILE" << EOF -GARAGE_ACCESS_KEY_ID=$ACCESS_KEY -GARAGE_SECRET_ACCESS_KEY=$SECRET_KEY +GARAGE_ACCESS_KEY_ID=$access_key +GARAGE_SECRET_ACCESS_KEY=$secret_key GARAGE_BUCKET_NAME=$BUCKET_NAME -GARAGE_ENDPOINT=http://maze:3900 +GARAGE_ENDPOINT=http://localhost:3900 EOF - echo " ✅ Credentials saved to $CREDENTIALS_FILE" - - # Mark setup as done - touch "$SETUP_MARKER" - echo "🎉 Setup complete!" + touch "$SETUP_DONE" + echo "✅ Credentials saved to $CREDENTIALS_FILE" } -# Main execution - -# Check if we need to run setup -if [ ! -f "$SETUP_MARKER" ]; then - echo "đŸ“Ļ First run detected. Starting Garage for setup..." - - # Start Garage in background - /garage "$@" & - GARAGE_PID=$! - - # Wait for it to be ready - if wait_for_garage; then - # Run the setup - run_setup - else - echo "❌ Setup failed - Garage didn't become ready" - kill "$GARAGE_PID" 2>/dev/null - exit 1 - fi - - # Kill the background Garage - echo "âšī¸ Stopping background Garage..." - kill "$GARAGE_PID" - wait "$GARAGE_PID" 2>/dev/null || true - echo "🔄 Restarting Garage in foreground..." -else +# Check if setup already completed +if [ -f "$SETUP_DONE" ]; then echo "â„šī¸ Setup already completed. Starting Garage..." + exec $GARAGE_BIN "$@" fi +echo "🔧 First-time setup - initializing Garage..." + +# Start Garage in background for setup (just the binary, no daemon subcommand) +echo "âŗ Starting Garage in background..." +$GARAGE_BIN "$@" & +GARAGE_PID=$! + +# Wait for Garage to be ready +echo "âŗ Waiting for Garage API..." +until curl -s -f "http://localhost:3901/v0/status" > /dev/null 2>&1; do + echo " Not ready yet, sleeping 2s..." + sleep 2 +done +echo "✅ Garage API is responding!" + +# Apply cluster layout +if ! $GARAGE_BIN layout show 2>/dev/null | grep -q "Current cluster layout"; then + echo "đŸ“Ļ Applying cluster layout..." + NODE_ID=$($GARAGE_BIN node id | head -n1) + $GARAGE_BIN layout assign --version 1 "$NODE_ID" + $GARAGE_BIN layout apply --version 1 + echo " ✅ Layout applied" + sleep 2 +else + echo "â„šī¸ Layout already applied" +fi + +# Create bucket +if ! $GARAGE_BIN bucket info "$BUCKET_NAME" 2>/dev/null; then + echo "đŸ“Ļ Creating bucket: $BUCKET_NAME" + $GARAGE_BIN bucket create "$BUCKET_NAME" +else + echo "â„šī¸ Bucket $BUCKET_NAME already exists" +fi + +# Handle key +if [ -n "$AWS_ACCESS_KEY_ID" ] && [ -n "$AWS_SECRET_ACCESS_KEY" ]; then + echo "🔑 Using pre-defined credentials from .env" + if ! $GARAGE_BIN key info "$AWS_ACCESS_KEY_ID" 2>/dev/null; then + $GARAGE_BIN key import "$AWS_ACCESS_KEY_ID" "$AWS_SECRET_ACCESS_KEY" "app-key" + echo " ✅ Key imported: $AWS_ACCESS_KEY_ID" + else + echo " â„šī¸ Key already exists: $AWS_ACCESS_KEY_ID" + fi + ACCESS_KEY="$AWS_ACCESS_KEY_ID" + SECRET_KEY="$AWS_SECRET_ACCESS_KEY" +else + echo "🔑 Generating new key..." + KEY_OUTPUT=$($GARAGE_BIN key create --name "app-key") + echo "$KEY_OUTPUT" + ACCESS_KEY=$(echo "$KEY_OUTPUT" | grep 'Key ID:' | awk '{print $3}') + SECRET_KEY=$(echo "$KEY_OUTPUT" | grep 'Secret key:' | awk '{print $3}') + echo " ✅ Key generated: $ACCESS_KEY" +fi + +# Grant permissions +$GARAGE_BIN bucket allow --read --write --owner "$BUCKET_NAME" --key "$ACCESS_KEY" +echo " ✅ Permissions granted" + +# Save credentials +write_credentials "$ACCESS_KEY" "$SECRET_KEY" + +echo "🎉 Setup complete!" +echo " Bucket: $BUCKET_NAME" +echo " Access Key: $ACCESS_KEY" + +# Stop background Garage +echo "âšī¸ Stopping background Garage..." +kill "$GARAGE_PID" +wait "$GARAGE_PID" 2>/dev/null || true + # Start Garage in foreground -exec /garage "$@" +echo "🚀 Starting Garage in foreground..." +exec $GARAGE_BIN "$@" -- 2.47.3 From f07e0108cd212e1722a8f2dc8a9ebacc2f16f497 Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 28 Jul 2026 13:08:33 -0400 Subject: [PATCH 13/91] Getting closer --- docker-compose.yaml | 32 +++++++-------- garage/entrypoint.sh | 98 ++++++++++++++++++++++++++++++-------------- 2 files changed, 83 insertions(+), 47 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 9960eaf..51105b1 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -42,22 +42,22 @@ services: # - ./path/to/your/web-api-repo:/app # --- songparser service --- - songparser: - build: - context: ../songparser - ssh: ["default"] - dockerfile: Dockerfile - container_name: songparser - restart: unless-stopped - env_file: - - ../songparser/.env - depends_on: - - api - - main_db - - auth_api - - auth_db - networks: - - soaricarus-network +# songparser: +# build: +# context: ../songparser +# ssh: ["default"] +# dockerfile: Dockerfile +# container_name: songparser +# restart: unless-stopped +# env_file: +# - ../songparser/.env +# depends_on: +# - api +# - main_db +# - auth_api +# - auth_db +# networks: +# - soaricarus-network # --- storage service --- maze: build: diff --git a/garage/entrypoint.sh b/garage/entrypoint.sh index 5273235..5b68c9e 100755 --- a/garage/entrypoint.sh +++ b/garage/entrypoint.sh @@ -21,66 +21,101 @@ EOF echo "✅ Credentials saved to $CREDENTIALS_FILE" } +echo "Sleeping for a bit" +sleep 5 +GARAGE_COMMAND_EXEC="$GARAGE_BIN -c /etc/garage.toml server" + # Check if setup already completed if [ -f "$SETUP_DONE" ]; then echo "â„šī¸ Setup already completed. Starting Garage..." - exec $GARAGE_BIN "$@" + exec $GARAGE_COMMANDS_EXEC fi echo "🔧 First-time setup - initializing Garage..." # Start Garage in background for setup (just the binary, no daemon subcommand) echo "âŗ Starting Garage in background..." -$GARAGE_BIN "$@" & -GARAGE_PID=$! +echo "GARAGE_BIN: $GARAGE_COMMAND_EXEC" +# $GARAGE_BIN "$@" & +# GARAGE_PID=$! +# $GARAGE_BIN -c /etc/garage.toml & GARAGE_PID=$! +$GARAGE_COMMAND_EXEC & GARAGE_PID=$! -# Wait for Garage to be ready -echo "âŗ Waiting for Garage API..." -until curl -s -f "http://localhost:3901/v0/status" > /dev/null 2>&1; do - echo " Not ready yet, sleeping 2s..." - sleep 2 -done -echo "✅ Garage API is responding!" +echo "GARAGE_PID: $GARAGE_PID" + +# echo "Command: $GARAGE_BIN $@" # Apply cluster layout if ! $GARAGE_BIN layout show 2>/dev/null | grep -q "Current cluster layout"; then echo "đŸ“Ļ Applying cluster layout..." NODE_ID=$($GARAGE_BIN node id | head -n1) - $GARAGE_BIN layout assign --version 1 "$NODE_ID" + echo "Node ID: $NODE_ID" + sleep 5 + + echo "Assigning layout" + # $GARAGE_BIN layout assign --version 1 -z ny1 -c 4G $NODE_ID + $GARAGE_BIN layout assign -z ny1 -c 4G $NODE_ID + # $GARAGE_BIN status + sleep 5 + # $GARAGE_BIN status + echo "Show layout" + $GARAGE_BIN layout show + sleep 5 + echo "Applying layout" $GARAGE_BIN layout apply --version 1 echo " ✅ Layout applied" - sleep 2 + sleep 10 else echo "â„šī¸ Layout already applied" fi + # Create bucket +echo "Bucket: $BUCKET_NAME" if ! $GARAGE_BIN bucket info "$BUCKET_NAME" 2>/dev/null; then echo "đŸ“Ļ Creating bucket: $BUCKET_NAME" $GARAGE_BIN bucket create "$BUCKET_NAME" + sleep 10 else echo "â„šī¸ Bucket $BUCKET_NAME already exists" fi + # Handle key -if [ -n "$AWS_ACCESS_KEY_ID" ] && [ -n "$AWS_SECRET_ACCESS_KEY" ]; then - echo "🔑 Using pre-defined credentials from .env" - if ! $GARAGE_BIN key info "$AWS_ACCESS_KEY_ID" 2>/dev/null; then - $GARAGE_BIN key import "$AWS_ACCESS_KEY_ID" "$AWS_SECRET_ACCESS_KEY" "app-key" - echo " ✅ Key imported: $AWS_ACCESS_KEY_ID" - else - echo " â„šī¸ Key already exists: $AWS_ACCESS_KEY_ID" - fi - ACCESS_KEY="$AWS_ACCESS_KEY_ID" - SECRET_KEY="$AWS_SECRET_ACCESS_KEY" -else - echo "🔑 Generating new key..." - KEY_OUTPUT=$($GARAGE_BIN key create --name "app-key") - echo "$KEY_OUTPUT" - ACCESS_KEY=$(echo "$KEY_OUTPUT" | grep 'Key ID:' | awk '{print $3}') - SECRET_KEY=$(echo "$KEY_OUTPUT" | grep 'Secret key:' | awk '{print $3}') - echo " ✅ Key generated: $ACCESS_KEY" -fi +#if [ -n "$AWS_ACCESS_KEY_ID" ] && [ -n "$AWS_SECRET_ACCESS_KEY" ]; then +# echo "🔑 Using pre-defined credentials from .env" +# if ! $GARAGE_BIN key info "$AWS_ACCESS_KEY_ID" 2>/dev/null; then +# $GARAGE_BIN key import "$AWS_ACCESS_KEY_ID" "$AWS_SECRET_ACCESS_KEY" "app-key" +# echo " ✅ Key imported: $AWS_ACCESS_KEY_ID" +# else +# echo " â„šī¸ Key already exists: $AWS_ACCESS_KEY_ID" +# fi +# ACCESS_KEY="$AWS_ACCESS_KEY_ID" +# SECRET_KEY="$AWS_SECRET_ACCESS_KEY" +#else +# echo "🔑 Generating new key..." +# KEY_OUTPUT=$($GARAGE_BIN key create --name "app-key") +# echo "$KEY_OUTPUT" +# ACCESS_KEY=$(echo "$KEY_OUTPUT" | grep 'Key ID:' | awk '{print $3}') +# SECRET_KEY=$(echo "$KEY_OUTPUT" | grep 'Secret key:' | awk '{print $3}') +# echo " ✅ Key generated: $ACCESS_KEY" +#fi + +sleep 15 +echo "🔑 Generating new key..." +KEY_OUTPUT=$($GARAGE_BIN key create --name "app-key") +echo "$KEY_OUTPUT" +ACCESS_KEY=$(echo "$KEY_OUTPUT" | grep 'Key ID:' | awk '{print $3}') +SECRET_KEY=$(echo "$KEY_OUTPUT" | grep 'Secret key:' | awk '{print $3}') +echo " ✅ Key generated: $ACCESS_KEY" + +# Wait for Garage to be ready +echo "âŗ Waiting for Garage API..." +until curl -s -f "http://localhost:3900/v0/status" > /dev/null 2>&1; do + echo " Not ready yet, sleeping 2s..." + sleep 2 +done +echo "✅ Garage API is responding!" # Grant permissions $GARAGE_BIN bucket allow --read --write --owner "$BUCKET_NAME" --key "$ACCESS_KEY" @@ -100,4 +135,5 @@ wait "$GARAGE_PID" 2>/dev/null || true # Start Garage in foreground echo "🚀 Starting Garage in foreground..." -exec $GARAGE_BIN "$@" +# exec $GARAGE_BIN "$@" +exec $GARAGE_COMMANDS_EXEC -- 2.47.3 From 10cec1d7c7ed431602fcb154a7d414b0e464578c Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 30 Jul 2026 13:23:17 -0400 Subject: [PATCH 14/91] Getting closer --- garage/entrypoint.sh | 47 +++++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/garage/entrypoint.sh b/garage/entrypoint.sh index 5b68c9e..1536560 100755 --- a/garage/entrypoint.sh +++ b/garage/entrypoint.sh @@ -21,14 +21,23 @@ EOF echo "✅ Credentials saved to $CREDENTIALS_FILE" } +sleep 20 +echo "Garage secret" +echo "$GARAGE_RPC_SECRET" +echo "Should be printed" +sleep 20 + echo "Sleeping for a bit" sleep 5 +echo "Starting garage" GARAGE_COMMAND_EXEC="$GARAGE_BIN -c /etc/garage.toml server" # Check if setup already completed if [ -f "$SETUP_DONE" ]; then echo "â„šī¸ Setup already completed. Starting Garage..." + sleep 5 exec $GARAGE_COMMANDS_EXEC + exit fi echo "🔧 First-time setup - initializing Garage..." @@ -44,11 +53,21 @@ $GARAGE_COMMAND_EXEC & GARAGE_PID=$! echo "GARAGE_PID: $GARAGE_PID" # echo "Command: $GARAGE_BIN $@" +sleep 20 +echo "Garage secret" +echo "$GARAGE_RPC_SECRET" +echo "Should be printed" +sleep 20 # Apply cluster layout if ! $GARAGE_BIN layout show 2>/dev/null | grep -q "Current cluster layout"; then echo "đŸ“Ļ Applying cluster layout..." NODE_ID=$($GARAGE_BIN node id | head -n1) + if [ -z "$NODE_ID" ]; then + echo "$NODE_ID is empty" + sleep 5 + exit + fi echo "Node ID: $NODE_ID" sleep 5 @@ -56,13 +75,14 @@ if ! $GARAGE_BIN layout show 2>/dev/null | grep -q "Current cluster layout"; the # $GARAGE_BIN layout assign --version 1 -z ny1 -c 4G $NODE_ID $GARAGE_BIN layout assign -z ny1 -c 4G $NODE_ID # $GARAGE_BIN status - sleep 5 + # sleep 5 # $GARAGE_BIN status - echo "Show layout" - $GARAGE_BIN layout show - sleep 5 + # echo "Show layout" + # $GARAGE_BIN layout show + sleep 10 echo "Applying layout" $GARAGE_BIN layout apply --version 1 + # $GARAGE_BIN layout apply echo " ✅ Layout applied" sleep 10 else @@ -101,29 +121,32 @@ fi # echo " ✅ Key generated: $ACCESS_KEY" #fi -sleep 15 echo "🔑 Generating new key..." -KEY_OUTPUT=$($GARAGE_BIN key create --name "app-key") +KEY_OUTPUT=$($GARAGE_BIN key create "app-key") echo "$KEY_OUTPUT" ACCESS_KEY=$(echo "$KEY_OUTPUT" | grep 'Key ID:' | awk '{print $3}') SECRET_KEY=$(echo "$KEY_OUTPUT" | grep 'Secret key:' | awk '{print $3}') echo " ✅ Key generated: $ACCESS_KEY" +sleep 5 # Wait for Garage to be ready -echo "âŗ Waiting for Garage API..." -until curl -s -f "http://localhost:3900/v0/status" > /dev/null 2>&1; do - echo " Not ready yet, sleeping 2s..." - sleep 2 -done -echo "✅ Garage API is responding!" +# echo "âŗ Waiting for Garage API..." +# until curl -s -f "http://localhost:3900/v0/status" > /dev/null 2>&1; do +# echo " Not ready yet, sleeping 2s..." +# sleep 2 +# done +# echo "✅ Garage API is responding!" # Grant permissions $GARAGE_BIN bucket allow --read --write --owner "$BUCKET_NAME" --key "$ACCESS_KEY" echo " ✅ Permissions granted" +sleep 10 # Save credentials write_credentials "$ACCESS_KEY" "$SECRET_KEY" +sleep 10 + echo "🎉 Setup complete!" echo " Bucket: $BUCKET_NAME" echo " Access Key: $ACCESS_KEY" -- 2.47.3 From 140b9dba454dde9e1f40dfb8d7656fad77357432 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 30 Jul 2026 16:59:58 -0400 Subject: [PATCH 15/91] Saving script change --- garage/entrypoint.sh | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/garage/entrypoint.sh b/garage/entrypoint.sh index 1536560..53161d9 100755 --- a/garage/entrypoint.sh +++ b/garage/entrypoint.sh @@ -21,17 +21,13 @@ EOF echo "✅ Credentials saved to $CREDENTIALS_FILE" } -sleep 20 -echo "Garage secret" -echo "$GARAGE_RPC_SECRET" -echo "Should be printed" sleep 20 -echo "Sleeping for a bit" -sleep 5 echo "Starting garage" GARAGE_COMMAND_EXEC="$GARAGE_BIN -c /etc/garage.toml server" +sleep 10 + # Check if setup already completed if [ -f "$SETUP_DONE" ]; then echo "â„šī¸ Setup already completed. Starting Garage..." @@ -44,23 +40,21 @@ echo "🔧 First-time setup - initializing Garage..." # Start Garage in background for setup (just the binary, no daemon subcommand) echo "âŗ Starting Garage in background..." -echo "GARAGE_BIN: $GARAGE_COMMAND_EXEC" +echo "GARAGE_COMMAND_EXEC: $GARAGE_COMMAND_EXEC" # $GARAGE_BIN "$@" & # GARAGE_PID=$! # $GARAGE_BIN -c /etc/garage.toml & GARAGE_PID=$! $GARAGE_COMMAND_EXEC & GARAGE_PID=$! +sleep 10 +sleep 10 echo "GARAGE_PID: $GARAGE_PID" # echo "Command: $GARAGE_BIN $@" -sleep 20 -echo "Garage secret" -echo "$GARAGE_RPC_SECRET" -echo "Should be printed" -sleep 20 # Apply cluster layout if ! $GARAGE_BIN layout show 2>/dev/null | grep -q "Current cluster layout"; then + sleep 5 echo "đŸ“Ļ Applying cluster layout..." NODE_ID=$($GARAGE_BIN node id | head -n1) if [ -z "$NODE_ID" ]; then @@ -69,11 +63,11 @@ if ! $GARAGE_BIN layout show 2>/dev/null | grep -q "Current cluster layout"; the exit fi echo "Node ID: $NODE_ID" - sleep 5 + sleep 10 echo "Assigning layout" # $GARAGE_BIN layout assign --version 1 -z ny1 -c 4G $NODE_ID - $GARAGE_BIN layout assign -z ny1 -c 4G $NODE_ID + $GARAGE_BIN --rpc-secret "$GARAGE_RPC_SECRET" layout assign -z ny1 -c 4G $NODE_ID # $GARAGE_BIN status # sleep 5 # $GARAGE_BIN status @@ -84,16 +78,18 @@ if ! $GARAGE_BIN layout show 2>/dev/null | grep -q "Current cluster layout"; the $GARAGE_BIN layout apply --version 1 # $GARAGE_BIN layout apply echo " ✅ Layout applied" - sleep 10 else echo "â„šī¸ Layout already applied" fi +sleep 10 + # Create bucket echo "Bucket: $BUCKET_NAME" if ! $GARAGE_BIN bucket info "$BUCKET_NAME" 2>/dev/null; then echo "đŸ“Ļ Creating bucket: $BUCKET_NAME" + sleep 5 $GARAGE_BIN bucket create "$BUCKET_NAME" sleep 10 else @@ -124,6 +120,8 @@ fi echo "🔑 Generating new key..." KEY_OUTPUT=$($GARAGE_BIN key create "app-key") echo "$KEY_OUTPUT" +sleep 15 + ACCESS_KEY=$(echo "$KEY_OUTPUT" | grep 'Key ID:' | awk '{print $3}') SECRET_KEY=$(echo "$KEY_OUTPUT" | grep 'Secret key:' | awk '{print $3}') echo " ✅ Key generated: $ACCESS_KEY" @@ -159,4 +157,5 @@ wait "$GARAGE_PID" 2>/dev/null || true # Start Garage in foreground echo "🚀 Starting Garage in foreground..." # exec $GARAGE_BIN "$@" +sleep 20 exec $GARAGE_COMMANDS_EXEC -- 2.47.3 From b583ff8ef1532f109e4e270dd31d2e6993b6215f Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 4 Aug 2026 11:08:30 -0400 Subject: [PATCH 16/91] Saving files --- docker-compose.yaml | 46 ++++++++++++++++++++++++++++++++------- garage.toml | 1 - garage/init/Dockerfile | 19 ++++++++++++++++ garage/init/entrypoint.sh | 0 garage/storage/Dockerfile | 19 ++++++++++++++++ garage/storage/run.sh | 41 ++++++++++++++++++++++++++++++++++ 6 files changed, 117 insertions(+), 9 deletions(-) create mode 100644 garage/init/Dockerfile create mode 100755 garage/init/entrypoint.sh create mode 100644 garage/storage/Dockerfile create mode 100755 garage/storage/run.sh diff --git a/docker-compose.yaml b/docker-compose.yaml index 51105b1..07b0e12 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -58,10 +58,11 @@ services: # - auth_db # networks: # - soaricarus-network + # --- storage service --- maze: build: - context: ./garage + context: ./garage/storage dockerfile: Dockerfile container_name: maze restart: unless-stopped @@ -72,7 +73,8 @@ services: - "3903:3903" # Admin API volumes: - ./garage.toml:/etc/garage.toml:ro - - ./garage/entrypoint.sh:/entrypoint.sh:ro + # - ./garage/entrypoint.sh:/entrypoint.sh:ro + - ./garage/storage/run.sh:/run.sh:ro - shared_credentials:/shared - object_data:/var/lib/garage # - ./scripts:/scripts:ro # ← ADD THIS - mount the scripts directory @@ -85,18 +87,46 @@ services: - BUCKET_NAME=${S3_BUCKET_NAME} # entrypoint: ["/entrypoint.sh"] # command: [] - healthcheck: - test: ["CMD-SHELL", "curl -f http://localhost:3901/v0/status || exit 1"] + # healthcheck: + # test: ["CMD-SHELL", "curl -f http://localhost:3901/v0/status || exit 1"] # test: ["CMD-SHELL", "echo 'What is to be done?'"] # test: ["CMD-SHELL", "nc -z localhost 3900 || exit 1"] # test: ["CMD-SHELL", "/garage status | grep -q 'Health: ok' || exit 1"] - interval: 10s - timeout: 5s - retries: 5 - start_period: 30s + # interval: 10s + # timeout: 5s + # retries: 5 + # start_period: 30s networks: - soaricarus-network + maze-init: + # image: dxflrs/garage:v2.3.0 + # image: docker:dind + build: + context: ./garage/init + dockerfile: Dockerfile + container_name: maze-init + depends_on: + maze: + condition: service_started + volumes: + - /var/run/docker.sock:/var/run/docker.sock # Mount Docker socket + - shared_credentials:/shared + - object_data:/var/lib/garage + - ./garage/init/entrypoint.sh:/entrypoint.sh:ro + # - ./scripts:/scripts:ro # ← ADD THIS - mount the scripts directory + environment: + - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} + - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} + - GARAGE_RPC_SECRET=${GARAGE_RPC_SECRET} + - BUCKET_NAME=${S3_BUCKET_NAME} + env_file: + - .env + # entrypoint: ["/bin/sh"] + # command: ["/scripts/init-garage.sh"] + restart: "no" # Run once and exit + networks: + - soaricarus-network # PostgreSQL Database Service main_db: diff --git a/garage.toml b/garage.toml index 6c3d0ba..b79b590 100644 --- a/garage.toml +++ b/garage.toml @@ -4,7 +4,6 @@ db_engine = "sqlite" replication_factor = 1 rpc_bind_addr = "[::]:3901" -rpc_secret = "${GARAGE_RPC_SECRET}" [s3_api] s3_region = "maze" diff --git a/garage/init/Dockerfile b/garage/init/Dockerfile new file mode 100644 index 0000000..9979593 --- /dev/null +++ b/garage/init/Dockerfile @@ -0,0 +1,19 @@ +# Use a base image with a shell (Alpine) +FROM alpine:latest + +# Install necessary tools +RUN apk add --no-cache curl + +# Copy the Garage binary from the official image +COPY --from=dxflrs/garage:v2.3.0 /garage /usr/local/bin/garage + +# Copy the entrypoint script +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +# Set the entrypoint +ENTRYPOINT ["/entrypoint.sh"] + +# Pass through any arguments to Garage +CMD [] + diff --git a/garage/init/entrypoint.sh b/garage/init/entrypoint.sh new file mode 100755 index 0000000..e69de29 diff --git a/garage/storage/Dockerfile b/garage/storage/Dockerfile new file mode 100644 index 0000000..c5efaa6 --- /dev/null +++ b/garage/storage/Dockerfile @@ -0,0 +1,19 @@ +# Use a base image with a shell (Alpine) +FROM alpine:latest + +# Install necessary tools +RUN apk add --no-cache curl + +# Copy the Garage binary from the official image +COPY --from=dxflrs/garage:v2.3.0 /garage /usr/local/bin/garage + +# Copy the entrypoint script +COPY run.sh /run.sh +RUN chmod +x /run.sh + +# Set the run +ENTRYPOINT ["/run.sh"] + +# Pass through any arguments to Garage +CMD [] + diff --git a/garage/storage/run.sh b/garage/storage/run.sh new file mode 100755 index 0000000..a85fd41 --- /dev/null +++ b/garage/storage/run.sh @@ -0,0 +1,41 @@ +#!/bin/sh +set -e + +BUCKET_NAME="${BUCKET_NAME:-soaricarus-storage}" +CREDENTIALS_FILE="/shared/garage-credentials.env" +SETUP_DONE="/shared/setup.done" +GARAGE_BIN="/usr/local/bin/garage" + +# Function to write credentials +write_credentials() { + local access_key="$1" + local secret_key="$2" + mkdir -p "$(dirname "$CREDENTIALS_FILE")" + cat > "$CREDENTIALS_FILE" << EOF +GARAGE_ACCESS_KEY_ID=$access_key +GARAGE_SECRET_ACCESS_KEY=$secret_key +GARAGE_BUCKET_NAME=$BUCKET_NAME +GARAGE_ENDPOINT=http://localhost:3900 +EOF + touch "$SETUP_DONE" + echo "✅ Credentials saved to $CREDENTIALS_FILE" +} + +sleep 5 + +echo "Starting garage" +GARAGE_COMMAND_EXEC="$GARAGE_BIN -c /etc/garage.toml server" + +echo "Running" + + +# Start Garage in background for setup (just the binary, no daemon subcommand) +echo "âŗ Starting Garage in background..." +echo "GARAGE_COMMAND_EXEC: $GARAGE_COMMAND_EXEC" +# $GARAGE_BIN "$@" & +# GARAGE_PID=$! +# $GARAGE_BIN -c /etc/garage.toml & GARAGE_PID=$! +$GARAGE_COMMAND_EXEC & GARAGE_PID=$! + +sleep 10 +echo "GARAGE_PID: $GARAGE_PID" -- 2.47.3 From 639216987815dd968b51e566cfc549bd77744e9d Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 4 Aug 2026 12:34:39 -0400 Subject: [PATCH 17/91] Saving changes. Just going to stick with one docker service for storage --- docker-compose.yaml | 118 +++++++++++++++++++---------------------- garage-init.sh | 17 ++++++ scripts/init-garage.sh | 5 ++ 3 files changed, 78 insertions(+), 62 deletions(-) create mode 100755 garage-init.sh diff --git a/docker-compose.yaml b/docker-compose.yaml index 07b0e12..16afc13 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -60,73 +60,67 @@ services: # - soaricarus-network # --- storage service --- - maze: - build: - context: ./garage/storage - dockerfile: Dockerfile - container_name: maze + garage: + image: dxflrs/garage:v2.3.0 # Use official Garage image + container_name: garage restart: unless-stopped + environment: + # Garage configuration via environment variables + GARAGE_SERVER_BIND_ADDR: "0.0.0.0:3900" + GARAGE_SERVER_BIND_PUBLIC_ADDR: "0.0.0.0:3901" + GARAGE_S3_API_S3_REGION: "garage" + GARAGE_S3_API_BIND_ADDR: "0.0.0.0:3900" + GARAGE_S3_API_PUBLIC_BIND_ADDR: "0.0.0.0:3901" + GARAGE_S3_API_PUBLIC_ADDRS: "http://localhost:3901" + GARAGE_S3_API_ROOT_DOMAIN: "garage.local" + GARAGE_ADMIN_BIND_ADDR: "0.0.0.0:3902" + GARAGE_ADMIN_PUBLIC_BIND_ADDR: "0.0.0.0:3902" + + # Cluster configuration (single node for simplicity) + GARAGE_CLUSTER_REPLICATION_MODE: "none" # Single node + GARAGE_CLUSTER_PEER_REPLICATION_STRATEGY: "ring" + + # Data storage + GARAGE_DATA_DIR: "/data" + GARAGE_METADATA_DIR: "/data/meta" + + # RPC configuration + GARAGE_RPC_PUBLIC_ADDR: "http://garage:3901" + GARAGE_RPC_BIND_ADDR: "0.0.0.0:3901" + GARAGE_RPC_SECRET: "${GARAGE_RPC_SECRET:-changeme12345678901234567890123456789012}" # 32+ chars + + # Web Admin + GARAGE_ADMIN_TOKEN: "${GARAGE_ADMIN_TOKEN:-garage-admin-token}" + + # Logging + GARAGE_LOG_LEVEL: "info" + + GARAGE_S3_BUCKET: "${S3_BUCKET_NAME}:-soaricarus-storage" + + volumes: + # - garage_data:/data # Persist Garage data + - ./garage.toml:/etc/garage.toml:ro # Mount config file + - shared_credentials:/data # Persist Garage data ports: - "3900:3900" # S3 API - - "3901:3901" # RPC for cluster communication - - "3902:3902" # S3 web interface - - "3903:3903" # Admin API - volumes: - - ./garage.toml:/etc/garage.toml:ro - # - ./garage/entrypoint.sh:/entrypoint.sh:ro - - ./garage/storage/run.sh:/run.sh:ro - - shared_credentials:/shared - - object_data:/var/lib/garage - # - ./scripts:/scripts:ro # ← ADD THIS - mount the scripts directory - env_file: - - .env - environment: - - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} - - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} - - GARAGE_RPC_SECRET=${GARAGE_RPC_SECRET} - - BUCKET_NAME=${S3_BUCKET_NAME} - # entrypoint: ["/entrypoint.sh"] - # command: [] - # healthcheck: - # test: ["CMD-SHELL", "curl -f http://localhost:3901/v0/status || exit 1"] - # test: ["CMD-SHELL", "echo 'What is to be done?'"] - # test: ["CMD-SHELL", "nc -z localhost 3900 || exit 1"] - # test: ["CMD-SHELL", "/garage status | grep -q 'Health: ok' || exit 1"] - # interval: 10s - # timeout: 5s - # retries: 5 - # start_period: 30s - networks: - - soaricarus-network - - maze-init: - # image: dxflrs/garage:v2.3.0 - # image: docker:dind - build: - context: ./garage/init - dockerfile: Dockerfile - container_name: maze-init - depends_on: - maze: - condition: service_started - volumes: - - /var/run/docker.sock:/var/run/docker.sock # Mount Docker socket - - shared_credentials:/shared - - object_data:/var/lib/garage - - ./garage/init/entrypoint.sh:/entrypoint.sh:ro - # - ./scripts:/scripts:ro # ← ADD THIS - mount the scripts directory - environment: - - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} - - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} - - GARAGE_RPC_SECRET=${GARAGE_RPC_SECRET} - - BUCKET_NAME=${S3_BUCKET_NAME} - env_file: - - .env - # entrypoint: ["/bin/sh"] - # command: ["/scripts/init-garage.sh"] - restart: "no" # Run once and exit + - "3901:3901" # S3 API public + - "3902:3902" # Admin API + # entrypoint: ["/bin/bash", "-c"] + # command: + # - | + # ls / + # /garage -c /etc/garage.toml server + command: ["/garage", "-c", "/etc/garage.toml", "server"] + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:3900/"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 10s networks: - soaricarus-network + extra_hosts: + - "garage.local:127.0.0.1" # Needed for local domain resolution # PostgreSQL Database Service main_db: diff --git a/garage-init.sh b/garage-init.sh new file mode 100755 index 0000000..d8bd67a --- /dev/null +++ b/garage-init.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Wait for Garage to be ready +echo "Waiting for Garage to be ready..." +until curl -s http://localhost:3902/health; do + sleep 2 +done + +# Set up the bucket +echo "Creating bucket..." +docker exec garage garage bucket create soaricarus-data + +# Set bucket permissions +echo "Setting bucket permissions..." +docker exec garage garage bucket allow soaricarus-data --read --write --owner + +echo "Garage setup complete!" diff --git a/scripts/init-garage.sh b/scripts/init-garage.sh index b6b3792..8999596 100755 --- a/scripts/init-garage.sh +++ b/scripts/init-garage.sh @@ -3,6 +3,11 @@ set -e BUCKET_NAME="soaricarus-storage" +sleep 15 +echo $GARAGE_RPC_SECRET +echo "Yes" +sleep 10 + echo "âŗ Waiting for Garage to be ready..." # until docker exec maze curl -s -f "http://localhost:3901/v0/status" > /dev/null 2>&1; do until docker exec maze nc -z "localhost 3900" > /dev/null 2>&1; do -- 2.47.3 From 45534a9d18342f56d247aa771376b9bf908ac766 Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 4 Aug 2026 17:02:35 -0400 Subject: [PATCH 18/91] Updated sample env --- .env.docker.sample | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.env.docker.sample b/.env.docker.sample index b21b599..0761ba4 100644 --- a/.env.docker.sample +++ b/.env.docker.sample @@ -13,6 +13,11 @@ POSTGRES_MAIN_PORT=5432 DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:${POSTGRES_MAIN_PORT}/${POSTGRES_MAIN_DB} GARAGE_RPC_SECRET=c2bde5c3f9c04116a7563e25ea5ba6fab25319daa2fe8a952ad57d0b8159b590 +GARAGE_METRICS_TOKEN=sD2g4jiYV66KdZWtIuj2amezuryzv81mZNktpMNcmU4= +GARAGE_DEFAULT_ACCESS_KEY=GK8eb91557b9a18dcbdc834c16a25ac6fc +GARAGE_DEFAULT_SECRET_KEY=WhFAtnAtWgYaa0pMfl9jwygalZSwYaVliY3Ndm7nYHo= +GARAGE_DEFAULT_BUCKET=soaricarus-bucket +GARAGE_ADMIN_TOKEN=5yMAjSINa6U04wr4pDbcTYfsXKl3S9ZjKdiPXWYUbNw= GARAGE_METADATA_DIR=/var/lib/garage/meta GARAGE_DATA_DIR=/var/lib/garage/data GARAGE_DB_ENGINE=sqlite @@ -27,3 +32,7 @@ AWS_SECRET_ACCESS_KEY=3o4n7yfo34985yrfcq9238765ry3928475rcy349857ty394578cy AWS_ACCESS_KEY_ID=2q39fnoy59q2347yfdrc327894ryfc0q2834rcyq023897 S3_BUCKET_NAME=soaricarus-storage + +AWS_ENDPOINT=http://garage:3900 +AWS_REGION=garage +GARAGE_BUCKET=soaricarus-data -- 2.47.3 From 82515b4ad7f806e08868b37f3ce845cdaf887d1b Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 4 Aug 2026 17:03:39 -0400 Subject: [PATCH 19/91] Updating garage.toml --- garage.toml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/garage.toml b/garage.toml index b79b590..842a66b 100644 --- a/garage.toml +++ b/garage.toml @@ -1,15 +1,25 @@ metadata_dir = "/var/lib/garage/meta" data_dir = "/var/lib/garage/data" db_engine = "sqlite" + replication_factor = 1 +rpc_public_addr = "127.0.0.1:3901" +rpc_secret = "$(openssl rand -hex 32)" +rpc_secret = "${GARAGE_RPC_SECRET}" rpc_bind_addr = "[::]:3901" [s3_api] s3_region = "maze" api_bind_addr = "[::]:3900" -root_domain = ".localhost" +root_domain = ".s3.maze.localhost" [s3_web] bind_addr = "[::]:3902" -root_domain = ".localhost" +root_domain = ".web.maze.localhost" +index = "index.html" + +[admin] +api_bind_addr = "[::]:3903" +admin_token = "${GARAGE_ADMIN_TOKEN}" +metrics_token = "${GARAGE_METRICS_TOKEN}" -- 2.47.3 From f5be2a44b9c871c0a35b46dc9c595bb06c6b8349 Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 4 Aug 2026 17:36:22 -0400 Subject: [PATCH 20/91] Got it working --- docker-compose.yaml | 9 ++++++--- garage.toml | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 16afc13..8991797 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -68,7 +68,6 @@ services: # Garage configuration via environment variables GARAGE_SERVER_BIND_ADDR: "0.0.0.0:3900" GARAGE_SERVER_BIND_PUBLIC_ADDR: "0.0.0.0:3901" - GARAGE_S3_API_S3_REGION: "garage" GARAGE_S3_API_BIND_ADDR: "0.0.0.0:3900" GARAGE_S3_API_PUBLIC_BIND_ADDR: "0.0.0.0:3901" GARAGE_S3_API_PUBLIC_ADDRS: "http://localhost:3901" @@ -87,7 +86,7 @@ services: # RPC configuration GARAGE_RPC_PUBLIC_ADDR: "http://garage:3901" GARAGE_RPC_BIND_ADDR: "0.0.0.0:3901" - GARAGE_RPC_SECRET: "${GARAGE_RPC_SECRET:-changeme12345678901234567890123456789012}" # 32+ chars + GARAGE_RPC_SECRET: "${GARAGE_RPC_SECRET}" # 32+ chars # Web Admin GARAGE_ADMIN_TOKEN: "${GARAGE_ADMIN_TOKEN:-garage-admin-token}" @@ -96,6 +95,9 @@ services: GARAGE_LOG_LEVEL: "info" GARAGE_S3_BUCKET: "${S3_BUCKET_NAME}:-soaricarus-storage" + GARAGE_DEFAULT_ACCESS_KEY: "${GARAGE_DEFAULT_ACCESS_KEY}" + GARAGE_DEFAULT_SECRET_KEY: "${GARAGE_DEFAULT_SECRET_KEY}" + GARAGE_DEFAULT_BUCKET: "${GARAGE_DEFAULT_BUCKET}" volumes: # - garage_data:/data # Persist Garage data @@ -110,7 +112,8 @@ services: # - | # ls / # /garage -c /etc/garage.toml server - command: ["/garage", "-c", "/etc/garage.toml", "server"] + # command: ["/garage", "-c", "/etc/garage.toml", "server"] + command: ["/garage", "server", "--single-node", "--default-bucket"] healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3900/"] interval: 30s diff --git a/garage.toml b/garage.toml index 842a66b..f722d5b 100644 --- a/garage.toml +++ b/garage.toml @@ -4,7 +4,6 @@ db_engine = "sqlite" replication_factor = 1 rpc_public_addr = "127.0.0.1:3901" -rpc_secret = "$(openssl rand -hex 32)" rpc_secret = "${GARAGE_RPC_SECRET}" rpc_bind_addr = "[::]:3901" -- 2.47.3 From b02cabc01610deb0623d640501dffbe5f4d2fbe4 Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 4 Aug 2026 17:54:28 -0400 Subject: [PATCH 21/91] Updating sample env files --- .env.docker.sample | 17 ++++++----------- .env.local.sample | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/.env.docker.sample b/.env.docker.sample index 0761ba4..6316ec6 100644 --- a/.env.docker.sample +++ b/.env.docker.sample @@ -12,11 +12,13 @@ POSTGRES_MAIN_HOST=main_db POSTGRES_MAIN_PORT=5432 DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:${POSTGRES_MAIN_PORT}/${POSTGRES_MAIN_DB} +S3_BUCKET_NAME=soaricarus-bucket +GARAGE_S3_REGION=maze GARAGE_RPC_SECRET=c2bde5c3f9c04116a7563e25ea5ba6fab25319daa2fe8a952ad57d0b8159b590 GARAGE_METRICS_TOKEN=sD2g4jiYV66KdZWtIuj2amezuryzv81mZNktpMNcmU4= GARAGE_DEFAULT_ACCESS_KEY=GK8eb91557b9a18dcbdc834c16a25ac6fc GARAGE_DEFAULT_SECRET_KEY=WhFAtnAtWgYaa0pMfl9jwygalZSwYaVliY3Ndm7nYHo= -GARAGE_DEFAULT_BUCKET=soaricarus-bucket +GARAGE_DEFAULT_BUCKET=${S3_BUCKET_NAME} GARAGE_ADMIN_TOKEN=5yMAjSINa6U04wr4pDbcTYfsXKl3S9ZjKdiPXWYUbNw= GARAGE_METADATA_DIR=/var/lib/garage/meta GARAGE_DATA_DIR=/var/lib/garage/data @@ -25,14 +27,7 @@ GARAGE_REPLICATION_FACTOR=1 GARAGE_RPC_BIND_ADDR=[::]:3901 GARAGE_S3_API_BIND_ADDR=[::]:3900 GARAGE_S3_WEB_BIND_ADDR=[::]:3902 -GARAGE_S3_REGION=maze GARAGE_ROOT_DOMAIN=.localhost -AWS_DEFAULT_REGION=maze -AWS_SECRET_ACCESS_KEY=3o4n7yfo34985yrfcq9238765ry3928475rcy349857ty394578cy -AWS_ACCESS_KEY_ID=2q39fnoy59q2347yfdrc327894ryfc0q2834rcyq023897 - -S3_BUCKET_NAME=soaricarus-storage - -AWS_ENDPOINT=http://garage:3900 -AWS_REGION=garage -GARAGE_BUCKET=soaricarus-data +AWS_DEFAULT_REGION=${GARAGE_S3_REGION} +AWS_SECRET_ACCESS_KEY=${GARAGE_DEFAULT_ACCESS_KEY} +AWS_ACCESS_KEY_ID=${GARAGE_DEFAULT_SECRET_KEY} diff --git a/.env.local.sample b/.env.local.sample index e69d0fe..6316ec6 100644 --- a/.env.local.sample +++ b/.env.local.sample @@ -11,3 +11,23 @@ POSTGRES_MAIN_DB=soaricarus_db POSTGRES_MAIN_HOST=main_db POSTGRES_MAIN_PORT=5432 DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:${POSTGRES_MAIN_PORT}/${POSTGRES_MAIN_DB} + +S3_BUCKET_NAME=soaricarus-bucket +GARAGE_S3_REGION=maze +GARAGE_RPC_SECRET=c2bde5c3f9c04116a7563e25ea5ba6fab25319daa2fe8a952ad57d0b8159b590 +GARAGE_METRICS_TOKEN=sD2g4jiYV66KdZWtIuj2amezuryzv81mZNktpMNcmU4= +GARAGE_DEFAULT_ACCESS_KEY=GK8eb91557b9a18dcbdc834c16a25ac6fc +GARAGE_DEFAULT_SECRET_KEY=WhFAtnAtWgYaa0pMfl9jwygalZSwYaVliY3Ndm7nYHo= +GARAGE_DEFAULT_BUCKET=${S3_BUCKET_NAME} +GARAGE_ADMIN_TOKEN=5yMAjSINa6U04wr4pDbcTYfsXKl3S9ZjKdiPXWYUbNw= +GARAGE_METADATA_DIR=/var/lib/garage/meta +GARAGE_DATA_DIR=/var/lib/garage/data +GARAGE_DB_ENGINE=sqlite +GARAGE_REPLICATION_FACTOR=1 +GARAGE_RPC_BIND_ADDR=[::]:3901 +GARAGE_S3_API_BIND_ADDR=[::]:3900 +GARAGE_S3_WEB_BIND_ADDR=[::]:3902 +GARAGE_ROOT_DOMAIN=.localhost +AWS_DEFAULT_REGION=${GARAGE_S3_REGION} +AWS_SECRET_ACCESS_KEY=${GARAGE_DEFAULT_ACCESS_KEY} +AWS_ACCESS_KEY_ID=${GARAGE_DEFAULT_SECRET_KEY} -- 2.47.3 From bae1dd41734ddf575bb4af455127f93caac5642b Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 4 Aug 2026 17:54:39 -0400 Subject: [PATCH 22/91] Updating docker file --- docker-compose.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 8991797..7f667a1 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -16,6 +16,10 @@ services: depends_on: main_db: condition: service_healthy + maze: + condition: service_started + auth_api: + condition: service_started networks: - soaricarus-network restart: unless-stopped @@ -56,13 +60,14 @@ services: # - main_db # - auth_api # - auth_db +# - maze # networks: # - soaricarus-network # --- storage service --- - garage: + maze: image: dxflrs/garage:v2.3.0 # Use official Garage image - container_name: garage + container_name: maze restart: unless-stopped environment: # Garage configuration via environment variables @@ -71,7 +76,7 @@ services: GARAGE_S3_API_BIND_ADDR: "0.0.0.0:3900" GARAGE_S3_API_PUBLIC_BIND_ADDR: "0.0.0.0:3901" GARAGE_S3_API_PUBLIC_ADDRS: "http://localhost:3901" - GARAGE_S3_API_ROOT_DOMAIN: "garage.local" + GARAGE_S3_API_ROOT_DOMAIN: "${GARAGE_ROOT_DOMAIN}" GARAGE_ADMIN_BIND_ADDR: "0.0.0.0:3902" GARAGE_ADMIN_PUBLIC_BIND_ADDR: "0.0.0.0:3902" @@ -84,17 +89,18 @@ services: GARAGE_METADATA_DIR: "/data/meta" # RPC configuration - GARAGE_RPC_PUBLIC_ADDR: "http://garage:3901" + GARAGE_RPC_PUBLIC_ADDR: "http://maze:3901" GARAGE_RPC_BIND_ADDR: "0.0.0.0:3901" GARAGE_RPC_SECRET: "${GARAGE_RPC_SECRET}" # 32+ chars # Web Admin - GARAGE_ADMIN_TOKEN: "${GARAGE_ADMIN_TOKEN:-garage-admin-token}" + GARAGE_ADMIN_TOKEN: "${GARAGE_ADMIN_TOKEN}" # Logging GARAGE_LOG_LEVEL: "info" - GARAGE_S3_BUCKET: "${S3_BUCKET_NAME}:-soaricarus-storage" + GARAGE_S3_BUCKET: "${S3_BUCKET_NAME}" + GARAGE_DEFAULT_ACCESS_KEY: "${GARAGE_DEFAULT_ACCESS_KEY}" GARAGE_DEFAULT_SECRET_KEY: "${GARAGE_DEFAULT_SECRET_KEY}" GARAGE_DEFAULT_BUCKET: "${GARAGE_DEFAULT_BUCKET}" -- 2.47.3 From db07f2c39dbfa28e1c78d0dc629cbeaeeb94a91d Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 4 Aug 2026 18:19:27 -0400 Subject: [PATCH 23/91] Updated yml --- docker-compose.yaml | 46 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 7f667a1..863f312 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -6,7 +6,7 @@ services: build: context: . ssh: ["default"] - container_name: soaricarus + container_name: api ports: - "8000:8000" env_file: @@ -46,23 +46,23 @@ services: # - ./path/to/your/web-api-repo:/app # --- songparser service --- -# songparser: -# build: -# context: ../songparser -# ssh: ["default"] -# dockerfile: Dockerfile -# container_name: songparser -# restart: unless-stopped -# env_file: -# - ../songparser/.env -# depends_on: -# - api -# - main_db -# - auth_api -# - auth_db -# - maze -# networks: -# - soaricarus-network + songparser: + build: + context: ../songparser + ssh: ["default"] + dockerfile: Dockerfile + container_name: songparser + restart: unless-stopped + env_file: + - ../songparser/.env + depends_on: + - api + - main_db + - auth_api + - auth_db + - maze + networks: + - soaricarus-network # --- storage service --- maze: @@ -100,25 +100,19 @@ services: GARAGE_LOG_LEVEL: "info" GARAGE_S3_BUCKET: "${S3_BUCKET_NAME}" + GARAGE_S3_REGION: "${GARAGE_S3_REGION}" GARAGE_DEFAULT_ACCESS_KEY: "${GARAGE_DEFAULT_ACCESS_KEY}" GARAGE_DEFAULT_SECRET_KEY: "${GARAGE_DEFAULT_SECRET_KEY}" GARAGE_DEFAULT_BUCKET: "${GARAGE_DEFAULT_BUCKET}" volumes: - # - garage_data:/data # Persist Garage data - ./garage.toml:/etc/garage.toml:ro # Mount config file - shared_credentials:/data # Persist Garage data ports: - "3900:3900" # S3 API - "3901:3901" # S3 API public - "3902:3902" # Admin API - # entrypoint: ["/bin/bash", "-c"] - # command: - # - | - # ls / - # /garage -c /etc/garage.toml server - # command: ["/garage", "-c", "/etc/garage.toml", "server"] command: ["/garage", "server", "--single-node", "--default-bucket"] healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3900/"] @@ -129,7 +123,7 @@ services: networks: - soaricarus-network extra_hosts: - - "garage.local:127.0.0.1" # Needed for local domain resolution + - "garage.local:127.0.0.1" # PostgreSQL Database Service main_db: -- 2.47.3 From efbeaf2f7e34543caaa5ac071ac673c2cba6c2a4 Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 4 Aug 2026 18:19:44 -0400 Subject: [PATCH 24/91] ci: Updated workflow --- .github/workflows/workflow.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4c3c6c3..1bbdcd5 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -65,6 +65,13 @@ jobs: echo "Checking Docker Daemon Status (ps):" docker ps -a echo "Docker environment check complete." + + - name: Setup Garage S3 Server + uses: garage-s3/setup-garage@v1 + with: + garage-version: 'v2.3.0' + bucket: 'soaricarus-ci-bucket' + set-aws-env: 'true' - name: Run tests env: # Define DATABASE_URL for tests to use -- 2.47.3 From e86420f19c25ea257992f1322a5cd90ee50ee7b2 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 5 Aug 2026 17:36:21 -0400 Subject: [PATCH 25/91] ci: Updated yml --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 1bbdcd5..9063be1 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -67,7 +67,7 @@ jobs: echo "Docker environment check complete." - name: Setup Garage S3 Server - uses: garage-s3/setup-garage@v1 + uses: actions/setup-garage@v1 with: garage-version: 'v2.3.0' bucket: 'soaricarus-ci-bucket' -- 2.47.3 From ac1575f2d163df39f3ed7fb1d1c2bf2ed57b9ae0 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 5 Aug 2026 17:38:06 -0400 Subject: [PATCH 26/91] Tweak it --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 9063be1..c282f6a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -67,7 +67,7 @@ jobs: echo "Docker environment check complete." - name: Setup Garage S3 Server - uses: actions/setup-garage@v1 + uses: lowlydba/setup-garage@v1.0.0 with: garage-version: 'v2.3.0' bucket: 'soaricarus-ci-bucket' -- 2.47.3 From 3648c65aa2848847d11adb568b6095755acfe40a Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 5 Aug 2026 17:49:38 -0400 Subject: [PATCH 27/91] Removing unused garage files --- garage-init.sh | 17 ---- garage/Dockerfile | 18 ----- garage/entrypoint.sh | 161 ------------------------------------- garage/full-init-garage.sh | 109 ------------------------- garage/init-garage.sh | 36 --------- garage/init/Dockerfile | 19 ----- garage/init/entrypoint.sh | 0 garage/storage/Dockerfile | 19 ----- garage/storage/run.sh | 41 ---------- 9 files changed, 420 deletions(-) delete mode 100755 garage-init.sh delete mode 100644 garage/Dockerfile delete mode 100755 garage/entrypoint.sh delete mode 100644 garage/full-init-garage.sh delete mode 100755 garage/init-garage.sh delete mode 100644 garage/init/Dockerfile delete mode 100755 garage/init/entrypoint.sh delete mode 100644 garage/storage/Dockerfile delete mode 100755 garage/storage/run.sh diff --git a/garage-init.sh b/garage-init.sh deleted file mode 100755 index d8bd67a..0000000 --- a/garage-init.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# Wait for Garage to be ready -echo "Waiting for Garage to be ready..." -until curl -s http://localhost:3902/health; do - sleep 2 -done - -# Set up the bucket -echo "Creating bucket..." -docker exec garage garage bucket create soaricarus-data - -# Set bucket permissions -echo "Setting bucket permissions..." -docker exec garage garage bucket allow soaricarus-data --read --write --owner - -echo "Garage setup complete!" diff --git a/garage/Dockerfile b/garage/Dockerfile deleted file mode 100644 index 5f4acaa..0000000 --- a/garage/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# Use a base image with a shell (Alpine) -FROM alpine:latest - -# Install necessary tools -RUN apk add --no-cache curl - -# Copy the Garage binary from the official image -COPY --from=dxflrs/garage:v2.3.0 /garage /usr/local/bin/garage - -# Copy the entrypoint script -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -# Set the entrypoint -ENTRYPOINT ["/entrypoint.sh"] - -# Pass through any arguments to Garage -CMD [] diff --git a/garage/entrypoint.sh b/garage/entrypoint.sh deleted file mode 100755 index 53161d9..0000000 --- a/garage/entrypoint.sh +++ /dev/null @@ -1,161 +0,0 @@ -#!/bin/sh -set -e - -BUCKET_NAME="${BUCKET_NAME:-soaricarus-storage}" -CREDENTIALS_FILE="/shared/garage-credentials.env" -SETUP_DONE="/shared/setup.done" -GARAGE_BIN="/usr/local/bin/garage" - -# Function to write credentials -write_credentials() { - local access_key="$1" - local secret_key="$2" - mkdir -p "$(dirname "$CREDENTIALS_FILE")" - cat > "$CREDENTIALS_FILE" << EOF -GARAGE_ACCESS_KEY_ID=$access_key -GARAGE_SECRET_ACCESS_KEY=$secret_key -GARAGE_BUCKET_NAME=$BUCKET_NAME -GARAGE_ENDPOINT=http://localhost:3900 -EOF - touch "$SETUP_DONE" - echo "✅ Credentials saved to $CREDENTIALS_FILE" -} - -sleep 20 - -echo "Starting garage" -GARAGE_COMMAND_EXEC="$GARAGE_BIN -c /etc/garage.toml server" - -sleep 10 - -# Check if setup already completed -if [ -f "$SETUP_DONE" ]; then - echo "â„šī¸ Setup already completed. Starting Garage..." - sleep 5 - exec $GARAGE_COMMANDS_EXEC - exit -fi - -echo "🔧 First-time setup - initializing Garage..." - -# Start Garage in background for setup (just the binary, no daemon subcommand) -echo "âŗ Starting Garage in background..." -echo "GARAGE_COMMAND_EXEC: $GARAGE_COMMAND_EXEC" -# $GARAGE_BIN "$@" & -# GARAGE_PID=$! -# $GARAGE_BIN -c /etc/garage.toml & GARAGE_PID=$! -$GARAGE_COMMAND_EXEC & GARAGE_PID=$! - -sleep 10 -sleep 10 -echo "GARAGE_PID: $GARAGE_PID" - -# echo "Command: $GARAGE_BIN $@" - -# Apply cluster layout -if ! $GARAGE_BIN layout show 2>/dev/null | grep -q "Current cluster layout"; then - sleep 5 - echo "đŸ“Ļ Applying cluster layout..." - NODE_ID=$($GARAGE_BIN node id | head -n1) - if [ -z "$NODE_ID" ]; then - echo "$NODE_ID is empty" - sleep 5 - exit - fi - echo "Node ID: $NODE_ID" - sleep 10 - - echo "Assigning layout" - # $GARAGE_BIN layout assign --version 1 -z ny1 -c 4G $NODE_ID - $GARAGE_BIN --rpc-secret "$GARAGE_RPC_SECRET" layout assign -z ny1 -c 4G $NODE_ID - # $GARAGE_BIN status - # sleep 5 - # $GARAGE_BIN status - # echo "Show layout" - # $GARAGE_BIN layout show - sleep 10 - echo "Applying layout" - $GARAGE_BIN layout apply --version 1 - # $GARAGE_BIN layout apply - echo " ✅ Layout applied" -else - echo "â„šī¸ Layout already applied" -fi - -sleep 10 - - -# Create bucket -echo "Bucket: $BUCKET_NAME" -if ! $GARAGE_BIN bucket info "$BUCKET_NAME" 2>/dev/null; then - echo "đŸ“Ļ Creating bucket: $BUCKET_NAME" - sleep 5 - $GARAGE_BIN bucket create "$BUCKET_NAME" - sleep 10 -else - echo "â„šī¸ Bucket $BUCKET_NAME already exists" -fi - - -# Handle key -#if [ -n "$AWS_ACCESS_KEY_ID" ] && [ -n "$AWS_SECRET_ACCESS_KEY" ]; then -# echo "🔑 Using pre-defined credentials from .env" -# if ! $GARAGE_BIN key info "$AWS_ACCESS_KEY_ID" 2>/dev/null; then -# $GARAGE_BIN key import "$AWS_ACCESS_KEY_ID" "$AWS_SECRET_ACCESS_KEY" "app-key" -# echo " ✅ Key imported: $AWS_ACCESS_KEY_ID" -# else -# echo " â„šī¸ Key already exists: $AWS_ACCESS_KEY_ID" -# fi -# ACCESS_KEY="$AWS_ACCESS_KEY_ID" -# SECRET_KEY="$AWS_SECRET_ACCESS_KEY" -#else -# echo "🔑 Generating new key..." -# KEY_OUTPUT=$($GARAGE_BIN key create --name "app-key") -# echo "$KEY_OUTPUT" -# ACCESS_KEY=$(echo "$KEY_OUTPUT" | grep 'Key ID:' | awk '{print $3}') -# SECRET_KEY=$(echo "$KEY_OUTPUT" | grep 'Secret key:' | awk '{print $3}') -# echo " ✅ Key generated: $ACCESS_KEY" -#fi - -echo "🔑 Generating new key..." -KEY_OUTPUT=$($GARAGE_BIN key create "app-key") -echo "$KEY_OUTPUT" -sleep 15 - -ACCESS_KEY=$(echo "$KEY_OUTPUT" | grep 'Key ID:' | awk '{print $3}') -SECRET_KEY=$(echo "$KEY_OUTPUT" | grep 'Secret key:' | awk '{print $3}') -echo " ✅ Key generated: $ACCESS_KEY" -sleep 5 - -# Wait for Garage to be ready -# echo "âŗ Waiting for Garage API..." -# until curl -s -f "http://localhost:3900/v0/status" > /dev/null 2>&1; do -# echo " Not ready yet, sleeping 2s..." -# sleep 2 -# done -# echo "✅ Garage API is responding!" - -# Grant permissions -$GARAGE_BIN bucket allow --read --write --owner "$BUCKET_NAME" --key "$ACCESS_KEY" -echo " ✅ Permissions granted" -sleep 10 - -# Save credentials -write_credentials "$ACCESS_KEY" "$SECRET_KEY" - -sleep 10 - -echo "🎉 Setup complete!" -echo " Bucket: $BUCKET_NAME" -echo " Access Key: $ACCESS_KEY" - -# Stop background Garage -echo "âšī¸ Stopping background Garage..." -kill "$GARAGE_PID" -wait "$GARAGE_PID" 2>/dev/null || true - -# Start Garage in foreground -echo "🚀 Starting Garage in foreground..." -# exec $GARAGE_BIN "$@" -sleep 20 -exec $GARAGE_COMMANDS_EXEC diff --git a/garage/full-init-garage.sh b/garage/full-init-garage.sh deleted file mode 100644 index c93be4b..0000000 --- a/garage/full-init-garage.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/sh -set -e - -BUCKET_NAME="${BUCKET_NAME:-soaricarus-storage}" -CREDENTIALS_FILE="/shared/garage-credentials.env" -SETUP_DONE="/shared/setup.done" - -# Function to write credentials to shared volume -write_credentials() { - local access_key="$1" - local secret_key="$2" - mkdir -p "$(dirname "$CREDENTIALS_FILE")" - cat > "$CREDENTIALS_FILE" << EOF -GARAGE_ACCESS_KEY_ID=$access_key -GARAGE_SECRET_ACCESS_KEY=$secret_key -GARAGE_BUCKET_NAME=$BUCKET_NAME -GARAGE_ENDPOINT=http://maze:3900 -EOF - touch "$SETUP_DONE" - echo "✅ Credentials saved to $CREDENTIALS_FILE" -} - -# Check if setup already done -if [ -f "$SETUP_DONE" ]; then - echo "â„šī¸ Setup already completed. Starting Garage..." - # Source credentials if needed for the main Garage process - # shellcheck source=/dev/null - [ -f "$CREDENTIALS_FILE" ] && . "$CREDENTIALS_FILE" - exec /usr/local/bin/garage "$@" -fi - -echo "🔧 Running initial setup..." - -# Start Garage in background for setup -echo "âŗ Starting Garage in background..." -/usr/local/bin/garage "$@" & -GARAGE_PID=$! - -# Wait for Garage API to be ready -echo "âŗ Waiting for Garage API..." -# until curl -s -f "http://localhost:3900/v0/status" > /dev/null 2>&1; do -# echo " Not ready yet, sleeping 2s..." -# sleep 2 -#done -echo "✅ Garage API is responding!" - -# Apply layout if not already applied -if ! /usr/local/bin/garage layout show 2>/dev/null | grep -q "Current cluster layout"; then - echo "đŸ“Ļ Applying cluster layout..." - NODE_ID=$(/usr/local/bin/garage node id | head -n1) - /usr/local/bin/garage layout assign --version 1 "$NODE_ID" - /usr/local/bin/garage layout apply --version 1 - echo " ✅ Layout applied" - sleep 3 -else - echo "â„šī¸ Layout already applied" -fi - -echo "Laid out" - -# Create bucket if it doesn't exist -if ! /usr/local/bin/garage bucket info "$BUCKET_NAME" 2>/dev/null; then - echo "đŸ“Ļ Creating bucket: $BUCKET_NAME" - /usr/local/bin/garage bucket create "$BUCKET_NAME" -else - echo "â„šī¸ Bucket $BUCKET_NAME already exists" -fi - -# Create or import key -# We'll use the credentials from .env if provided, otherwise generate new ones -if [ -n "$AWS_ACCESS_KEY_ID" ] && [ -n "$AWS_SECRET_ACCESS_KEY" ]; then - echo "🔑 Using pre-defined AWS credentials from .env" - if ! /usr/local/bin/garage key info "$AWS_ACCESS_KEY_ID" 2>/dev/null; then - # Key doesn't exist, import it - /usr/local/bin/garage key import "$AWS_ACCESS_KEY_ID" "$AWS_SECRET_ACCESS_KEY" "app-key" - echo " ✅ Key imported: $AWS_ACCESS_KEY_ID" - else - echo " â„šī¸ Key already exists: $AWS_ACCESS_KEY_ID" - fi - ACCESS_KEY="$AWS_ACCESS_KEY_ID" - SECRET_KEY="$AWS_SECRET_ACCESS_KEY" -else - echo "🔑 Generating new key..." - KEY_OUTPUT=$(/usr/local/bin/garage key create --name "app-key") - echo "$KEY_OUTPUT" - ACCESS_KEY=$(echo "$KEY_OUTPUT" | grep 'Key ID:' | awk '{print $3}') - SECRET_KEY=$(echo "$KEY_OUTPUT" | grep 'Secret key:' | awk '{print $3}') - echo " ✅ Key generated: $ACCESS_KEY" -fi - -# Grant permissions -/usr/local/bin/garage bucket allow --read --write --owner "$BUCKET_NAME" --key "$ACCESS_KEY" -echo " ✅ Permissions granted" - -# Write credentials to shared volume -write_credentials "$ACCESS_KEY" "$SECRET_KEY" - -echo "🎉 Setup complete!" -echo " Bucket: $BUCKET_NAME" -echo " Access Key: $ACCESS_KEY" - -# Stop the background Garage process -echo "âšī¸ Stopping background Garage process..." -kill "$GARAGE_PID" -wait "$GARAGE_PID" 2>/dev/null || true - -echo "🚀 Starting Garage in foreground..." -exec /usr/local/bin/garage "$@" - diff --git a/garage/init-garage.sh b/garage/init-garage.sh deleted file mode 100755 index 1650ede..0000000 --- a/garage/init-garage.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -set -e - -BUCKET_NAME="${BUCKET_NAME:-soaricarus-storage}" -CREDENTIALS_FILE="/shared/garage-credentials.env" -SETUP_DONE="/shared/setup.done" - -echo "🔧 Running initial setup..." - -# Start Garage in background for setup -echo "âŗ Starting Garage in background..." -/usr/local/bin/garage "$@" & -GARAGE_PID=$! - -# Wait for Garage API to be ready -echo "âŗ Waiting for Garage API..." -# until curl -s -f "http://localhost:3900/v0/status" > /dev/null 2>&1; do -# echo " Not ready yet, sleeping 2s..." -# sleep 2 -#done -echo "✅ Garage API is responding!" - -# Apply layout if not already applied -#if ! /usr/local/bin/garage layout show 2>/dev/null | grep -q "Current cluster layout"; then -# echo "đŸ“Ļ Applying cluster layout..." -# NODE_ID=$(/usr/local/bin/garage node id | head -n1) -# echo $NODE_ID - # /usr/local/bin/garage layout assign --version 1 "$NODE_ID" - # /usr/local/bin/garage layout apply --version 1 -# echo " ✅ Layout applied" -# sleep 3 -#else - # echo "â„šī¸ Layout already applied" -# fi - -echo "Laid out" diff --git a/garage/init/Dockerfile b/garage/init/Dockerfile deleted file mode 100644 index 9979593..0000000 --- a/garage/init/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# Use a base image with a shell (Alpine) -FROM alpine:latest - -# Install necessary tools -RUN apk add --no-cache curl - -# Copy the Garage binary from the official image -COPY --from=dxflrs/garage:v2.3.0 /garage /usr/local/bin/garage - -# Copy the entrypoint script -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -# Set the entrypoint -ENTRYPOINT ["/entrypoint.sh"] - -# Pass through any arguments to Garage -CMD [] - diff --git a/garage/init/entrypoint.sh b/garage/init/entrypoint.sh deleted file mode 100755 index e69de29..0000000 diff --git a/garage/storage/Dockerfile b/garage/storage/Dockerfile deleted file mode 100644 index c5efaa6..0000000 --- a/garage/storage/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# Use a base image with a shell (Alpine) -FROM alpine:latest - -# Install necessary tools -RUN apk add --no-cache curl - -# Copy the Garage binary from the official image -COPY --from=dxflrs/garage:v2.3.0 /garage /usr/local/bin/garage - -# Copy the entrypoint script -COPY run.sh /run.sh -RUN chmod +x /run.sh - -# Set the run -ENTRYPOINT ["/run.sh"] - -# Pass through any arguments to Garage -CMD [] - diff --git a/garage/storage/run.sh b/garage/storage/run.sh deleted file mode 100755 index a85fd41..0000000 --- a/garage/storage/run.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -set -e - -BUCKET_NAME="${BUCKET_NAME:-soaricarus-storage}" -CREDENTIALS_FILE="/shared/garage-credentials.env" -SETUP_DONE="/shared/setup.done" -GARAGE_BIN="/usr/local/bin/garage" - -# Function to write credentials -write_credentials() { - local access_key="$1" - local secret_key="$2" - mkdir -p "$(dirname "$CREDENTIALS_FILE")" - cat > "$CREDENTIALS_FILE" << EOF -GARAGE_ACCESS_KEY_ID=$access_key -GARAGE_SECRET_ACCESS_KEY=$secret_key -GARAGE_BUCKET_NAME=$BUCKET_NAME -GARAGE_ENDPOINT=http://localhost:3900 -EOF - touch "$SETUP_DONE" - echo "✅ Credentials saved to $CREDENTIALS_FILE" -} - -sleep 5 - -echo "Starting garage" -GARAGE_COMMAND_EXEC="$GARAGE_BIN -c /etc/garage.toml server" - -echo "Running" - - -# Start Garage in background for setup (just the binary, no daemon subcommand) -echo "âŗ Starting Garage in background..." -echo "GARAGE_COMMAND_EXEC: $GARAGE_COMMAND_EXEC" -# $GARAGE_BIN "$@" & -# GARAGE_PID=$! -# $GARAGE_BIN -c /etc/garage.toml & GARAGE_PID=$! -$GARAGE_COMMAND_EXEC & GARAGE_PID=$! - -sleep 10 -echo "GARAGE_PID: $GARAGE_PID" -- 2.47.3 From b436a1cd0af8717f575c2290997c22b9eaf3c629 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 5 Aug 2026 17:49:50 -0400 Subject: [PATCH 28/91] ci: Adding container name --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index c282f6a..e47b23a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -72,6 +72,7 @@ jobs: garage-version: 'v2.3.0' bucket: 'soaricarus-ci-bucket' set-aws-env: 'true' + container-name: 'maze' - name: Run tests env: # Define DATABASE_URL for tests to use -- 2.47.3 From a34bc7c0aef0d7a2c8cae48becf42b399e7e14bf Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 5 Aug 2026 17:53:56 -0400 Subject: [PATCH 29/91] Removing init script --- scripts/init-garage.sh | 89 ------------------------------------------ 1 file changed, 89 deletions(-) delete mode 100755 scripts/init-garage.sh diff --git a/scripts/init-garage.sh b/scripts/init-garage.sh deleted file mode 100755 index 8999596..0000000 --- a/scripts/init-garage.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/sh -set -e - -BUCKET_NAME="soaricarus-storage" - -sleep 15 -echo $GARAGE_RPC_SECRET -echo "Yes" -sleep 10 - -echo "âŗ Waiting for Garage to be ready..." -# until docker exec maze curl -s -f "http://localhost:3901/v0/status" > /dev/null 2>&1; do -until docker exec maze nc -z "localhost 3900" > /dev/null 2>&1; do - echo " Garage not ready yet, retrying in 2s..." - sleep 2 -done -echo "✅ Garage API is responding!" - -sleep 3 - -# Check if layout is already applied -if docker exec maze garage layout show 2>/dev/null | grep -q "Current cluster layout"; then - echo "â„šī¸ Layout already applied, checking bucket..." -else - echo "đŸ“Ļ Applying cluster layout..." - - # Get node ID - MAX_RETRIES=10 - RETRY_COUNT=0 - NODE_ID="" - while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do - NODE_ID=$(docker exec maze garage node id 2>/dev/null | head -n1) - if [ -n "$NODE_ID" ]; then - break - fi - RETRY_COUNT=$((RETRY_COUNT + 1)) - echo " Waiting for node ID (attempt $RETRY_COUNT/$MAX_RETRIES)..." - sleep 2 - done - - if [ -z "$NODE_ID" ]; then - echo "❌ Failed to get node ID after $MAX_RETRIES attempts" - exit 1 - fi - - echo " Node ID: $NODE_ID" - docker exec maze garage layout assign --version 1 "$NODE_ID" - docker exec maze garage layout apply --version 1 - echo " ✅ Layout applied" - - sleep 3 -fi - -# Check if bucket exists -if docker exec maze garage bucket info "${BUCKET_NAME}" 2>/dev/null; then - echo "â„šī¸ Bucket '${BUCKET_NAME}' already exists. Skipping setup." - exit 0 -fi - -echo "đŸ“Ļ Creating bucket and configuring permissions..." - -# Create the bucket -docker exec maze garage bucket create "${BUCKET_NAME}" -echo " ✅ Bucket created: ${BUCKET_NAME}" - -# Check if key exists -if docker exec maze garage key info "${AWS_ACCESS_KEY_ID}" 2>/dev/null; then - echo " â„šī¸ Key already exists: ${AWS_ACCESS_KEY_ID}" -else - docker exec maze garage key create \ - --name "app-key" \ - "${AWS_ACCESS_KEY_ID}" \ - "${AWS_SECRET_ACCESS_KEY}" - echo " ✅ Key created: ${AWS_ACCESS_KEY_ID}" -fi - -# Grant permissions -docker exec maze garage bucket allow \ - --read \ - --write \ - --owner \ - "${BUCKET_NAME}" \ - --key "${AWS_ACCESS_KEY_ID}" -echo " ✅ Permissions granted" - -echo "🎉 Setup complete!" -echo " Bucket: ${BUCKET_NAME}" -echo " Access Key: ${AWS_ACCESS_KEY_ID}" -echo " Endpoint: http://maze:3900" -- 2.47.3 From 40c41c1c1b9283094729b0e910be0319d1a4a4d2 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 5 Aug 2026 18:00:08 -0400 Subject: [PATCH 30/91] ci: Updated yml --- .github/workflows/workflow.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e47b23a..f8b1662 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -73,6 +73,9 @@ jobs: bucket: 'soaricarus-ci-bucket' set-aws-env: 'true' container-name: 'maze' + access-key-id: GK31c5f2dab2a46c2a3b2653f3 + secret-access-key: ${{ secrets.GARAGE_SECRET }} + region: us-test-1 - name: Run tests env: # Define DATABASE_URL for tests to use -- 2.47.3 From 77ec72dff4a32c5282dd47d2d9cf706bc18870c2 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 5 Aug 2026 18:03:46 -0400 Subject: [PATCH 31/91] ci: Added timeout --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index f8b1662..bff96ae 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -35,6 +35,7 @@ jobs: test: name: Test Suite runs-on: ubuntu-24.04 + timeout-minutes: 20 services: postgres: image: postgres:18.4-alpine -- 2.47.3 From d214ed106af831060bd05c4b8da5038efe641ee0 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 5 Aug 2026 18:07:15 -0400 Subject: [PATCH 32/91] Updating dockerfile --- Dockerfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0c2ac50..11cfe6b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,10 +30,6 @@ RUN --mount=type=ssh mkdir src && \ COPY src ./src COPY .env ./.env COPY migrations ./migrations -COPY scripts/init-garage.sh /scripts/init-garage.sh - -# Make it executable -RUN chmod +x /scripts/init-garage.sh RUN --mount=type=ssh \ cargo build --release --quiet -- 2.47.3 From edf109e4d91243d715826ac20325ff9d9f249ae1 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 5 Aug 2026 18:24:12 -0400 Subject: [PATCH 33/91] ci: Maybe this time --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index bff96ae..85e0873 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -73,7 +73,7 @@ jobs: garage-version: 'v2.3.0' bucket: 'soaricarus-ci-bucket' set-aws-env: 'true' - container-name: 'maze' + container-name: 'amaze' access-key-id: GK31c5f2dab2a46c2a3b2653f3 secret-access-key: ${{ secrets.GARAGE_SECRET }} region: us-test-1 -- 2.47.3 From d50959c6020b3dd8896730ee4d4185a4530f599c Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 6 Aug 2026 10:51:39 -0400 Subject: [PATCH 34/91] ci: Maybe this --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 85e0873..34e59c5 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -73,7 +73,7 @@ jobs: garage-version: 'v2.3.0' bucket: 'soaricarus-ci-bucket' set-aws-env: 'true' - container-name: 'amaze' + # container-name: 'amaze' access-key-id: GK31c5f2dab2a46c2a3b2653f3 secret-access-key: ${{ secrets.GARAGE_SECRET }} region: us-test-1 -- 2.47.3 From 6490f51d17477a21cf16612409eaac0ca0d1ee7f Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 6 Aug 2026 11:29:17 -0400 Subject: [PATCH 35/91] ci: Maybe this time --- .github/workflows/workflow.yml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 34e59c5..3db0424 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -49,6 +49,21 @@ jobs: --health-timeout 5s --health-retries 5 + localstack: + image: localstack/localstack:latest + env: + SERVICES: s3 + AWS_ACCESS_KEY_ID: GK31c5f2dab2a46c2a3b2653f3 + AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} + AWS_DEFAULT_REGION: us-east-1 + options: >- + --health-cmd "curl -f http://localhost:4566/_localstack/health || exit 1" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 3900:3900 + steps: - uses: actions/checkout@v6 - uses: actions-rust-lang/setup-rust-toolchain@v1 @@ -67,16 +82,6 @@ jobs: docker ps -a echo "Docker environment check complete." - - name: Setup Garage S3 Server - uses: lowlydba/setup-garage@v1.0.0 - with: - garage-version: 'v2.3.0' - bucket: 'soaricarus-ci-bucket' - set-aws-env: 'true' - # container-name: 'amaze' - access-key-id: GK31c5f2dab2a46c2a3b2653f3 - secret-access-key: ${{ secrets.GARAGE_SECRET }} - region: us-test-1 - name: Run tests env: # Define DATABASE_URL for tests to use -- 2.47.3 From 6c910ab2123a38c272c64438031f3cfda35d2af2 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 6 Aug 2026 11:37:00 -0400 Subject: [PATCH 36/91] ci: Updated workflow --- .github/workflows/workflow.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 3db0424..c58fe08 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -53,9 +53,9 @@ jobs: image: localstack/localstack:latest env: SERVICES: s3 - AWS_ACCESS_KEY_ID: GK31c5f2dab2a46c2a3b2653f3 + AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} - AWS_DEFAULT_REGION: us-east-1 + AWS_DEFAULT_REGION: ${{ secrets.GARAGE_REGION }} options: >- --health-cmd "curl -f http://localhost:4566/_localstack/health || exit 1" --health-interval 10s @@ -90,6 +90,9 @@ jobs: SECRET_MAIN_KEY: ${{ secrets.TOKEN_SECRET_KEY }} SSH_AUTH_SOCK: ${{ env.SSH_AUTH_SOCK }} ROOT_DIRECTORY: "/tmp" + AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} + AWS_DEFAULT_REGION: ${{ secrets.GARAGE_REGION }} run: | mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/soaricarus_models_deploy_key -- 2.47.3 From 569c684c1c02b09d2e2633510fcfa1e4df997ef7 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 6 Aug 2026 11:45:34 -0400 Subject: [PATCH 37/91] Added labyrinth --- Cargo.lock | 1047 ++++++++++++++++++++++++++++++++++++++++++++++++++-- Cargo.toml | 1 + 2 files changed, 1014 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5af1cf8..08e8a47 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -38,6 +38,15 @@ dependencies = [ "derive_arbitrary", ] +[[package]] +name = "arc-swap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c049c0be4daef0b145cb3555416b3b8ef5b7888a38aea1a3a155801fe7b0810b" +dependencies = [ + "rustversion", +] + [[package]] name = "atoi" version = "2.0.0" @@ -59,6 +68,490 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" +[[package]] +name = "aws-config" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b180a3c8b55960db3426d8964b8745e652466a1a49fe1a2eda828046d30b5e4" +dependencies = [ + "aws-credential-types", + "aws-runtime", + "aws-sdk-sso", + "aws-sdk-ssooidc", + "aws-sdk-sts", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-schema", + "aws-smithy-types", + "aws-types", + "bytes", + "fastrand", + "hex", + "http 1.4.2", + "sha1 0.10.7", + "time", + "tokio", + "tracing", + "url", + "zeroize", +] + +[[package]] +name = "aws-credential-types" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e93964ffdaf57857f544be3666a5f57570bb699e934700f11b49708f61bb556e" +dependencies = [ + "aws-smithy-async", + "aws-smithy-runtime-api", + "aws-smithy-types", + "zeroize", +] + +[[package]] +name = "aws-lc-rs" +version = "1.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00bdb5da18dac48ca2cc7cd4a98e533e8635a58e2361d13a1a4ee3888e0d72f1" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43103168cc76fe62678a375e722fc9cb3a0146159ac5828bc4f0dfd755c2224c" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", + "pkg-config", +] + +[[package]] +name = "aws-runtime" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9007227e10b5fed2f3e0a2beff489211e2b5604c400b7a9d5d81ca9d64c24bb" +dependencies = [ + "aws-credential-types", + "aws-sigv4", + "aws-smithy-async", + "aws-smithy-eventstream", + "aws-smithy-http", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "bytes", + "bytes-utils", + "fastrand", + "http 0.2.12", + "http 1.4.2", + "http-body 0.4.6", + "http-body 1.1.0", + "percent-encoding", + "pin-project-lite", + "tracing", + "uuid", +] + +[[package]] +name = "aws-sdk-s3" +version = "1.140.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9660cf991e512fbe6094f1041ff3d3282bc5aeeeb6184e8de437ec2de024a10" +dependencies = [ + "arc-swap", + "aws-credential-types", + "aws-runtime", + "aws-sigv4", + "aws-smithy-async", + "aws-smithy-checksums", + "aws-smithy-eventstream", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-observability", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-schema", + "aws-smithy-types", + "aws-smithy-xml", + "aws-types", + "bytes", + "fastrand", + "hex", + "hmac 0.13.0", + "http 0.2.12", + "http 1.4.2", + "http-body 1.1.0", + "lru", + "percent-encoding", + "regex-lite", + "sha2 0.11.0", + "tracing", + "url", +] + +[[package]] +name = "aws-sdk-sso" +version = "1.105.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ffd0fbe7873cb548a7aa60f9573c268fff94155397fd4f14dc9f1ecaaab8516" +dependencies = [ + "arc-swap", + "aws-credential-types", + "aws-runtime", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-observability", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-schema", + "aws-smithy-types", + "aws-types", + "bytes", + "fastrand", + "http 0.2.12", + "http 1.4.2", + "regex-lite", + "tracing", +] + +[[package]] +name = "aws-sdk-ssooidc" +version = "1.107.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175763eb222a46377df7aa257a3bca980ab3e96703fefc8f4d0b8da6ad2e254c" +dependencies = [ + "arc-swap", + "aws-credential-types", + "aws-runtime", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-observability", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-schema", + "aws-smithy-types", + "aws-types", + "bytes", + "fastrand", + "http 0.2.12", + "http 1.4.2", + "regex-lite", + "tracing", +] + +[[package]] +name = "aws-sdk-sts" +version = "1.110.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b14781dfbff48984017d57167b6ea0b6471c6920ec52b44a2677c7feb3c13" +dependencies = [ + "arc-swap", + "aws-credential-types", + "aws-runtime", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-observability", + "aws-smithy-query", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-schema", + "aws-smithy-types", + "aws-smithy-xml", + "aws-types", + "fastrand", + "http 0.2.12", + "http 1.4.2", + "regex-lite", + "tracing", +] + +[[package]] +name = "aws-sigv4" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "723c2234ad7511ceef63eab016b7ba6ff7c55590fefb96fa8467af014a07309f" +dependencies = [ + "aws-credential-types", + "aws-smithy-eventstream", + "aws-smithy-http", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes", + "crypto-bigint", + "form_urlencoded", + "hex", + "hmac 0.13.0", + "http 0.2.12", + "http 1.4.2", + "p256", + "percent-encoding", + "sha2 0.11.0", + "subtle", + "time", + "tracing", + "zeroize", +] + +[[package]] +name = "aws-smithy-async" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f02e407fb3b54891734224b9ffac8a71fdd35f542500fa1af95754a6b2beb316" +dependencies = [ + "futures-util", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "aws-smithy-checksums" +version = "0.65.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67ecd999972b58e67cab052f5129906c08c25883bd0788ceefc55ef97d61307" +dependencies = [ + "aws-smithy-http", + "aws-smithy-types", + "bytes", + "crc-fast", + "hex", + "http 1.4.2", + "http-body 1.1.0", + "http-body-util", + "md-5", + "pin-project-lite", + "sha1 0.11.0", + "sha2 0.11.0", + "tracing", +] + +[[package]] +name = "aws-smithy-eventstream" +version = "0.61.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9381123ab62d20c13082b151f30f962a3b112b727345394536dfa39a482944" +dependencies = [ + "aws-smithy-types", + "bytes", + "crc32fast", +] + +[[package]] +name = "aws-smithy-http" +version = "0.64.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37843d9add67c3aff5856f409c6dc315d3cdff60f9c0cb5b670dab1e9920306d" +dependencies = [ + "aws-smithy-eventstream", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes", + "bytes-utils", + "futures-core", + "futures-util", + "http 1.4.2", + "http-body 1.1.0", + "http-body-util", + "percent-encoding", + "pin-project-lite", + "pin-utils", + "tracing", +] + +[[package]] +name = "aws-smithy-http-client" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "635d23afda0a6ab48d666c4d447c4873e8d1e83518a2be2093122397e50b838e" +dependencies = [ + "aws-smithy-async", + "aws-smithy-runtime-api", + "aws-smithy-types", + "h2 0.3.27", + "h2 0.4.15", + "http 0.2.12", + "http 1.4.2", + "http-body 0.4.6", + "hyper 0.14.32", + "hyper 1.10.1", + "hyper-rustls 0.24.2", + "hyper-rustls 0.27.9", + "hyper-util", + "pin-project-lite", + "rustls 0.21.12", + "rustls 0.23.43", + "rustls-native-certs", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.4", + "tower", + "tracing", +] + +[[package]] +name = "aws-smithy-json" +version = "0.63.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dc65a121adb4b33729919fcfa14fa36fb33c1555a8f06bb0e2188dbfdc1d9ef" +dependencies = [ + "aws-smithy-runtime-api", + "aws-smithy-schema", + "aws-smithy-types", +] + +[[package]] +name = "aws-smithy-observability" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e86338c869539a581bf161247762a6e87f92c5c075060057b5ed6d06632ed0c" +dependencies = [ + "aws-smithy-runtime-api", +] + +[[package]] +name = "aws-smithy-query" +version = "0.62.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512346c7212ab7436df2d77a16d976a468ae44a418835511d2a69269810aaf62" +dependencies = [ + "aws-smithy-runtime-api", + "aws-smithy-schema", + "aws-smithy-types", + "aws-smithy-xml", + "urlencoding", +] + +[[package]] +name = "aws-smithy-runtime" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07505b34e8f4b3591a4fa69e9792b52289b95488dbbc68c3c0075b7bedb245e1" +dependencies = [ + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-http-client", + "aws-smithy-observability", + "aws-smithy-runtime-api", + "aws-smithy-schema", + "aws-smithy-types", + "bytes", + "fastrand", + "http 0.2.12", + "http 1.4.2", + "http-body 0.4.6", + "http-body 1.1.0", + "http-body-util", + "pin-project-lite", + "pin-utils", + "tokio", + "tracing", +] + +[[package]] +name = "aws-smithy-runtime-api" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b98f2e1fd67ec06618f9c291e5e495a468e60519e44c9c1979cd0521f3affdb" +dependencies = [ + "aws-smithy-async", + "aws-smithy-runtime-api-macros", + "aws-smithy-types", + "bytes", + "http 0.2.12", + "http 1.4.2", + "pin-project-lite", + "tokio", + "tracing", + "zeroize", +] + +[[package]] +name = "aws-smithy-runtime-api-macros" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "221eaa237ddf1ca79b60d1372aad77e47f9c0ea5b3ce5099da8c61d027dc77b3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "aws-smithy-schema" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d56e0a4e53127a632224e43633b0fe045fa9e1e3cfc68b9830f1115e103f910" +dependencies = [ + "aws-smithy-runtime-api", + "aws-smithy-types", + "http 1.4.2", +] + +[[package]] +name = "aws-smithy-types" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6dc683efb34b9e755675b37fedbe0103141e5b6df7bdc9eb6967756a8c167d8" +dependencies = [ + "base64-simd", + "bytes", + "bytes-utils", + "futures-core", + "http 0.2.12", + "http 1.4.2", + "http-body 0.4.6", + "http-body 1.1.0", + "http-body-util", + "itoa", + "num-integer", + "pin-project-lite", + "pin-utils", + "ryu", + "serde", + "time", + "tokio", + "tokio-util", +] + +[[package]] +name = "aws-smithy-xml" +version = "0.62.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce84f71c72fee2cbbadde6e7d082f5fb466e3a84733855295fa7aafd1b31b7d8" +dependencies = [ + "aws-smithy-runtime-api", + "aws-smithy-schema", + "aws-smithy-types", + "xmlparser", +] + +[[package]] +name = "aws-types" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eec1cd5469f328c782dc3e33d4153cf118a54e33cbb3356d60d16f89883e1f94" +dependencies = [ + "aws-credential-types", + "aws-smithy-async", + "aws-smithy-runtime-api", + "aws-smithy-schema", + "aws-smithy-types", + "rustc_version", + "tracing", +] + [[package]] name = "axum" version = "0.8.9" @@ -69,10 +562,10 @@ dependencies = [ "bytes", "form_urlencoded", "futures-util", - "http", - "http-body", + "http 1.4.2", + "http-body 1.1.0", "http-body-util", - "hyper", + "hyper 1.10.1", "hyper-util", "itoa", "matchit", @@ -101,8 +594,8 @@ checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" dependencies = [ "bytes", "futures-core", - "http", - "http-body", + "http 1.4.2", + "http-body 1.1.0", "http-body-util", "mime", "pin-project-lite", @@ -124,8 +617,8 @@ dependencies = [ "cookie", "futures-core", "futures-util", - "http", - "http-body", + "http 1.4.2", + "http-body 1.1.0", "http-body-util", "mime", "pin-project-lite", @@ -146,6 +639,16 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64-simd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" +dependencies = [ + "outref", + "vsimd", +] + [[package]] name = "base64ct" version = "1.8.3" @@ -197,6 +700,16 @@ version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" +[[package]] +name = "bytes-utils" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dafe3a8757b027e2be6e4e5601ed563c55989fcf1546e933c66c8eb3a058d35" +dependencies = [ + "bytes", + "either", +] + [[package]] name = "cc" version = "1.3.0" @@ -204,6 +717,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" dependencies = [ "find-msvc-tools", + "jobserver", + "libc", "shlex", ] @@ -235,6 +750,15 @@ dependencies = [ "rand_core 0.10.1", ] +[[package]] +name = "cmake" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" +dependencies = [ + "cc", +] + [[package]] name = "cmov" version = "0.5.4" @@ -250,7 +774,7 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http", + "http 1.4.2", "mime", "mime_guess", "rand 0.8.7", @@ -359,6 +883,16 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "217698eaf96b4a3f0bc4f3662aaa55bdf913cd54d7204591faa790070c6d0853" +[[package]] +name = "crc-fast" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e75b2483e97a5a7da73ac68a05b629f9c53cff58d8ed1c77866079e18b00dba5" +dependencies = [ + "digest 0.10.7", + "spin 0.10.1", +] + [[package]] name = "crc32fast" version = "1.5.0" @@ -528,6 +1062,12 @@ version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "ecdsa" version = "0.16.9" @@ -618,7 +1158,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.61.2", ] [[package]] @@ -628,7 +1168,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de48cc4d1c1d97a20fd819def54b890cadde72ed3ad0c614822a0a433361be96" dependencies = [ "cfg-if", - "windows-sys", + "windows-sys 0.61.2", ] [[package]] @@ -689,7 +1229,7 @@ checksum = "5e139bc46ca777eb5efaf62df0ab8cc5fd400866427e56c68b22e414e53bd3be" dependencies = [ "futures-core", "futures-sink", - "spin", + "spin 0.9.9", ] [[package]] @@ -728,6 +1268,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "futures" version = "0.3.33" @@ -872,6 +1418,44 @@ dependencies = [ "subtle", ] +[[package]] +name = "h2" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cb093c84e8bd9b188d4c4a8cb6579fc016968d14c99882163cd3ff402a4f155" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.4.2", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hashbrown" version = "0.16.1" @@ -956,6 +1540,17 @@ dependencies = [ "digest 0.11.3", ] +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "http" version = "1.4.2" @@ -966,6 +1561,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + [[package]] name = "http-body" version = "1.1.0" @@ -973,7 +1579,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c" dependencies = [ "bytes", - "http", + "http 1.4.2", ] [[package]] @@ -984,8 +1590,8 @@ checksum = "e9f41fd6a08e4d4ec69df65976da761afd5ad5e58a9d4acb46bd1c953a9e3ff2" dependencies = [ "bytes", "futures-core", - "http", - "http-body", + "http 1.4.2", + "http-body 1.1.0", "pin-project-lite", ] @@ -1010,6 +1616,30 @@ dependencies = [ "typenum", ] +[[package]] +name = "hyper" +version = "0.14.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.3.27", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2 0.5.10", + "tokio", + "tower-service", + "tracing", + "want", +] + [[package]] name = "hyper" version = "1.10.1" @@ -1020,14 +1650,47 @@ dependencies = [ "bytes", "futures-channel", "futures-core", - "http", - "http-body", + "h2 0.4.15", + "http 1.4.2", + "http-body 1.1.0", "httparse", "httpdate", "itoa", "pin-project-lite", "smallvec", "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http 0.2.12", + "hyper 0.14.32", + "log", + "rustls 0.21.12", + "tokio", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" +dependencies = [ + "http 1.4.2", + "hyper 1.10.1", + "hyper-util", + "rustls 0.23.43", + "rustls-native-certs", + "tokio", + "tokio-rustls 0.26.4", + "tower-service", ] [[package]] @@ -1036,13 +1699,21 @@ version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" dependencies = [ + "base64", "bytes", - "http", - "http-body", - "hyper", + "futures-channel", + "futures-util", + "http 1.4.2", + "http-body 1.1.0", + "hyper 1.10.1", + "ipnet", + "libc", + "percent-encoding", "pin-project-lite", + "socket2 0.6.5", "tokio", "tower-service", + "tracing", ] [[package]] @@ -1175,12 +1846,28 @@ dependencies = [ "cfb", ] +[[package]] +name = "ipnet" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a756c3fac73139e83f14c2d742155dd2b78d3ee56597b419a0579b7bdd6dd78" + [[package]] name = "itoa" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +[[package]] +name = "jobserver" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" +dependencies = [ + "getrandom 0.4.3", + "libc", +] + [[package]] name = "josekit" version = "0.10.3" @@ -1248,13 +1935,25 @@ version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" +[[package]] +name = "labyrinth" +version = "0.0.1" +source = "git+ssh://git@git.kundeng.us/phoenix/labyrinth.git?tag=v0.0.1#a29a9fa9f790f30bd6bec1f501ed049d7c9af8b4" +dependencies = [ + "aws-config", + "aws-sdk-s3", + "time", + "tokio", + "uuid", +] + [[package]] name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin", + "spin 0.9.9", ] [[package]] @@ -1332,6 +2031,15 @@ version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" +[[package]] +name = "lru" +version = "0.16.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f66e8d5d03f609abc3a39e6f08e4164ebf1447a732906d39eb9b99b7919ef39" +dependencies = [ + "hashbrown 0.16.1", +] + [[package]] name = "matchit" version = "0.8.4" @@ -1388,7 +2096,7 @@ checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427" dependencies = [ "libc", "wasi", - "windows-sys", + "windows-sys 0.61.2", ] [[package]] @@ -1400,11 +2108,11 @@ dependencies = [ "bytes", "encoding_rs", "futures-util", - "http", + "http 1.4.2", "httparse", "memchr", "mime", - "spin", + "spin 0.9.9", "version_check", ] @@ -1431,7 +2139,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys", + "windows-sys 0.61.2", ] [[package]] @@ -1563,6 +2271,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "outref" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" + [[package]] name = "p256" version = "0.13.2" @@ -1653,6 +2367,12 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + [[package]] name = "pkcs1" version = "0.7.5" @@ -1816,6 +2536,12 @@ dependencies = [ "regex-syntax", ] +[[package]] +name = "regex-lite" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab834c73d247e67f4fae452806d17d3c7501756d98c8808d7c9c7aa7d18f973" + [[package]] name = "regex-syntax" version = "0.8.11" @@ -1832,6 +2558,20 @@ dependencies = [ "subtle", ] +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + [[package]] name = "rsa" version = "0.9.10" @@ -1906,7 +2646,76 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring", + "rustls-webpki 0.101.7", + "sct", +] + +[[package]] +name = "rustls" +version = "0.23.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0283386ce02abc0151e1761d08802dfe86c173b0b494af5cbc086574e453da06" +dependencies = [ + "aws-lc-rs", + "once_cell", + "rustls-pki-types", + "rustls-webpki 0.103.13", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dab5152771c58876a2146916e53e35057e1a4dfa2b9df0f0305b07f611fdea4d" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pki-types" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96" +dependencies = [ + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +dependencies = [ + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", ] [[package]] @@ -1936,7 +2745,7 @@ version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" dependencies = [ - "windows-sys", + "windows-sys 0.61.2", ] [[package]] @@ -1945,6 +2754,16 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "sec1" version = "0.7.3" @@ -2055,6 +2874,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha1" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "digest 0.10.7", +] + [[package]] name = "sha1" version = "0.11.0" @@ -2200,6 +3030,7 @@ dependencies = [ "futures", "josekit", "jsonwebtoken", + "labyrinth", "mime_guess", "openssl", "serde", @@ -2221,6 +3052,16 @@ dependencies = [ "uuid", ] +[[package]] +name = "socket2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "socket2" version = "0.6.5" @@ -2228,7 +3069,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.61.2", ] [[package]] @@ -2240,6 +3081,12 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spin" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "023a211cb3138dbc438680b32560ad89f699977624c9f8dbb95a47d5b4c07dd3" + [[package]] name = "spki" version = "0.7.3" @@ -2358,7 +3205,7 @@ dependencies = [ "log", "percent-encoding", "serde", - "sha1", + "sha1 0.11.0", "sha2 0.11.0", "sqlx-core", "thiserror 2.0.18", @@ -2491,7 +3338,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix", - "windows-sys", + "windows-sys 0.61.2", ] [[package]] @@ -2610,9 +3457,9 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.6.5", "tokio-macros", - "windows-sys", + "windows-sys 0.61.2", ] [[package]] @@ -2626,6 +3473,26 @@ dependencies = [ "syn", ] +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.12", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls 0.23.43", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.18" @@ -2678,8 +3545,8 @@ checksum = "b11f75e912b0c2be01b63d8cf8057b8c3f97cf34abb3d431a3a4c8675498e233" dependencies = [ "bitflags", "bytes", - "http", - "http-body", + "http 1.4.2", + "http-body 1.1.0", "percent-encoding", "pin-project-lite", "tokio", @@ -2757,6 +3624,12 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + [[package]] name = "typenum" version = "1.20.1" @@ -2802,6 +3675,12 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.5.8" @@ -2814,6 +3693,12 @@ dependencies = [ "serde", ] +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + [[package]] name = "utf8_iter" version = "1.0.4" @@ -2893,6 +3778,12 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "vsimd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" + [[package]] name = "walkdir" version = "2.5.0" @@ -2903,6 +3794,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" version = "0.11.1+wasi-snapshot-preview1" @@ -2966,7 +3866,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys", + "windows-sys 0.61.2", ] [[package]] @@ -2975,6 +3875,15 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.61.2" @@ -2984,12 +3893,82 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + [[package]] name = "writeable" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" +[[package]] +name = "xmlparser" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" + [[package]] name = "yoke" version = "0.8.3" diff --git a/Cargo.toml b/Cargo.toml index abba574..6640cd7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,7 @@ utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] } simeta = { git = "ssh://git@git.kundeng.us/phoenix/simeta.git", tag = "v0.6.1-main-b690995806-680" } simodels = { git = "ssh://git@git.kundeng.us/phoenix/simodels.git", tag = "v0.11.3-main-fe9d101bd0-111" } sienvy = { git = "ssh://git@git.kundeng.us/phoenix/sienvy.git", tag = "v0.8.0-main-d06c8fdf49-006" } +labyrinth = { git = "ssh://git@git.kundeng.us/phoenix/labyrinth.git", tag = "v0.0.1" } [dev-dependencies] common-multipart-rfc7578 = { version = "0.7.0" } -- 2.47.3 From 9b6e6716c462fde99eef386dcec9155def04faaf Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 6 Aug 2026 17:17:26 -0400 Subject: [PATCH 38/91] Updated code --- .github/workflows/workflow.yml | 5 ++++ Cargo.lock | 2 +- Cargo.toml | 2 +- src/callers/queue/song.rs | 53 ++++++++++++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index c58fe08..af77d03 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -93,6 +93,11 @@ jobs: AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} AWS_DEFAULT_REGION: ${{ secrets.GARAGE_REGION }} + GARAGE_DEFAULT_ACCESS_KEY: ${{ secrets.GARAGE_KEY_ID }} + GARAGE_DEFAULT_SECRET_KEY: ${{ secrets.GARAGE_SECRET }} + GARAGE_S3_REGION: ${{ secrets.GARAGE_REGION }} + S3_BUCKET_NAME: "soaricarus-bucket" + S3_ENDPOINT_URL: "http://localhost:3900" run: | mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/soaricarus_models_deploy_key diff --git a/Cargo.lock b/Cargo.lock index 08e8a47..f0cdc37 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1938,7 +1938,7 @@ checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" [[package]] name = "labyrinth" version = "0.0.1" -source = "git+ssh://git@git.kundeng.us/phoenix/labyrinth.git?tag=v0.0.1#a29a9fa9f790f30bd6bec1f501ed049d7c9af8b4" +source = "git+ssh://git@git.kundeng.us/phoenix/labyrinth.git?tag=v0.0.1-1-742393c25b-928#742393c25b73aa73dce963cb6b4a740e64b93051" dependencies = [ "aws-config", "aws-sdk-s3", diff --git a/Cargo.toml b/Cargo.toml index 6640cd7..f9e5520 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] } simeta = { git = "ssh://git@git.kundeng.us/phoenix/simeta.git", tag = "v0.6.1-main-b690995806-680" } simodels = { git = "ssh://git@git.kundeng.us/phoenix/simodels.git", tag = "v0.11.3-main-fe9d101bd0-111" } sienvy = { git = "ssh://git@git.kundeng.us/phoenix/sienvy.git", tag = "v0.8.0-main-d06c8fdf49-006" } -labyrinth = { git = "ssh://git@git.kundeng.us/phoenix/labyrinth.git", tag = "v0.0.1" } +labyrinth = { git = "ssh://git@git.kundeng.us/phoenix/labyrinth.git", tag = "v0.0.1-1-742393c25b-928" } [dev-dependencies] common-multipart-rfc7578 = { version = "0.7.0" } diff --git a/src/callers/queue/song.rs b/src/callers/queue/song.rs index 5ec55b3..2a94843 100644 --- a/src/callers/queue/song.rs +++ b/src/callers/queue/song.rs @@ -156,6 +156,7 @@ pub mod endpoint { ); let raw_data: Vec = data.to_vec(); + let copied_raw_data = data.to_vec(); match super::is_song_valid(&raw_data).await { Ok(valid) => { if valid { @@ -169,6 +170,58 @@ pub mod endpoint { { Ok(queued_song) => { results.push(queued_song); + println!("Uploading to bucket"); + + let s3_endpoint_url = + sienvy::environment::get_env("S3_ENDPOINT_URL"); + let bucket_name = + sienvy::environment::get_env("S3_BUCKET_NAME"); + let region = + sienvy::environment::get_env("GARAGE_S3_REGION"); + let access_key_id = sienvy::environment::get_env( + "GARAGE_DEFAULT_ACCESS_KEY", + ); + let secret_key = sienvy::environment::get_env( + "GARAGE_DEFAULT_SECRET_KEY", + ); + + let lab_config = labyrinth::config::Config { + url: s3_endpoint_url.value, + bucket: bucket_name.value, + region: region.value, + access_key_id: access_key_id.value, + secret_key: secret_key.value, + }; + + println!("Labyrinth config: {lab_config:?}"); + + let lr = labyrinth::Labyrinth { config: lab_config }; + let data = labyrinth::Data { + raw_data: copied_raw_data, + ..Default::default() + }; + let filename = simodels::song::generate_filename( + simodels::types::MusicType::FlacExtension, + true, + ) + .unwrap(); + println!("Filename: {filename:?}"); + let file_path = format!("queued/song/{filename}"); + println!("Path: {file_path:?}"); + + match lr.upload(&file_path, &data).await { + Ok(res) => { + println!("Result: {res:?}"); + } + Err(err) => match err { + labyrinth::Error::Info(err_str) => { + eprintln!("Error: {:?}", err_str); + } + labyrinth::Error::SError(err_s) => { + eprintln!("Error: {:?}", err_s); + } + }, + } } Err(err) => { response.message = err.to_string(); -- 2.47.3 From f7a191846261ed48dfc5fd3aa446b91cd932a40e Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 6 Aug 2026 17:17:45 -0400 Subject: [PATCH 39/91] ci: Updated docker compose --- docker-compose.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index 863f312..21316a9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -105,6 +105,11 @@ services: GARAGE_DEFAULT_ACCESS_KEY: "${GARAGE_DEFAULT_ACCESS_KEY}" GARAGE_DEFAULT_SECRET_KEY: "${GARAGE_DEFAULT_SECRET_KEY}" GARAGE_DEFAULT_BUCKET: "${GARAGE_DEFAULT_BUCKET}" + + AWS_ACCESS_KEY_ID: "${GARAGE_DEFAULT_ACCESS_KEY}" + AWS_SECRET_ACCESS_KEY: "${GARAGE_DEFAULT_SECRET_KEY}" + AWS_DEFAULT_REGION: "${GARAGE_DEFAULT_BUCKET}" + AWS_S3_FORCE_PATH_STYLE: "true" volumes: - ./garage.toml:/etc/garage.toml:ro # Mount config file -- 2.47.3 From 78d74cf6f3cb576f8d43e83b36da293237da7bf6 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 6 Aug 2026 17:17:59 -0400 Subject: [PATCH 40/91] Updated sample env files --- .env.docker.sample | 1 + .env.local.sample | 1 + 2 files changed, 2 insertions(+) diff --git a/.env.docker.sample b/.env.docker.sample index 6316ec6..8556d81 100644 --- a/.env.docker.sample +++ b/.env.docker.sample @@ -13,6 +13,7 @@ POSTGRES_MAIN_PORT=5432 DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:${POSTGRES_MAIN_PORT}/${POSTGRES_MAIN_DB} S3_BUCKET_NAME=soaricarus-bucket +S3_ENDPOINT_URL=http://maze:3900 GARAGE_S3_REGION=maze GARAGE_RPC_SECRET=c2bde5c3f9c04116a7563e25ea5ba6fab25319daa2fe8a952ad57d0b8159b590 GARAGE_METRICS_TOKEN=sD2g4jiYV66KdZWtIuj2amezuryzv81mZNktpMNcmU4= diff --git a/.env.local.sample b/.env.local.sample index 6316ec6..8556d81 100644 --- a/.env.local.sample +++ b/.env.local.sample @@ -13,6 +13,7 @@ POSTGRES_MAIN_PORT=5432 DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:${POSTGRES_MAIN_PORT}/${POSTGRES_MAIN_DB} S3_BUCKET_NAME=soaricarus-bucket +S3_ENDPOINT_URL=http://maze:3900 GARAGE_S3_REGION=maze GARAGE_RPC_SECRET=c2bde5c3f9c04116a7563e25ea5ba6fab25319daa2fe8a952ad57d0b8159b590 GARAGE_METRICS_TOKEN=sD2g4jiYV66KdZWtIuj2amezuryzv81mZNktpMNcmU4= -- 2.47.3 From a05dae25d7d37d8bbe0527fa497425f408fce9d3 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 6 Aug 2026 17:39:46 -0400 Subject: [PATCH 41/91] Let's see if the test passes --- src/callers/queue/song.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/callers/queue/song.rs b/src/callers/queue/song.rs index 2a94843..8746da0 100644 --- a/src/callers/queue/song.rs +++ b/src/callers/queue/song.rs @@ -216,9 +216,13 @@ pub mod endpoint { Err(err) => match err { labyrinth::Error::Info(err_str) => { eprintln!("Error: {:?}", err_str); + response.message = err_str.to_string(); + return (axum::http::StatusCode::INTERNAL_SERVER_ERROR, axum::Json(response)); } labyrinth::Error::SError(err_s) => { eprintln!("Error: {:?}", err_s); + response.message = err_s.to_string(); + return (axum::http::StatusCode::INTERNAL_SERVER_ERROR, axum::Json(response)); } }, } -- 2.47.3 From 4eee8e3b034e0a4a0f8fb2e59b5d3e2143d0a8ea Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 6 Aug 2026 17:55:17 -0400 Subject: [PATCH 42/91] Updating workflow --- .github/workflows/workflow.yml | 41 +++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index af77d03..3d228ec 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -49,21 +49,6 @@ jobs: --health-timeout 5s --health-retries 5 - localstack: - image: localstack/localstack:latest - env: - SERVICES: s3 - AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} - AWS_DEFAULT_REGION: ${{ secrets.GARAGE_REGION }} - options: >- - --health-cmd "curl -f http://localhost:4566/_localstack/health || exit 1" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 3900:3900 - steps: - uses: actions/checkout@v6 - uses: actions-rust-lang/setup-rust-toolchain@v1 @@ -82,6 +67,30 @@ jobs: docker ps -a echo "Docker environment check complete." + - name: Setup LocalStack S3 + run: | + # Install AWS CLI + sudo apt-get update + sudo apt-get install -y awscli + + # Wait for LocalStack + until curl -s http://localhost:4566/_localstack/health | grep -q '"s3":"available"'; do + sleep 2 + done + + # CHOOSE A BUCKET NAME - this is whatever you want + BUCKET_NAME="soaricarus-ci-bucket" # <-- CHANGE THIS TO WHAT YOUR APP EXPECTS + + # Create the bucket + aws --endpoint-url=http://localhost:4566 s3 mb s3://$BUCKET_NAME --region ${{ secrets.GARAGE_REGION }} + + # Set it as an environment variable for the test step + echo "BUCKET_NAME=$BUCKET_NAME" >> $GITHUB_ENV + env: + AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} + AWS_DEFAULT_REGION: ${{ secrets.GARAGE_REGION }} + - name: Run tests env: # Define DATABASE_URL for tests to use @@ -96,7 +105,7 @@ jobs: GARAGE_DEFAULT_ACCESS_KEY: ${{ secrets.GARAGE_KEY_ID }} GARAGE_DEFAULT_SECRET_KEY: ${{ secrets.GARAGE_SECRET }} GARAGE_S3_REGION: ${{ secrets.GARAGE_REGION }} - S3_BUCKET_NAME: "soaricarus-bucket" + S3_BUCKET_NAME: "soaricarus-ci-bucket" S3_ENDPOINT_URL: "http://localhost:3900" run: | mkdir -p ~/.ssh -- 2.47.3 From 27e6b51616399544c04673770028a1e1a8d18359 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 6 Aug 2026 17:56:05 -0400 Subject: [PATCH 43/91] bump: labyrinth --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f0cdc37..f5f075d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1937,8 +1937,8 @@ checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" [[package]] name = "labyrinth" -version = "0.0.1" -source = "git+ssh://git@git.kundeng.us/phoenix/labyrinth.git?tag=v0.0.1-1-742393c25b-928#742393c25b73aa73dce963cb6b4a740e64b93051" +version = "0.0.2" +source = "git+ssh://git@git.kundeng.us/phoenix/labyrinth.git?tag=v0.0.2-1-84f98521c8-928#84f98521c8c98693e422db48eb0aa7c124c2586b" dependencies = [ "aws-config", "aws-sdk-s3", diff --git a/Cargo.toml b/Cargo.toml index f9e5520..b824d32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] } simeta = { git = "ssh://git@git.kundeng.us/phoenix/simeta.git", tag = "v0.6.1-main-b690995806-680" } simodels = { git = "ssh://git@git.kundeng.us/phoenix/simodels.git", tag = "v0.11.3-main-fe9d101bd0-111" } sienvy = { git = "ssh://git@git.kundeng.us/phoenix/sienvy.git", tag = "v0.8.0-main-d06c8fdf49-006" } -labyrinth = { git = "ssh://git@git.kundeng.us/phoenix/labyrinth.git", tag = "v0.0.1-1-742393c25b-928" } +labyrinth = { git = "ssh://git@git.kundeng.us/phoenix/labyrinth.git", tag = "v0.0.2-1-84f98521c8-928" } [dev-dependencies] common-multipart-rfc7578 = { version = "0.7.0" } -- 2.47.3 From 9042ba13e7116d14ca36631eb1ddb081bfc531a6 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 6 Aug 2026 18:01:02 -0400 Subject: [PATCH 44/91] ci: Change sleep time in s3 setup --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 3d228ec..d4b8811 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -75,7 +75,7 @@ jobs: # Wait for LocalStack until curl -s http://localhost:4566/_localstack/health | grep -q '"s3":"available"'; do - sleep 2 + sleep 3 done # CHOOSE A BUCKET NAME - this is whatever you want -- 2.47.3 From 685f2f925754190396ce16fa53c65e2c5ab1435a Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 6 Aug 2026 18:49:48 -0400 Subject: [PATCH 45/91] Let's try this --- .github/workflows/workflow.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index d4b8811..0c3f695 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -70,8 +70,7 @@ jobs: - name: Setup LocalStack S3 run: | # Install AWS CLI - sudo apt-get update - sudo apt-get install -y awscli + pip install awscli # Wait for LocalStack until curl -s http://localhost:4566/_localstack/health | grep -q '"s3":"available"'; do -- 2.47.3 From 61df07732d6319da18a1d4d0b9d99449e0fcb59c Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 6 Aug 2026 18:56:19 -0400 Subject: [PATCH 46/91] Try it again --- .github/workflows/workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0c3f695..37f6e49 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -70,6 +70,8 @@ jobs: - name: Setup LocalStack S3 run: | # Install AWS CLI + sudo apt update + sudo apt search awscli pip install awscli # Wait for LocalStack -- 2.47.3 From 25c745e951a9b285a19e59d7f00e4521d6d2f743 Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 10:50:20 -0400 Subject: [PATCH 47/91] Updating workflow --- .github/workflows/pr.yml | 118 +++++++++++++++++++++++++++++++++ .github/workflows/workflow.yml | 2 - 2 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..978a5c3 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,118 @@ +name: pr CI + +on: + pull_request: + branches: [ "main" ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + + +jobs: + check: + name: Check + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: 1.97 + - uses: Swatinem/rust-cache@v2 + - run: | + mkdir -p ~/.ssh + echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/soaricarus_models_deploy_key + chmod 600 ~/.ssh/soaricarus_models_deploy_key + ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts + + eval $(ssh-agent -s) + ssh-add -v ~/.ssh/soaricarus_models_deploy_key + + cargo check + + test: + name: Test Suite + runs-on: ubuntu-24.04 + timeout-minutes: 20 + services: + postgres: + image: postgres:18.4-alpine + env: + POSTGRES_USER: ${{ secrets.DB_TEST_USER || 'testuser' }} + POSTGRES_PASSWORD: ${{ secrets.DB_TEST_PASSWORD || 'testpassword' }} + POSTGRES_DB: ${{ secrets.DB_TEST_NAME || 'testdb' }} + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - uses: actions/checkout@v6 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: 1.97 + - uses: Swatinem/rust-cache@v2 + - name: Verify Docker Environment + run: | + echo "Runner User Info:" + id + echo "Checking Docker Version:" + docker --version + echo "Checking Docker Daemon Status (info):" + docker info + echo "Checking Docker Daemon Status (ps):" + docker ps -a + echo "Docker environment check complete." + + - name: Setup LocalStack S3 + run: | + # Install AWS CLI + sudo apt update + sudo apt search awscli + pip install awscli + + # Wait for LocalStack + until curl -s http://localhost:4566/_localstack/health | grep -q '"s3":"available"'; do + sleep 3 + done + + # CHOOSE A BUCKET NAME - this is whatever you want + BUCKET_NAME="soaricarus-ci-bucket" # <-- CHANGE THIS TO WHAT YOUR APP EXPECTS + + # Create the bucket + aws --endpoint-url=http://localhost:4566 s3 mb s3://$BUCKET_NAME --region ${{ secrets.GARAGE_REGION }} + + # Set it as an environment variable for the test step + echo "BUCKET_NAME=$BUCKET_NAME" >> $GITHUB_ENV + env: + AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} + AWS_DEFAULT_REGION: ${{ secrets.GARAGE_REGION }} + + - name: Run tests + env: + # Define DATABASE_URL for tests to use + DATABASE_URL: postgresql://${{ secrets.DB_TEST_USER || 'testuser' }}:${{ secrets.DB_TEST_PASSWORD || 'testpassword' }}@postgres:5432/${{ secrets.DB_TEST_NAME || 'testdb' }} + RUST_LOG: info # Optional: configure test log level + SECRET_MAIN_KEY: ${{ secrets.TOKEN_SECRET_KEY }} + SSH_AUTH_SOCK: ${{ env.SSH_AUTH_SOCK }} + ROOT_DIRECTORY: "/tmp" + AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} + AWS_DEFAULT_REGION: ${{ secrets.GARAGE_REGION }} + GARAGE_DEFAULT_ACCESS_KEY: ${{ secrets.GARAGE_KEY_ID }} + GARAGE_DEFAULT_SECRET_KEY: ${{ secrets.GARAGE_SECRET }} + GARAGE_S3_REGION: ${{ secrets.GARAGE_REGION }} + S3_BUCKET_NAME: "soaricarus-ci-bucket" + S3_ENDPOINT_URL: "http://localhost:3900" + run: | + mkdir -p ~/.ssh + echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/soaricarus_models_deploy_key + chmod 600 ~/.ssh/soaricarus_models_deploy_key + ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts + + eval $(ssh-agent -s) + ssh-add -v ~/.ssh/soaricarus_models_deploy_key + + cargo test diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 37f6e49..064e975 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -3,8 +3,6 @@ name: soaricarus_api CI on: push: branches: [ "main" ] - pull_request: - branches: [ "main" ] concurrency: group: ${{ github.workflow }}-${{ github.ref }} -- 2.47.3 From a47694164cdc908745c7ef749dc1e0ec1092a15c Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 10:52:15 -0400 Subject: [PATCH 48/91] Fixing workflow --- .github/workflows/pr.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 978a5c3..7954993 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -70,7 +70,11 @@ jobs: # Install AWS CLI sudo apt update sudo apt search awscli - pip install awscli + sudo apt install -y curl unzip + curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + unzip awscliv2.zip + sudo ./aws/install + aws --version # Wait for LocalStack until curl -s http://localhost:4566/_localstack/health | grep -q '"s3":"available"'; do -- 2.47.3 From f3f9d10ed5f2bba9625159eca95e73aa8888a9a5 Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 11:00:19 -0400 Subject: [PATCH 49/91] ci: Focusing on test for now --- .github/workflows/pr.yml | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 7954993..91825bd 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -10,26 +10,6 @@ concurrency: jobs: - check: - name: Check - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: 1.97 - - uses: Swatinem/rust-cache@v2 - - run: | - mkdir -p ~/.ssh - echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/soaricarus_models_deploy_key - chmod 600 ~/.ssh/soaricarus_models_deploy_key - ssh-keyscan ${{ secrets.MYHOST }} >> ~/.ssh/known_hosts - - eval $(ssh-agent -s) - ssh-add -v ~/.ssh/soaricarus_models_deploy_key - - cargo check - test: name: Test Suite runs-on: ubuntu-24.04 @@ -65,6 +45,15 @@ jobs: docker ps -a echo "Docker environment check complete." + + - name: Setup AWS CLI + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.GARAGE_KEY_ID }} + aws-secret-access-key: ${{ secrets.GARAGE_SECRET }} + aws-region: ${{ secrets.GARAGE_REGION }} + mask-aws-account-id: false + - name: Setup LocalStack S3 run: | # Install AWS CLI @@ -78,7 +67,8 @@ jobs: # Wait for LocalStack until curl -s http://localhost:4566/_localstack/health | grep -q '"s3":"available"'; do - sleep 3 + echo "Wating for localstack" + sleep 2 done # CHOOSE A BUCKET NAME - this is whatever you want -- 2.47.3 From 84bd59f488d40d5d8111a0349b6aada57d6df2b2 Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 11:06:09 -0400 Subject: [PATCH 50/91] ci: Trying out fake s3 --- .github/workflows/pr.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 91825bd..267be48 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -27,6 +27,16 @@ jobs: --health-timeout 5s --health-retries 5 + fake-s3: + image: lphoward/fake-s3:latest + ports: + - 4569:4569 + options: >- + --health-cmd "curl -f http://localhost:4569 || exit 1" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: - uses: actions/checkout@v6 - uses: actions-rust-lang/setup-rust-toolchain@v1 @@ -45,16 +55,7 @@ jobs: docker ps -a echo "Docker environment check complete." - - - name: Setup AWS CLI - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.GARAGE_KEY_ID }} - aws-secret-access-key: ${{ secrets.GARAGE_SECRET }} - aws-region: ${{ secrets.GARAGE_REGION }} - mask-aws-account-id: false - - - name: Setup LocalStack S3 + - name: Setup S3 run: | # Install AWS CLI sudo apt update -- 2.47.3 From c28f1dd0a9f75bd995582787084bb26c303f513a Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 11:10:06 -0400 Subject: [PATCH 51/91] ci: Updating fake s3 port --- .github/workflows/pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 267be48..9b682bb 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -67,7 +67,7 @@ jobs: aws --version # Wait for LocalStack - until curl -s http://localhost:4566/_localstack/health | grep -q '"s3":"available"'; do + until curl -s http://localhost:4569 | grep -q '"s3":"available"'; do echo "Wating for localstack" sleep 2 done @@ -76,7 +76,7 @@ jobs: BUCKET_NAME="soaricarus-ci-bucket" # <-- CHANGE THIS TO WHAT YOUR APP EXPECTS # Create the bucket - aws --endpoint-url=http://localhost:4566 s3 mb s3://$BUCKET_NAME --region ${{ secrets.GARAGE_REGION }} + aws --endpoint-url=http://localhost:4569 s3 mb s3://$BUCKET_NAME --region ${{ secrets.GARAGE_REGION }} # Set it as an environment variable for the test step echo "BUCKET_NAME=$BUCKET_NAME" >> $GITHUB_ENV -- 2.47.3 From 21928f7eac9cfc0bd5eedf5e60c34e69595de8e1 Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 11:13:02 -0400 Subject: [PATCH 52/91] ci: Do it --- .github/workflows/pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9b682bb..f14f75b 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -67,8 +67,8 @@ jobs: aws --version # Wait for LocalStack - until curl -s http://localhost:4569 | grep -q '"s3":"available"'; do - echo "Wating for localstack" + until curl -s http://localhost:4569; do + echo "Wating for localstack..." sleep 2 done -- 2.47.3 From 9368e80abedba7953124a98bd3386607d137c8c3 Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 11:19:12 -0400 Subject: [PATCH 53/91] ci: Maybe this time --- .github/workflows/pr.yml | 48 ++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index f14f75b..de5ecaa 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -27,15 +27,19 @@ jobs: --health-timeout 5s --health-retries 5 - fake-s3: - image: lphoward/fake-s3:latest - ports: - - 4569:4569 + minio: + image: minio/minio:latest + env: + MINIO_ROOT_USER: test + MINIO_ROOT_PASSWORD: test options: >- - --health-cmd "curl -f http://localhost:4569 || exit 1" + --health-cmd "curl -f http://localhost:9000/minio/health/ready || exit 1" --health-interval 10s --health-timeout 5s --health-retries 5 + ports: + - 9000:9000 + command: server /data --console-address ":9001" steps: - uses: actions/checkout@v6 @@ -57,28 +61,29 @@ jobs: - name: Setup S3 run: | - # Install AWS CLI - sudo apt update - sudo apt search awscli - sudo apt install -y curl unzip - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" - unzip awscliv2.zip - sudo ./aws/install - aws --version + # Download and install mc (MinIO Client) + wget https://dl.min.io/client/mc/release/linux-amd64/mc + chmod +x mc + sudo mv mc /usr/local/bin/ - # Wait for LocalStack - until curl -s http://localhost:4569; do - echo "Wating for localstack..." + # Wait for MinIO to be ready + until curl -s http://localhost:9000/minio/health/ready; do + echo "Waiting for MinIO..." sleep 2 done + echo "MinIO is ready!" - # CHOOSE A BUCKET NAME - this is whatever you want - BUCKET_NAME="soaricarus-ci-bucket" # <-- CHANGE THIS TO WHAT YOUR APP EXPECTS + # Configure mc to use MinIO + mc alias set localminio http://localhost:9000 test test # Create the bucket - aws --endpoint-url=http://localhost:4569 s3 mb s3://$BUCKET_NAME --region ${{ secrets.GARAGE_REGION }} + BUCKET_NAME="soaricarus-ci-bucket" + mc mb localminio/$BUCKET_NAME - # Set it as an environment variable for the test step + # Verify bucket was created + mc ls localminio/ + + # Set bucket name for test step echo "BUCKET_NAME=$BUCKET_NAME" >> $GITHUB_ENV env: AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} @@ -100,7 +105,8 @@ jobs: GARAGE_DEFAULT_SECRET_KEY: ${{ secrets.GARAGE_SECRET }} GARAGE_S3_REGION: ${{ secrets.GARAGE_REGION }} S3_BUCKET_NAME: "soaricarus-ci-bucket" - S3_ENDPOINT_URL: "http://localhost:3900" + S3_ENDPOINT_URL: "http://localhost:9000" + AWS_S3_FORCE_PATH_STYLE: "true" run: | mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/soaricarus_models_deploy_key -- 2.47.3 From b3fb8b308827d248a6daa27a91f0a12738b0bdad Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 11:24:46 -0400 Subject: [PATCH 54/91] Trying it out --- .github/workflows/pr.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index de5ecaa..407e840 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -32,11 +32,6 @@ jobs: env: MINIO_ROOT_USER: test MINIO_ROOT_PASSWORD: test - options: >- - --health-cmd "curl -f http://localhost:9000/minio/health/ready || exit 1" - --health-interval 10s - --health-timeout 5s - --health-retries 5 ports: - 9000:9000 command: server /data --console-address ":9001" @@ -66,12 +61,20 @@ jobs: chmod +x mc sudo mv mc /usr/local/bin/ - # Wait for MinIO to be ready - until curl -s http://localhost:9000/minio/health/ready; do - echo "Waiting for MinIO..." - sleep 2 + # Wait for MinIO with a simpler check + echo "Waiting for MinIO to start..." + for i in {1..30}; do + if curl -s http://localhost:9000/minio/health/ready > /dev/null 2>&1; then + echo "MinIO is ready!" + break + fi + echo "Attempt $i: MinIO not ready yet..." + docker logs minio || true # Show container logs for debugging + sleep 3 done - echo "MinIO is ready!" + + # Check if MinIO is actually running + docker ps | grep minio || echo "MinIO container is not running!" # Configure mc to use MinIO mc alias set localminio http://localhost:9000 test test -- 2.47.3 From dfa1dc448773160051b6892f26acb660aac83d23 Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 11:29:04 -0400 Subject: [PATCH 55/91] ci: This is a doozy --- .github/workflows/pr.yml | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 407e840..4979820 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -56,38 +56,24 @@ jobs: - name: Setup S3 run: | - # Download and install mc (MinIO Client) + # Download and install mc wget https://dl.min.io/client/mc/release/linux-amd64/mc chmod +x mc sudo mv mc /usr/local/bin/ - # Wait for MinIO with a simpler check - echo "Waiting for MinIO to start..." - for i in {1..30}; do - if curl -s http://localhost:9000/minio/health/ready > /dev/null 2>&1; then - echo "MinIO is ready!" - break - fi - echo "Attempt $i: MinIO not ready yet..." - docker logs minio || true # Show container logs for debugging - sleep 3 - done + # Simple wait - just try connecting + echo "Waiting for MinIO..." + sleep 10 # Give it a moment to start - # Check if MinIO is actually running - docker ps | grep minio || echo "MinIO container is not running!" + # Check if it's running + curl -v http://localhost:9000 || echo "Connection failed" - # Configure mc to use MinIO - mc alias set localminio http://localhost:9000 test test - - # Create the bucket - BUCKET_NAME="soaricarus-ci-bucket" - mc mb localminio/$BUCKET_NAME - - # Verify bucket was created + # Try to configure and create bucket + mc alias set localminio http://localhost:9000 test test || echo "mc config failed" + mc mb localminio/soaricarus-ci-bucket || echo "Bucket creation failed" mc ls localminio/ - - # Set bucket name for test step - echo "BUCKET_NAME=$BUCKET_NAME" >> $GITHUB_ENV + + echo "S3_BUCKET_NAME=soaricarus-ci-bucket" >> $GITHUB_ENV env: AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} -- 2.47.3 From 6c0b0fa7f0787fdd46908c0e75f8578a7396668d Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 11:30:17 -0400 Subject: [PATCH 56/91] ci: Fix --- .github/workflows/pr.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4979820..4804fb1 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -60,20 +60,20 @@ jobs: wget https://dl.min.io/client/mc/release/linux-amd64/mc chmod +x mc sudo mv mc /usr/local/bin/ - + # Simple wait - just try connecting echo "Waiting for MinIO..." sleep 10 # Give it a moment to start - + # Check if it's running curl -v http://localhost:9000 || echo "Connection failed" - + # Try to configure and create bucket mc alias set localminio http://localhost:9000 test test || echo "mc config failed" mc mb localminio/soaricarus-ci-bucket || echo "Bucket creation failed" mc ls localminio/ - - echo "S3_BUCKET_NAME=soaricarus-ci-bucket" >> $GITHUB_ENV + + echo "S3_BUCKET_NAME=soaricarus-ci-bucket" >> $GITHUB_ENV env: AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} -- 2.47.3 From 41d6ed0334ec06afa42275d24808a1aaa5d686b8 Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 11:39:13 -0400 Subject: [PATCH 57/91] ci: Switching s3 --- .github/workflows/pr.yml | 41 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4804fb1..28f2daf 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -27,15 +27,19 @@ jobs: --health-timeout 5s --health-retries 5 - minio: - image: minio/minio:latest + # Use fake-s3 instead of MinIO - simpler and more reliable + s3: + image: adobe/s3mock:latest env: - MINIO_ROOT_USER: test - MINIO_ROOT_PASSWORD: test + initialBuckets: soaricarus-ci-bucket + defaultRegion: ${{ secreats.GARAGE_REGION }} ports: - - 9000:9000 - command: server /data --console-address ":9001" - + - 9090:9090 + options: >- + --health-cmd "curl -f http://localhost:9090/ || exit 1" + --health-interval 10s + --health-timeout 5s + --health-retries 5 steps: - uses: actions/checkout@v6 - uses: actions-rust-lang/setup-rust-toolchain@v1 @@ -56,24 +60,9 @@ jobs: - name: Setup S3 run: | - # Download and install mc - wget https://dl.min.io/client/mc/release/linux-amd64/mc - chmod +x mc - sudo mv mc /usr/local/bin/ - - # Simple wait - just try connecting - echo "Waiting for MinIO..." - sleep 10 # Give it a moment to start - - # Check if it's running - curl -v http://localhost:9000 || echo "Connection failed" - - # Try to configure and create bucket - mc alias set localminio http://localhost:9000 test test || echo "mc config failed" - mc mb localminio/soaricarus-ci-bucket || echo "Bucket creation failed" - mc ls localminio/ - - echo "S3_BUCKET_NAME=soaricarus-ci-bucket" >> $GITHUB_ENV + # No need to install mc or create bucket - S3Mock creates it automatically! + echo "S3_BUCKET_NAME=soaricarus-ci-bucket" >> $GITHUB_ENV + echo "S3_ENDPOINT_URL=http://localhost:9090" >> $GITHUB_ENV env: AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} @@ -94,7 +83,7 @@ jobs: GARAGE_DEFAULT_SECRET_KEY: ${{ secrets.GARAGE_SECRET }} GARAGE_S3_REGION: ${{ secrets.GARAGE_REGION }} S3_BUCKET_NAME: "soaricarus-ci-bucket" - S3_ENDPOINT_URL: "http://localhost:9000" + S3_ENDPOINT_URL: "http://localhost:9090" AWS_S3_FORCE_PATH_STYLE: "true" run: | mkdir -p ~/.ssh -- 2.47.3 From 2fd93cae64b9ca27098a35012c31a47be582794d Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 11:40:00 -0400 Subject: [PATCH 58/91] Fix typo --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 28f2daf..bd6d5fb 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -32,7 +32,7 @@ jobs: image: adobe/s3mock:latest env: initialBuckets: soaricarus-ci-bucket - defaultRegion: ${{ secreats.GARAGE_REGION }} + defaultRegion: ${{ secrets.GARAGE_REGION }} ports: - 9090:9090 options: >- -- 2.47.3 From 9c57caa860e141a6d93bc5e2af0283d3446f3edd Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 11:48:31 -0400 Subject: [PATCH 59/91] ci: Get it up --- .github/workflows/pr.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index bd6d5fb..5c60e36 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -62,7 +62,13 @@ jobs: run: | # No need to install mc or create bucket - S3Mock creates it automatically! echo "S3_BUCKET_NAME=soaricarus-ci-bucket" >> $GITHUB_ENV - echo "S3_ENDPOINT_URL=http://localhost:9090" >> $GITHUB_ENV + echo "S3_ENDPOINT_URL=http://localhost:9090" >> $GITHUB_ENV + echo "AWS_ACCESS_KEY_ID=test" >> $GITHUB_ENV + echo "AWS_SECRET_ACCESS_KEY=test" >> $GITHUB_ENV + echo "AWS_DEFAULT_REGION=us-east-1" >> $GITHUB_ENV + + # Test connection to S3Mock + curl -v http://localhost:9090 || echo "S3Mock not responding" env: AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} @@ -76,12 +82,12 @@ jobs: SECRET_MAIN_KEY: ${{ secrets.TOKEN_SECRET_KEY }} SSH_AUTH_SOCK: ${{ env.SSH_AUTH_SOCK }} ROOT_DIRECTORY: "/tmp" - AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} - AWS_DEFAULT_REGION: ${{ secrets.GARAGE_REGION }} - GARAGE_DEFAULT_ACCESS_KEY: ${{ secrets.GARAGE_KEY_ID }} - GARAGE_DEFAULT_SECRET_KEY: ${{ secrets.GARAGE_SECRET }} - GARAGE_S3_REGION: ${{ secrets.GARAGE_REGION }} + AWS_ACCESS_KEY_ID: test + AWS_SECRET_ACCESS_KEY: test + AWS_DEFAULT_REGION: us-east-1 + GARAGE_DEFAULT_ACCESS_KEY: test + GARAGE_DEFAULT_SECRET_KEY: test + GARAGE_S3_REGION: us-east-1 S3_BUCKET_NAME: "soaricarus-ci-bucket" S3_ENDPOINT_URL: "http://localhost:9090" AWS_S3_FORCE_PATH_STYLE: "true" -- 2.47.3 From 5ce07d8eb2875ad0555719dff73ef78ba828b508 Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 12:25:09 -0400 Subject: [PATCH 60/91] ci: Using docker --- .github/workflows/pr.yml | 50 +++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5c60e36..c28abe9 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,20 +26,30 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 - - # Use fake-s3 instead of MinIO - simpler and more reliable - s3: - image: adobe/s3mock:latest + # Garage S3 service - just like in docker-compose! + garage: + image: dxflrs/garage:v2.3.0 env: - initialBuckets: soaricarus-ci-bucket - defaultRegion: ${{ secrets.GARAGE_REGION }} + GARAGE_SERVER_BIND_ADDR: "0.0.0.0:3900" + GARAGE_S3_API_BIND_ADDR: "0.0.0.0:3900" + GARAGE_CLUSTER_REPLICATION_MODE: "none" + GARAGE_RPC_SECRET: "w03ABWJDfYsrkd+WpT/7G7gVkFCJQi+MGt/+1nyy0hc=" + GARAGE_ADMIN_TOKEN: "test-admin-token" + GARAGE_DEFAULT_ACCESS_KEY: "test" + GARAGE_DEFAULT_SECRET_KEY: "test" + GARAGE_DEFAULT_BUCKET: "soaricarus-ci-bucket" + GARAGE_S3_REGION: "us-east-1" + GARAGE_DATA_DIR: "/data" + GARAGE_METADATA_DIR: "/data/meta" ports: - - 9090:9090 + - 3900:3900 options: >- - --health-cmd "curl -f http://localhost:9090/ || exit 1" + --health-cmd "curl -f http://localhost:3900/ || exit 1" --health-interval 10s --health-timeout 5s --health-retries 5 + command: ["/garage", "server", "--single-node", "--default-bucket"] + steps: - uses: actions/checkout@v6 - uses: actions-rust-lang/setup-rust-toolchain@v1 @@ -60,19 +70,17 @@ jobs: - name: Setup S3 run: | - # No need to install mc or create bucket - S3Mock creates it automatically! - echo "S3_BUCKET_NAME=soaricarus-ci-bucket" >> $GITHUB_ENV - echo "S3_ENDPOINT_URL=http://localhost:9090" >> $GITHUB_ENV - echo "AWS_ACCESS_KEY_ID=test" >> $GITHUB_ENV - echo "AWS_SECRET_ACCESS_KEY=test" >> $GITHUB_ENV - echo "AWS_DEFAULT_REGION=us-east-1" >> $GITHUB_ENV - - # Test connection to S3Mock - curl -v http://localhost:9090 || echo "S3Mock not responding" - env: - AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} - AWS_DEFAULT_REGION: ${{ secrets.GARAGE_REGION }} + sudo apt update + sudo apt install curl unzip -y + curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + unzip awscliv2.zip + sudo ./aws/install + aws --version + # Garage is accessible at localhost:3900 + curl -v http://localhost:3900 + + # Create bucket + aws --endpoint-url=http://localhost:3900 s3 mb s3://soaricarus-ci-bucket --region us-east-1 - name: Run tests env: -- 2.47.3 From 43d2625e69963099763b9d541767d00e5e1e0ae6 Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 12:28:29 -0400 Subject: [PATCH 61/91] ci: Go for it --- .github/workflows/pr.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c28abe9..b781dd8 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -77,6 +77,9 @@ jobs: sudo ./aws/install aws --version # Garage is accessible at localhost:3900 + echo "Trying garage" + curl -v http://garage:3900 + echo "Same old" curl -v http://localhost:3900 # Create bucket -- 2.47.3 From 3106242640540f0f8e0c3f61529dfb12f9df84cc Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 12:32:47 -0400 Subject: [PATCH 62/91] ci: Try --- .github/workflows/pr.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b781dd8..c939130 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -77,8 +77,7 @@ jobs: sudo ./aws/install aws --version # Garage is accessible at localhost:3900 - echo "Trying garage" - curl -v http://garage:3900 + sleep 15 echo "Same old" curl -v http://localhost:3900 -- 2.47.3 From 2b70eeb1a969d96508b75406393d05fa8d8a787f Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 12:34:06 -0400 Subject: [PATCH 63/91] ci: Checking it --- .github/workflows/pr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c939130..3cab216 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -78,6 +78,8 @@ jobs: aws --version # Garage is accessible at localhost:3900 sleep 15 + docker ps -a | grep garage || echo "Garage container not found" + sleep 15 echo "Same old" curl -v http://localhost:3900 -- 2.47.3 From fc01503b1295371a16e75fc461467f62d566276e Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 7 Aug 2026 12:42:13 -0400 Subject: [PATCH 64/91] ci: Try it again --- .github/workflows/pr.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3cab216..8b5a743 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -32,11 +32,13 @@ jobs: env: GARAGE_SERVER_BIND_ADDR: "0.0.0.0:3900" GARAGE_S3_API_BIND_ADDR: "0.0.0.0:3900" + GARAGE_ADMIN_BIND_ADDR: "0.0.0.0:3902" + GARAGE_RPC_BIND_ADDR: "0.0.0.0:3901" GARAGE_CLUSTER_REPLICATION_MODE: "none" GARAGE_RPC_SECRET: "w03ABWJDfYsrkd+WpT/7G7gVkFCJQi+MGt/+1nyy0hc=" GARAGE_ADMIN_TOKEN: "test-admin-token" - GARAGE_DEFAULT_ACCESS_KEY: "test" - GARAGE_DEFAULT_SECRET_KEY: "test" + GARAGE_DEFAULT_ACCESS_KEY: "${{ secrets.GARAGE_KEY_ID }}" + GARAGE_DEFAULT_SECRET_KEY: "${{ secrets.GARAGE_SECRET }}" GARAGE_DEFAULT_BUCKET: "soaricarus-ci-bucket" GARAGE_S3_REGION: "us-east-1" GARAGE_DATA_DIR: "/data" @@ -94,14 +96,14 @@ jobs: SECRET_MAIN_KEY: ${{ secrets.TOKEN_SECRET_KEY }} SSH_AUTH_SOCK: ${{ env.SSH_AUTH_SOCK }} ROOT_DIRECTORY: "/tmp" - AWS_ACCESS_KEY_ID: test - AWS_SECRET_ACCESS_KEY: test + AWS_ACCESS_KEY_ID: "${{ secrets.GARAGE_KEY_ID }}" + AWS_SECRET_ACCESS_KEY: "${{ secrets.GARAGE_SECRET }}" AWS_DEFAULT_REGION: us-east-1 - GARAGE_DEFAULT_ACCESS_KEY: test - GARAGE_DEFAULT_SECRET_KEY: test + GARAGE_DEFAULT_ACCESS_KEY: "${{ secrets.GARAGE_KEY_ID }}" + GARAGE_DEFAULT_SECRET_KEY: "${{ secrets.GARAGE_SECRET }}" GARAGE_S3_REGION: us-east-1 S3_BUCKET_NAME: "soaricarus-ci-bucket" - S3_ENDPOINT_URL: "http://localhost:9090" + S3_ENDPOINT_URL: "http://localhost:3900" AWS_S3_FORCE_PATH_STYLE: "true" run: | mkdir -p ~/.ssh -- 2.47.3 From 4c4326bb88540383030445746084b2f2224755a1 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 11:58:25 -0400 Subject: [PATCH 65/91] ci: Try it --- .github/workflows/pr.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 8b5a743..7fdbb1a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -35,7 +35,7 @@ jobs: GARAGE_ADMIN_BIND_ADDR: "0.0.0.0:3902" GARAGE_RPC_BIND_ADDR: "0.0.0.0:3901" GARAGE_CLUSTER_REPLICATION_MODE: "none" - GARAGE_RPC_SECRET: "w03ABWJDfYsrkd+WpT/7G7gVkFCJQi+MGt/+1nyy0hc=" + GARAGE_RPC_SECRET: "aa7c56948e0b1e7bdaf72c0a60eba338873d36b5db7eddee36a8ca057baa7dd7" GARAGE_ADMIN_TOKEN: "test-admin-token" GARAGE_DEFAULT_ACCESS_KEY: "${{ secrets.GARAGE_KEY_ID }}" GARAGE_DEFAULT_SECRET_KEY: "${{ secrets.GARAGE_SECRET }}" @@ -43,6 +43,7 @@ jobs: GARAGE_S3_REGION: "us-east-1" GARAGE_DATA_DIR: "/data" GARAGE_METADATA_DIR: "/data/meta" + AWS_S3_FORCE_PATH_STYLE: "true" ports: - 3900:3900 options: >- -- 2.47.3 From 74dda6c9ef92e27fb4a484ae28f4ecea5e2a5247 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 12:05:25 -0400 Subject: [PATCH 66/91] ci: Try it --- .github/workflows/pr.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 7fdbb1a..8d3f051 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -79,15 +79,10 @@ jobs: unzip awscliv2.zip sudo ./aws/install aws --version - # Garage is accessible at localhost:3900 - sleep 15 - docker ps -a | grep garage || echo "Garage container not found" - sleep 15 - echo "Same old" - curl -v http://localhost:3900 + curl -v ${{ secrets.S3_CI_ENDPOINT_URL }} # Create bucket - aws --endpoint-url=http://localhost:3900 s3 mb s3://soaricarus-ci-bucket --region us-east-1 + aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} s3 mb s3://soaricarus-ci-bucket --region us-east-1 - name: Run tests env: @@ -116,3 +111,15 @@ jobs: ssh-add -v ~/.ssh/soaricarus_models_deploy_key cargo test + + - name: Cleanup + if: always() + run: | + aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} \ + s3 rb s3://soaricarus-ci-bucket --force \ + --region us-east-1 + env: + AWS_ACCESS_KEY_ID: "${{ secrets.GARAGE_KEY_ID }}" + AWS_SECRET_ACCESS_KEY: "${{ secrets.GARAGE_SECRET }}" + AWS_DEFAULT_REGION: us-east-1 + continue-on-error: true -- 2.47.3 From efaa7122e2d14a850472e38b08baa4737175dcce Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 12:08:23 -0400 Subject: [PATCH 67/91] ci: Getting somewhere --- .github/workflows/pr.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 8d3f051..94694db 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -72,6 +72,10 @@ jobs: echo "Docker environment check complete." - name: Setup S3 + env: + GARAGE_DEFAULT_ACCESS_KEY: "${{ secrets.GARAGE_KEY_ID }}" + GARAGE_DEFAULT_SECRET_KEY: "${{ secrets.GARAGE_SECRET }}" + GARAGE_DEFAULT_BUCKET: "soaricarus-ci-bucket" run: | sudo apt update sudo apt install curl unzip -y -- 2.47.3 From 14f197d47233a4f75617877e7a14166d941ac14c Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 12:11:31 -0400 Subject: [PATCH 68/91] ci: Maybe this time? --- .github/workflows/pr.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 94694db..0c11bd1 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -76,6 +76,9 @@ jobs: GARAGE_DEFAULT_ACCESS_KEY: "${{ secrets.GARAGE_KEY_ID }}" GARAGE_DEFAULT_SECRET_KEY: "${{ secrets.GARAGE_SECRET }}" GARAGE_DEFAULT_BUCKET: "soaricarus-ci-bucket" + AWS_ACCESS_KEY_ID: "${{ secrets.GARAGE_KEY_ID }}" + AWS_SECRET_ACCESS_KEY: "${{ secrets.GARAGE_SECRET }}" + AWS_DEFAULT_REGION: us-east-1 run: | sudo apt update sudo apt install curl unzip -y -- 2.47.3 From a2c9d938f948357d70cd271568fbc88008615167 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 12:19:51 -0400 Subject: [PATCH 69/91] ci: Changed url --- .github/workflows/pr.yml | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 0c11bd1..d067446 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,32 +26,6 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 - # Garage S3 service - just like in docker-compose! - garage: - image: dxflrs/garage:v2.3.0 - env: - GARAGE_SERVER_BIND_ADDR: "0.0.0.0:3900" - GARAGE_S3_API_BIND_ADDR: "0.0.0.0:3900" - GARAGE_ADMIN_BIND_ADDR: "0.0.0.0:3902" - GARAGE_RPC_BIND_ADDR: "0.0.0.0:3901" - GARAGE_CLUSTER_REPLICATION_MODE: "none" - GARAGE_RPC_SECRET: "aa7c56948e0b1e7bdaf72c0a60eba338873d36b5db7eddee36a8ca057baa7dd7" - GARAGE_ADMIN_TOKEN: "test-admin-token" - GARAGE_DEFAULT_ACCESS_KEY: "${{ secrets.GARAGE_KEY_ID }}" - GARAGE_DEFAULT_SECRET_KEY: "${{ secrets.GARAGE_SECRET }}" - GARAGE_DEFAULT_BUCKET: "soaricarus-ci-bucket" - GARAGE_S3_REGION: "us-east-1" - GARAGE_DATA_DIR: "/data" - GARAGE_METADATA_DIR: "/data/meta" - AWS_S3_FORCE_PATH_STYLE: "true" - ports: - - 3900:3900 - options: >- - --health-cmd "curl -f http://localhost:3900/ || exit 1" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - command: ["/garage", "server", "--single-node", "--default-bucket"] steps: - uses: actions/checkout@v6 @@ -86,7 +60,7 @@ jobs: unzip awscliv2.zip sudo ./aws/install aws --version - curl -v ${{ secrets.S3_CI_ENDPOINT_URL }} + # curl -v ${{ secrets.S3_CI_ENDPOINT_URL }} # Create bucket aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} s3 mb s3://soaricarus-ci-bucket --region us-east-1 @@ -106,7 +80,7 @@ jobs: GARAGE_DEFAULT_SECRET_KEY: "${{ secrets.GARAGE_SECRET }}" GARAGE_S3_REGION: us-east-1 S3_BUCKET_NAME: "soaricarus-ci-bucket" - S3_ENDPOINT_URL: "http://localhost:3900" + S3_ENDPOINT_URL: "${{ secrets.S3_CI_ENDPOINT_URL }}" AWS_S3_FORCE_PATH_STYLE: "true" run: | mkdir -p ~/.ssh -- 2.47.3 From 043adeb39081b785f2c119882cbe152877d7e3f7 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 12:45:39 -0400 Subject: [PATCH 70/91] ci: Updated --- .github/workflows/workflow.yml | 58 +++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 064e975..bfd4fdd 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -65,30 +65,25 @@ jobs: docker ps -a echo "Docker environment check complete." - - name: Setup LocalStack S3 - run: | - # Install AWS CLI - sudo apt update - sudo apt search awscli - pip install awscli - - # Wait for LocalStack - until curl -s http://localhost:4566/_localstack/health | grep -q '"s3":"available"'; do - sleep 3 - done - - # CHOOSE A BUCKET NAME - this is whatever you want - BUCKET_NAME="soaricarus-ci-bucket" # <-- CHANGE THIS TO WHAT YOUR APP EXPECTS - - # Create the bucket - aws --endpoint-url=http://localhost:4566 s3 mb s3://$BUCKET_NAME --region ${{ secrets.GARAGE_REGION }} - - # Set it as an environment variable for the test step - echo "BUCKET_NAME=$BUCKET_NAME" >> $GITHUB_ENV + - name: Setup S3 env: - AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} - AWS_DEFAULT_REGION: ${{ secrets.GARAGE_REGION }} + GARAGE_DEFAULT_ACCESS_KEY: "${{ secrets.GARAGE_KEY_ID }}" + GARAGE_DEFAULT_SECRET_KEY: "${{ secrets.GARAGE_SECRET }}" + GARAGE_DEFAULT_BUCKET: "soaricarus-ci-bucket" + AWS_ACCESS_KEY_ID: "${{ secrets.GARAGE_KEY_ID }}" + AWS_SECRET_ACCESS_KEY: "${{ secrets.GARAGE_SECRET }}" + AWS_DEFAULT_REGION: us-east-1 + run: | + sudo apt update + sudo apt install curl unzip -y + curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + unzip awscliv2.zip + sudo ./aws/install + aws --version + # curl -v ${{ secrets.S3_CI_ENDPOINT_URL }} + + # Create bucket + aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} s3 mb s3://soaricarus-ci-bucket --region us-east-1 - name: Run tests env: @@ -100,12 +95,13 @@ jobs: ROOT_DIRECTORY: "/tmp" AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} - AWS_DEFAULT_REGION: ${{ secrets.GARAGE_REGION }} + AWS_DEFAULT_REGION: us-east-1 GARAGE_DEFAULT_ACCESS_KEY: ${{ secrets.GARAGE_KEY_ID }} GARAGE_DEFAULT_SECRET_KEY: ${{ secrets.GARAGE_SECRET }} - GARAGE_S3_REGION: ${{ secrets.GARAGE_REGION }} + GARAGE_S3_REGION: us-east-1 S3_BUCKET_NAME: "soaricarus-ci-bucket" S3_ENDPOINT_URL: "http://localhost:3900" + AWS_S3_FORCE_PATH_STYLE: "true" run: | mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/soaricarus_models_deploy_key @@ -117,6 +113,18 @@ jobs: cargo test + - name: Cleanup + if: always() + run: | + aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} \ + s3 rb s3://soaricarus-ci-bucket --force \ + --region us-east-1 + env: + AWS_ACCESS_KEY_ID: "${{ secrets.GARAGE_KEY_ID }}" + AWS_SECRET_ACCESS_KEY: "${{ secrets.GARAGE_SECRET }}" + AWS_DEFAULT_REGION: us-east-1 + continue-on-error: true + fmt: name: Rustfmt runs-on: ubuntu-24.04 -- 2.47.3 From 84e6ff4718089715be0ae838e57243077598776d Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 12:45:54 -0400 Subject: [PATCH 71/91] Updating readme --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 797cb43..9261adc 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,21 @@ Copy the `.env.docker.sample` file to `.env`. Ensure that the `ROOT_DIRECTORY` v and exists on the docker image's filesystem. The credentials for the database doesn't need to be changed for development, but if deploying it, it should be modified. +### S3 Setup +Using the copied `.env.docker.sample`, ensure that the following has been properly populated. +``` +S3_ENDPOINT_URL - URL of the S3 bucket +S3_BUCKET_NAME - Name of the S3 bucket +GARAGE_S3_REGION - Region of the S3 bucket +GARAGE_RPC_SECRET - A 32-bit hex string +GARAGE_DEFAULT_ACCESS_KEY - Access key starting with GK followed with a 16-bit hex string +GARAGE_DEFAULT_SECRET_KEY - Secret key with a 32-bit hex string +``` + +The other S3-related environment variables can be left as is for the sake of getting +started. + + Build containers ``` docker compose build --ssh default -- 2.47.3 From e8e150e7b20eb2967be62a9ccd970d3d7bf93c44 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 12:46:09 -0400 Subject: [PATCH 72/91] bump: soaricarus_api --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f5f075d..a9d6d28 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3022,7 +3022,7 @@ dependencies = [ [[package]] name = "soaricarus_api" -version = "0.5.2" +version = "0.5.3" dependencies = [ "axum", "axum-extra", diff --git a/Cargo.toml b/Cargo.toml index b824d32..3120101 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "soaricarus_api" -version = "0.5.2" +version = "0.5.3" edition = "2024" rust-version = "1.95" license = "MIT" -- 2.47.3 From 16b92c0f5ee2655c9de763a6f85ae2487ccacc7b Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 12:58:28 -0400 Subject: [PATCH 73/91] ci: Go --- .github/workflows/pr.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d067446..d5b1f5c 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -47,23 +47,23 @@ jobs: - name: Setup S3 env: - GARAGE_DEFAULT_ACCESS_KEY: "${{ secrets.GARAGE_KEY_ID }}" - GARAGE_DEFAULT_SECRET_KEY: "${{ secrets.GARAGE_SECRET }}" - GARAGE_DEFAULT_BUCKET: "soaricarus-ci-bucket" + S3_BUCKET: "soaricarus-ci-bucket" AWS_ACCESS_KEY_ID: "${{ secrets.GARAGE_KEY_ID }}" AWS_SECRET_ACCESS_KEY: "${{ secrets.GARAGE_SECRET }}" AWS_DEFAULT_REGION: us-east-1 run: | sudo apt update + echo "Installing curl and unzip" sudo apt install curl unzip -y + + echo "Installing awscli" curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install aws --version - # curl -v ${{ secrets.S3_CI_ENDPOINT_URL }} - # Create bucket - aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} s3 mb s3://soaricarus-ci-bucket --region us-east-1 + echo "Creating bucket" + aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} s3 mb s3://$$S3_BUCKET --region $$AWS_DEFAULT_REGION - name: Run tests env: -- 2.47.3 From 565e0b29599238641da358f5a77f1db15c099b7d Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 13:01:19 -0400 Subject: [PATCH 74/91] Try it --- .github/workflows/pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d5b1f5c..90821c0 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -62,8 +62,8 @@ jobs: sudo ./aws/install aws --version - echo "Creating bucket" - aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} s3 mb s3://$$S3_BUCKET --region $$AWS_DEFAULT_REGION + echo "Creating bucket: $S3_BUCKET" + aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} s3 mb s3://$S3_BUCKET --region $AWS_DEFAULT_REGION - name: Run tests env: -- 2.47.3 From 076793a8674ad27bbad73631b494cb6dd5b7ad52 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 13:07:47 -0400 Subject: [PATCH 75/91] ci: Some tweaking --- .github/workflows/pr.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 90821c0..9f1cd55 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -47,7 +47,7 @@ jobs: - name: Setup S3 env: - S3_BUCKET: "soaricarus-ci-bucket" + S3_BUCKET: "soaricarus-ci-bucket-$(openssl rand -hex 4)" AWS_ACCESS_KEY_ID: "${{ secrets.GARAGE_KEY_ID }}" AWS_SECRET_ACCESS_KEY: "${{ secrets.GARAGE_SECRET }}" AWS_DEFAULT_REGION: us-east-1 @@ -79,7 +79,7 @@ jobs: GARAGE_DEFAULT_ACCESS_KEY: "${{ secrets.GARAGE_KEY_ID }}" GARAGE_DEFAULT_SECRET_KEY: "${{ secrets.GARAGE_SECRET }}" GARAGE_S3_REGION: us-east-1 - S3_BUCKET_NAME: "soaricarus-ci-bucket" + S3_BUCKET_NAME: "$S3_BUCKET" S3_ENDPOINT_URL: "${{ secrets.S3_CI_ENDPOINT_URL }}" AWS_S3_FORCE_PATH_STYLE: "true" run: | @@ -96,9 +96,10 @@ jobs: - name: Cleanup if: always() run: | + echo "Cleaning up bucket $S3_BUCKET" aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} \ - s3 rb s3://soaricarus-ci-bucket --force \ - --region us-east-1 + s3 rb s3://$S3_BUCKET --force \ + --region $AWS_DEFAULT_REGION env: AWS_ACCESS_KEY_ID: "${{ secrets.GARAGE_KEY_ID }}" AWS_SECRET_ACCESS_KEY: "${{ secrets.GARAGE_SECRET }}" -- 2.47.3 From 35c379a631d3f300a753a7e3f01833743a1344e0 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 13:12:08 -0400 Subject: [PATCH 76/91] ci: Change --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9f1cd55..75312fe 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -47,7 +47,6 @@ jobs: - name: Setup S3 env: - S3_BUCKET: "soaricarus-ci-bucket-$(openssl rand -hex 4)" AWS_ACCESS_KEY_ID: "${{ secrets.GARAGE_KEY_ID }}" AWS_SECRET_ACCESS_KEY: "${{ secrets.GARAGE_SECRET }}" AWS_DEFAULT_REGION: us-east-1 @@ -62,6 +61,7 @@ jobs: sudo ./aws/install aws --version + echo "S3_BUCKET=soaricarus-ci-bucket-$(openssl rand -hex 4)" >> $GITHUB_ENV echo "Creating bucket: $S3_BUCKET" aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} s3 mb s3://$S3_BUCKET --region $AWS_DEFAULT_REGION -- 2.47.3 From f00c16d1cd596ae349fda2117fe57eaec5003d5e Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 13:20:39 -0400 Subject: [PATCH 77/91] ci: Try it --- .github/workflows/pr.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 75312fe..12ffb8a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -61,7 +61,8 @@ jobs: sudo ./aws/install aws --version - echo "S3_BUCKET=soaricarus-ci-bucket-$(openssl rand -hex 4)" >> $GITHUB_ENV + echo $(echo $RANDOM | md5sum | head -c 8) + echo "S3_BUCKET=soaricarus-ci-bucket-$(echo $RANDOM | md5sum | head -c 8)" >> $GITHUB_ENV echo "Creating bucket: $S3_BUCKET" aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} s3 mb s3://$S3_BUCKET --region $AWS_DEFAULT_REGION -- 2.47.3 From 602b7db6cd8ed8dc443ef5368392bd6f72ce63ff Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 13:25:18 -0400 Subject: [PATCH 78/91] ci: Tweak --- .github/workflows/pr.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 12ffb8a..42d56d3 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -61,10 +61,10 @@ jobs: sudo ./aws/install aws --version - echo $(echo $RANDOM | md5sum | head -c 8) - echo "S3_BUCKET=soaricarus-ci-bucket-$(echo $RANDOM | md5sum | head -c 8)" >> $GITHUB_ENV - echo "Creating bucket: $S3_BUCKET" - aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} s3 mb s3://$S3_BUCKET --region $AWS_DEFAULT_REGION + BUCKET="soaricarus-ci-bucket-$(echo $RANDOM | md5sum | head -c 8)" + echo "S3_BUCKET=$BUCKET" >> $GITHUB_ENV + echo "Creating bucket: $BUCKET" + aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} s3 mb s3://$BUCKET --region $AWS_DEFAULT_REGION - name: Run tests env: -- 2.47.3 From 3d335db36237f8f19775cf9c59bbc35dc35c8640 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 13:29:05 -0400 Subject: [PATCH 79/91] ci: Better --- .github/workflows/pr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 42d56d3..4ee10b4 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -92,6 +92,8 @@ jobs: eval $(ssh-agent -s) ssh-add -v ~/.ssh/soaricarus_models_deploy_key + echo "Bucket: $S3_BUCKET" + cargo test - name: Cleanup -- 2.47.3 From acdddfe49b716ad6067dc283fe6566d18c40d215 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 13:32:41 -0400 Subject: [PATCH 80/91] ci: Wooo --- .github/workflows/pr.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4ee10b4..1226da5 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -80,7 +80,7 @@ jobs: GARAGE_DEFAULT_ACCESS_KEY: "${{ secrets.GARAGE_KEY_ID }}" GARAGE_DEFAULT_SECRET_KEY: "${{ secrets.GARAGE_SECRET }}" GARAGE_S3_REGION: us-east-1 - S3_BUCKET_NAME: "$S3_BUCKET" + S3_BUCKET_NAME: ${{ env.S3_BUCKET }} S3_ENDPOINT_URL: "${{ secrets.S3_CI_ENDPOINT_URL }}" AWS_S3_FORCE_PATH_STYLE: "true" run: | @@ -93,6 +93,7 @@ jobs: ssh-add -v ~/.ssh/soaricarus_models_deploy_key echo "Bucket: $S3_BUCKET" + echo "S3 Bucket: $S3_BUCKET_NAME" cargo test -- 2.47.3 From 3f982c126306d08a0b5f70a13c5a918dc9dfbabf Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 13:40:55 -0400 Subject: [PATCH 81/91] ci: Removing already created env --- .github/workflows/pr.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 1226da5..e6ae51e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -104,8 +104,4 @@ jobs: aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} \ s3 rb s3://$S3_BUCKET --force \ --region $AWS_DEFAULT_REGION - env: - AWS_ACCESS_KEY_ID: "${{ secrets.GARAGE_KEY_ID }}" - AWS_SECRET_ACCESS_KEY: "${{ secrets.GARAGE_SECRET }}" - AWS_DEFAULT_REGION: us-east-1 continue-on-error: true -- 2.47.3 From 24128e91afd4d07d4577f233303511201935173f Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 13:46:28 -0400 Subject: [PATCH 82/91] ci: Try again --- .github/workflows/pr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e6ae51e..4287c27 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -100,8 +100,8 @@ jobs: - name: Cleanup if: always() run: | - echo "Cleaning up bucket $S3_BUCKET" + echo "Cleaning up bucket ${{ env.S3_BUCKET }}" aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} \ - s3 rb s3://$S3_BUCKET --force \ - --region $AWS_DEFAULT_REGION + s3 rb s3://${{ env.S3_BUCKET }} --force \ + --region ${{ env.AWS_DEFAULT_REGION }} continue-on-error: true -- 2.47.3 From 3cd4b81dc442a43ba6e8a1a4bf8cec16fd0c382c Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 13:49:48 -0400 Subject: [PATCH 83/91] ci: Got something after this --- .github/workflows/pr.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4287c27..82cae75 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -103,5 +103,7 @@ jobs: echo "Cleaning up bucket ${{ env.S3_BUCKET }}" aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} \ s3 rb s3://${{ env.S3_BUCKET }} --force \ - --region ${{ env.AWS_DEFAULT_REGION }} + --region $AWS_DEFAULT_REGION + env: + AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }} continue-on-error: true -- 2.47.3 From 76eae50e35302c1764a17eb05ca86c3c8db0fa85 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 13:53:05 -0400 Subject: [PATCH 84/91] ci: Making env var available --- .github/workflows/pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 82cae75..bfd56a5 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -63,6 +63,7 @@ jobs: BUCKET="soaricarus-ci-bucket-$(echo $RANDOM | md5sum | head -c 8)" echo "S3_BUCKET=$BUCKET" >> $GITHUB_ENV + echo "AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION" >> $GITHUB_ENV echo "Creating bucket: $BUCKET" aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} s3 mb s3://$BUCKET --region $AWS_DEFAULT_REGION -- 2.47.3 From 9c35c66d614676548ecbeea449b5b1e21b6cb066 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 13:58:00 -0400 Subject: [PATCH 85/91] ci: Getting closer --- .github/workflows/pr.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index bfd56a5..d07516d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -102,9 +102,12 @@ jobs: if: always() run: | echo "Cleaning up bucket ${{ env.S3_BUCKET }}" + echo "Region: ${{ env.AWS_DEFAULT_REGION }}" + echo "B: $BUCK" aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} \ s3 rb s3://${{ env.S3_BUCKET }} --force \ --region $AWS_DEFAULT_REGION env: - AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }} + AWS_DEFAULT_REGION: us-east-1 + BUCK: ${{ env.S3_BUCKET }} continue-on-error: true -- 2.47.3 From 16e63a2dc2154ca35eeb8382d98ac31e1a5d1560 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 14:03:01 -0400 Subject: [PATCH 86/91] Go ci;git push --- .github/workflows/pr.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d07516d..c50c5f2 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -104,10 +104,13 @@ jobs: echo "Cleaning up bucket ${{ env.S3_BUCKET }}" echo "Region: ${{ env.AWS_DEFAULT_REGION }}" echo "B: $BUCK" - aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} \ - s3 rb s3://${{ env.S3_BUCKET }} --force \ + aws --endpoint-url=$ENDPOINT_URL \ + s3 rb s3://$BUCK --force \ --region $AWS_DEFAULT_REGION env: - AWS_DEFAULT_REGION: us-east-1 + ENDPOINT_URL: ${{ secrets.S3_CI_ENDPOINT_URL }} + AWS_ACCESS_KEY_ID: "${{ env.AWS_ACCESS_KEY_ID }}" + AWS_SECRET_ACCESS_KEY: "{{ env.AWS_SECRET_ACCESS_KEY }}" + AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}" BUCK: ${{ env.S3_BUCKET }} continue-on-error: true -- 2.47.3 From a7de834877534755f6153d1d0f1808f666663ae0 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 14:05:58 -0400 Subject: [PATCH 87/91] Go ci;git push --- .github/workflows/pr.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c50c5f2..87b5e4f 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -64,6 +64,9 @@ jobs: BUCKET="soaricarus-ci-bucket-$(echo $RANDOM | md5sum | head -c 8)" echo "S3_BUCKET=$BUCKET" >> $GITHUB_ENV echo "AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION" >> $GITHUB_ENV + echo "AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID" >> $GITHUB_ENV + echo "AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY" >> $GITHUB_ENV + echo "Creating bucket: $BUCKET" aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} s3 mb s3://$BUCKET --region $AWS_DEFAULT_REGION -- 2.47.3 From 0857921fd410ca8ceb85dda354476df0b1ca2ca7 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 14:08:02 -0400 Subject: [PATCH 88/91] ci: Saving changes --- .github/workflows/pr.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 87b5e4f..a9ed25c 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -72,7 +72,6 @@ jobs: - name: Run tests env: - # Define DATABASE_URL for tests to use DATABASE_URL: postgresql://${{ secrets.DB_TEST_USER || 'testuser' }}:${{ secrets.DB_TEST_PASSWORD || 'testpassword' }}@postgres:5432/${{ secrets.DB_TEST_NAME || 'testdb' }} RUST_LOG: info # Optional: configure test log level SECRET_MAIN_KEY: ${{ secrets.TOKEN_SECRET_KEY }} -- 2.47.3 From d4348d5a9b723da0409f4ca0669db606eb67edeb Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 14:11:34 -0400 Subject: [PATCH 89/91] ci: Fix --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a9ed25c..5a14474 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -113,6 +113,6 @@ jobs: ENDPOINT_URL: ${{ secrets.S3_CI_ENDPOINT_URL }} AWS_ACCESS_KEY_ID: "${{ env.AWS_ACCESS_KEY_ID }}" AWS_SECRET_ACCESS_KEY: "{{ env.AWS_SECRET_ACCESS_KEY }}" - AWS_DEFAULT_REGION: ${{ env.AWS_DEFAULT_REGION }}" + AWS_DEFAULT_REGION: "${{ env.AWS_DEFAULT_REGION }}" BUCK: ${{ env.S3_BUCKET }} continue-on-error: true -- 2.47.3 From 4257e4b7bc61128df555506cae2ef83cc6b347c0 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 14:14:35 -0400 Subject: [PATCH 90/91] ci: Forgot this --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5a14474..ce38d20 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -112,7 +112,7 @@ jobs: env: ENDPOINT_URL: ${{ secrets.S3_CI_ENDPOINT_URL }} AWS_ACCESS_KEY_ID: "${{ env.AWS_ACCESS_KEY_ID }}" - AWS_SECRET_ACCESS_KEY: "{{ env.AWS_SECRET_ACCESS_KEY }}" + AWS_SECRET_ACCESS_KEY: "${{ env.AWS_SECRET_ACCESS_KEY }}" AWS_DEFAULT_REGION: "${{ env.AWS_DEFAULT_REGION }}" BUCK: ${{ env.S3_BUCKET }} continue-on-error: true -- 2.47.3 From c5578da54e72f2bdf81ce3c367f5113e1f6afd59 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 8 Aug 2026 14:26:11 -0400 Subject: [PATCH 91/91] ci: Updating workflows --- .github/workflows/pr.yml | 16 ++++++-------- .github/workflows/workflow.yml | 40 +++++++++++++++++++++------------- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index ce38d20..caf3172 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -50,6 +50,7 @@ jobs: AWS_ACCESS_KEY_ID: "${{ secrets.GARAGE_KEY_ID }}" AWS_SECRET_ACCESS_KEY: "${{ secrets.GARAGE_SECRET }}" AWS_DEFAULT_REGION: us-east-1 + ENDPOINT_URL: "${{ secrets.S3_CI_ENDPOINT_URL}}" run: | sudo apt update echo "Installing curl and unzip" @@ -68,7 +69,7 @@ jobs: echo "AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY" >> $GITHUB_ENV echo "Creating bucket: $BUCKET" - aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} s3 mb s3://$BUCKET --region $AWS_DEFAULT_REGION + aws --endpoint-url=$ENDPOINT_URL s3 mb s3://$BUCKET --region $AWS_DEFAULT_REGION - name: Run tests env: @@ -79,10 +80,10 @@ jobs: ROOT_DIRECTORY: "/tmp" AWS_ACCESS_KEY_ID: "${{ secrets.GARAGE_KEY_ID }}" AWS_SECRET_ACCESS_KEY: "${{ secrets.GARAGE_SECRET }}" - AWS_DEFAULT_REGION: us-east-1 + AWS_DEFAULT_REGION: "${{ env.AWS_DEFAULT_REGION }}" GARAGE_DEFAULT_ACCESS_KEY: "${{ secrets.GARAGE_KEY_ID }}" GARAGE_DEFAULT_SECRET_KEY: "${{ secrets.GARAGE_SECRET }}" - GARAGE_S3_REGION: us-east-1 + GARAGE_S3_REGION: "${{ env.AWS_DEFAULT_REGION }}" S3_BUCKET_NAME: ${{ env.S3_BUCKET }} S3_ENDPOINT_URL: "${{ secrets.S3_CI_ENDPOINT_URL }}" AWS_S3_FORCE_PATH_STYLE: "true" @@ -95,17 +96,14 @@ jobs: eval $(ssh-agent -s) ssh-add -v ~/.ssh/soaricarus_models_deploy_key - echo "Bucket: $S3_BUCKET" - echo "S3 Bucket: $S3_BUCKET_NAME" - cargo test - name: Cleanup if: always() run: | - echo "Cleaning up bucket ${{ env.S3_BUCKET }}" - echo "Region: ${{ env.AWS_DEFAULT_REGION }}" - echo "B: $BUCK" + echo "Cleaning up bucket $BUCK" + echo "Region: $AWS_DEFAULT_REGION" + aws --endpoint-url=$ENDPOINT_URL \ s3 rb s3://$BUCK --force \ --region $AWS_DEFAULT_REGION diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index bfd4fdd..69871c6 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -67,27 +67,32 @@ jobs: - name: Setup S3 env: - GARAGE_DEFAULT_ACCESS_KEY: "${{ secrets.GARAGE_KEY_ID }}" - GARAGE_DEFAULT_SECRET_KEY: "${{ secrets.GARAGE_SECRET }}" - GARAGE_DEFAULT_BUCKET: "soaricarus-ci-bucket" AWS_ACCESS_KEY_ID: "${{ secrets.GARAGE_KEY_ID }}" AWS_SECRET_ACCESS_KEY: "${{ secrets.GARAGE_SECRET }}" AWS_DEFAULT_REGION: us-east-1 + ENDPOINT_URL: "${{ secrets.S3_CI_ENDPOINT_URL}}" run: | sudo apt update + echo "Installing curl and unzip" sudo apt install curl unzip -y + + echo "Installing awscli" curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install aws --version - # curl -v ${{ secrets.S3_CI_ENDPOINT_URL }} - # Create bucket - aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} s3 mb s3://soaricarus-ci-bucket --region us-east-1 + BUCKET="soaricarus-ci-bucket-$(echo $RANDOM | md5sum | head -c 8)" + echo "S3_BUCKET=$BUCKET" >> $GITHUB_ENV + echo "AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION" >> $GITHUB_ENV + echo "AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID" >> $GITHUB_ENV + echo "AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY" >> $GITHUB_ENV + + echo "Creating bucket: $BUCKET" + aws --endpoint-url=$ENDPOINT_URL s3 mb s3://$BUCKET --region $AWS_DEFAULT_REGION - name: Run tests env: - # Define DATABASE_URL for tests to use DATABASE_URL: postgresql://${{ secrets.DB_TEST_USER || 'testuser' }}:${{ secrets.DB_TEST_PASSWORD || 'testpassword' }}@postgres:5432/${{ secrets.DB_TEST_NAME || 'testdb' }} RUST_LOG: info # Optional: configure test log level SECRET_MAIN_KEY: ${{ secrets.TOKEN_SECRET_KEY }} @@ -95,10 +100,10 @@ jobs: ROOT_DIRECTORY: "/tmp" AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} - AWS_DEFAULT_REGION: us-east-1 + AWS_DEFAULT_REGION: "${{ env.AWS_DEFAULT_REGION }}" GARAGE_DEFAULT_ACCESS_KEY: ${{ secrets.GARAGE_KEY_ID }} GARAGE_DEFAULT_SECRET_KEY: ${{ secrets.GARAGE_SECRET }} - GARAGE_S3_REGION: us-east-1 + GARAGE_S3_REGION: "${{ env.AWS_DEFAULT_REGION }}" S3_BUCKET_NAME: "soaricarus-ci-bucket" S3_ENDPOINT_URL: "http://localhost:3900" AWS_S3_FORCE_PATH_STYLE: "true" @@ -116,13 +121,18 @@ jobs: - name: Cleanup if: always() run: | - aws --endpoint-url=${{ secrets.S3_CI_ENDPOINT_URL }} \ - s3 rb s3://soaricarus-ci-bucket --force \ - --region us-east-1 + echo "Cleaning up bucket $BUCK" + echo "Region: $AWS_DEFAULT_REGION" + + aws --endpoint-url=$ENDPOINT_URL \ + s3 rb s3://$BUCK --force \ + --region $AWS_DEFAULT_REGION env: - AWS_ACCESS_KEY_ID: "${{ secrets.GARAGE_KEY_ID }}" - AWS_SECRET_ACCESS_KEY: "${{ secrets.GARAGE_SECRET }}" - AWS_DEFAULT_REGION: us-east-1 + ENDPOINT_URL: ${{ secrets.S3_CI_ENDPOINT_URL }} + AWS_ACCESS_KEY_ID: "${{ env.AWS_ACCESS_KEY_ID }}" + AWS_SECRET_ACCESS_KEY: "${{ env.AWS_SECRET_ACCESS_KEY }}" + AWS_DEFAULT_REGION: "${{ env.AWS_DEFAULT_REGION }}" + BUCK: ${{ env.S3_BUCKET }} continue-on-error: true fmt: -- 2.47.3