[ARVADOS] updated: dbb3b8ddb414dadfc76d4e750be54cd2a70eaab6
Git user
git at public.curoverse.com
Fri Sep 23 16:09:18 EDT 2016
Summary of changes:
build/{go-package-scripts => python-package-scripts}/postinst | 1 +
build/{go-package-scripts => python-package-scripts}/prerm | 1 +
build/run-library.sh | 10 ++++++++++
sdk/pam/setup.py | 7 +++++++
.../arvados-docker-cleaner.service} | 7 ++++---
services/dockercleaner/setup.py | 2 +-
6 files changed, 24 insertions(+), 4 deletions(-)
copy build/{go-package-scripts => python-package-scripts}/postinst (93%)
copy build/{go-package-scripts => python-package-scripts}/prerm (90%)
copy services/{crunch-dispatch-slurm/crunch-dispatch-slurm.service => dockercleaner/arvados-docker-cleaner.service} (53%)
via dbb3b8ddb414dadfc76d4e750be54cd2a70eaab6 (commit)
via ed63ab0b7f12bfc84959c79f1ad56a546a4acaed (commit)
from 585a20614b6cdffe1e573343eb2de348cbd66366 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit dbb3b8ddb414dadfc76d4e750be54cd2a70eaab6
Author: Tom Clegg <tom at curoverse.com>
Date: Fri Sep 23 16:08:37 2016 -0400
9960: Add systemd unit file for arvados-docker-cleaner.
diff --git a/build/python-package-scripts/postinst b/build/python-package-scripts/postinst
new file mode 100755
index 0000000..27e4601
--- /dev/null
+++ b/build/python-package-scripts/postinst
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+set -e
+
+# NOTE: This package name detection will only work on Debian.
+# If this postinst script ever starts doing work on Red Hat,
+# we'll need to adapt this code accordingly.
+script="$(basename "${0}")"
+pkg="${script%.postinst}"
+systemd_unit="${pkg}.service"
+
+case "${1}" in
+ configure)
+ if [ -e /run/systemd/system ]; then
+ cp "/usr/share/doc/${pkg}/${pkg}.service" /lib/systemd/system/
+ eval "$(systemctl -p UnitFileState show "${systemd_unit}")"
+ case "${UnitFileState}" in
+ disabled)
+ # Failing to enable or start the service is not a
+ # package error, so don't let errors here
+ # propagate up.
+ systemctl enable "${systemd_unit}" || true
+ systemctl start "${systemd_unit}" || true
+ ;;
+ enabled)
+ systemctl daemon-reload || true
+ systemctl reload-or-try-restart "${systemd_unit}" || true
+ ;;
+ esac
+ fi
+ ;;
+esac
diff --git a/build/python-package-scripts/prerm b/build/python-package-scripts/prerm
new file mode 100755
index 0000000..6d75f81
--- /dev/null
+++ b/build/python-package-scripts/prerm
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+# NOTE: This package name detection will only work on Debian.
+# If this prerm script ever starts doing work on Red Hat,
+# we'll need to adapt this code accordingly.
+script="$(basename "${0}")"
+pkg="${script%.prerm}"
+systemd_unit="${pkg}.service"
+
+case "${1}" in
+ remove)
+ if [ -e /run/systemd/system ]; then
+ systemctl stop "${systemd_unit}" || true
+ systemctl disable "${systemd_unit}" || true
+ rm "/lib/systemd/system/${pkg}.service"
+ fi
+ ;;
+esac
diff --git a/build/run-library.sh b/build/run-library.sh
index 067285d..e445541 100755
--- a/build/run-library.sh
+++ b/build/run-library.sh
@@ -265,6 +265,14 @@ fpm_build () {
# that will take precedence, as desired.
COMMAND_ARR+=(--iteration "$default_iteration_value")
+ if [[ python = "$PACKAGE_TYPE" ]] && [[ -e "${PACKAGE}/${PACKAGE_NAME}.service" ]]
+ then
+ COMMAND_ARR+=(
+ --after-install "${WORKSPACE}/build/python-package-scripts/postinst"
+ --before-remove "${WORKSPACE}/build/python-package-scripts/prerm"
+ )
+ fi
+
# Append --depends X and other arguments specified by fpm-info.sh in
# the package source dir. These are added last so they can override
# the arguments added by this script.
diff --git a/services/dockercleaner/arvados-docker-cleaner.service b/services/dockercleaner/arvados-docker-cleaner.service
new file mode 100644
index 0000000..43e4ab8
--- /dev/null
+++ b/services/dockercleaner/arvados-docker-cleaner.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Arvados Docker Image Cleaner
+Documentation=https://doc.arvados.org/
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/env arvados-docker-cleaner
+Restart=always
+RestartSec=10s
+
+[Install]
+WantedBy=multi-user.target
diff --git a/services/dockercleaner/setup.py b/services/dockercleaner/setup.py
index 15b9b4e..535650e 100644
--- a/services/dockercleaner/setup.py
+++ b/services/dockercleaner/setup.py
@@ -25,7 +25,7 @@ setup(name="arvados-docker-cleaner",
'console_scripts': ['arvados-docker-cleaner=arvados_docker.cleaner:main'],
},
data_files=[
- ('share/doc/arvados-docker-cleaner', ['agpl-3.0.txt']),
+ ('share/doc/arvados-docker-cleaner', ['agpl-3.0.txt', 'arvados-docker-cleaner.service']),
],
install_requires=[
'docker-py==1.7.2',
commit ed63ab0b7f12bfc84959c79f1ad56a546a4acaed
Author: Tom Clegg <tom at curoverse.com>
Date: Fri Sep 23 16:09:03 2016 -0400
9960: Install python data files to /usr/share/... not /usr/data/share/...
diff --git a/build/run-library.sh b/build/run-library.sh
index 4495a4e..067285d 100755
--- a/build/run-library.sh
+++ b/build/run-library.sh
@@ -213,6 +213,7 @@ fpm_build () {
--python-package-name-prefix "$PYTHON2_PKG_PREFIX" \
--prefix "$PYTHON2_PREFIX" \
--python-install-lib "$PYTHON2_INSTALL_LIB" \
+ --python-install-data . \
--exclude "${PYTHON2_INSTALL_LIB#/}/tests" \
--depends "$PYTHON2_PACKAGE"
# Fix --iteration for #9242.
@@ -229,6 +230,7 @@ fpm_build () {
--python-package-name-prefix "$PYTHON3_PKG_PREFIX" \
--prefix "$PYTHON3_PREFIX" \
--python-install-lib "$PYTHON3_INSTALL_LIB" \
+ --python-install-data . \
--exclude "${PYTHON3_INSTALL_LIB#/}/tests" \
--depends "$PYTHON3_PACKAGE"
# Fix --iteration for #9242.
diff --git a/sdk/pam/setup.py b/sdk/pam/setup.py
index c194013..e1046ac 100755
--- a/sdk/pam/setup.py
+++ b/sdk/pam/setup.py
@@ -37,6 +37,13 @@ setup(name='arvados-pam',
('share/pam-configs', ['pam-configs/arvados']),
('share/doc/arvados-pam', ['LICENSE-2.0.txt', 'README.rst']),
('share/doc/arvados-pam/examples', glob.glob('examples/*')),
+
+ # The arvados build scripts used to install data files to
+ # "/usr/data/*" but now install them to "/usr/*". Here, we
+ # install an extra copy in the old location so existing pam
+ # configs can still work. When old systems have had a chance
+ # to update to the new paths, this line can be removed.
+ ('data/lib/security', ['lib/libpam_arvados.py']),
],
install_requires=[
'arvados-python-client>=0.1.20150801000000',
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list