-
First, I ran setup target defined in
Makefile
as per documentationmake setup
Error logs
Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:58: mounting \\\"/home/beebox/d2d-data-challenge-master/app/init_db.py\\\" to rootfs \\\"/var/lib/docker/overlay2/701b781612fb56ef3bc68cffefa7d7deacd10c9e0957cdd667f00ccc69f88eb4/merged\\\" at \\\"/var/lib/docker/overlay2/701b781612fb56ef3bc68cffefa7d7deacd10c9e0957cdd667f00ccc69f88eb4/merged/data/app/init_db.py\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
make: *** [Makefile:16: initdb] Error 1
-
Tried getting past this error with the next command
docker-compose up --force-recreate
Error logs
app_1 | for i in 1 2 3 4 5 6 7 8; do echo | nc -q 1 telemetrydb 5432 >/dev/null && break; echo 'DB unavailable, sleeping...'; sleep 3; done
app_1 | pytest app/challenge
app_1 | ============================= test session starts ==============================
app_1 | platform linux -- Python 3.6.5, pytest-3.6.1, py-1.8.0, pluggy-0.6.0
app_1 | rootdir: /data/app, inifile:
app_1 |
app_1 | ========================= no tests ran in 0.01 seconds =========================
app_1 | ERROR: file not found: app/challenge
app_1 |
app_1 | Makefile:5: recipe for target 'test' failed
app_1 | make: *** [test] Error 4
d2d-data-challenge-master_app_1 exited with code 2
-
Attempt to run tests result in error
make test
Error logs
docker-compose -f docker-compose.yml -p d2d-challenge run --rm app test
Starting d2d-challenge_telemetrydb_1 ... done
Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:58: mounting \\\"/home/beebox/d2d-data-challenge-master/app/init_db.py\\\" to rootfs \\\"/var/lib/docker/overlay2/5e24a2cb5376cb29a393bf97b60c550af5eb746f7b0fdaa1a4811b1823e0167b/merged\\\" at \\\"/var/lib/docker/overlay2/5e24a2cb5376cb29a393bf97b60c550af5eb746f7b0fdaa1a4811b1823e0167b/merged/data/app/init_db.py\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
make: *** [Makefile:19: test] Error 1
- I made changes in the
docker-compose.yml
based on the error in Step 1 to the following, did step 1 again and got this error
docker-compose.yml
version: '3.7'
services:
app:
build: ./app
links:
- telemetrydb
command:
- test
volumes:
- ./app/Makefile:/data/app/Makefile
- ./app/challenge/init_db.py:/data/app/init_db.py
- ./app/run.py:/data/app/run.py
telemetrydb:
image: postgres:9.6
ports:
- 5432:5432
Error logs
telemetrydb [172.18.0.2] 5432 (postgresql) : Connection refused
DB unavailable, sleeping...
python init_db.py
Traceback (most recent call last):
File "init_db.py", line 1, in <module>
from resources import config, create_conn
ModuleNotFoundError: No module named 'resources'
Makefile:14: recipe for target 'initdb' failed
make: *** [initdb] Error 1
make: *** [Makefile:16: initdb] Error 2
Edit 3: I noticed there were few other parameters that might be off in other files, since I realized that the zip-file shared had some outdated references.
Below are the correct values for sections within each file:
volume:
section indocker-compose.yml
:host=
property indwhdb.ini
:initdb:
andtest:
commands forapp/Makefile
:app/dwhdb.ini
ininit_db.py
,run.py
,test_solution.py
to be updated to:These changes seem to be a lot and in order to make it simpler I have included zip archive from the latest commit to my solution.
Thanks for your patience and apologies for the mix-up.