Skip to content

hasadna/datacity-ckan-dgp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b8f3598 · Feb 11, 2025

History

52 Commits
Jun 20, 2024
Oct 29, 2020
Feb 11, 2025
Oct 19, 2020
Oct 19, 2020
Aug 4, 2024
Oct 19, 2020
Jun 20, 2024
Jun 20, 2024
Oct 19, 2020
May 4, 2021
Jul 15, 2024
Nov 5, 2020
Oct 21, 2020
Oct 19, 2020
Oct 21, 2020
Nov 9, 2020
Jun 20, 2024
Oct 19, 2020

Repository files navigation

datacity-ckan-dgp

Install

Create .env file

bin/generate_key_pair.sh > .env

Generate Google OAuth credentials - https://console.developers.google.com/apis/credentials

echo GOOGLE_KEY=XXXX >> .env
echo GOOGLE_SECRET=YYYY >> .env

Start a datacity CKAN instance for local development, see https://github.com/hasadna/ckanext-datacity/blob/master/README.md

The instance should have the following configuration in development.ini:

ckan.site_url = http://172.17.0.1:5000

Get an admin CKAN API key from that instance and set in .env

echo CKAN_INSTANCE_LOCAL_DEVELOPMENT_API_KEY=XXXXX >> .env
echo CKAN_INSTANCE_LOCAL_DEVELOPMENT_URL=http://172.17.0.1:5000 >> .env

Use

Start the datacity CKAN instance for local development, see https://github.com/hasadna/ckanext-datacity/blob/master/README.md

Start the dgp server

docker-compose up --build

http://localhost:15000

Login with your Google account

Set admin status:

docker-compose exec server bash -c "source env.sh && python mk_admin.py"

Local operator development

Install

python3 -m venv venv
venv/bin/pip install -r requirements.txt
venv/bin/pip install -e .

Start development CKAN instance and set env vars

source .env
export CKAN_INSTANCE_LOCAL_DEVELOPMENT_API_KEY
export CKAN_INSTANCE_LOCAL_DEVELOPMENT_URL

Run operators

python3 -m datacity_ckan_dgp.operators.ckan_sync '{"source":"Local development","target":"Local development"}'

Tests

Install test requirements

pip install -r tests/requirements.txt

Run tests

pytest