Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aura-engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Kruse
aura-engine
Commits
dbbb9f82
Commit
dbbb9f82
authored
4 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
Dynamically use a compatible Python version. #17
parent
d47aaf1b
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
engine-core.py
+4
-1
4 additions, 1 deletion
engine-core.py
guru.py
+4
-1
4 additions, 1 deletion
guru.py
install.sh
+10
-1
10 additions, 1 deletion
install.sh
run.sh
+15
-5
15 additions, 5 deletions
run.sh
test/tests.py
+4
-1
4 additions, 1 deletion
test/tests.py
with
37 additions
and
9 deletions
engine-core.py
+
4
−
1
View file @
dbbb9f82
#!/usr/bin/env python3.7
#!/bin/sh
''''
which python3.8 >/dev/null 2>&1 && exec python3.8
"
$0
"
"
$@
"
#
'''
''''
which python3.7 >/dev/null 2>&1 && exec python3.7
"
$0
"
"
$@
"
#
'''
''''
exec echo
"
Error: Snaaakey Python, where are you?
"
#
'''
#
#
# Aura Engine (https://gitlab.servus.at/aura/engine)
# Aura Engine (https://gitlab.servus.at/aura/engine)
...
...
This diff is collapsed.
Click to expand it.
guru.py
+
4
−
1
View file @
dbbb9f82
#!/usr/bin/env python3.7
#!/bin/sh
''''
which python3.8 >/dev/null 2>&1 && exec python3.8
"
$0
"
"
$@
"
#
'''
''''
which python3.7 >/dev/null 2>&1 && exec python3.7
"
$0
"
"
$@
"
#
'''
''''
exec echo
"
Error: Snaaakey Python, where are you?
"
#
'''
#
#
# Aura Engine (https://gitlab.servus.at/aura/engine)
# Aura Engine (https://gitlab.servus.at/aura/engine)
...
...
This diff is collapsed.
Click to expand it.
install.sh
+
10
−
1
View file @
dbbb9f82
...
@@ -13,6 +13,15 @@ if [ $mode == "prod" ]; then
...
@@ -13,6 +13,15 @@ if [ $mode == "prod" ]; then
echo
"[Installing AURA ENGINE for Production]"
echo
"[Installing AURA ENGINE for Production]"
fi
fi
# Find the correct Python version (3.7 or 3.8)
if
hash
python3.8 2>/dev/null
;
then
PYTHON_EXEC
=
"python3.8"
echo
"[ Using Python 3.8 ]"
else
PYTHON_EXEC
=
"python3.7"
echo
"[ Using Python 3.7 ]"
fi
# Development and Production
# Development and Production
...
@@ -20,7 +29,7 @@ echo "Installing OPAM Packages ..."
...
@@ -20,7 +29,7 @@ echo "Installing OPAM Packages ..."
bash script/install-opam-packages.sh
bash script/install-opam-packages.sh
echo
"Installing Python Requirements ..."
echo
"Installing Python Requirements ..."
python3.7
$(
which pip3
)
install
-r
requirements.txt
$PYTHON_EXEC
$(
which pip3
)
install
-r
requirements.txt
# Development
# Development
...
...
This diff is collapsed.
Click to expand it.
run.sh
+
15
−
5
View file @
dbbb9f82
...
@@ -32,6 +32,16 @@ echo "[ Run mode=$mode ]"
...
@@ -32,6 +32,16 @@ echo "[ Run mode=$mode ]"
echo
"[ Docker=
$docker
]"
echo
"[ Docker=
$docker
]"
# Find the correct Python version (3.7 or 3.8)
if
hash
python3.8 2>/dev/null
;
then
PYTHON_EXEC
=
"python3.8"
echo
"[ Using Python 3.8 ]"
else
PYTHON_EXEC
=
"python3.7"
echo
"[ Using Python 3.7 ]"
fi
# +++ DEFAULT COMMANDS +++ #
# +++ DEFAULT COMMANDS +++ #
...
@@ -48,26 +58,26 @@ if [[ $docker == "false" ]]; then
...
@@ -48,26 +58,26 @@ if [[ $docker == "false" ]]; then
if
[[
$mode
==
"engine"
]]
;
then
if
[[
$mode
==
"engine"
]]
;
then
eval
$(
opam
env
)
eval
$(
opam
env
)
/usr/bin/env
python3.7
engine-core.py
/usr/bin/env
$PYTHON_EXEC
engine-core.py
fi
fi
### Runs Engine Core only ###
### Runs Engine Core only ###
if
[[
$mode
==
"core"
]]
;
then
if
[[
$mode
==
"core"
]]
;
then
/usr/bin/env
python3.7
engine-core.py
--without-lqs
/usr/bin/env
$PYTHON_EXEC
engine-core.py
--without-lqs
fi
fi
### Runs Liquidsoap only ###
### Runs Liquidsoap only ###
if
[[
$mode
==
"lqs"
]]
;
then
if
[[
$mode
==
"lqs"
]]
;
then
lqs
=
$(
/usr/bin/env
python3.7
engine-core.py
--get-lqs-command
)
lqs
=
$(
/usr/bin/env
$PYTHON_EXEC
engine-core.py
--get-lqs-command
)
eval
"
$lqs
"
eval
"
$lqs
"
fi
fi
### CAUTION: This deletes everything in your database ###
### CAUTION: This deletes everything in your database ###
if
[[
$mode
==
"recreate-database"
]]
;
then
if
[[
$mode
==
"recreate-database"
]]
;
then
/usr/bin/env
python3.7
engine-core.py
--recreate-database
/usr/bin/env
$PYTHON_EXEC
engine-core.py
--recreate-database
fi
fi
fi
fi
...
@@ -87,7 +97,7 @@ if [[ $docker == "true" ]]; then
...
@@ -87,7 +97,7 @@ if [[ $docker == "true" ]]; then
--rm
-d
\
--rm
-d
\
-u
$UID
:
$GID
\
-u
$UID
:
$GID
\
-v
"
$BASE_D
"
:/srv
\
-v
"
$BASE_D
"
:/srv
\
-v
"
$BASE_D
/audio/source"
:/
home/opam
/audio/source:ro
\
-v
"
$BASE_D
/audio/source"
:/
var
/audio/source:ro
\
-v
"
$BASE_D
/configuration/docker"
:/etc/aura
\
-v
"
$BASE_D
/configuration/docker"
:/etc/aura
\
-v
"/dev/snd"
:/dev/snd
\
-v
"/dev/snd"
:/dev/snd
\
--privileged
\
--privileged
\
...
...
This diff is collapsed.
Click to expand it.
test/tests.py
+
4
−
1
View file @
dbbb9f82
#!/usr/bin/python3.7
#!/bin/sh
''''
which python3.8 >/dev/null 2>&1 && exec python3.8
"
$0
"
"
$@
"
#
'''
''''
which python3.7 >/dev/null 2>&1 && exec python3.7
"
$0
"
"
$@
"
#
'''
''''
exec echo
"
Error: Snaaakey Python, where are you?
"
#
'''
#
#
# Aura Engine (https://gitlab.servus.at/aura/engine)
# Aura Engine (https://gitlab.servus.at/aura/engine)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment