-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun-dat-platform.sh
More file actions
executable file
·70 lines (54 loc) · 2.45 KB
/
run-dat-platform.sh
File metadata and controls
executable file
·70 lines (54 loc) · 2.45 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
#!/bin/bash
echo " +@@#. +#*+- %@- #%=
@@@@- #@@@@@#: .@@+ @@*
--. -#@@@@@@* .@@+ @@*
:#@@@@* .+#@@@%#=.@@+ :+#@@@@#+: .**@@%**+
#@@%-. .=%@@* @@@@@. +@@#-:.:=#@@@+ #@@+:..:+@@#.-=@@#==-
%@@@+:.:+@@@% %@@@@: =@@- +@@+ %@% %@# @@*
.. :. +@@@@% #@% @@+.@@= =@@ @@*
:: :+*@@@@@%. =@@. -@@: @@# #@@. @@*
%@@@: #@@@@@@+ *@@+. :*@@= :@@%-. .-%@@@. *@@-..
*@@%. *%%#+- :*%@@@@@%+. =%@@@@@%=+@@ =%@@@=
"
# Step 1: Create a new directory
mkdir dat
cd dat || exit
# Step 3: Create a directory named db-scripts
mkdir db-scripts
# Step 4: Download an SQL file via curl and save it in db-scripts directory
curl -o db-scripts/001-create-db-seed.sql https://raw.githubusercontent.com/dat-labs/dat-main/main/db-scripts/001-create-db-seed.sql
# Step 5: Download a docker-compose file via curl
curl -O https://raw.githubusercontent.com/dat-labs/dat-main/main/docker-compose.yml
# Step 5: docker compose down just to be safe
docker compose down
docker pull datlabs/dat-api:latest
docker pull datlabs/dat-orchestrator:latest
docker pull datlabs/dat-telemetry:latest
docker pull datlabs/dat-scheduler:latest
docker pull datlabs/dat-ui:latest
# Step 7: Seed local database with verified-actors
docker compose up db-backend api -d
API_URL="http://localhost:8000/connections/list"
while true; do
# Use curl to check if the API is reachable
response=$(curl --write-out "%{http_code}" --silent --output /dev/null "$API_URL?workspace_id=wkspc-uuid")
# Check if the response code is 200
if [ "$response" -eq 200 ]; then
echo "API is reachable. Exiting the loop."
break
else
echo "API is not reachable. Sleeping for 10 second..."
sleep 10
fi
done
# Step 7.1: Create a directory named sh-scripts
mkdir sh-scripts
# Step 7.2: Download an sh file via curl and save it in sh-scripts directory
curl -o sh-scripts/actors-seed.sh https://raw.githubusercontent.com/dat-labs/dat-main/main/sh-scripts/actors-seed.sh
curl -o sh-scripts/actors.csv https://raw.githubusercontent.com/dat-labs/dat-main/main/sh-scripts/actors.csv
# Step 7.3: Execute the downloaded file
bash sh-scripts/actors-seed.sh
# Prepare for launch
docker compose down
# Step 7: Run docker compose up
docker compose up