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

Upgrade to ckan 2.10.3 #1662

Open
wants to merge 70 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
fcbb964
Upgrade CKAN to 2.10
kentsanggds Apr 25, 2023
bb7fea1
Remove function me, as interfered with flask login
kentsanggds Jun 7, 2023
79be7d5
Use ckan.ini rather than production.ini
kentsanggds Jun 7, 2023
77c407d
Update pycsw Dockerfile to use CKAN 2.10
kentsanggds Jun 7, 2023
aa6f028
Update ckan.ini
kentsanggds Jun 13, 2023
a199cad
Add CSRF to harvest source form
kentsanggds Jun 13, 2023
433cd01
User id rather than user name for edit user form
kentsanggds Jun 13, 2023
3b8eac8
Update CKAN and spatial sha in CKAN dockerfile
kentsanggds Jun 13, 2023
3413e8b
Update ckan-solr:2.10 harvest to multivalued
kentsanggds Jun 13, 2023
b34fbe3
Update docker compose for CKAN 2.10
kentsanggds Jun 13, 2023
699593f
Do not include docker/src as part of git
kentsanggds Jun 13, 2023
57ec88b
Remove tests for me function as handled upstream
kentsanggds Jun 15, 2023
c471746
Assume that the model will always be postgres
kentsanggds Jun 15, 2023
8097c12
Remove test as no longer needed
kentsanggds Jun 15, 2023
444db5a
Remove symlink for ckan-pip3 line in Dockerfile
kentsanggds Jun 15, 2023
947d87d
Update GHA to only create PRs on main-2.10
kentsanggds Jun 15, 2023
1d4bb79
Update WTF secret key and 2.10.Dockerfile for solr
kentsanggds Jun 21, 2023
38721dd
Update production.ini for ckan 2.10
kentsanggds Feb 8, 2024
d3a4e98
Update requirements.txt to work with ckan 2.10
kentsanggds Feb 8, 2024
ae3f389
Fix setup_pycsw so the database is set correctly
kentsanggds Feb 8, 2024
c9943ec
Remove import of ckantoolkit
kentsanggds Feb 8, 2024
6da41f7
Update datagovuk.css for ckan 2.10
kentsanggds Feb 8, 2024
1588bcd
Update references used in html templates
kentsanggds Feb 8, 2024
f17e1a7
Add csrf_input for login forms
kentsanggds Feb 8, 2024
888ba18
Add docker-compose-2.9.9-full.yaml for reference
kentsanggds Feb 8, 2024
817cdaf
Fix static-mock-harvest-source in docker-compose
kentsanggds Feb 8, 2024
d245a51
Add ckan 2.10 docker files
kentsanggds Feb 8, 2024
92e3d57
Add basic nginx to point to ckan hostname
kentsanggds Feb 8, 2024
0878883
Update pycsw 2.6.1.Dockerfile use latest spatial
kentsanggds Feb 8, 2024
b9f2fa5
Update solr 2.10.Dockerfile
kentsanggds Feb 8, 2024
0b680c9
Fix html and css
kentsanggds Feb 29, 2024
7349a53
Add solr Dockerfile for CKAN 2.10
kentsanggds Feb 29, 2024
57c154b
Add docker-compose for 2.10
kentsanggds Feb 29, 2024
23e3301
Update 2.10-core.Dockerfile
kentsanggds Mar 7, 2024
eb85c1d
Update 2.10-base.Dockerfile
kentsanggds Mar 7, 2024
ebe8574
Add 2.10.Dockerfile
kentsanggds Mar 7, 2024
0165ba2
Use ubunutu jammy for 2.10-core.Dockerfile
kentsanggds Mar 13, 2024
5c90451
Update requirements.txt pandas dependency
kentsanggds Mar 13, 2024
9027b83
Add solr 2.10 build option
kentsanggds Mar 13, 2024
9836483
Update CKAN and pycsw build image
kentsanggds Mar 13, 2024
06f9ca7
Only build solr version when upgrading solr
kentsanggds Mar 13, 2024
0bf5bdc
Update pycsw 2.6.1.Dockerfile to use ubuntu jammy
kentsanggds Mar 15, 2024
632c735
Install gunicorn
kentsanggds Mar 15, 2024
98c3fdd
Only build CKAN
kentsanggds Mar 15, 2024
caf771f
Update CI for CKAN 2.10
kentsanggds Mar 15, 2024
d6c1e54
Add patch for patched version release
kentsanggds Mar 15, 2024
2df42b6
Update 2.10-base.Dockerfile pip dependencies
kentsanggds Mar 19, 2024
0b411ab
Move tests to work with new CKAN test framework
kentsanggds Mar 19, 2024
4cbf62e
Update requirements for CKAN 2.10.3
kentsanggds Mar 21, 2024
0e9bb58
Update dev-requirements.txt for CKAN 2.10.3
kentsanggds Mar 21, 2024
e5c107e
Add activity to the list of ckan.plugins in test.ini for activity str…
kentsanggds Mar 21, 2024
4eb56ab
Add unicode_safe as a validator in place of str
kentsanggds Mar 21, 2024
c8e0e7f
Replace HTMLParser.unescape with html.unescape
kentsanggds Mar 21, 2024
dd0699a
Add deployment of CKAN, PyCSW and Solr notes to README
kentsanggds Mar 21, 2024
e9fd5bd
Add abillity to manually trigger CI tests
kentsanggds Mar 21, 2024
4e57d23
Update CI to install dev-requirements.txt
kentsanggds Mar 21, 2024
33826dd
Update CI pytest path
kentsanggds Mar 21, 2024
c5efac8
Update build-image tags
kentsanggds Mar 21, 2024
f84118e
Update pycsw 2.6.1.Dockerfile to fix gunicorn running
kentsanggds Mar 25, 2024
1eb7bf1
Update pycsw patch to c
kentsanggds Mar 25, 2024
91bba4f
Add ckan dev.Dockerfile
kentsanggds Mar 25, 2024
58aab7e
Remove redundant files used in docker-compose stack
kentsanggds Mar 28, 2024
385a154
Only build CKAN on tag
kentsanggds Mar 28, 2024
04c8576
Remove pycsw 2.4.2
kentsanggds Mar 28, 2024
949be1f
Update README deployment for solr and pycsw.
kentsanggds Mar 28, 2024
7048223
Restore header text
kentsanggds Mar 28, 2024
db8f926
f re-add index truncate test
kentsanggds Apr 23, 2024
aca63b8
Fix solr indexing truncates test
kentsanggds Apr 23, 2024
a041c0e
Only create PR for CKAN
kentsanggds Apr 23, 2024
89af9f6
Update docker-compose 2.10 args for development
kentsanggds Apr 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 3 additions & 13 deletions .github/workflows/build-image-on-tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ jobs:
build_and_push:
name: ${{ matrix.app.name }} (${{ matrix.arch }})
runs-on: ubuntu-latest
strategy:
matrix:
app:
- name: ckan
version: 2.9.9
- name: pycsw
version: 2.4.2
- name: solr
version: 8-2.9f
arch: [ amd64 ]
permissions:
packages: write
steps:
Expand All @@ -33,8 +23,8 @@ jobs:
ref: ${{ inputs.gitRef }}
- name: Build and push images
env:
APP: ${{ matrix.app.name }}
VERSION: ${{ matrix.app.version }}
ARCH: ${{ matrix.arch }}
APP: ckan
VERSION: "2.10"
ARCH: amd64
GH_REF: ${{ github.ref_name }}
run: ./docker/build-image.sh
29 changes: 18 additions & 11 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ on:
required: true
type: choice
options:
- build_push
- build_push_ckan
- build_only
- build_push_base
- build_push_pycsw
- build_push_solr
- build_push_test_ckan
push:
branches:
Expand All @@ -28,14 +29,12 @@ jobs:
# remember to update versions on build-image-on-tags.yaml
app:
- name: ckan
version: 2.9.9
version: "2.10"
- name: pycsw
version: 2.6.1
skip: true
- name: pycsw
version: 2.4.2
patch: c
- name: solr
version: 8-2.9f
version: "2.10"
arch: [ amd64 ]
permissions:
packages: write
Expand All @@ -57,15 +56,14 @@ jobs:
VERSION: ${{ matrix.app.version }}
ARCH: ${{ matrix.arch }}
run: ./docker/build-image.sh
- name: Build and push images
if: ${{ inputs.buildType == 'build_push' || github.ref == 'refs/heads/main' }}
- name: Build and push CKAN image
if: ${{ (inputs.buildType == 'build_push_ckan' || github.ref == 'refs/heads/main') && matrix.app.name == 'ckan' }}
env:
APP: ${{ matrix.app.name }}
VERSION: ${{ matrix.app.version }}
ARCH: ${{ matrix.arch }}
SKIP: ${{ matrix.app.skip }}
run: ./docker/build-image.sh
- name: Build and push CKAN base image
- name: Build and push CKAN base and core image
if: ${{ inputs.buildType == 'build_push_base' && matrix.app.name == 'ckan' }}
env:
APP: ${{ matrix.app.name }}
Expand All @@ -78,9 +76,18 @@ jobs:
env:
APP: ${{ matrix.app.name }}
VERSION: ${{ matrix.app.version }}
PATCH: ${{ matrix.app.patch }}
ARCH: ${{ matrix.arch }}
BUILD_BASE: true
SKIP: ${{ matrix.app.skip }}
run: ./docker/build-image.sh
- name: Build and push solr image
if: ${{ inputs.buildType == 'build_push_solr' && matrix.app.name == 'solr' }}
env:
APP: ${{ matrix.app.name }}
VERSION: ${{ matrix.app.version }}
ARCH: ${{ matrix.arch }}
GH_REF: ${{ matrix.app.version }}
BUILD_BASE: false
run: ./docker/build-image.sh
- name: Build and push CKAN test image
if: ${{ inputs.buildType == 'build_push_test_ckan' && matrix.app.name == 'ckan' }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: ckanext-datagovuk ci
on:
workflow_dispatch:
push:
pull_request_target:
branches:
- main
types:
- closed


jobs:
test:
name: test
runs-on: ubuntu-latest
container:
image: ghcr.io/alphagov/ckan:2.9.9-base
image: ghcr.io/alphagov/ckan:2.10-base
options: --user root
services:
solr:
image: ghcr.io/alphagov/solr:8-2.9f
image: ghcr.io/alphagov/solr:2.10
postgres:
image: postgis/postgis:13-3.1-alpine
env:
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
pip install -e .
- name: Install dev requirements
run: |
pip install factory-boy==2.12.0 pytest-ckan==0.0.12 pytest-cov==4.0.0 mock==2.0.0
pip install -r dev-requirements.txt
- name: Update config
run: |
# Replace default path to CKAN core config file with the one on the container
Expand All @@ -68,4 +68,4 @@ jobs:
run: |
ckan db init
- name: Run tests
run: pytest --ckan-ini=test.ini tests --cov=ckanext.datagovuk --cov-report=term-missing --disable-pytest-warnings -v
run: pytest --ckan-ini=test.ini ckanext/datagovuk/tests --cov=ckanext.datagovuk --cov-report=term-missing --disable-pytest-warnings -v
3 changes: 2 additions & 1 deletion .github/workflows/create-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ on:
workflows: [ "Build and push images" ]
types:
- completed
push:
branches:
- main
- main-2.10
kentsanggds marked this conversation as resolved.
Show resolved Hide resolved

jobs:
create_pr:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ docs/_build/
environment.sh
.DS_Store
.env*
docker/src
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,11 @@ Then run the paster command:
In order to remove the test data:

ckan datagovuk remove-dgu-test-data

-----------------
Deploying CKAN, PyCSW and Solr
-----------------

By default merging a PR into main will trigger a build of the CKAN image and create PRs on the govuk-dgu-charts repo. Updating the tag will build and push a tagged image and create the PR for Staging and Production environments in the govuk-dgu-charts repo.

If you want to deploy updates to PyCSW or Solr then you will need to trigger the build manually via the github actions tab and manually update the pycsw or solr tag in govuk-dgu-charts repo for each environment.
1 change: 1 addition & 0 deletions bin/setup_pycsw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ done

# only run the setup script if the records table has not been created
if !(psql $CKAN_SQLALCHEMY_URL -c "select exists (SELECT * FROM information_schema.tables where table_name = 'records');" | tr -d '\n' | grep -q "exists -------- t"); then
sed "s|database=\${CKAN_SQLALCHEMY_URL}|database=$CKAN_SQLALCHEMY_URL|g" -i /config/pycsw.cfg
ckan ckan-pycsw setup -p $CKAN_CONFIG/pycsw.cfg

echo "Drop ix_records_abstract if exists and create pycsw abstract index to allow for larger records"
Expand Down