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

Can't get the system running #89

Closed
Serhiy-Shekhovtsov opened this Issue Sep 4, 2017 · 11 comments

Comments

Projects
None yet
3 participants
@Serhiy-Shekhovtsov
Copy link
Contributor

Serhiy-Shekhovtsov commented Sep 4, 2017

After pulling the code and data I can't run the environment. The build was successful, but the command for taking projects up fails with following error:

compile_docs_1 | make: Entering directory '/app/docs'
compile_docs_1 | make: Leaving directory '/app/docs'
compile_docs_1 | make: *** No rule to make target 'html'. Stop.
postgres_1 | LOG: database system was shut down at 2017-09-04 12:24:18 UTC
postgres_1 | LOG: MultiXact member wraparound protections are now enabled
postgres_1 | LOG: database system is ready to accept connections
interface_1 | Postgres is up - continuing...
interface_1 | python: can't open file 'manage.py': [Errno 2] No such file or directory
repo_compile_docs_1 exited with code 2
interface_1 | python: can't open file 'manage.py': [Errno 2] No such file or directory
repo_interface_1 exited with code 2

prediction_1 | * Serving Flask app "src/factory.py"
prediction_1 | * Forcing debug mode on
prediction_1 | * Running on http://0.0.0.0:8001/ (Press CTRL+C to quit)
compile_docs_1 | make: *** /app/docs: No such file or directory. Stop.
compile_docs_1 | make: Entering directory '/app/docs'
compile_docs_1 | make: Leaving directory '/app/docs'
compile_docs_1 | make: *** No rule to make target 'html'. Stop.

And the compile_docs_1 | make: ... messages set keeps repeating.

Expected Behavior

After running the docker-compose -f local.yml up command user should be able to open a browser and view the interface at http://localhost:8000 and the prediction API at http://localhost:8001

Current Behavior

http://localhost:8000 nor http://localhost:8001 are not accessible.

Steps to Reproduce

  1. Take latest
  2. run docker-compose -f local.yml build
  3. run docker-compose -f local.yml up
  4. browse http://localhost:8000

Environment

Windows 7 x64, Docker Toolbox

Checklist before submitting

  • I have searched through the other currently open issues and am confident this is not a duplicate of an existing bug
  • I provided a minimal code snippet or list of steps that reproduces the bug.
  • I filled out all the relevant sections of this template
@reubano

This comment has been minimized.

Copy link
Contributor

reubano commented Sep 4, 2017

Hi @Serhiy-Shekhovtsov, can you please post the output of the following?

docker --version
docker-compose --version
docker-machine --version

Thanks!

@Serhiy-Shekhovtsov

This comment has been minimized.

Copy link
Contributor

Serhiy-Shekhovtsov commented Sep 4, 2017

Hi @reubano!

Docker version 17.07.0-ce, build 8784753
docker-compose version 1.15.0, build e12f3b94
docker-machine.exe version 0.12.2, build 9371605

Btw, I have put the following code to start-dev.sh:

echo "Hello World"
python -c "exec(\"import os\\ncwd = os.getcwd()\\nprint(os.listdir(cwd))\")"

python manage.py migrate
python manage.py runserver_plus 0.0.0.0:8000

and after rebuild and run it printed:
interface_1 | Postgres is up - continuing...
interface_1 | Hello World
interface_1 | []
interface_1 | python: can't open file 'manage.py': [Errno 2] No such file or directory

Also when I printed the cwd from python script it was /app.

@Serhiy-Shekhovtsov

This comment has been minimized.

Copy link
Contributor

Serhiy-Shekhovtsov commented Sep 4, 2017

The problem is - on windows we can't(?) mount the folder that is outside home directory (C:\users\username). More details here.
This tool looks promising.

@isms

This comment has been minimized.

Copy link
Contributor

isms commented Sep 4, 2017

@Serhiy-Shekhovtsov @reubano The actual root causes should be separated here.

Problem in your compile_docs container

There seems to be a problem with the compile_docs. This is a bug introduced by #55, possibly due to lack of __init__.pys and installation of requirements when the docs are being compiled. Opening up a separate issue, see #90.

Problem in your interface container

@Serhiy-Shekhovtsov This does not seem to make sense:

The problem is - on windows we can't(?) mount the folder that is outside home directory (C:\users\username). More details here.

The /app is inside the Docker container. What's your theory on this being a problem?

@Serhiy-Shekhovtsov

This comment has been minimized.

Copy link
Contributor

Serhiy-Shekhovtsov commented Sep 4, 2017

@isms, docker maps the folder on host machine to a folder inside Docker container. When the host folder I am mapping is not inside home directory - the mapping doesn't work.
So, when project is placed in D:\Projects\DS\concept-to-clinic\repo - it doesn't work. If I copy the project to C:\Users\serhiy\concept-to-clinic it's going to work.
Does it make sense now?

