BergmannLab/MONET

Docker on Mac OS X: no "successfully built" line

Closed this issue · 4 comments

While we were debugging another issue, @samanfrm noticed that the .monet script doesn't always detect a successful build on Mac OS X, since the "successfully built" line isn't necessarily written to the docker_build_output file even for a successful build/run.

More details from Saman:

I have struggled with the code and I found that this function in the monet code was not allowed the code to run the method docker:

checkDockerBuildSuccess() {
  if ! grep -q "Successfully built" /tmp/docker_build_output; then
    echo "ERROR: docker build returned an error"
    echo "       - is an internet connection available?"
    echo "       - is the docker daemon running?"
    echo "see /tmp/docker_build_output for details"
    exit 1
  fi

}

Apparently, in Mac, there is no "Successfully built" line even the docker is built correclty. I commented out and It worked.

At some point we should look into this and update the .monet script to take this into account.

Thank you Jake for adding this comment. I think you should revisit checkDockerBuildSuccess() function to check it using a better approach that is compatible with other OS.

Dear @samanfrm, thank you for reporting this issue.
The MacOS tests are carried out the on MacOS Sierra 10.12.6 / Docker 2.3 (the version the tool was originally created on). In this environment, I encounter no problems.

[...]
Step 6/6 : ENTRYPOINT ["/bin/bash", "/R1_code/runCausality.sh"]
 ---> Running in 35b585c547e4
Removing intermediate container 35b585c547e4
 ---> 49c930b153d6
**Successfully built** 49c930b153d6
Successfully tagged r1-image:latest

It's probably time to move to support the latest versions, assuming that is the problem. What versions of MacOS and Docker are you running? Could show me your /tmp/docker_build_output?

Update: I retested on latest MacOS (Big Sur 11.4) and pushed a fix.
6e9d07f
Thank you!

Great, thank you @mattiat!