-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_remote_server.sh
More file actions
executable file
·76 lines (64 loc) · 2.46 KB
/
setup_remote_server.sh
File metadata and controls
executable file
·76 lines (64 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env bash
# ============================================================================
# Setup Blackbird dataset + WebDAV on a remote server
#
# Run this on the remote machine where the MP3 files live:
# /home/k4/Datasets/Music_Part1.01_Test/
#
# Prerequisites:
# - pip install blackbird (or install from this repo)
# - Ubuntu (for the WebDAV nginx setup)
# ============================================================================
set -euo pipefail
DATASET_PATH="/home/k4/Datasets/Music_Part1.01_Part01"
WEBDAV_PORT=8091
WEBDAV_USER="blackbird"
WEBDAV_PASS="dataset"
echo "=== Step 0: Install nginx with WebDAV support ==="
sudo apt-get update -qq
sudo apt-get install -y -qq nginx libnginx-mod-http-dav-ext
SCHEMA_FILE="$DATASET_PATH/.blackbird/schema.json"
if [[ -f "$SCHEMA_FILE" ]]; then
echo "=== Schema already exists at $SCHEMA_FILE, skipping discovery ==="
else
echo "=== Step 1: Discover schema from MP3 files ==="
blackbird schema discover "$DATASET_PATH" --test-run
echo ""
echo "=== Step 2: Save discovered schema ==="
blackbird schema discover "$DATASET_PATH"
fi
echo ""
echo "=== Step 3: Add result components for streaming uploads ==="
# These are produced by process_remote_streaming.py and uploaded back.
# Adding them to the schema makes them visible in stats/find-tracks/reindex.
#blackbird schema add "$DATASET_PATH" "mir.json" "*.mir.json"
#blackbird schema add "$DATASET_PATH" "vocal.mp3" "*_vocal.mp3"
echo ""
echo "=== Step 4: Build index ==="
blackbird reindex "$DATASET_PATH"
echo ""
echo "=== Step 5: Check dataset stats ==="
blackbird stats "$DATASET_PATH"
echo ""
echo "=== Step 6: Setup WebDAV server ==="
blackbird webdav setup "$DATASET_PATH" \
--port "$WEBDAV_PORT" \
--username "$WEBDAV_USER" \
--password "$WEBDAV_PASS" \
--non-interactive
echo ""
echo "=== Step 7: Verify WebDAV is running ==="
blackbird webdav list
echo ""
echo "============================================================"
echo " WebDAV server is running!"
echo ""
echo " URL: webdav://${WEBDAV_USER}:${WEBDAV_PASS}@<SERVER_IP>:${WEBDAV_PORT}/"
echo ""
echo " From the client machine, run:"
echo " blackbird stats webdav://${WEBDAV_USER}:${WEBDAV_PASS}@<SERVER_IP>:${WEBDAV_PORT}/"
echo " python examples/process_remote_streaming.py"
echo ""
echo " After processing, reindex on the server to pick up new files:"
echo " blackbird reindex ${DATASET_PATH}"
echo "============================================================"