File size: 1,409 Bytes
990f10a
 
 
 
b2577d0
 
69fe7bd
b2577d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0c01de4
 
b2577d0
0c01de4
 
69fe7bd
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
#!/usr/bin/env bash

set -e

# Changing user
sudo -S su user

# Generate hashed passwords
admin_password=$(htpasswd -nbB "" "$ADMIN_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
cat >/packages/users.yml <<EOF
- username: "admin"
  api_key: $ADMIN_API_KEY
  full_name: Hugging Face
  email: [email protected]
  hashed_password: $admin_password
  workspaces: []

- username: "argilla"
  api_key: $ARGILLA_API_KEY
  full_name: Hugging Face
  email: [email protected]
  hashed_password: $argilla_password
  workspaces: ["admin"]
EOF

# Disable security in elasticsearch configuration
sudo sed -i "s/xpack.security.enabled: true/xpack.security.enabled: false/g" /etc/elasticsearch/elasticsearch.yml
sudo sed -i "s/cluster.initial_master_nodes/#cluster.initial_master_nodes/g" /etc/elasticsearch/elasticsearch.yml
echo "cluster.routing.allocation.disk.threshold_enabled: false" | sudo tee -a /etc/elasticsearch/elasticsearch.yml

# Create elasticsearch directory and change ownership
sudo mkdir -p /var/run/elasticsearch
sudo chown -R elasticsearch:elasticsearch /var/run/elasticsearch

# Starting elasticsearch
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch
sudo systemctl start elasticsearch

# Load data
python /app/load_data.py &

# Start argilla
uvicorn argilla:app --host "0.0.0.0"