summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--blob-service.service28
-rw-r--r--debian/ick2.install1
-rw-r--r--debian/ick2.postinst6
-rw-r--r--setup.py13
-rw-r--r--start_blob_service24
5 files changed, 69 insertions, 3 deletions
diff --git a/blob-service.service b/blob-service.service
new file mode 100644
index 0000000..8f2f046
--- /dev/null
+++ b/blob-service.service
@@ -0,0 +1,28 @@
+# Copyright 2017 Lars Wirzenius
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+[Unit]
+Description=ick2 blob service
+After=network.target
+
+[Service]
+Type=simple
+User=_ickbs
+Group=_ickbs
+WorkingDirectory=/var/lib/ick/blobs
+ExecStart=/usr/bin/start_blob_service
+KillSignal=QUIT
+
+[Install]
+WantedBy=multi-user.target
diff --git a/debian/ick2.install b/debian/ick2.install
index 2535f43..bda5847 100644
--- a/debian/ick2.install
+++ b/debian/ick2.install
@@ -1,3 +1,4 @@
ick2.service lib/systemd/system
ick2-worker-manager.service lib/systemd/system
+blob-service.service lib/systemd/system
worker_manager.yaml etc/ick
diff --git a/debian/ick2.postinst b/debian/ick2.postinst
index f66dbda..3e70087 100644
--- a/debian/ick2.postinst
+++ b/debian/ick2.postinst
@@ -33,9 +33,10 @@ create_user()
}
-# Create a group and user for ick controllerand worker-manager
+# Create a group and user for ick users
create_user _ick /var/lib/ick /var/log/ick
create_user _ickwm /var/lib/ick/wm /var/log/ickwm
+create_user _ickbs /var/lib/ick/blobs /var/log/ickbs
# Create controller config dir.
install -d -m 0755 -o root -g root /etc/ick
@@ -46,4 +47,7 @@ install -d -m 0755 -o _ick -g _ick /var/lib/ick/state
# Create worker-manager workspace
install -d -m 0755 -o _ickwm -g _ickwm /var/lib/ick/workspace
+# Create blob service storage
+install -d -m 0755 -o _ickbs -g _ickbs /var/lib/ick/blobs
+
#DEBHELPER#
diff --git a/setup.py b/setup.py
index f1b190c..8cdc0c7 100644
--- a/setup.py
+++ b/setup.py
@@ -46,9 +46,18 @@ setup(
author='Lars Wirzenius',
author_email='liw@liw.fi',
url='http://liw.fi/ick/',
- py_modules=['ick_controller'],
+ py_modules=[
+ 'ick_controller',
+ 'blob_service',
+ ],
packages=['ick2'],
- scripts=['create-token', 'start_ick', 'icktool', 'worker_manager'],
+ scripts=[
+ 'create-token',
+ 'start_ick',
+ 'start_blob_service',
+ 'icktool',
+ 'worker_manager'
+ ],
data_files=[('share/man/man1', glob.glob('*.1'))],
cmdclass={
'build': Build,
diff --git a/start_blob_service b/start_blob_service
new file mode 100644
index 0000000..88bd770
--- /dev/null
+++ b/start_blob_service
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Copyright (C) 2017 Lars Wirzenius
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set -eux
+
+export BLOB_SERVICE_CONFIG=/etc/ick/blob_service.conf
+gunicorn3 \
+ --bind 127.0.0.1:12766 \
+ --log-file /var/log/ickbs/gunicorn3.log \
+ --log-level debug \
+ blob_service:app