Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ckan 2.10 upgrade #10

Open
wants to merge 80 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
f5230c1
Changed dataset.yaml to dataset-druf.yaml for testing
twdbben Mar 4, 2024
bab4111
Updated tags to point to bb-dev repos for work towards 0.5.3
twdbben Mar 4, 2024
9b64794
merge
twdbben Apr 1, 2024
794c8e0
2.10 upgrade prep
twdbben Nov 4, 2024
c21295a
CKAN_DATASTORE_WRITE_URL and CKAN_VERSION updates
twdbben Nov 7, 2024
ad4d4e9
Updated CKAN_PLUGINS list
twdbben Nov 7, 2024
bea7dfd
Alphabetized plugins list; updated tags
twdbben Nov 7, 2024
0b488dc
Added port forwarding to db config
twdbben Nov 7, 2024
8eabb52
Turn off collaborator functionality
twdbben Nov 8, 2024
ce1d36d
Merge branch 'ckan-2.10-upgrade' of github.com:TNRIS/twdh_ckan_docker…
twdbben Nov 8, 2024
d83f5d0
merge resolution
twdbben Nov 18, 2024
cafb3a6
Corrected branch on ckanext-twdh_gazetteer
twdbben Dec 4, 2024
e9f12df
Merge branch 'ckan-2.10-upgrade' of github.com:TNRIS/twdh_ckan_docker…
twdbben Dec 4, 2024
99a0af7
Added 01_ckan_upgrade.sh db upgrade script
twdbben Dec 5, 2024
2aaa744
Renamed and improved 01_ckan_db_upgrade.sh
twdbben Dec 5, 2024
3385366
Temporarily disable HEALTHCHECK
twdbben Dec 5, 2024
852e5b1
Turned off UPGRADE toggle
twdbben Dec 5, 2024
266dab7
Removed errant exit statement
twdbben Dec 5, 2024
ce9b2e5
Reenabled HEALTHCHECK
twdbben Dec 5, 2024
145df27
Set HEALTHCHECK=NONE
twdbben Dec 5, 2024
5b29596
Reenabled HEALTHCHECK
twdbben Dec 5, 2024
8641ddb
Set UPGRADE=1 to initiate 2.10.5 db upgrade
twdbben Dec 5, 2024
53e1f8c
Set UPGRADE=0
twdbben Dec 6, 2024
dea1a5c
Added variables
twdbben Dec 6, 2024
9540fd3
Added datapusher_plus to PLUGINS
twdbben Dec 6, 2024
c5fb4fc
added ckanext-datapusher_plus block
twdbben Dec 6, 2024
f2957c9
DP+ Upgrade - supervisor process and qsv
twdbben Dec 9, 2024
2ee9bad
Removed unused extensions from $CKAN_PLUGINS
twdbben Dec 9, 2024
e390de6
Merge branch 'ckan-2.10-upgrade' of github.com:TNRIS/twdh_ckan_docker…
twdbben Dec 9, 2024
1efb3ad
Updated docker/ckan/Dockerfile for supervisor
twdbben Dec 9, 2024
a63cb2c
Merge branch 'ckan-2.10-upgrade' of github.com:TNRIS/twdh_ckan_docker…
twdbben Dec 9, 2024
0ea4d80
Changed way supervisor.conf gets copied
twdbben Dec 10, 2024
56f141d
Added supervisor-ckan-worker.conf config file
twdbben Dec 10, 2024
841d61d
Added supervisord.conf
twdbben Dec 10, 2024
d071ac4
Fixed /etc/supervisor/conf.d/ path in supervisord.conf
twdbben Dec 10, 2024
409509a
Commented out beaker.session.secret in merge.production.ini
twdbben Dec 11, 2024
88ff660
Merge branch 'ckan-2.10-upgrade' of github.com:TNRIS/twdh_ckan_docker…
twdbben Dec 11, 2024
ae2a713
Uncommented beaker.session.secret in merge.production.ini
twdbben Dec 11, 2024
efd0797
Removed DP+ secrets
twdbben Dec 11, 2024
7195b0d
Added to .env-ckan.env
twdbben Dec 11, 2024
ac49cf8
Removed CKAN__DATAPUSHER__API from .ckan-env.env
twdbben Dec 11, 2024
428d4b6
Set CKAN_DATAPUSHER_API_TOKEN in .env-ckan.env
twdbben Dec 11, 2024
5d4c251
Added comment
twdbben Dec 11, 2024
a2c6575
TESTING added variables to .ckan-env.env
twdbben Dec 11, 2024
5d0f648
Rolling back changes
twdbben Dec 12, 2024
f060ae0
Set USER back to ckan
twdbben Dec 13, 2024
3823d42
Copy qsvdp into /usr/local/bin/
twdbben Dec 13, 2024
aac2568
Changed log dir from /tmp to /var/log/supervisor
twdbben Dec 13, 2024
8226151
Trying running as root again
twdbben Dec 13, 2024
2ed0e8f
Set supervisor to run as user ckan
twdbben Dec 13, 2024
d888811
mv instead of cp qsvdp binary
twdbben Dec 13, 2024
ce286d7
Not running as ckan due to permision problem
twdbben Dec 13, 2024
c33e19e
Install file command required by qsv
twdbben Dec 13, 2024
9e6a4c3
Added uchardet to apt-get
twdbben Dec 13, 2024
0a64696
Changed dp+ branch to dev-v1.0
twdbben Dec 16, 2024
4b5b181
SOLR field config
twdbben Dec 16, 2024
d2e6534
Added "group" field definition to SOLR config
twdbben Jan 6, 2025
e679e94
Merge branch 'ckan-2.10-upgrade' of github.com:TNRIS/twdh_ckan_docker…
twdbben Jan 6, 2025
5591ef8
Changed tag template to twdh-*.*.*
twdbben Jan 6, 2025
2470496
Added output to show git clone commands
twdbben Jan 7, 2025
6461cf5
actions/upload-artifact@v3 -> v4
twdbben Jan 9, 2025
f82e3dc
Merge branch 'ckan-2.10-upgrade' of github.com:TNRIS/twdh_ckan_docker…
twdbben Jan 9, 2025
3f1e9b8
Reactivated scheming_organizations plugin
twdbben Jan 9, 2025
188215e
Updated plugin branches & tags
twdbben Jan 13, 2025
4dd727c
Updated plugin branches & tags
twdbben Jan 13, 2025
277fa6b
Revised qsv install process
twdbben Jan 14, 2025
8281bb5
Set datapusher branch to druf-phase1
twdbben Jan 15, 2025
cf77ec0
Updated datapusher-plus cmd
twdbben Jan 15, 2025
269b022
Updated datapusher-plus plugin
twdbben Jan 15, 2025
abbeeb0
Fixed typo
twdbben Jan 15, 2025
23ab98c
Fixed branch name
twdbben Jan 15, 2025
fa13022
Turned on db UPGRADE
twdbben Jan 16, 2025
5a0cca8
Turned UPDRADE off
twdbben Jan 16, 2025
550c778
Reverted to non-DRUF dataset.yaml
twdbben Jan 17, 2025
89029a3
Removed testing cruft
twdbben Jan 17, 2025
8c84c8d
Merge branch 'ckan-2.10-upgrade' of github.com:TNRIS/twdh_ckan_docker…
twdbben Jan 17, 2025
75afff7
Cleanup
twdbben Jan 21, 2025
f5c4ba6
Merge branch 'ckan-2.10-upgrade' of github.com:TNRIS/twdh_ckan_docker…
twdbben Jan 21, 2025
4d53da9
Cleanup
twdbben Jan 21, 2025
9aaf51a
Refactor of print() statement for git command
twdbben Jan 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/wf1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ run-name: ${{ github.actor }} created a new release
on:
push:
tags:
- v*.*.*-*
- twdh-*.*.*
jobs:
test-image:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
- run: |
cd docker && docker compose --file docker-compose_local.yml up -d --wait
- name: docker_log
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build_log
path: build.log
Expand All @@ -61,4 +61,4 @@ jobs:
env:
SOURCE_NAME: ${{ steps.name_branch_tags.outputs.SOURCE_NAME }}
SOURCE_BRANCH: ${{ steps.name_branch_tags.outputs.SOURCE_BRANCH }}
SOURCE_TAG: ${{ steps.name_branch_tags.outputs.SOURCE_TAG }}
SOURCE_TAG: ${{ steps.name_branch_tags.outputs.SOURCE_TAG }}
8 changes: 6 additions & 2 deletions docker/.env-ckan.env
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ DATASTORE_READONLY_USER=datastore
DATASTORE_READONLY_PASSWORD=datastore

