Skip to content
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

stack --docker build hangs #202

Closed
tgkokk opened this issue Sep 9, 2015 · 9 comments
Closed

stack --docker build hangs #202

tgkokk opened this issue Sep 9, 2015 · 9 comments

Comments

@tgkokk
Copy link

tgkokk commented Sep 9, 2015

I'm trying to build using the steps outlined here. I pulled the image successfully but when I run stack --docker build, I get an error from tar and then it hangs, so I have to kill the process. The output of stack --verbosity debug --docker build is this;

Version 0.1.4.0, Git revision dac8cfe51802e08edb523b80c51cf35e21933513 (1722 commits) X86_64
2015-09-09 10:20:28.247781: [debug] Checking for project config at: /Users/tgkokk/HaskellR/stack.yaml @(stack_256QTnIkPXj66qDsz01mSu:Stack.Config src/Stack/Config.hs:466:9)
2015-09-09 10:20:28.249206: [debug] Loading project config file stack.yaml @(stack_256QTnIkPXj66qDsz01mSu:Stack.Config src/Stack/Config.hs:489:13)
2015-09-09 10:20:28.254748: [debug] Run process: docker --version @(stack_256QTnIkPXj66qDsz01mSu:System.Process.Read src/System/Process/Read.hs:260:3)
2015-09-09 10:20:28.342812: [debug] Run process: id -u @(stack_256QTnIkPXj66qDsz01mSu:System.Process.Read src/System/Process/Read.hs:260:3)
2015-09-09 10:20:28.34787: [debug] Run process: id -g @(stack_256QTnIkPXj66qDsz01mSu:System.Process.Read src/System/Process/Read.hs:260:3)
2015-09-09 10:20:28.350336: [debug] Run process: docker inspect tweag/haskellr:latest @(stack_256QTnIkPXj66qDsz01mSu:System.Process.Read src/System/Process/Read.hs:260:3)
2015-09-09 10:20:28.659259: [debug] Run process: docker create --net=host -e STACK_IN_CONTAINER=1 -e STACK_ROOT=/Users/tgkokk/.stack -e WORK_UID=501 -e WORK_GID=20 -e WORK_WD=/Users/tgkokk/HaskellR -e WORK_HOME=/Users/tgkokk/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620 -e WORK_ROOT=/Users/tgkokk/HaskellR -v /Users/tgkokk/.stack:/Users/tgkokk/.stack -v /Users/tgkokk/HaskellR:/Users/tgkokk/HaskellR -v /Users/tgkokk/HaskellR/.stack-work/docker/_sandbox/basic_build_lts-2.14_20150620:/Users/tgkokk/HaskellR/.stack-work/docker -v /Users/tgkokk/HaskellR/.stack-work/docker/_home:/Users/tgkokk/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620 -v /Users/tgkokk/.stack:/Users/tgkokk/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.stack -v /Users/tgkokk/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.ghc:/Users/tgkokk/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.ghc -v /Users/tgkokk/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.cabal:/Users/tgkokk/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.cabal -v /Users/tgkokk/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.ghcjs:/Users/tgkokk/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.ghcjs -t -i tweag/haskellr:latest stack --internal-re-exec --verbosity debug --docker build @(stack_256QTnIkPXj66qDsz01mSu:System.Process.Read src/System/Process/Read.hs:260:3)
2015-09-09 10:20:29.021395: [debug] Run process: /usr/local/bin/docker start -a -i bc84c051370e098366aa3774f674afaa935c61319ceb577a0fe94ca5b6fde76b @(stack_256QTnIkPXj66qDsz01mSu:System.Process.Run src/System/Process/Run.hs:92:5)
tar: ./.profile: Cannot open: Permission denied
tar: ./.bash_logout: Cannot open: Permission denied
tar: ./.bashrc: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors
^C2015-09-09 10:20:35.308352: [debug] Run process: docker rm -f bc84c051370e098366aa3774f674afaa935c61319ceb577a0fe94ca5b6fde76b @(stack_256QTnIkPXj66qDsz01mSu:System.Process.Read src/System/Process/Read.hs:260:3)

I'm on OS X and I'm using docker along with docker-machine.

@Fuuzetsu
Copy link
Contributor

Fuuzetsu commented Sep 9, 2015

This may or may not belong on the stack issue tracker instead. @snoyberg what do you think?

@Fuuzetsu
Copy link
Contributor

Fuuzetsu commented Sep 9, 2015

I also hear @borsboom is a person to ask stack+docker related questions so cc too :)

@borsboom
Copy link
Collaborator

borsboom commented Sep 9, 2015

stack's Docker support currently requires the Docker client to be running on the same machine as the Docker Engine, so that volume mounts and UID mapping work. That rules out things like boot2docker and Docker Machine.

In terms of hanging, there's a bug in the image's entrypoint that causes it to run a big sed command on the contents of your ~/.stack the first time you use docker for a project. How long this takes depends on how big that directory is, so if you've been using stack already it can take quite a while (tens of seconds even on a fast filesystem). Chances are your host's filesystem is being mounted in the Docker Machine using VirtualBox shared folders, which are extremely slow and could well cause this process to take hours.

I fixed this entrypoint bug a few days ago and the most recent Docker images I've generated include that fix. @mboes, perhaps you can update the entrypoint in the tweag/haskellr image?

@mboes
Copy link
Member

mboes commented Sep 9, 2015

Closing, since this is an upstream issue. Even once we close #203, it won't help your use case, only make it less slow (if I'm understanding @borsboom correctly).

@mboes mboes closed this as completed Sep 9, 2015
@mboes
Copy link
Member

mboes commented Sep 9, 2015

@borsboom is there any solution to @tgkokk's use case in sight? (If so we should have a ticket on the stack issue tracker). Would resolving commercialhaskell/stack#531 help?

@tgkokk in the meantime, I think you're better off using Vagrant.

@tgkokk
Copy link
Author

tgkokk commented Sep 9, 2015

@borsboom Thanks for your explanation.

@mboes Thanks. Do you know if HaskellR is buildable on OS X without Docker?

@mboes
Copy link
Member

mboes commented Sep 9, 2015

@tgkokk stack build H should work okay (i.e. everything except IHaskell support), though that's untested since we don't have Mac users on the team. Would be awesome if you could give it a whirl and submit a PR with updated build instructions for OS X if need be.

IHaskell support outside of docker might work, but likely it will be finicky. Fortunately there's http://www.kronosnotebook.com/haskell. @gibiansky do you know what it would take to have kronos pick up the inline-r plugin?

@borsboom
Copy link
Collaborator

borsboom commented Sep 9, 2015

is there any solution to @tgkokk's use case in sight? (If so we should have a ticket on the stack issue tracker).

See commercialhaskell/stack#194.

Would resolving commercialhaskell/stack#531 help?

Not with the boot2docker issue, but it would help with you not needing to update the image's entrypoint to take advantage of any future bugfixes/requirements (since the entrypoint's functionality would move to stack itself).

@tgkokk
Copy link
Author

tgkokk commented Sep 9, 2015

@mboes OK, I was able to build HaskellR. The console REPL (H) works fine. Now, IHaskell works out-of-the-box, but it doesn't provide support for HaskellR. If I manually insert the H.ghci file's contents into a cell and evaluate that (and add an import for Language.R.Instance, because for some reason it doesn't work if the full path is specified) I get HaskellR support. Now, the example plot here doesn't really work, but simple interfacing with R works fine.

FWIW, this is what the plot looks like:

screen shot 2015-09-09 at 20 39 02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants