Make OMK SPOC-compatible

This commit is contained in:
Disassembler 2020-03-22 10:28:57 +01:00
parent fea0a7911a
commit 7a45daf853
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
8 changed files with 32 additions and 30 deletions

View File

@ -46,7 +46,7 @@ Assign the newly generated key to your GitLab account
```bash
# Clone the repository
git clone --recurse-submodules ssh://git@git.spotter.cz:2222/Spotter-Cluster/Spotter-Cluster.git
git clone --recursive ssh://git@git.spotter.cz:2222/Spotter-Cluster/Spotter-Cluster.git
# Install the build toolchain
Spotter-Cluster/build/install-toolchain.sh

View File

@ -1,5 +1,5 @@
#!/bin/execlineb -P
foreground { add-ca-cert }
foreground { /bin/add-ca-cert }
s6-setuidgid ckandp
uwsgi --plugin python --http-socket 0.0.0.0:8080 --wsgi-file /etc/ckan-datapusher/datapusher.wsgi --enable-threads

18
lxc-apps/openmapkit/app Normal file
View File

@ -0,0 +1,18 @@
{
"version": "0.12.0-200313",
"meta": {
"title": "OpenMapKit",
"desc-cs": "Sběr mapových dat",
"desc-en": "Map data collection",
"license": "GPL"
},
"containers": {
"openmapkit": {
"image": "openmapkit_0.12.0-200313",
"mounts": {
"openmapkit/omk_conf/settings.js": "srv/openmapkit/settings.js:file",
"openmapkit/omk_data": "srv/openmapkit/data"
}
}
}
}

View File

@ -1,5 +1,5 @@
IMAGE openmapkit_0.12.0-190620
FROM alpine3.9-java8_8.212.04-190620
IMAGE openmapkit_0.12.0-200313
FROM alpine3.11-java8_8.242.08-200313
RUN EOF
# Install runtime dependencies
@ -9,11 +9,10 @@ RUN EOF
apk --no-cache add --virtual .deps build-base git py2-pip yarn
# Clone OpenMapKit
git clone --depth 1 https://github.com/posm/OpenMapKitServer /srv/openmapkit
cd /srv/openmapkit
git submodule update --init #TODO: Why does this fail?
git clone --recursive --depth 1 https://github.com/posm/OpenMapKitServer /srv/openmapkit
# Install OpenMapKit dependencies
cd /srv/openmapkit
pip install -r requirements.txt
yarn add libxmljs
yarn
@ -34,6 +33,6 @@ RUN EOF
EOF
# s6 required for single service due to inability of nodejs to process signals when running as PID 1
COPY lxc
COPY image.d
CMD /bin/s6-svscan /etc/services.d

View File

@ -1,15 +1,18 @@
#!/bin/sh
set -ev
# Volumes
OMK_CONF="${VOLUMES_DIR}/openmapkit/omk_conf"
OMK_DATA="${VOLUMES_DIR}/openmapkit/omk_data"
# Configure OpenMapKit
export OPENMAPKIT_ADMIN_USER="admin"
export OPENMAPKIT_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
mkdir -p /srv/openmapkit/omk_conf
chown -R 108080:108080 /srv/openmapkit/omk_conf
envsubst <omk_conf/settings.js >/srv/openmapkit/omk_conf/settings.js
install -o 108080 -g 108080 -m 750 -d ${OMK_CONF}
envsubst <omk_conf/settings.js | install -o 108080 -g 108080 -m 640 /dev/stdin ${OMK_CONF}/settings.js
# Copy existing files into persistent storage
lxchelper extract openmapkit /srv/openmapkit/data /srv/openmapkit/omk_data
cp -rp ${LAYERS_DIR}/openmapkit_0.12.0-200313/srv/openmapkit/data ${OMK_DATA}
# Register application
vmmgr register-app openmapkit omk "${OPENMAPKIT_ADMIN_USER}" "${OPENMAPKIT_ADMIN_PWD}"

View File

@ -1,18 +0,0 @@
{
"version": "0.12.0-190620",
"meta": {
"title": "OpenMapKit",
"desc-cs": "Sběr mapových dat",
"desc-en": "Map data collection",
"license": "GPL"
},
"containers": {
"openmapkit": {
"image": "openmapkit_0.12.0-190620",
"mounts": [
["FILE", "/srv/openmapkit/omk_conf/settings.js", "/srv/openmapkit/settings.js"],
["DIR", "/srv/openmapkit/omk_data", "/srv/openmapkit/data"]
]
}
}
}