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

generate fake-data fails #195

Open
rantoniuk opened this issue Dec 5, 2024 · 4 comments
Open

generate fake-data fails #195

rantoniuk opened this issue Dec 5, 2024 · 4 comments
Assignees

Comments

@rantoniuk
Copy link

rantoniuk commented Dec 5, 2024

On a clean setup of 2.11 from pre-built docker images, the fake data generator doesn't work:

docker compose exec ckan ckan -c /srv/app/ckan.ini generate fake-data organization
2024-12-05 10:09:59,835 INFO  [ckan.cli] Using configuration file /srv/app/ckan.ini
2024-12-05 10:09:59,835 INFO  [ckan.config.environment] Loading static files from public
2024-12-05 10:10:00,344 WARNI [ckan.common] Option lang is not declared
2024-12-05 10:10:00,431 INFO  [ckan.config.environment] Loading templates from /srv/app/src/ckan/ckan/templates
2024-12-05 10:10:00,675 WARNI [ckan.config.middleware.flask_app] Extensions are excluded from CSRF protection! We allow extensions to run without CSRF protection but it will be forced future releases. Read the documentation for more information on how to add CSRF protection to your extension.
No module named 'factory'
Make sure you have dev-dependencies installed:
	pip install -r dev-requirements.txt
Aborted!

I wouldn't expect to have to build my own images for this, no?

Ref: ckan/ckan#8177

@rantoniuk
Copy link
Author

@wardi do you have any immediate suggestion to add anything in the downstream Dockerfile that would make it work?

@wardi
Copy link
Contributor

wardi commented Dec 13, 2024

@rantoniuk you could use the dev image instead, i.e.

docker compose -f docker-compose.dev.yml exec ckan-dev ckan -c /srv/app/ckan.ini generate fake-data organization

@kowh-ai WDYT, should this be in the readme as well? I was considering adding a collection of little bash scripts for related tasks in dev like:

  • installing packages from src dir
  • reloading dev settings from .env
  • running ckan <subcommand> in dev

that last one would make creating test data like this a little easier.

@rantoniuk
Copy link
Author

rantoniuk commented Dec 13, 2024

I actually went the other way round and just added:

RUN  pip3 install -r https://raw.githubusercontent.com/ckan/ckan/refs/heads/2.11/dev-requirements.txt

to my Dockerfile along other plugins. Just as stated in the linked ckan/ckan issue, I feel like this is not a "dev" dependency.

For example commands, I'd propose to add a README.md section:

While docker is running, you can execute any ckan CLI commands by executing command:

docker compose exec ckan ckan -c /srv/app/ckan.ini <command>

e.g.
docker compose exec ckan ckan -c /srv/app/ckan.ini --help

with most used usecases as examples.

@kowh-ai kowh-ai self-assigned this Dec 15, 2024
@kowh-ai
Copy link
Contributor

kowh-ai commented Dec 16, 2024

@rantoniuk The CKAN cli documentation does specify when it's a "Development" task eg:

Screenshot 2024-12-16 at 12 30 04 pm

but yes it's a bit unclear and should be clarified a little better.

There are many ways make changes to a CKAN Docker environment - running a cli command from the host, running it from within the running CKAN container, adding configuration to the locally built CKAN image like you have done

@wardi I agree an update to the README would be useful and yes please your bash script additions would be much appreciated. I can update the README this week with some examples of how to run commands from the host in a running CKAN Dev container

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants