#!/bin/bash

# Loop from 0 to 99
for index in {0..99}
do
    echo "Processing shard $index..."
    
    sudo docker run --rm \
        -v "$PWD":/app \
        -w /app \
        my-python-jupyter-suno \
        python3 -u upload_index_file_to_s3.py \
        --local_file_path "./index/genius_shazam_index_dict_shard_${index}.pkl" \
        --s3_bucket "suno-data" \
        --s3_key "ashe/processed_genius_fingerprints/genius_shazam_index_dict_shard_${index}.pkl"
    
    # Check if the command was successful
    if [ $? -eq 0 ]; then
        echo "Successfully uploaded shard $index"
    else
        echo "Failed to upload shard $index"
        # Optionally exit on first failure
        # exit 1
    fi
done
