Merge pull request #1371 from jooola/feat/install_pip

Install python apps using pip
This commit is contained in:
Kyle Robbertze 2021-10-04 18:07:50 +00:00 committed by GitHub
commit 77a9d98273
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 12 deletions

View File

@ -28,10 +28,11 @@ setup(
"django-url-filter",
"markdown",
"model_bakery",
"psycopg2", # TODO: Move to prod requires
],
extras_require={
"prod": [],
"prod": [
"psycopg2",
],
"dev": [
"psycopg2-binary",
],

15
install
View File

@ -995,12 +995,13 @@ loud "-----------------------------------------------------"
python_version=$($python_bin --version 2>&1 | awk '{ print $2 }')
verbose "Detected Python version: $python_version"
pip_cmd="$python_bin -m pip"
verbose "\n * Installing necessary python services..."
loudCmd "$python_bin -mpip install setuptools --upgrade"
loudCmd "$pip_cmd install setuptools --upgrade"
# Required here because PyGObject requires it, but it is installed after PyGObject
# when pip parses the setup.py file in airtime_analyzer
loudCmd "$python_bin -mpip install pycairo==1.19.1"
loudCmd "$pip_cmd install pycairo==1.19.1"
verbose "...Done"
verbose "\n * Creating /run/airtime..."
@ -1023,11 +1024,11 @@ if [ ! -d /var/log/airtime ]; then
fi
verbose "\n * Installing API client..."
loudCmd "$python_bin ${AIRTIMEROOT}/python_apps/api_clients/setup.py install --install-scripts=/usr/bin"
loudCmd "$pip_cmd install ${AIRTIMEROOT}/python_apps/api_clients"
verbose "...Done"
verbose "\n * Installing pypo and liquidsoap..."
loudCmd "$python_bin ${AIRTIMEROOT}/python_apps/pypo/setup.py install --install-scripts=/usr/bin"
loudCmd "$pip_cmd install ${AIRTIMEROOT}/python_apps/pypo"
loudCmd "mkdir -p /var/log/airtime/{pypo,pypo-liquidsoap} /var/tmp/airtime/pypo/{cache,files,tmp} /var/tmp/airtime/show-recorder/"
loudCmd "chown -R ${web_user}:${web_user} /var/log/airtime/{pypo,pypo-liquidsoap} /var/tmp/airtime/pypo/{cache,files,tmp} /var/tmp/airtime/show-recorder/"
systemInitInstall libretime-liquidsoap "$web_user"
@ -1035,7 +1036,7 @@ systemInitInstall libretime-playout "$web_user"
verbose "...Done"
verbose "\n * Installing airtime-celery..."
loudCmd "$python_bin ${AIRTIMEROOT}/python_apps/airtime-celery/setup.py install"
loudCmd "$pip_cmd install ${AIRTIMEROOT}/python_apps/airtime-celery"
# Create the Celery user
if $is_centos_dist; then
loudCmd "id celery 2>/dev/null || adduser --no-create-home -c 'LibreTime Celery' -r celery || true"
@ -1051,12 +1052,12 @@ systemInitInstall libretime-celery
verbose "...Done"
verbose "\n * Installing libretime-analyzer..."
loudCmd "$python_bin ${AIRTIMEROOT}/python_apps/airtime_analyzer/setup.py install --install-scripts=/usr/bin"
loudCmd "$pip_cmd install ${AIRTIMEROOT}/python_apps/airtime_analyzer"
systemInitInstall libretime-analyzer "$web_user"
verbose "...Done"
verbose "\n * Installing API..."
loudCmd "python3 ${AIRTIMEROOT}/api/setup.py install --install-scripts=/usr/bin"
loudCmd "$pip_cmd install ${AIRTIMEROOT}/api[prod]"
systemInitInstall libretime-api "$web_user"
mkdir -p /etc/airtime
sed -e "s@WEB_USER@${web_user}@g" \

View File

@ -2,7 +2,7 @@
Description=LibreTime Media Analyzer Service
[Service]
ExecStart=/usr/bin/libretime-analyzer
ExecStart=/usr/local/bin/libretime-analyzer
User=libretime-analyzer
Group=libretime-analyzer
Restart=always

View File

@ -2,7 +2,7 @@
Description=Libretime Liquidsoap Service
[Service]
ExecStart=/usr/bin/airtime-liquidsoap
ExecStart=/usr/local/bin/airtime-liquidsoap
User=libretime-playout
Group=libretime-playout
Restart=always

View File

@ -3,7 +3,7 @@ Description=Libretime Playout Service
After=network-online.target
[Service]
ExecStart=/usr/bin/airtime-playout
ExecStart=/usr/local/bin/airtime-playout
User=libretime-pypo
Group=libretime-pypo
Restart=always