@isms

This comment has been minimized.

Copy link
Contributor

isms commented Sep 4, 2017

@Serhiy-Shekhovtsov Interesting, I think I understand what you're saying.

What is the proposed path forward with this issue given that it's not project specific?

@Serhiy-Shekhovtsov

This comment has been minimized.

Copy link
Contributor

Serhiy-Shekhovtsov commented Sep 4, 2017

@isms looks like it can be fixed with this tool. After mounting interface folder it doesn't have problems locating /app/manage.py.
Then I mounted the repo root folder and it's failing to mount the HEAD:

ERROR: for repo_interface_1 Cannot start service interface: oci runtime error:
container_linux.go:262: starting container process caused "process_linux.go:339:
container init caused "rootfs_linux.go:57: mounting \"/d/Projects/DS/concept
-to-clinic/repo/.git/logs/HEAD\" to rootfs \"/mnt/sda1/var/lib/docker/aufs/m
nt/ebfe3deb31a87e6de1901640c13b0031e552ac7cb44244b1e80565a93ab062e5\" at \"/
mnt/sda1/var/lib/docker/aufs/mnt/ebfe3deb31a87e6de1901640c13b0031e552ac7cb44244b
1e80565a93ab062e5/HEAD\" caused \"not a directory\"""
: 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

Basically, point is head is not a directory, just like it says. I am looking into it.

@Serhiy-Shekhovtsov

This comment has been minimized.

Copy link
Contributor

Serhiy-Shekhovtsov commented Sep 4, 2017

Yes, mounting the root repository folder fixed the mapping issue. The error above solved by removing and rebuilding the container.

@Serhiy-Shekhovtsov

This comment has been minimized.

Copy link
Contributor

Serhiy-Shekhovtsov commented Sep 4, 2017

The most recent log looks good:

Starting repo_prediction_1 ...
Starting repo_postgres_1 ...
Starting repo_prediction_1
Starting repo_prediction_1 ... done
Starting repo_interface_1 ...
Starting repo_interface_1 ... done
Attaching to repo_postgres_1, repo_prediction_1, repo_interface_1
postgres_1 | LOG: database system was shut down at 2017-09-04 20:30:58 UTC
postgres_1 | LOG: MultiXact member wraparound protections are now enabled
interface_1 | Postgres is up - continuing...
prediction_1 | * Serving Flask app "src.factory"
prediction_1 | * Forcing debug mode on
prediction_1 | * Running on http://0.0.0.0:8001/ (Press CTRL+C to quit)
interface_1 | /usr/local/lib/python3.6/site-packages/environ/environ.py:618: U
serWarning: Error reading /app/.env - if you're not configuring your environment
separately, check this.
interface_1 | "environment separately, check this." % env_file)
interface_1 | Operations to perform:
interface_1 | Apply all migrations: auth, cases, contenttypes, images, sessi
ons
interface_1 | Running migrations:
prediction_1 | * Restarting with inotify reloader
prediction_1 | * Debugger is active!
interface_1 | No migrations to apply.
interface_1 | /usr/local/lib/python3.6/site-packages/environ/environ.py:618: U
serWarning: Error reading /app/.env - if you're not configuring your environment
separately, check this.
interface_1 | "environment separately, check this." % env_file)
interface_1 | * Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)
interface_1 | * Restarting with stat
interface_1 | /usr/local/lib/python3.6/site-packages/environ/environ.py:618: U
serWarning: Error reading /app/.env - if you're not configuring your environment
separately, check this.
interface_1 | "environment separately, check this." % env_file)
interface_1 | Performing system checks...
interface_1 |
interface_1 | System check identified no issues (0 silenced).
interface_1 |
interface_1 | Django version 1.11.3, using settings 'config.settings.local'
interface_1 | Development server is running at http://0.0.0.0:8000/
interface_1 | Using the Werkzeug debugger (http://werkzeug.pocoo.org/)
interface_1 | Quit the server with CONTROL-C.
interface_1 | * Debugger is active!

But still the interface project can't be reached from browser on host machine. I tried browsing http://localhost:8000/ and http://[container_ip]:8000/

@Serhiy-Shekhovtsov

This comment has been minimized.

Copy link
Contributor

Serhiy-Shekhovtsov commented Sep 4, 2017

Ok, issue solved now. The site can't be reached with localhost or container_ip but can be reached using DOCKER_HOST variable. Command docker-machine env can be used to get this value.

@isms

This comment has been minimized.

Copy link
Contributor

isms commented Sep 5, 2017

Great, closing. Thanks for reporting!

@isms isms closed this Sep 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment