From: Guillaume Pellerin Date: Sun, 19 May 2019 10:31:37 +0000 (+0200) Subject: add temporary deps, force boilerplate X-Git-Tag: 1.7.4~5^2~16 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=037dc3f20879e79d5cb586cd1b8487a94d1df1c7;p=telemeta.git add temporary deps, force boilerplate --- diff --git a/app/bin/app.sh b/app/bin/app.sh index 8b9bd605..29fdb508 100755 --- a/app/bin/app.sh +++ b/app/bin/app.sh @@ -22,7 +22,10 @@ gid='www-data' # pip install django-debug-toolbar==1.6 # pip install -e git+https://github.com/Parisson/django-jqchat.git@dj1.8#egg=django-jqchat # pip install -e git+https://github.com/Parisson/saved_searches.git@dj1.8#egg=saved_searches-2.0.0-beta -pip install youtube-dl +pip install -U youtube-dl librosa + +# install plugins +/srv/app/bin/setup_plugins.sh # waiting for other network services sh $app/bin/wait.sh diff --git a/app/bin/setup_plugins.sh b/app/bin/setup_plugins.sh index a0c485a5..ab6ed259 100755 --- a/app/bin/setup_plugins.sh +++ b/app/bin/setup_plugins.sh @@ -2,24 +2,30 @@ plugins=/srv/lib/plugins -apt-get update for dir in $(ls $plugins); do env=$plugins/$dir/conda-environment.yml if [ -f $env ]; then conda env update --name root --file $env fi - req=$plugins/$dir/debian-requirements.txt + + req=$plugins/$dir/debian-requirements.txt if [ -f $req ]; then + apt-get update packs=$(egrep -v "^\s*(#|$)" $req) apt-get install -y --force-yes $packs - fi - if [ -f $plugins/$dir/requirements.txt ]; then + apt-get clean + fi + + if [ -f $plugins/$dir/requirements.txt ]; then + echo $dir pip install -r $plugins/$dir/requirements.txt fi - if [ -f $plugins/$dir/setup.py ]; then + + if [ -f $plugins/$dir/setup.py ]; then + echo $dir pip install -e $plugins/$dir/. fi done -apt-get clean + diff --git a/app/bin/worker.sh b/app/bin/worker.sh index 8de6e129..aae0573e 100755 --- a/app/bin/worker.sh +++ b/app/bin/worker.sh @@ -12,7 +12,10 @@ concurrency=12 # pip install django-debug-toolbar==1.6 # pip install -e git+https://github.com/Parisson/django-jqchat.git@dj1.8#egg=django-jqchat # pip install -e git+https://github.com/Parisson/saved_searches.git@dj1.8#egg=saved_searches-2.0.0-beta -pip install youtube-dl +pip install -U youtube-dl librosa + +# install plugins +/srv/app/bin/setup_plugins.sh # waiting for other services bash $app/bin/wait.sh diff --git a/docker-compose.yml b/docker-compose.yml index 2f0b8bca..9962cd20 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -56,6 +56,7 @@ app: - ./app:/srv/app - ./telemeta:/srv/lib/telemeta/telemeta - ./lib/TimeSide:/srv/lib/timeside + - ./lib/plugins:/srv/lib/plugins volumes_from: - data env_file: diff --git a/telemeta/management/commands/telemeta-create-boilerplate.py b/telemeta/management/commands/telemeta-create-boilerplate.py index be0ed599..147a7815 100644 --- a/telemeta/management/commands/telemeta-create-boilerplate.py +++ b/telemeta/management/commands/telemeta-create-boilerplate.py @@ -24,54 +24,45 @@ class Command(BaseCommand): result.delete() def handle(self, *args, **options): - collections = MediaCollection.objects.filter(code=self.code) - if collections: - collection = collections[0] - created = False - else: - collection = MediaCollection(title=self.code, code=self.code, public_access='full') - created = True - collection.save() + collection, created = MediaCollection.objects.get_or_create(title=self.code, code=self.code, public_access='full') #TS# selection, created = Selection.objects.get_or_create(title='Tests') - - if created: - #TS#presets = [] - #TS#blacklist =['decoder', 'live', 'gain', 'vamp'] - #TS#processors = timeside.core.processor.processors(timeside.core.api.IProcessor) - #TS#for proc in processors: - #TS# trig = True - #TS# for black in blacklist: - #TS# if black in proc.id(): - #TS# trig = False - #TS# if trig: - #TS# processor, c = Processor.objects.get_or_create(pid=proc.id()) - #TS# preset, c = Preset.objects.get_or_create(processor=processor, parameters='{}') - #TS# presets.append(preset) + #TS#presets = [] + #TS#blacklist =['decoder', 'live', 'gain', 'vamp'] + #TS#processors = timeside.core.processor.processors(timeside.core.api.IProcessor) + #TS#for proc in processors: + #TS# trig = True + #TS# for black in blacklist: + #TS# if black in proc.id(): + #TS# trig = False + #TS# if trig: + #TS# processor, c = Processor.objects.get_or_create(pid=proc.id()) + #TS# preset, c = Preset.objects.get_or_create(processor=processor, parameters='{}') + #TS# presets.append(preset) - media_dir = 'items' + os.sep + 'tests' - samples_dir = settings.MEDIA_ROOT + media_dir - samples = generateSamples(samples_dir=samples_dir) + media_dir = 'items' + os.sep + 'tests' + samples_dir = settings.MEDIA_ROOT + media_dir + samples = generateSamples(samples_dir=samples_dir) - for sample in samples.iteritems(): - filename, path = sample - title = os.path.splitext(filename)[0] - path = media_dir + os.sep + filename - #TS#item, c = Item.objects.get_or_create(title=title, file=path) - #TS#if not item in selection.items.all(): - #TS# selection.items.add(item) - #TS#if self.cleanup: - #TS# for result in item.results.all(): - #TS# result.delete() - mediaitem, c = MediaItem.objects.get_or_create(title=title, - code=self.code + '-' + slugify(filename), - file=path, collection=collection, public_access = 'full') - #TS# - #TS# experience, c = Experience.objects.get_or_create(title='All') - #TS# for preset in presets: - #TS# if not preset in experience.presets.all(): - #TS# experience.presets.add(preset) - #TS# - #TS# task = Task(experience=experience, selection=selection) - #TS# task.save() + for sample in samples.iteritems(): + filename, path = sample + title = os.path.splitext(filename)[0] + path = media_dir + os.sep + filename + #TS#item, c = Item.objects.get_or_create(title=title, file=path) + #TS#if not item in selection.items.all(): + #TS# selection.items.add(item) + #TS#if self.cleanup: + #TS# for result in item.results.all(): + #TS# result.delete() + mediaitem, c = MediaItem.objects.get_or_create(title=title, + code=self.code + '-' + slugify(filename), + file=path, collection=collection, public_access = 'full') + #TS# + #TS# experience, c = Experience.objects.get_or_create(title='All') + #TS# for preset in presets: + #TS# if not preset in experience.presets.all(): + #TS# experience.presets.add(preset) + #TS# + #TS# task = Task(experience=experience, selection=selection) + #TS# task.save() diff --git a/telemeta/management/commands/telemeta-run-timeside-experience.py b/telemeta/management/commands/telemeta-run-timeside-experience.py index 7b943114..1f578f82 100644 --- a/telemeta/management/commands/telemeta-run-timeside-experience.py +++ b/telemeta/management/commands/telemeta-run-timeside-experience.py @@ -54,12 +54,12 @@ class Command(BaseCommand): dest='test', help='test mode') - parser.add_argument('--pid', + parser.add_argument('-p', '--pid', nargs='+', type=str, help='Processor ID') - parser.add_argument('--collection_code', + parser.add_argument('-cc', '--collection_code', dest='collection_code', help='define the telemeta collection code') @@ -89,6 +89,7 @@ class Command(BaseCommand): def create_experience(self): presets = [] + print(self.pid) processors = timeside.core.processor.processors(timeside.core.api.IProcessor) for proc in processors: trig = True