ibpsa / project1-boptest

Building Optimization Performance Tests
Other
101 stars 66 forks source link

Invalid mount path: ''/home/user'/testcase.py' mount path must be absolute #630

Open JanMarcoRuizdeVargas opened 4 months ago

JanMarcoRuizdeVargas commented 4 months ago

Hi, when trying to run

TESTCASE=bestest_air docker-compose up (Ubuntu debian 20.04)

I get the following error:

Recreating project1-boptest_boptest_1 ... error

ERROR: for project1-boptest_boptest_1 Cannot create container for service boptest: invalid volume specification: '/home/janmarco.ruiz/code_development/boptest_playground/project1-boptest-gym/project1-boptest/testcase.py:'/home/user'/testcase.py:rw': invalid mount config for type "bind": invalid mount path: ''/home/user'/testcase.py' mount path must be absolute

ERROR: for boptest Cannot create container for service boptest: invalid volume specification: '/home/janmarco.ruiz/code_development/boptest_playground/project1-boptest-gym/project1-boptest/testcase.py:'/home/user'/testcase.py:rw': invalid mount config for type "bind": invalid mount path: ''/home/user'/testcase.py' mount path must be absolute ERROR: Encountered errors while bringing up the project.

I tried fiddling around a lot with the APP_USER and TESTCASE variables in the environment.yml, but nothing worked. For some reason, it seems that these variables are set with exta single quotation marks, i.e. APP_USER = '/home/user', which causes the issue. But i can't figure out how to fix this.

Does anyone have any ideas? I would really appreciate your help, thanks!

dhblum commented 4 months ago

Sorry for this issue, I have not seen it before. A couple things:

  1. I'm not quite clear, if you set APP_USER=/home/user without the single quotes, does it work?
  2. Another issue might be related to using docker-compose vs. docker compose on Ubuntu 20.04 and how the .env gets interpreted (this is just a guess). I think the travis configuration is Ubuntu 16 actually by default and uses docker-compose. I realize when I run on Ubuntu 18 I use docker-compose but on Ubuntu 20 I use docker compose. Can you try using docker compose on your Ubuntu 20, and also report what version of docker-compose you are using when you get that error? We might need to update our guidance on usage of docker-compose vs docker compose.
JanMarcoRuizdeVargas commented 4 months ago

Many thanks for your quick reply! Using docker compose instead of docker-compose actually fixed it!

I am using docker-compose version 1.25.0 build unkown where I get the error described above. Hope that helps.

Regarding 1.: even though it doesn't matter now, where could I have set the APP_USER? i didn't find APP_USER=/home/user anywhere, in the Dockerfile I only found ENV HOME /home/user

dhblum commented 4 months ago

Ok good to know using docker compose fixed it. Our travis.yml file indicates we use docker-compose version 1.26.0 for testing. So it seems updating docker-compose to at least that version may also fix the issue.

APP_USER is set in the .env file in the root of the repo.

I'm going to keep this issue open so that we can try to clarify documentation around this.

JanMarcoRuizdeVargas commented 4 months ago

I'm not exactly sure why, but it seems the newest docker-compose version I can install on my system is 1.25.0. So unfortunately I couldn't check whether 1.26+ fixes the error.

I did check changing APP_PATH=/home/user instead of APP_PATH='/home/user' in the .env file, that also fixed the error.

I hope that helps in clarifying the documentation, let me know if you need anything else. :)

dhblum commented 4 months ago

All good to know, thank you @JanMarcoRuizdeVargas!

JanMarcoRuizdeVargas commented 4 months ago

You're welcome!