#DB CONNECTION STRINGS
CKAN_DATASTORE_WRITE_URL=postgresql://${DATASTORE_READONLY_USER}:${DATASTORE_READONLY_PASSWORD}@db/datastore
CKAN_DATASTORE_WRITE_URL=postgresql://${CKAN_DB_USER}:${CKAN_DB_PASSWORD}@db/datastore
CKAN_DATASTORE_READ_URL=postgresql://${DATASTORE_READONLY_USER}:${DATASTORE_READONLY_PASSWORD}@db/datastore

# General Settings
CKAN_VERSION=2.9.9
CKAN_VERSION=2.10.5
CKAN_SITE_ID=default
CKAN_SITE_URL=http://0.0.0.0:5000
CKAN_PORT=5000
Expand All @@ -36,6 +36,7 @@ CKAN___DEBUG=false

# Auth Settings
CKAN__AUTH__CREATE_USER_VIA_WEB=false
CKAN__AUTH__ALLOW_DATASET_COLLABORATORS=false

# Tracking Settings
CKAN__TRACKING_ENABLED=true
Expand All @@ -60,6 +61,7 @@ [email protected]
# CKAN_SMTP_MAIL_FROM=ckan@localhost

# Datapusher configuration
CKAN__DATAPUSHER__API_TOKEN=${CKAN_DATAPUSHER_API_TOKEN}
CKAN__DATAPUSHER__URL=http://datapusher:8800
CKAN__DATAPUSHER__CALLBACK_URL_BASE=http://0.0.0.0:5000/
DATAPUSHER_VERSION=0.0.17
Expand Down Expand Up @@ -94,6 +96,7 @@ CKAN___BEAKER__SESSION__TYPE=ext:redis
CKAN___BEAKER__SESSION__URL=redis://redis:6379/8
CKAN___BEAKER__SESSION__COOKIE_EXPIRES=true
CKAN___BEAKER__SESSION__COOKIE_DOMAIN=0.0.0.0

