From 04e26cc89ed3e67e160d69b32ce289aa8a853695 Mon Sep 17 00:00:00 2001 From: Michael Polidori Date: Fri, 9 Aug 2024 17:16:17 -0400 Subject: [PATCH] Revert dev env settings; Bump Solr version to 9 --- .docker-compose.vital-strategies-theme.yaml | 5 +- README.md | 12 +- docker-compose.yaml | 12 +- solr/schemas/schema210.xml | 203 ++++++++++++++++++++ 4 files changed, 216 insertions(+), 16 deletions(-) create mode 100644 solr/schemas/schema210.xml diff --git a/.docker-compose.vital-strategies-theme.yaml b/.docker-compose.vital-strategies-theme.yaml index 4fbf592..44910c2 100644 --- a/.docker-compose.vital-strategies-theme.yaml +++ b/.docker-compose.vital-strategies-theme.yaml @@ -22,7 +22,6 @@ services: CKAN_BRANCH: ckan-2.10.4 EXTRA_PACKAGES: cron EXTRA_FILESYSTEM: "./overrides/vital-strategies/filesystem/" - #PRE_INSTALL: "sed -i -e 's/psycopg2==2.4.5/psycopg2==2.7.7/g' ~/venv/src/ckan/requirements.txt" POST_INSTALL: | install_standard_ckan_extension_github -r datopian/ckanext-querytool -b dev/python3-upgrade &&\ install_standard_ckan_extension_github -r ckan/ckanext-geoview && \ @@ -37,8 +36,8 @@ services: cd ~/venv/src/ckanext-querytool && ~/venv/bin/python setup.py compile_catalog -l zh_Hans_CN -f environment: - CKAN_CONFIG_TEMPLATE_PREFIX=vital-strategies-theme- - ports: # <-- Add this section to expose port 5000 - - 5000:5000 + #ports: # Uncomment to expose CKAN on localhost for development + # - 5000:5000 jobs: image: viderum/ckan-cloud-docker:ckan-latest-vital-strategies-theme diff --git a/README.md b/README.md index 4a821b3..6300007 100644 --- a/README.md +++ b/README.md @@ -407,11 +407,13 @@ curl "http://localhost:8983/solr/admin/collections?action=RELOAD&name=${INSTANCE ## Migrating to CKAN 2.10 and Python 3 -**Note**: As of January 1, 2020, Python 2 is no longer supported. If you're running CKAN 2.7 with Python 2, it's highly recommended to migrate to CKAN 2.10 with Python 3. The steps below outline how to do this. +>**Note**: As of January 1, 2020, Python 2 is no longer officially supported. If you're running CKAN 2.7 with Python 2, it's highly recommended to migrate to CKAN 2.10 with Python 3. The latest version of this repo also no longer supports CKAN < 2.10 and Python < 3. If you must stick with those versions for now, you will need to maintain your local copy of this repo yourself. -On the `master` branch, build/start CKAN (this is the old CKAN 2.7 with Python 2—you need to seed this portal first before testing the migration). All commands should be run in `ckan-cloud-docker` (unless stated otherwise). In the examples below, I'm using the `vital-strategies` project template as an example. Replace `vital-strategies` with the name of your project template. **Note**: Depending on any custom configurations you have, you might need to adjust the variables in `db/migration/upgrade_databases.sh` (and others, such as your custom `docker-compose` file, or your custom `.ini` file) to match your setup. +All of the following commands should be run in `ckan-cloud-docker` (unless stated otherwise). In the examples below, I'm using the `vital-strategies` project template as an example. Replace `vital-strategies` with the name of your project template. -1. Start up your current instance (if it's not running—don't pull the latest changes yet): `make start O=vital-strategies` +>**Note**: Depending on any custom configurations you have, you might need to adjust the variables in `db/migration/upgrade_databases.sh` (and others, such as your custom `docker-compose` file, or your custom `.ini` file) to match your setup. + +1. Start up your _current_ instance (if it's not running already—**don't pull the latest changes yet**): `make start O=vital-strategies` 2. Backup the DBs: `make backup-db O=vital-strategies` (confirm that you have `ckan.dump`, `datastore.dump` and `ckan_data.tar.gz` in the current directory after running this command) 3. Stop the containers: `make stop O=vital-strategies` 4. Pull the latest changes: `git pull` @@ -424,9 +426,9 @@ On the `master` branch, build/start CKAN (this is the old CKAN 2.7 with Python 2 11. Start the containers: `make start O=vital-strategies` 12. Test and confirm that the migration was successful -**Note**: The first time you visit the DataStore tab for a given resource, it will say "Error: cannot connect to datapusher". If you click "Upload to DataStore", this error will go away and the process will complete as expected. +>**Note**: The first time you visit the DataStore tab for a given resource, it will say "Error: cannot connect to datapusher". If you click "Upload to DataStore", this error will go away and the process will complete as expected. -**Important**: It's recommended to make copies of `ckan.dump`, `datastore.dump` and `ckan_data.tar.gz` and move them off of the server, if possible. If anything goes wrong, and you must revert to the old CKAN 2.7 instance, you can restore it by following the steps below: +>**Important**: It's recommended to make copies of `ckan.dump`, `datastore.dump` and `ckan_data.tar.gz` and move them off of the server, if possible. If anything goes wrong, and you must revert to the old CKAN 2.7 instance, you can restore it by following the steps below: 1. Stop the containers: `make stop O=vital-strategies` 2. Checkout the last CKAN 2.7 commit: `git checkout d3bdc178a1726ada331b47157b92123cdec82b12` diff --git a/docker-compose.yaml b/docker-compose.yaml index db7b93e..e43935e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,8 +3,8 @@ services: image: traefik:1.7.2-alpine restart: always volumes: - #- ./traefik/traefik.toml:/traefik.toml - - ./traefik/traefik.dev.toml:/traefik.toml + - ./traefik/traefik.toml:/traefik.toml # Comment out for development + #- ./traefik/traefik.dev.toml:/traefik.toml # Uncomment for development - ./traefik/acme.json:/acme.json networks: - ckan-multi @@ -67,16 +67,12 @@ services: - ckan-multi solr: - image: viderum/ckan-cloud-docker:solr-latest - build: - context: solr - args: - SCHEMA_XML: ${SCHEMA_XML:-schemas/schema28.xml} + image: ckan/ckan-solr:${SOLR_IMAGE:-2.10-solr9} restart: always expose: - "8983" volumes: - - solr:/opt/solr/server + - solr:/var/solr networks: - ckan-multi diff --git a/solr/schemas/schema210.xml b/solr/schemas/schema210.xml new file mode 100644 index 0000000..9b90496 --- /dev/null +++ b/solr/schemas/schema210.xml @@ -0,0 +1,203 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +index_id + + + + + + + + + + + + + + + + + + + + + + + + +