add bundle:voc-tracker-worker
This commit is contained in:
parent
7126831a93
commit
8145fb22e8
5 changed files with 127 additions and 1 deletions
14
bundles/voc-tracker-worker/files/crs-runner.service
Normal file
14
bundles/voc-tracker-worker/files/crs-runner.service
Normal file
|
@ -0,0 +1,14 @@
|
|||
[Unit]
|
||||
Description=CRS runner for ${script}
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=voc
|
||||
Group=voc
|
||||
ExecStart=/opt/crs-scripts/bin/crs_run ${script}
|
||||
WorkingDirectory=/opt/crs-scripts
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=crs-worker.target
|
3
bundles/voc-tracker-worker/files/environment
Normal file
3
bundles/voc-tracker-worker/files/environment
Normal file
|
@ -0,0 +1,3 @@
|
|||
export CRS_TRACKER="${url}"
|
||||
export CRS_TOKEN="${token}"
|
||||
export CRS_SECRET="${secret}"
|
52
bundles/voc-tracker-worker/items.py
Normal file
52
bundles/voc-tracker-worker/items.py
Normal file
|
@ -0,0 +1,52 @@
|
|||
paths = { # subpaths of /video
|
||||
'capture',
|
||||
'encoded',
|
||||
'fuse',
|
||||
'intros',
|
||||
'repair',
|
||||
'tmp',
|
||||
}
|
||||
|
||||
directories = {
|
||||
'/opt/crs-scripts': {},
|
||||
}
|
||||
|
||||
for path in paths:
|
||||
directories[f'/video/{path}'] = {}
|
||||
|
||||
git_deploy = {
|
||||
'/opt/crs-scripts': {
|
||||
'repo': 'https://github.com/crs-tools/crs-scripts.git',
|
||||
'rev': 'master',
|
||||
},
|
||||
}
|
||||
|
||||
files = {
|
||||
'/etc/default/crs-worker': {
|
||||
'content_type': 'mako',
|
||||
'source': 'environment',
|
||||
'context': node.metadata.get('voc-tracker-worker'),
|
||||
},
|
||||
}
|
||||
|
||||
for worker, script in {
|
||||
'recording-scheduler': 'script-A-recording-scheduler.pl',
|
||||
'mount4cut': 'script-B-mount4cut.pl',
|
||||
'cut-postprocessor': 'script-C-cut-postprocessor.pl',
|
||||
'encoding': 'script-D-encoding.pl',
|
||||
'postencoding': 'script-E-postencoding-auphonic.pl',
|
||||
'postprocessing': 'script-F-postprocessing-upload.pl',
|
||||
}.items():
|
||||
files[f'/etc/systemd/system/crs-{worker}.service'] = {
|
||||
'content_type': 'mako',
|
||||
'source': 'crs-runner.service',
|
||||
'context': {
|
||||
'script': script,
|
||||
},
|
||||
'needs': {
|
||||
'file:/etc/default/crs-worker',
|
||||
},
|
||||
'triggers': {
|
||||
'action:systemd-reload',
|
||||
},
|
||||
}
|
49
bundles/voc-tracker-worker/metadata.py
Normal file
49
bundles/voc-tracker-worker/metadata.py
Normal file
|
@ -0,0 +1,49 @@
|
|||
defaults = {
|
||||
'apt': {
|
||||
'packages': {
|
||||
'ffmpeg': {},
|
||||
'fuse': {},
|
||||
'fuse-ts': {},
|
||||
'libboolean-perl': {},
|
||||
'libconfig-inifiles-perl': {},
|
||||
'libdatetime-perl': {},
|
||||
'libfile-which-perl': {},
|
||||
'libipc-run3-perl': {},
|
||||
'libjson-perl': {},
|
||||
'libmath-round-perl': {},
|
||||
'libproc-processtable-perl': {},
|
||||
'libwww-curl-perl': {},
|
||||
'libxml-rpc-fast-perl': {},
|
||||
'libxml-simple-perl': {},
|
||||
},
|
||||
},
|
||||
'users': {
|
||||
'voc': {
|
||||
'home': '/opt/voc',
|
||||
},
|
||||
},
|
||||
'pacman': {
|
||||
'packages': {
|
||||
'ffmpeg': {},
|
||||
'fuse2': {},
|
||||
'fuse3': {},
|
||||
# fuse-ts missing
|
||||
'perl-boolean': {}, # from aurto
|
||||
'perl-config-inifiles': {},
|
||||
'perl-datetime': {},
|
||||
'perl-file-which': {},
|
||||
'perl-ipc-run3': {},
|
||||
'perl-json': {},
|
||||
'perl-math-round': {},
|
||||
'perl-proc-processtable': {},
|
||||
'perl-www-curl': {}, # from aurto
|
||||
'perl-xml-simple': {},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
# Install manually from CPAN:
|
||||
# IO::Socket::SSL
|
||||
# LWP::Protocol::https
|
||||
# Types::Serialiser::Error
|
||||
# XML::RPC::Fast
|
|
@ -9,6 +9,7 @@ nodes['kunsi-p14s'] = {
|
|||
'systemd-boot',
|
||||
'telegraf-battery-usage',
|
||||
'vmhost',
|
||||
'voc-tracker-worker',
|
||||
'zfs',
|
||||
},
|
||||
'groups': {
|
||||
|
@ -39,7 +40,9 @@ nodes['kunsi-p14s'] = {
|
|||
'dhcp': True,
|
||||
},
|
||||
'enp5s0': {
|
||||
'dhcp': True,
|
||||
'ips': {'10.73.100.103/16'},
|
||||
'gateway4': '10.73.0.254',
|
||||
#'dhcp': True,
|
||||
},
|
||||
# there is also wlp3s0, but that's managed by netctl
|
||||
},
|
||||
|
@ -139,6 +142,11 @@ nodes['kunsi-p14s'] = {
|
|||
'delete': True,
|
||||
},
|
||||
},
|
||||
'voc-tracker-worker': {
|
||||
'url': 'https://tracker.c3voc.de/rpc',
|
||||
'token': vault.decrypt('encrypt$gAAAAABiYqaFl4CqOc8DTQIn49Qq0KgAJSzA19GKPNMbyHIjYg0JkvY0sK43ps8CbJWMRR6hJHVK-nP4vrWLwyoWWqt8N8aASMur4odC2s8pEHQKM0TXg4cRwobQz_lyJgrYa2VYdhcD'),
|
||||
'secret': vault.decrypt('encrypt$gAAAAABiYqaYbY-3IbnRk-S25pqxrOGN7ovgPo3kBYz8ZqKDedPRzskKZefpLHxBbCOZKjg1XNT4cKbIs5cPCLdj7HdY4beAhnXl4EHZZdxU1zVC7sJCmz9XOS_Ac0UOgOlUFMiet14U'),
|
||||
},
|
||||
'zfs': {
|
||||
'pools': {
|
||||
'zroot': {
|
||||
|
|
Loading…
Reference in a new issue