Skip to content

Commit

Permalink
Revert "Harvest config feb 03 2025 (#637)"
Browse files Browse the repository at this point in the history
This reverts commit e68155a.
  • Loading branch information
mpolidori committed Feb 12, 2025
1 parent e68155a commit 297a6ed
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 21 deletions.
4 changes: 2 additions & 2 deletions ckan-backend-dev/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ DATAPUSHER_REWRITE_RESOURCES=True
DATAPUSHER_REWRITE_URL=http://ckan-dev:5000

# Extensions
CKAN__PLUGINS="image_view text_view webpage_view resource_proxy datatables_view datastore datapusher activity s3filestore scheming_datasets scheming_organizations scheming_groups harvest wri wri_harvester auth hierarchy_display hierarchy_form hierarchy_group_form issues envvars"
CKAN__VIEWS__DEFAULT_VIEWS="image_view text_view webpage_view datatables_view"
CKAN__PLUGINS=image_view text_view webpage_view resource_proxy datatables_view datastore datapusher activity s3filestore scheming_datasets scheming_organizations scheming_groups harvest wri wri_harvester auth hierarchy_display hierarchy_form hierarchy_group_form issues envvars
CKAN__VIEWS__DEFAULT_VIEWS=image_view text_view webpage_view datatables_view
CKAN__HARVEST__MQ__TYPE=redis
CKAN__HARVEST__MQ__HOSTNAME=redis
CKAN__HARVEST__MQ__PORT=6379
Expand Down
8 changes: 0 additions & 8 deletions ckan-backend-dev/ckan/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,6 @@ COPY setup/supervisord.conf /etc/supervisord.conf
COPY setup/supervisor.worker.conf /etc/supervisord.d/worker.conf
COPY setup/supervisor.harvest.conf /etc/supervisord.d/harvest.conf

RUN SUPERVISOR_USER="root"; \
SUPERVISOR_HOME="/tmp"; \
sed -i "s|SUPERVISOR_USER|${SUPERVISOR_USER}|g" /etc/supervisord.d/harvest.conf && \
sed -i "s|SUPERVISOR_HOME|${SUPERVISOR_HOME}|g" /etc/supervisord.d/harvest.conf && \
sed -i "s|SUPERVISOR_USER|${SUPERVISOR_USER}|g" /etc/supervisord.d/worker.conf && \
sed -i "s|SUPERVISOR_HOME|${SUPERVISOR_HOME}|g" /etc/supervisord.d/worker.conf && \
sed -i "s|SUPERVISOR_HOME|${SUPERVISOR_HOME}|g" /etc/supervisord.conf

RUN chown -R ckan:ckan /etc/supervisord.d
RUN chown -R ckan:ckan /etc/supervisord.conf

Expand Down
20 changes: 20 additions & 0 deletions ckan-backend-dev/ckan/setup/start_ckan_development.sh.override
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,27 @@ then
done
fi

# Check if we are running in GitHub Actions
if [ "$GITHUB_ACTIONS" = "true" ]; then
SUPERVISOR_USER='root'
SUPERVISOR_HOME='/tmp'
else
SUPERVISOR_USER='ckan'
SUPERVISOR_HOME='/srv/app'
fi

# Start supervisord
echo "==================================="
echo "SUPERVISOR_USER: $SUPERVISOR_USER"
echo "SUPERVISOR_HOME: $SUPERVISOR_HOME"
echo "==================================="

sed -i "s|SUPERVISOR_USER|$SUPERVISOR_USER|g" /etc/supervisord.d/harvest.conf
sed -i "s|SUPERVISOR_HOME|$SUPERVISOR_HOME|g" /etc/supervisord.d/harvest.conf
sed -i "s|SUPERVISOR_USER|$SUPERVISOR_USER|g" /etc/supervisord.d/worker.conf
sed -i "s|SUPERVISOR_HOME|$SUPERVISOR_HOME|g" /etc/supervisord.d/worker.conf
sed -i "s|SUPERVISOR_HOME|$SUPERVISOR_HOME|g" /etc/supervisord.conf

supervisord --configuration /etc/supervisord.conf &

# Start the development server with automatic reload
Expand Down
1 change: 0 additions & 1 deletion ckan-backend-dev/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ volumes:
services:

