File size: 1,171 Bytes
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
#!/usr/bin/env bash

set -e

# Changing user
sudo -S su user

# 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 ownerships
sudo mkdir -p /var/run/elasticsearch
sudo chown -R elasticsearch:elasticsearch /var/run/elasticsearch
sudo chown -R user:user /load_data.py

# Start elasticsearch
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service

# Update API_KEY and PASSWORD from users.yml
sudo sed -i 's,API_KEY,'"$API_KEY"',g' /packages/users.yml
sudo sed -i 's,ADMIN_PASSWORD,'"$ADMIN_PASSWORD"',g' /packages/users.yml
sudo sed -i 's,ARGILLA_PASSWORD,'"$ARGILLA_PASSWORD"',g' /packages/users.yml

# Load data
pip3 install datasets
python3.9 /load_data.py "$API_KEY" &

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