File size: 953 Bytes
2c80eb3
 
 
 
fcffc62
 
f79718f
 
 
 
fcffc62
 
 
 
f79718f
fcffc62
 
f79718f
fcffc62
 
 
f79718f
fcffc62
 
f79718f
fcffc62
 
2c80eb3
f79718f
 
3aae0cf
f79718f
0dafcc8
3aae0cf
2c80eb3
f79718f
 
 
 
 
 
0dafcc8
fcffc62
2c80eb3
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
#!/usr/bin/env bash

set -e

whoami

# Generate hashed passwords
team_password=$(htpasswd -nbB "" "$TEAM_PASSWORD" | cut -d ":" -f 2 | tr -d "\n")
argilla_password=$(htpasswd -nbB "" "$ARGILLA_PASSWORD" | cut -d ":" -f 2 | tr -d "\n")

# Create users.yml file
echo "Creating users schema"
cat >"$HOME"/users.yml <<EOF
- username: "team"
  api_key: $TEAM_API_KEY
  full_name: Team
  email: [email protected]
  hashed_password: $team_password
  workspaces: []

- username: "argilla"
  api_key: $ARGILLA_API_KEY
  full_name: Argilla
  email: [email protected]
  hashed_password: $argilla_password
  workspaces: ["team"]
EOF

# Start Elasticsearch
echo "Starting Elasticsearch"
elasticsearch &

echo "Waiting for elasticsearch to start"
sleep 30

# Load data
if [ "$LOAD_DATA_ENABLE" == "true" ]; then
  echo "Starting to load data"
  python3.9 /load_data.py "$TEAM_API_KEY" &
fi

# Start Argilla
echo "Starting Argilla"
uvicorn argilla:app --host "0.0.0.0"