Make CKAN SPOC-compatible

This commit is contained in:
Disassembler 2020-03-13 20:10:24 +01:00
parent f45e25ea2c
commit 923b794cc6
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
11 changed files with 65 additions and 70 deletions

50
lxc-apps/ckan/app Normal file
View File

@ -0,0 +1,50 @@
{
"version": "2.8.3-200313",
"meta": {
"title": "CKAN",
"desc-cs": "Datový sklad",
"desc-en": "Data store",
"license": "GPL"
},
"containers": {
"ckan": {
"image": "ckan_2.8.3-200313",
"depends": [
"ckan-datapusher",
"ckan-redis",
"ckan-solr",
"ckan-postgres"
],
"mounts": {
"ckan/ckan_conf": "etc/ckan",
"ckan/ckan_data": "srv/ckan/storage"
}
},
"ckan-datapusher": {
"image": "ckan-datapusher_0.0.13-190620",
"mounts": {
"ckan/datapusher_conf": "etc/ckan-datapusher",
"ckan/datapusher_data": "srv/ckan-datapusher/data"
}
},
"ckan-redis": {
"image": "redis_4.0.12-190620",
"mounts": {
"ckan/redis_conf/redis.conf": "etc/redis.conf:file",
"ckan/redis_data": "var/lib/redis"
}
},
"ckan-solr": {
"image": "solr6_6.5.1-190620",
"mounts": {
"ckan/solr_data": "var/lib/solr"
}
},
"ckan-postgres": {
"image": "postgis_2.5.1-190620",
"mounts": {
"ckan/postgres_data": "var/lib/postgresql"
}
}
}
}

View File

@ -1,5 +1,5 @@
IMAGE ckan-datapusher_0.0.13-190620
FROM alpine3.9-python2.7_2.7.16-190620
FROM alpine3.11-python2.7_2.7.16-200313
RUN EOF
# Install runtime dependencies
@ -14,10 +14,6 @@ RUN EOF
pip install -U setuptools
pip install -e 'git+https://github.com/ckan/datapusher.git#egg=datapusher'
# Hackfix the X509_STORE_CTX wrapper
sed -i 's/\[security\]//' /srv/ckan-datapusher/src/datapusher/requirements.txt
pip install -r /srv/ckan-datapusher/src/datapusher/requirements.txt
# Create OS user
addgroup -S -g 8080 ckandp
adduser -S -u 8080 -h /srv/ckan-datapusher -s /bin/false -g ckandp -G ckandp ckandp
@ -29,6 +25,6 @@ RUN EOF
rm -rf /root/.cache
EOF
COPY ckan-datapusher.lxc
COPY ckan-datapusher.image.d
CMD execlineb -P /run
CMD /bin/execlineb -P /run

View File

@ -0,0 +1,7 @@
#!/usr/bin/python3
import ssl
cert = ssl.get_server_certificate(('host', 443))
with open('/usr/lib/python3.8/site-packages/certifi/cacert.pem', 'a') as f:
f.write(cert)

View File

@ -1,4 +0,0 @@
#!/bin/sh
/bin/cat /etc/ssl/services.pem >>/usr/lib/python2.7/site-packages/requests/cacert.pem
/bin/cat /etc/ssl/services.pem >>/usr/lib/python2.7/site-packages/certifi/cacert.pem

View File

@ -1,22 +1,19 @@
IMAGE ckan_2.8.2-190620
FROM alpine3.9-python2.7_2.7.16-190620
IMAGE ckan_2.8.3-200313
FROM alpine3.11-python2.7_2.7.16-200313
RUN EOF
# Install runtime dependencies
apk --no-cache add geos@vm libjpeg-turbo libmagic libpq mailcap py2-pip zlib
apk --no-cache add geos libjpeg-turbo libmagic libpq mailcap py2-pip zlib
# Install build dependencies
apk --no-cache add --virtual .deps build-base git libjpeg-turbo-dev libxml2-dev libxslt-dev postgresql-dev python2-dev zlib-dev
# Hackfix for python find_library('c') call
ln -s /lib/ld-musl-x86_64.so.1 /lib/libc.so.1
# Install CKAN
mkdir -p /srv/ckan
cd /srv/ckan
pip install -U setuptools
pip install flask-debugtoolbar
pip install -e 'git+https://github.com/ckan/ckan.git#egg=ckan'
pip install -e 'git+https://github.com/ckan/ckan.git@8e1cc60b2fa11da6843051678b7ee2cc08c2a7a9#egg=ckan'
pip install -r /srv/ckan/src/ckan/requirements-py2.txt
# Install CKAN extensions
@ -42,6 +39,6 @@ RUN EOF
rm -rf /root/.cache
EOF
COPY ckan.lxc
COPY ckan.image.d
CMD /bin/s6-svscan /etc/services.d

View File

@ -1,51 +0,0 @@
{
"version": "2.8.2-190620",
"meta": {
"title": "CKAN",
"desc-cs": "Datový sklad",
"desc-en": "Data store",
"license": "GPL"
},
"containers": {
"ckan": {
"image": "ckan_2.8.2-190620",
"depends": [
"ckan-datapusher",
"ckan-redis",
"ckan-solr",
"ckan-postgres"
],
"mounts": [
["DIR", "/srv/ckan/ckan_conf", "/etc/ckan"],
["DIR", "/srv/ckan/ckan_data", "/srv/ckan/storage"]
]
},
"ckan-datapusher": {
"image": "ckan-datapusher_0.0.13-190620",
"mounts": [
["FILE", "/etc/ssl/services.pem", "/etc/ssl/services.pem"],
["DIR", "/srv/ckan/datapusher_conf", "/etc/ckan-datapusher"],
["DIR", "/srv/ckan/datapusher_data", "/srv/ckan-datapusher/data"]
]
},
"ckan-redis": {
"image": "redis_4.0.12-190620",
"mounts": [
["FILE", "/srv/ckan/redis_conf/redis.conf", "/etc/redis.conf"],
["DIR", "/srv/ckan/redis_data", "/var/lib/redis"]
]
},
"ckan-solr": {
"image": "solr6_6.5.1-190620",
"mounts": [
["DIR", "/srv/ckan/solr_data", "/var/lib/solr"]
]
},
"ckan-postgres": {
"image": "postgis_2.5.1-190620",
"mounts": [
["DIR", "/srv/ckan/postgres_data", "/var/lib/postgresql"]
]
}
}
}