Hi, I've managed to build the docker and looking at it, it seems that it was built OK (folders and files in place). opening the docker at /app and running 'ls' command, shows 4 files: train.py, infer.py, train.sh, infer.sh. running 'bash train.sh' raises the error. running 'python train.py' runs the python correctly. adding 'echo $PWD' shows execution is in the correct path. Running on windows. Any ideas on what am I doing wrong? Help is highly appreciated. Thanks!

Created by Tomer Hermelin MLS
Hi @so30 , It seems like a terminal issue, please see [this thread](https://superuser.com/questions/1172759/cygwin-error-failed-to-run-bin-bash-no-such-file-or-directory). Best, Yao
@yy6linda Hi, I tried the test docker image you suggested above, I still get the same error when trying to run "bash infer.sh": ': [Errno 2] No such file or directory Are you positive it should work on windows system?
Deleted message
Today I tried again and did exactly as in the example: ``` User@DESKTOP-RT8ISJE MINGW64 /c/g/examples/covid19-question-1 (master) $ docker build -t awesome-covid19-q1-model:v1 . Sending build context to Docker daemon 19.46kB Step 1/15 : FROM python:3.5 3.5: Pulling from library/python d6ff36c9ec48: Already exists c958d65b3090: Already exists edaf0a6b092f: Already exists 80931cf68816: Already exists bc1b8aca3825: Already exists 6bdbc0af74d9: Pulling fs layer e6eb974ca946: Pulling fs layer 11740b0bcf22: Pulling fs layer fc2b025653e5: Pulling fs layer fc2b025653e5: Waiting 11740b0bcf22: Verifying Checksum 11740b0bcf22: Download complete fc2b025653e5: Verifying Checksum fc2b025653e5: Download complete e6eb974ca946: Verifying Checksum e6eb974ca946: Download complete 6bdbc0af74d9: Verifying Checksum 6bdbc0af74d9: Download complete 6bdbc0af74d9: Pull complete e6eb974ca946: Pull complete 11740b0bcf22: Pull complete fc2b025653e5: Pull complete Digest: sha256:f451b0c1912e175444848cfe3242ac225975c1d0613c20a2339dfdde5700c0be Status: Downloaded newer image for python:3.5 ---> 342dab296f53 Step 2/15 : LABEL challenge="covid19" ---> Running in c4e6f4cbab3e Removing intermediate container c4e6f4cbab3e ---> 00e247432ab3 Step 3/15 : LABEL enable_training=true ---> Running in b14739eccd24 Removing intermediate container b14739eccd24 ---> 4fe1d622e2e6 Step 4/15 : LABEL description="COVID diagnosis baseline prediction" ---> Running in aa60c896b3d9 Removing intermediate container aa60c896b3d9 ---> 1551005ec1d8 Step 5/15 : LABEL ranked_features="cough,body temperature,hematocrit,diastolic blood pressure,systolic blood pressure" ---> Running in 3a2c576dfb7a Removing intermediate container 3a2c576dfb7a ---> 983acf671726 Step 6/15 : LABEL references="https://www.medrxiv.org/content/10.1101/2020.03.19.20039099v1" ---> Running in 4e2314133884 Removing intermediate container 4e2314133884 ---> 205d0c27e063 Step 7/15 : RUN pip install pandas numpy sklearn datetime joblib ---> Running in fee90707a8c7 Collecting pandas Downloading pandas-0.25.3-cp35-cp35m-manylinux1_x86_64.whl (10.3 MB) Collecting numpy Downloading numpy-1.18.5-cp35-cp35m-manylinux1_x86_64.whl (19.9 MB) Collecting sklearn Downloading sklearn-0.0.tar.gz (1.1 kB) Collecting datetime Downloading DateTime-4.3-py2.py3-none-any.whl (60 kB) Collecting joblib Downloading joblib-0.14.1-py2.py3-none-any.whl (294 kB) Collecting pytz>=2017.2 Downloading pytz-2020.1-py2.py3-none-any.whl (510 kB) Collecting python-dateutil>=2.6.1 Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB) Collecting scikit-learn Downloading scikit_learn-0.22.2.post1-cp35-cp35m-manylinux1_x86_64.whl (7.0 MB) Collecting zope.interface Downloading zope.interface-5.1.0-cp35-cp35m-manylinux2010_x86_64.whl (234 kB) Collecting six>=1.5 Downloading six-1.15.0-py2.py3-none-any.whl (10 kB) Collecting scipy>=0.17.0 Downloading scipy-1.4.1-cp35-cp35m-manylinux1_x86_64.whl (26.0 MB) Requirement already satisfied: setuptools in /usr/local/lib/python3.5/site-packages (from zope.interface->datetime) (49.2.1) Building wheels for collected packages: sklearn Building wheel for sklearn (setup.py): started Building wheel for sklearn (setup.py): finished with status 'done' Created wheel for sklearn: filename=sklearn-0.0-py2.py3-none-any.whl size=1315 sha256=f0446bf63a4ed88006d4b5774d1df44a621cd570bc73cd282d0d10ccdcc1de22 Stored in directory: /root/.cache/pip/wheels/9e/ec/a6/33cdb5605b0b150074213e154792654a1006e6e6807dc7ca6f Successfully built sklearn Installing collected packages: pytz, numpy, six, python-dateutil, pandas, scipy, joblib, scikit-learn, sklearn, zope.interface, datetime Successfully installed datetime-4.3 joblib-0.14.1 numpy-1.18.5 pandas-0.25.3 python-dateutil-2.8.1 pytz-2020.1 scikit-learn-0.22.2.post1 scipy-1.4.1 six-1.15.0 sklearn-0.0 zope.interface-5.1.0 Removing intermediate container fee90707a8c7 ---> f30091eb37f1 Step 8/15 : RUN mkdir /app ---> Running in a3ca59cd7e48 Removing intermediate container a3ca59cd7e48 ---> 09c8f2f8be57 Step 9/15 : WORKDIR /app ---> Running in 72ff51525b4d Removing intermediate container 72ff51525b4d ---> ba7e25778a0b Step 10/15 : COPY src/train.py . ---> 1ecc09f832ed Step 11/15 : COPY src/infer.py . ---> fddc253fbf2c Step 12/15 : COPY train.sh . ---> 6db936c3c12d Step 13/15 : COPY infer.sh . ---> df79f7cc25ac Step 14/15 : RUN chmod +x train.sh ---> Running in 20b62711a125 Removing intermediate container 20b62711a125 ---> 4cc7ef493b37 Step 15/15 : RUN chmod +x infer.sh ---> Running in 19f4b75a4e18 Removing intermediate container 19f4b75a4e18 ---> 339242fce781 Successfully built 339242fce781 Successfully tagged awesome-covid19-q1-model:v1 SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories. ``` ``` User@DESKTOP-RT8ISJE MINGW64 /c/g/examples/covid19-question-1 (master) $ docker run \ > -v $(pwd)/synthetic_data/training:/data:ro \ > -v $(pwd)/output:/output:rw \ > -v $(pwd)/scratch:/scratch:rw \ > -v $(pwd)/model:/model:rw \ > awesome-covid19-q1-model:v1 bash /app/train.sh **bash: C:/Program Files/Git/app/train.sh: No such file or directory** ```
@yy6linda Can you help me please? I installed linux and ran ``` bash train.sh ``` and again got the same error : [Errno 2] No such file or directory
When I try to run ``` bash train.sh ``` i got ``` Permission denied or No such file directory (This depend on kind of terminal) ``` And I try to run this without docker Does anyone have solution?
Hello I have the same problem I use docker on windows with "Cygwin64 Terminal" because it support linux syntax I locate files according to requires, after row ``` docker build -t awesome-covid19-q1-model:v1 . ``` I have warning 'SECURITY WARNING: You are building a Docker image from Windows against a non-Win dows Docker host. All files and directories added to build context will have '-r wxr-xr-x' permissions. It is recommended to double check and reset permissions f or sensitive files and directories.' I don't know how serious this is, but after ``` docker run \ -v $(pwd)/synthetic_data/training:/data:ro \ -v $(pwd)/output:/output:rw \ -v $(pwd)/scratch:/scratch:rw \ -v $(pwd)/model:/model:rw \ awesome-covid19-q1-model:v1 bash /app/train.sh ``` get '': [Errno 2] No such file or directory' Is this related to Windows? Thank you
Hi, Thanks for all the help! The first thing I've tried was the example command: ``` docker run \ -v $(pwd)/synthetic_data/training:/data:ro \ -v $(pwd)/output:/output:rw \ -v $(pwd)/scratch:/scratch:rw \ -v $(pwd)/model:/model:rw \ awesome-covid19-q1-model:v1 bash /app/train.sh ``` before I tried to pin down where my problem is (invoking the train.py file, specifically from the bash command). I've also tried to run without mounting the folders, but it didn't make a difference as the problem is starting the py file (I've also added a print in the first line of the py file and it didn't trigger). I think I'll erase everything and try again from the beginning, maybe I've corrupted some strings somehow. I will update if that helped. Thanks!
I did the same thing as what you were trying and didn't see the same error as what you have seen, here I suggest you do this simple practice without loading the data to see if you still have the same issue. ``` docker build -t test . docker run -it test /bin/bash ``` Then you should be able to see: ``` root@afc19a3049e9:/app# ls infer.py infer.sh train.py train.sh root@afc19a3049e9:/app# bash infer.sh Load measurement.csv Traceback (most recent call last): File "/app/infer.py", line 9, in ``` The bash file is running.
Have you tried to download synthetic data and run these commands below: ``` docker run \ -v $(pwd)/synthetic_data/training:/data:ro \ -v $(pwd)/output:/output:rw \ -v $(pwd)/scratch:/scratch:rw \ -v $(pwd)/model:/model:rw \ awesome-covid19-q1-model:v1 bash /app/train.sh ``` ``` docker run \ -v $(pwd)/synthetic_data/evaluation:/data:ro \ -v $(pwd)/output:/output:rw \ -v $(pwd)/scratch:/scratch:rw \ -v $(pwd)/model:/model:rw \ awesome-covid19-q1-model:v1 bash /app/infer.sh ``` Do they work?
Thanks! This was trying to run the example model here: https://github.com/Sage-Bionetworks-Challenges/ehr-dream-challenges/tree/master/examples/covid19-question-1 Tried to run it step by step. cmd prints: Error: ``` root@a5df190a004b:/app# bash infer.sh ': [Errno 2] No such file or directory ``` Context: ``` C:\src\MastersCourses\Clinical\Challenge\ehr-dream-challenges\examples\covid19-question-1>docker build -t awesome-covid19-q1-model:v1 . Sending build context to Docker daemon 6.697GB Step 1/15 : FROM python:3.5 ---> d002b97d4a21 Step 2/15 : LABEL challenge="covid19" ---> Using cache ---> fdf0c6aa68d0 Step 3/15 : LABEL enable_training=true ---> Using cache ---> 49c22d3e6f83 Step 4/15 : LABEL description="COVID diagnosis baseline prediction" ---> Using cache ---> ddd1a31cb1bb Step 5/15 : LABEL ranked_features="cough,body temperature,hematocrit,diastolic blood pressure,systolic blood pressure" ---> Using cache ---> 42501c671e1e Step 6/15 : LABEL references="https://www.medrxiv.org/content/10.1101/2020.03.19.20039099v1" ---> Using cache ---> aca876020f62 Step 7/15 : RUN pip install pandas numpy sklearn datetime joblib ---> Using cache ---> 298c346ef4cd Step 8/15 : RUN mkdir /app ---> Using cache ---> 0e14d2ec94fe Step 9/15 : WORKDIR /app ---> Using cache ---> 74289b1ba6a0 Step 10/15 : COPY src/train.py . ---> 0aa8f1b7f02e Step 11/15 : COPY src/infer.py . ---> 1a5f4439c9bf Step 12/15 : COPY train.sh . ---> 04e01e9a3135 Step 13/15 : COPY infer.sh . ---> ba0c4481a002 Step 14/15 : RUN chmod +x train.sh ---> Running in 59d28037ae2c Removing intermediate container 59d28037ae2c ---> 63a1c9fa0deb Step 15/15 : RUN chmod +x infer.sh ---> Running in ca3137054058 Removing intermediate container ca3137054058 ---> 58ea6cdd9f2a Successfully built 58ea6cdd9f2a Successfully tagged awesome-covid19-q1-model:v1 SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories. C:\src\MastersCourses\Clinical\Challenge\ehr-dream-challenges\examples\covid19-question-1>docker run -v C:\src\MastersCourses\Clinical\Challenge\ehr-dream-challenges\examples\covid19-question-1\synthetic_data\training:/data:ro -v C:\src\MastersCourses\Clinical\Challenge\ehr-dream-challenges\examples\covid19-question-1\output:/output:rw -v C:\src\MastersCourses\Clinical\Challenge\ehr-dream-challenges\examples\covid19-question-1\scratch:/scratch:rw -v C:\src\MastersCourses\Clinical\Challenge\ehr-dream-challenges\examples\covid19-question-1\model:/model:rw -it --entrypoint "/bin/bash" awesome-covid19-q1-model:v1 root@a5df190a004b:/app# bash train.sh ': [Errno 2] No such file or directory root@a5df190a004b:/app# bash inger.sh bash: inger.sh: No such file or directory root@a5df190a004b:/app# bash infer.sh ': [Errno 2] No such file or directory root@a5df190a004b:/app# cat infer.sh #!/usr/bin/env bash python /app/infer.py root@a5df190a004b:/app# python /app/infer.py Load measurement.csv Load condition.csv Killed root@a5df190a004b:/app# ls infer.py infer.sh train.py train.sh root@a5df190a004b:/app# ```
Hi @MLS , I'm happy to help. Can you send me the error message you got for running 'bash train.sh' ? Also I recommend you to take a look at this [example Docker model](https://github.com/Sage-Bionetworks-Challenges/ehr-dream-challenges/tree/master/examples/covid19-question-1). Try if you run into the same error when running the example model. Best, Yao

Not able to run python file from bash ([Errno 2] No such file or directory) page is loading…