CKANEXT__SECURITY__DOMAIN=0.0.0.0
CKANEXT__SECURITY__REDIS__HOST=redis
CKANEXT__SECURITY__REDIS__PORT=6379
Expand All @@ -103,3 +106,4 @@ CKANEXT__SECURITY__LOGIN_MAX_COUNT=10
CKANEXT__SECURITY__BRUTE_FORCE_KEY=user_name
CKANEXT__SECURITY__DISABLE_PASSWORD_RESET_OVERRIDE=true
CKANEXT__SECURITY__MFA_HELP_LINK=http://0.0.0.0:5000/pages/mfa

35 changes: 28 additions & 7 deletions docker/ckan/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FROM ubuntu:focal-20210827 as ckanbuild
# Set CKAN version to build

ENV GIT_URL=https://github.com/TNRIS/ckan.git
ENV GIT_BRANCH=twdh-patches-2.9.10
ENV GIT_BRANCH=twdh-patches-2.10.5

# Set timezone
ENV TZ=UTC
Expand Down Expand Up @@ -119,6 +119,7 @@ ENV CKAN__DEFAULT_VIEWS image_view \
ENV CKAN__PLUGINS \
stats \
twdh_theme \
activity \
security \
report \
check_link \
Expand All @@ -127,8 +128,6 @@ ENV CKAN__PLUGINS \
image_view \
video_view \
datastore \
harvest \
ckan_harvester \
spatial_metadata \
spatial_query \
twdh_schema \
Expand All @@ -143,7 +142,7 @@ ENV CKAN__PLUGINS \
wmts_view \
shp_view \
datatablesview_plus \
datapusher \
datapusher_plus \
openapi_viewer \
s3filestore \
googleanalytics \
Expand Down Expand Up @@ -191,6 +190,9 @@ RUN apt-get update && \
libfreetype6 \
libfreetype6-dev \
zlib1g-dev \
supervisor \
file \
uchardet \
apache2-utils && \
rm -rf /var/lib/apt/lists/* && \
# Create SRC_DIR
Expand All @@ -216,7 +218,7 @@ COPY ./plugins ${SRC_DIR}/plugins
RUN ls ${SRC_DIR}/plugins

# Additional install steps for build stages artifacts
RUN pip install uWSGI==2.0.20 gevent==21.12.0
RUN pip install uWSGI==2.0.20 gevent==22.10.2
# Create a local user and group to run the app
RUN groupadd -g 92 ckan && \
useradd -rm -d /srv/app -s /bin/bash -g ckan -u 92 ckan
Expand Down Expand Up @@ -263,7 +265,26 @@ RUN ckan config-tool ${APP_DIR}/production.ini "ckan.plugins = ${CKAN__PLUGINS}"
ckan config-tool ${APP_DIR}/production.ini "googleanalytics.id = G-SJK5R9G5F5" && \
ckan config-tool ${APP_DIR}/production.ini "googleanalytics.download_handler = ckanext.s3filestore.views:resource_download" && \
# Change ownership to app user
chown -R ckan:ckan /srv/app
chown -R ckan:ckan /srv/app && \
# Create log directory for `ckan jobs worker` process
mkdir -v /var/log/ckan

# Setup supervisor
COPY ./supervisord.conf /etc/supervisor/
COPY ./supervisor-ckan-worker.conf /etc/supervisor/conf.d/

# install Rust, then qsvdp
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
# source the cargo env to setup the $PATH for rust
. $HOME/.cargo/env && \
# install qsvdp from source
git clone https://github.com/dathere/qsv.git && \
cd qsv && \
export CARGO_BUILD_RUSTFLAGS='-C target-cpu=native' && \
cargo build --release --locked --bin qsvdp -F datapusher_plus,luau,polars && \
# mv the qsvdp binary so that ckan user can run it
mv target/release/qsvdp /usr/local/bin/ && \
cargo clean

# Remove wheels
RUN rm -rf /srv/app/wheels
Expand All @@ -288,6 +309,6 @@ EXPOSE 5000

HEALTHCHECK --interval=10s --timeout=5s --retries=5 CMD curl --fail http://0.0.0.0:5000/api/3/action/status_show || exit 1

USER ckan
#USER ckan

CMD ["/srv/app/start_ckan.sh"]
3 changes: 0 additions & 3 deletions docker/ckan/afterinit.d/00_harvest.sh

This file was deleted.

12 changes: 12 additions & 0 deletions docker/ckan/entrypoint.d/01_ckan_db_upgrade.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
echo "@@@@@@ UPGRADE CKAN DB @@@@@@"

UPGRADE=0

if [ "$UPGRADE" -ne 1 ]; then
echo "Warning: UPGRADE not enabled. If you want db upgrade to run, set UPGRADE=1 in twdh_ckan_docker/docker/ckan/entrypoint.d/01_ckan_db_upgrade.sh"
else
ckan -c /srv/app/production.ini db upgrade
ckan -c /srv/app/production.ini db pending-migrations --apply
fi

2 changes: 1 addition & 1 deletion docker/ckan/merge.production.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ ckanext.security.disable_password_reset_override = true

# Provide a help page to allow 2fa users to contact support or get more information
# Shows up as 'Need help?' on the 2fa entry form beside the submit button. Does not display a link if none provided
ckanext.security.mfa_help_link = https://data.govt.nz/catalogue-guide/releasing-data-on-data-govt-nz/how-do-i-set-up-two-factor-authentication/
ckanext.security.mfa_help_link = https://data.govt.nz/catalogue-guide/releasing-data-on-data-govt-nz/how-do-i-set-up-two-factor-authentication/
Loading