ckan-dev:
user: "ckan"
container_name: ${CKAN_CONTAINER_NAME}
image: ${CKAN_IMAGE}
environment:
Expand Down
14 changes: 4 additions & 10 deletions deployment/ckan/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ RUN for d in $APP_DIR/patches/*; do \
USER ckan
RUN cd ${APP_DIR}/src/ckanext-wri && pip3 install -r requirements.txt && pip3 install -r dev-requirements.txt && pip3 install -e .

RUN ckan config-tool ${CKAN_INI} "ckan.plugins = image_view text_view webpage_view resource_proxy datatables_view datastore datapusher activity s3filestore scheming_datasets scheming_organizations scheming_groups harvest wri wri_harvester auth hierarchy_display hierarchy_form hierarchy_group_form issues envvars"
ENV CKAN__PLUGINS image_view text_view webpage_view resource_proxy datatables_view datastore datapusher activity s3filestore scheming_datasets scheming_organizations scheming_groups harvest wri wri_harvester auth hierarchy_display issues envvars

RUN ckan config-tool ${CKAN_INI} "ckan.plugins = ${CKAN__PLUGINS}"
RUN ckan config-tool ${CKAN_INI} "ckan.auth.create_user_via_web = false"
RUN ckan config-tool ${CKAN_INI} "ckan.root_path = /private-admin/{{LANG}}"

Expand All @@ -87,16 +89,8 @@ COPY setup/supervisord.conf /etc/supervisord.conf
COPY setup/supervisor.worker.conf /etc/supervisord.d/worker.conf
COPY setup/supervisor.harvest.conf /etc/supervisord.d/harvest.conf

ENV SUPERVISOR_USER=root
ENV SUPERVISOR_HOME=/srv/app

RUN sed -i "s|SUPERVISOR_USER|${SUPERVISOR_USER}|g" /etc/supervisord.d/harvest.conf && \
sed -i "s|SUPERVISOR_HOME|${SUPERVISOR_HOME}|g" /etc/supervisord.d/harvest.conf && \
sed -i "s|SUPERVISOR_USER|${SUPERVISOR_USER}|g" /etc/supervisord.d/worker.conf && \
sed -i "s|SUPERVISOR_HOME|${SUPERVISOR_HOME}|g" /etc/supervisord.d/worker.conf && \
sed -i "s|SUPERVISOR_HOME|${SUPERVISOR_HOME}|g" /etc/supervisord.conf

RUN chown -R ckan:ckan /etc/supervisord.d
RUN chown -R ckan:ckan /etc/supervisord.conf

USER ckan

17 changes: 17 additions & 0 deletions deployment/ckan/setup/start_ckan.sh.override
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash

# Run the prerun script to init CKAN and create the default admin user
python3 prerun.py

Expand Down Expand Up @@ -30,6 +31,11 @@ echo "From GitHub Actions: $GITHUB_ACTIONS"
# Check if we are running in GitHub Actions
if [ "$GITHUB_ACTIONS" = "true" ]; then
UWSGI_OPTS="$UWSGI_OPTS --single-interpreter --manage-script-name --mount /private-admin=/srv/app/wsgi.py"
SUPERVISOR_USER='root'
SUPERVISOR_HOME='/tmp'
else
SUPERVISOR_USER='ckan'
SUPERVISOR_HOME='/srv/app'
fi
echo "Starting CKAN with the following uwsgi options: $UWSGI_OPTS"

Expand All @@ -38,6 +44,17 @@ export SCRIPT_NAME="/private-admin"
if [ $? -eq 0 ]
then
# Start supervisord
echo "==================================="
echo "SUPERVISOR_USER: $SUPERVISOR_USER"
echo "SUPERVISOR_HOME: $SUPERVISOR_HOME"
echo "==================================="

sed -i "s|SUPERVISOR_USER|$SUPERVISOR_USER|g" /etc/supervisord.d/harvest.conf
sed -i "s|SUPERVISOR_HOME|$SUPERVISOR_HOME|g" /etc/supervisord.d/harvest.conf
sed -i "s|SUPERVISOR_USER|$SUPERVISOR_USER|g" /etc/supervisord.d/worker.conf
sed -i "s|SUPERVISOR_HOME|$SUPERVISOR_HOME|g" /etc/supervisord.d/worker.conf
sed -i "s|SUPERVISOR_HOME|$SUPERVISOR_HOME|g" /etc/supervisord.conf

supervisord --configuration /etc/supervisord.conf &
# Start uwsgi
uwsgi $UWSGI_OPTS
Expand Down

0 comments on commit 297a6ed

Please sign in to comment.