- run
sudo apt install ffmpeg ffprobe - create link for ffmpeg & ffprobe in
ezra-be/venv/bin/fromusr/bin/ln -s /usr/bin/ffmpeg /root/ezra-be/venv/bin/ffmpeg ln -s /usr/bin/ffprobe /root/ezra-be/venv/bin/ffprobe - Install NVIDIA CUDA
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda-toolkit-12-6
- Install NVIDIA cuDNN
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get -y install cudnn
-
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-20-04
-
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu
-
https://www.digitalocean.com/community/tutorials/ufw-essentials-common-firewall-rules-and-commands
# #########################################################################################
curl --location 'https://marketplace.tensordock.com/api/v0/client/get/single' \
--data-urlencode 'api_key=[API_KEY]' \
--data-urlencode 'api_token=[API TOKEN]' \
--data-urlencode 'server=[SERVER_ID]'
curl --location 'https://marketplace.tensordock.com/api/v0/client/start/single' \
--data-urlencode 'api_key=[API_KEY]' \
--data-urlencode 'api_token=[API TOKEN]' \
--data-urlencode 'server=[SERVER_ID]'
curl --location 'https://marketplace.tensordock.com/api/v0/client/stop/single' \
--data-urlencode 'api_key=[API_KEY]' \
--data-urlencode 'api_token=[API TOKEN]' \
--data-urlencode 'server=[SERVER_ID]'
--data-urlencode 'disassociate_resources=true'
# #########################################################################################
ssh -p 47934 user@213.180.0.39
# #########################################################################################
1. https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key
ssh-keygen -t ed25519 -C "chris_eldon@yahoo.com"
2. https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account?tool=webui#adding-a-new-ssh-key-to-your-account
cat ~/.ssh/id_ed25519.pub
# #########################################################################################
cd ~/asr/src
python3 inference.py
# DEPLOY INFERENCE #######################################################################
cd ~/ezra-inference
git checkout main
git pull
source ~/ezra-inference/venv/bin/activate
pip install -r requirements.txt
sudo systemctl restart ezra-inference
sleep 5
sudo systemctl status ezra-inference
------------------------------------------------------------------------------------------
journalctl -e -u ezra-inference
htop
------------------------------------------------------------------------------------------
cd ~/ezra-inference
source ~/ezra-inference/venv/bin/activate
python3 -m venv venv
python3 app.py
------------------------------------------------------------------------------------------
curl http://213.180.0.39:47940/process
curl -H "Content-type: application/json" -d '{
"username": "eldon",
"password": "eldon444"
}' 'http://213.180.0.39:47940/process'
# COPY/CUT/REMOVE/RENAME/LINK FILES ######################################################
cp -r /usr/bin/ffmpeg /root/ezra-be/venv/bin/ffmpeg
scp root@104.248.159.174:/root/ezra-be/txt/eldon/2455-10minutes.txt .
scp -P 47903 C:/Users/AVOWS/Desktop/ASR/audio_files/3648.mp3 user@194.106.118.83:~/whisper/audio_files/3648.mp3
mv ezra-be /home/ezra_user/
ln -s /usr/bin/ffprobe /root/ezra-be/venv/bin/ffprobe
# DATABASE ###############################################################################
sudo -u ezra_user psql ezra
UPDATE system_settings SET setting_value = 'true' WHERE setting_key = 'transcribing_allowed';
psql 'postgres://avnadmin:[PASSWORD]@ezra-ezra.e.aivencloud.com:10744/ezra_be?sslmode=require'
# NGINX INFERENCE ########################################################################
sudo nano /etc/nginx/sites-available/ezra-inference
------------------------------------------------------------------------------------------
server {
listen 80;
server_name _;
location / {
include proxy_params;
proxy_pass http://unix:/home/user/ezra-inference/ezra-inference.sock;
}
}
------------------------------------------------------------------------------------------
sudo ln -s /etc/nginx/sites-available/ezra-inference /etc/nginx/sites-enabled
cd /etc/nginx/sites-enabled
sudo rm default
sudo nginx -t
sudo systemctl restart nginx
# GUNICORN INFERENCE SERVICE #############################################################
sudo nano /etc/systemd/system/ezra-inference.service
------------------------------------------------------------------------------------------
[Unit]
Description=Gunicorn instance to serve ezra-inference
After=network.target
[Service]
User=user
Group=www-data
WorkingDirectory=/home/user/ezra-inference
Environment="PATH=/home/user/ezra-inference/venv/bin"
ExecStart=/home/user/ezra-inference/venv/bin/gunicorn --timeout 0 --threads 3 --workers 3 --bind unix:ezra-inference.sock -m 007 wsgi:app
# Memory management
MemoryAccounting=yes
MemoryHigh=6.5G
CPUQuota=80%
[Install]
WantedBy=multi-user.target
------------------------------------------------------------------------------------------
sudo systemctl daemon-reload
sudo systemctl start ezra-inference
sudo systemctl stop ezra-inference
sudo systemctl restart ezra-inference
sudo systemctl enable ezra-inference
sudo systemctl status ezra-inference
# SSL #####################################################################################
sudo certbot --nginx -d transcript.griibandung.org -d www.transcript.griibandung.org