-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.sh
More file actions
58 lines (44 loc) · 1.92 KB
/
deploy.sh
File metadata and controls
58 lines (44 loc) · 1.92 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
# Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate
# Install Python dependencies
pip install -r requirements.txt
# install the custom private prompt generation tool # TODO: needs to be moved to requirements once it becomes public
pip install git+https://${GH_TOKEN}@github.com/zaidalyafeai/templator.git
# Navigate to the project directory
cd promptlab
# set production settings as env variable
export DJANGO_SETTINGS_MODULE=promptlab.production_settings
# migrate django sites first
python manage.py migrate sites
# Run Django management commands
python manage.py migrate
# create superusers
python manage.py import_superusers admins.yml
# setup allauth
python manage.py setup_allauth
# sync with hf
# python manage.py sync_with_hf \
# --sheet_id 1kIDS-fwO5l6sH2ZBDCepOJeNyOh2j7Wb-w3W0JChi2k \
# --sheet_name final-list \
# --is_single_classification_column is_single_classification \
# --target_column target_column \
# --clear_datasets False \
# --default_subset_column dataset_default_subset \
# --subsets_column dataset_subsets_to_download
# --example_template_column example_template \
# --example_template_created_by_column example_template_created_by \
# --example_template_subset_column subset \
# --example_template_tags_column example_template_tags \
# --answer_choices_column answer_choices \
# collect static
python manage.py collectstatic --noinput
# install gunicorn
pip install gunicorn
# run celery worker
# celery -A promptlab worker -l info --pool solo &
# run celery beat
celery -A promptlab beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler &
# Start the Gunicorn server in the background
# gunicorn promptlab.wsgi --workers 2 --thread 4 --bind 0.0.0.0:8080 --max-requests 4 --max-requests-jitter 10 --preload --timeout 150
gunicorn promptlab.wsgi --workers 2 --thread 2 --max-requests 4 --bind 0.0.0.0:8080 --timeout 150