Spaces:
Runtime error
Runtime error
File size: 1,060 Bytes
2c80eb3 142dd1a 2c80eb3 142dd1a 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 |
#!/usr/bin/env bash
set -e
# Changing user
sudo -S su user
# 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
# 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")
# Update API_KEY and PASSWORD from users.yml
sudo sed -i 's,TEAM_API_KEY,'"$TEAM_API_KEY"',g' /packages/users.yml
sudo sed -i 's,ARGILLA_API_KEY,'"$ARGILLA_API_KEY"',g' /packages/users.yml
sudo sed -i 's,TEAM_PASSWORD,'"$team_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"
|