Revert long naming for CKAN DataPusher
This commit is contained in:
parent
a15a716066
commit
89bd1882c0
14
ckan-datapusher.sh
Executable file
14
ckan-datapusher.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SOURCE_DIR=$(realpath $(dirname "${0}"))/ckan-datapusher
|
||||||
|
|
||||||
|
# Build Docker container
|
||||||
|
docker build -t ckan-datapusher ${SOURCE_DIR}
|
||||||
|
cp ${SOURCE_DIR}/etc/init.d/ckan-datapusher /etc/init.d/ckan-datapusher
|
||||||
|
rc-update -u
|
||||||
|
|
||||||
|
# Configure CKAN DataPusher
|
||||||
|
mkdir -p /srv/ckan-datapusher/conf /srv/ckan-datapusher/data
|
||||||
|
cp ${SOURCE_DIR}/srv/ckan-datapusher/conf/datapusher.wsgi /srv/ckan-datapusher/conf/datapusher.wsgi
|
||||||
|
cp ${SOURCE_DIR}/srv/ckan-datapusher/conf/datapusher_settings.py /srv/ckan-datapusher/conf/datapusher_settings.py
|
||||||
|
chown -R 8004:8004 /srv/ckan-datapusher/data
|
@ -17,24 +17,24 @@ RUN \
|
|||||||
# Install build dependencies
|
# Install build dependencies
|
||||||
apk --no-cache add --virtual .deps build-base git libffi-dev libressl-dev libxml2-dev libxslt-dev py2-pip python2-dev \
|
apk --no-cache add --virtual .deps build-base git libffi-dev libressl-dev libxml2-dev libxslt-dev py2-pip python2-dev \
|
||||||
# Install CKAN DataPusher
|
# Install CKAN DataPusher
|
||||||
&& mkdir -p /srv/ckandp \
|
&& mkdir -p /srv/ckan-datapusher \
|
||||||
&& cd /srv/ckandp \
|
&& cd /srv/ckan-datapusher \
|
||||||
&& pip install -U setuptools \
|
&& pip install -U setuptools \
|
||||||
&& pip install -e 'git+https://github.com/ckan/datapusher.git#egg=datapusher' \
|
&& pip install -e 'git+https://github.com/ckan/datapusher.git#egg=datapusher' \
|
||||||
# Hackfix the X509_STORE_CTX wrapper
|
# Hackfix the X509_STORE_CTX wrapper
|
||||||
&& sed -i 's/\[security\]//' /srv/ckandp/src/datapusher/requirements.txt \
|
&& sed -i 's/\[security\]//' /srv/ckan-datapusher/src/datapusher/requirements.txt \
|
||||||
&& pip install -r /srv/ckandp/src/datapusher/requirements.txt \
|
&& pip install -r /srv/ckan-datapusher/src/datapusher/requirements.txt \
|
||||||
# Create OS user
|
# Create OS user
|
||||||
&& addgroup -S -g 8004 ckandp \
|
&& addgroup -S -g 8004 ckandp \
|
||||||
&& adduser -S -u 8004 -h /srv/ckandp -s /bin/false -g ckandp -G ckandp ckandp \
|
&& adduser -S -u 8004 -h /srv/ckan-datapusher -s /bin/false -g ckandp -G ckandp ckandp \
|
||||||
&& chown -R ckandp:ckandp /srv/ckandp \
|
&& chown -R ckandp:ckandp /srv/ckan-datapusher \
|
||||||
# Cleanup
|
# Cleanup
|
||||||
&& apk --no-cache del .deps \
|
&& apk --no-cache del .deps \
|
||||||
&& find /srv/ckandp/src -name '.git*' -exec rm -rf {} + \
|
&& find /srv/ckan-datapusher/src -name '.git*' -exec rm -rf {} + \
|
||||||
&& rm -rf /root/.cache
|
&& rm -rf /root/.cache
|
||||||
|
|
||||||
VOLUME ["/etc/ckandp", "/srv/ckandp/data"]
|
VOLUME ["/etc/ckan-datapusher", "/srv/ckan-datapusher/data"]
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
USER ckandp
|
USER ckandp
|
||||||
CMD ["uwsgi", "--plugin", "python", "--http-socket", "0.0.0.0:8080", "--wsgi-file", "/etc/ckandp/datapusher.wsgi", "--enable-threads"]
|
CMD ["uwsgi", "--plugin", "python", "--http-socket", "0.0.0.0:8080", "--wsgi-file", "/etc/ckan-datapusher/datapusher.wsgi", "--enable-threads"]
|
20
ckan-datapusher/etc/init.d/ckan-datapusher
Executable file
20
ckan-datapusher/etc/init.d/ckan-datapusher
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
description="CKAN DataPusher docker container"
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need docker
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
/usr/bin/docker run -d --rm \
|
||||||
|
--name ckan-datapusher \
|
||||||
|
-h ckan-datapusher \
|
||||||
|
-v /srv/ckan-datapusher/conf:/etc/ckan-datapusher \
|
||||||
|
-v /srv/ckan-datapusher/data:/srv/ckan-datapusher/data \
|
||||||
|
ckan-datapusher
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
/usr/bin/docker stop ckan-datapusher
|
||||||
|
}
|
@ -3,7 +3,7 @@
|
|||||||
import os
|
import os
|
||||||
import ckanserviceprovider.web as web
|
import ckanserviceprovider.web as web
|
||||||
|
|
||||||
os.environ['JOB_CONFIG'] = '/etc/ckandp/datapusher_settings.py'
|
os.environ['JOB_CONFIG'] = '/etc/ckan-datapusher/datapusher_settings.py'
|
||||||
web.init()
|
web.init()
|
||||||
|
|
||||||
import datapusher.jobs as jobs
|
import datapusher.jobs as jobs
|
@ -10,7 +10,7 @@ PASSWORD = str(uuid.uuid4())
|
|||||||
|
|
||||||
NAME = 'datapusher'
|
NAME = 'datapusher'
|
||||||
|
|
||||||
SQLALCHEMY_DATABASE_URI = 'sqlite:////srv/ckandp/data/jobs.db'
|
SQLALCHEMY_DATABASE_URI = 'sqlite:////srv/ckan-datapusher/data/jobs.db'
|
||||||
|
|
||||||
HOST = '0.0.0.0'
|
HOST = '0.0.0.0'
|
||||||
PORT = 8080
|
PORT = 8080
|
2
ckan.sh
2
ckan.sh
@ -3,7 +3,7 @@
|
|||||||
SOURCE_DIR=$(realpath $(dirname "${0}"))/ckan
|
SOURCE_DIR=$(realpath $(dirname "${0}"))/ckan
|
||||||
|
|
||||||
# Check prerequisites
|
# Check prerequisites
|
||||||
docker image ls | grep -q ckandp || $(realpath $(dirname "${0}"))/ckandp.sh
|
docker image ls | grep -q ckan-datapusher || $(realpath $(dirname "${0}"))/ckan-datapusher.sh
|
||||||
docker image ls | grep -q postfix || $(realpath $(dirname "${0}"))/postfix.sh
|
docker image ls | grep -q postfix || $(realpath $(dirname "${0}"))/postfix.sh
|
||||||
docker image ls | grep -q postgres || $(realpath $(dirname "${0}"))/postgres.sh
|
docker image ls | grep -q postgres || $(realpath $(dirname "${0}"))/postgres.sh
|
||||||
docker image ls | grep -q redis || $(realpath $(dirname "${0}"))/redis.sh
|
docker image ls | grep -q redis || $(realpath $(dirname "${0}"))/redis.sh
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
description="CKAN docker container"
|
description="CKAN docker container"
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
need docker ckandp postfix postgres redis solr
|
need docker ckan-datapusher postfix postgres redis solr
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
/usr/bin/docker run -d --rm \
|
/usr/bin/docker run -d --rm \
|
||||||
--name ckan \
|
--name ckan \
|
||||||
-h ckan \
|
-h ckan \
|
||||||
--link ckandp \
|
--link ckan-datapusher \
|
||||||
--link postfix \
|
--link postfix \
|
||||||
--link postgres \
|
--link postgres \
|
||||||
--link redis \
|
--link redis \
|
||||||
|
@ -177,7 +177,7 @@ ckan.max_image_size = 10
|
|||||||
# Make sure you have set up the DataStore
|
# Make sure you have set up the DataStore
|
||||||
|
|
||||||
#ckan.datapusher.formats = csv xls xlsx tsv application/csv application/vnd.ms-excel application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
#ckan.datapusher.formats = csv xls xlsx tsv application/csv application/vnd.ms-excel application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||||
ckan.datapusher.url = http://ckandp:8080/
|
ckan.datapusher.url = http://ckan-datapusher:8080/
|
||||||
#ckan.datapusher.assume_task_stale_after = 3600
|
#ckan.datapusher.assume_task_stale_after = 3600
|
||||||
|
|
||||||
# Resource Proxy settings
|
# Resource Proxy settings
|
||||||
|
14
ckandp.sh
14
ckandp.sh
@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
SOURCE_DIR=$(realpath $(dirname "${0}"))/ckandp
|
|
||||||
|
|
||||||
# Build Docker container
|
|
||||||
docker build -t ckandp ${SOURCE_DIR}
|
|
||||||
cp ${SOURCE_DIR}/etc/init.d/ckandp /etc/init.d/ckandp
|
|
||||||
rc-update -u
|
|
||||||
|
|
||||||
# Configure CKAN DataPusher
|
|
||||||
mkdir -p /srv/ckandp/conf /srv/ckandp/data
|
|
||||||
cp ${SOURCE_DIR}/srv/ckandp/conf/datapusher.wsgi /srv/ckandp/conf/datapusher.wsgi
|
|
||||||
cp ${SOURCE_DIR}/srv/ckandp/conf/datapusher_settings.py /srv/ckandp/conf/datapusher_settings.py
|
|
||||||
chown -R 8004:8004 /srv/ckandp/data
|
|
@ -1,20 +0,0 @@
|
|||||||
#!/sbin/openrc-run
|
|
||||||
|
|
||||||
description="CKAN DataPusher docker container"
|
|
||||||
|
|
||||||
depend() {
|
|
||||||
need docker
|
|
||||||
}
|
|
||||||
|
|
||||||
start() {
|
|
||||||
/usr/bin/docker run -d --rm \
|
|
||||||
--name ckandp \
|
|
||||||
-h ckandp \
|
|
||||||
-v /srv/ckandp/conf:/etc/ckandp \
|
|
||||||
-v /srv/ckandp/data:/srv/ckandp/data \
|
|
||||||
ckandp
|
|
||||||
}
|
|
||||||
|
|
||||||
stop() {
|
|
||||||
/usr/bin/docker stop ckandp
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user