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

Fixed a bug on dockerised environments where it was impossible to run make install against a postgres backend #4009

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

mauromsl
Copy link
Member

@mauromsl mauromsl commented Mar 7, 2024

closes #4005
closes #3607
closes #2775

The docker container for postgresql refuses to initialize when the directory is not empty. To solve this, I've stopped tracking this directory as it seems cleanest to have the Makefile create it

@danielBingham
Copy link

@mauromsl Looks like make install fails on this branch from a clean clone:

dbingham:~/app$ git clone git@github.com:BirkbeckCTP/janeway.git
Cloning into 'janeway'...
remote: Enumerating objects: 56569, done.
remote: Counting objects: 100% (17163/17163), done.
remote: Compressing objects: 100% (2951/2951), done.
remote: Total 56569 (delta 15037), reused 15619 (delta 14065), pack-reused 39406
Receiving objects: 100% (56569/56569), 83.34 MiB | 16.18 MiB/s, done.
Resolving deltas: 100% (42174/42174), done.
dbingham:~/app$ ls
janeway
dbingham:~/app$ cd janeway/
dbingham:~/app/janeway (master=)$ git checkout 4005-bugfix-postgres-docker 
Branch '4005-bugfix-postgres-docker' set up to track remote branch '4005-bugfix-postgres-docker' from 'origin'.
Switched to a new branch '4005-bugfix-postgres-docker'
dbingham:~/app/janeway (4005-bugfix-postgres-docker=)$ make install
touch db/janeway.sqlite3
mkdir -p db/postgres-data
docker-compose run --rm start_dependencies
[+] Creating 3/3
 ✔ Container janeway-janeway-debug-smtp-1  Created                                                                                                                                                                                       0.0s 
 ✔ Container janeway-janeway-pgadmin-1     Created                                                                                                                                                                                       0.0s 
 ✔ Container janeway-janeway-postgres-1    Recreated                                                                                                                                                                                     0.3s 
[+] Running 3/3
 ✔ Container janeway-janeway-debug-smtp-1  Started                                                                                                                                                                                       1.0s 
 ✔ Container janeway-janeway-pgadmin-1     Started                                                                                                                                                                                       0.9s 
 ✔ Container janeway-janeway-postgres-1    Started                                                                                                                                                                                       0.4s 
Waiting for janeway-postgres to listen on 5432...
sleeping
bash -c "make command CMD=install_janeway"
make[1]: Entering directory '/home/dbingham/app/janeway'
docker-compose run  --rm janeway-web install_janeway
[+] Creating 4/0
 ✔ Container janeway-janeway-pgadmin-1     Running                                                                                                                                                                                       0.0s 
 ✔ Container janeway-janeway-postgres-1    Running                                                                                                                                                                                       0.0s 
 ✔ Container janeway-janeway-debug-smtp-1  Running                                                                                                                                                                                       0.0s 
 ✔ Container janeway-start_dependencies-1  Created                                                                                                                                                                                       0.0s 
[+] Running 1/1
 ✔ Container janeway-start_dependencies-1  Started                                                                                                                                                                                       0.4s 
Traceback (most recent call last):
  File "src/manage.py", line 14, in <module>
    load_janeway_settings()
  File "/vol/janeway/src/utils/__init__.py", line 55, in load_janeway_settings
    django.setup()
  File "/usr/local/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python3.8/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/usr/local/lib/python3.8/site-packages/django/apps/config.py", line 224, in create
    import_module(entry)
  File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'django_countries'
make[1]: *** [Makefile:85: command] Error 1
make[1]: Leaving directory '/home/dbingham/app/janeway'
make: *** [Makefile:90: install] Error 2

@ajrbyers
Copy link
Member

@mauromsl I've added a PR to remove django_countries: #4011

@ajrbyers ajrbyers merged commit 777f547 into master Mar 11, 2024
1 check failed
@ajrbyers ajrbyers deleted the 4005-bugfix-postgres-docker branch March 11, 2024 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants