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

Get Stack/Docker modes passing again (and revive bintreebench) #108

Open
rrnewton opened this issue Jan 27, 2019 · 6 comments
Open

Get Stack/Docker modes passing again (and revive bintreebench) #108

rrnewton opened this issue Jan 27, 2019 · 6 comments

Comments

@rrnewton
Copy link
Member

rrnewton commented Jan 27, 2019

Now there are four modes that are distinguished by env vars, all of which need some work to revive. For both Docker and Nix, we can use them at the coarse granularity (run the entire test script inside) or at a fine-grain, relying on stack --docker and stack --nix:

COARSE_DOCKER=1:

This mode could be run with:
COARSE_DOCKER=1 ./.jenkins_script.sh

When I started this small audit, it looks like the BintreeBench/Dockerfile has rotted, which was set up to be the parent of ./Dockerfile.

COARSE_NIX=1

It looks like .nix_default_environment.txt has been updated a few times. It was left at a snapshot of nixos 18.03, which currently doesn't seem to be working:

error: attribute 'ghc843' missing, at (string):1:53

I bumped to 18.09 just now, but

$ COARSE_NIX=1 ./.jenkins_script.sh
...
+ stack --allow-different-user --system-ghc test ''
<tries to install GHC and fails>

It should not be trying to install GHC. Ok, right now we're on lts-12.5, and there is some version skew; that should imply GHC 8.4.3.

STACK_DOCKER=1

This is working ok for me on Mac OS (e.g. the gibd alias defined by set_env), but it can't pass the full test suite because of the current commit, the stack.yaml points at a vanilla fpco/stack-build image, and that doesn't have gc.h (Boehm conservative GC).

Really, we should restore the coarse-grained Docker mode, and then stack --docker can just use the same image with all the dependencies in it.

STACK_NIX=1

(Haven't tried this yet.)

@rrnewton
Copy link
Member Author

rrnewton commented Jan 27, 2019

(Re: STACK_NIX mode)
As of c72dc83, this runs without error

gibbon-compiler/$ stack --nix ghc -- --version 
The Glorious Glasgow Haskell Compilation System, version 8.4.3

In that same commit I could hop into a nix shell (make shell uses the appropriate pinned dir), and then COARSE_NIX=1 ./run_all_tests.sh.

But.... it did not pass. It gave me 1 unexpected passes and 22 unexpected failures (Prelude.read no parse). Hmm.

@ckoparkar ckoparkar reopened this Jan 29, 2019
@rrnewton
Copy link
Member Author

FYI: Supporting nix on travis should be possible with language: nix. But... I'm not sure if this leaves everything else in working shape for the non-nix builds.

ckoparkar added a commit that referenced this issue Feb 11, 2019
… "no space left on device")

re: "Prelude.read no parse" error that RRN reported:

`nix-shell` sets an environment variable, SIZE=size. I've not been
able track down what specific package is responsible for this. I tried
to write another minimal shell.nix script and that shell had this
environment variable too.

Gibbon tries to parse "size" as an Int (in Gibbon.Common.getRunConfig)
and that doesn't work out very well. Until we figure out the source of
this rogue variable, we *unset* it run_all_tests.sh.

Now, Travis fails with "No space left on device" while trying to
install Gibbon's dependencies (the Haskell ones, via Stack) :(
@ckoparkar
Copy link
Member

ckoparkar commented Feb 11, 2019

re: "Prelude.read no parse"

nix-shell sets an environment variable, SIZE=size. I've not been able track down what specific package (or something in our config) is responsible for this. I tried to write another minimal shell.nix script and that shell had this environment variable too.

This leads to the "no parse" error. Gibbon tries to parse "size" as an Int (in Gibbon.Common.getRunConfig) and that doesn't work out very well. Until we figure out the source of this rogue variable, we unset it in run_all_tests.sh, and it fixes that particular issue.

The *Nix modes still don't work though. Now, Travis fails while trying to install Gibbon's dependencies, (the Haskell ones, via Stack) with: hPutBuf: resource exhausted (No space left on device). What's strange is that it complains while installing haskell-src-exts in both COARSE_NIX and STACK_NIX modes.

I added a few df -h's in the script, and it looks like the VM is not running out of space. We might have to raise this upstream, and get access to a debug machine or something. I'm not really sure what's causing this atm.

[1] COARSE_NIX: https://travis-ci.org/iu-parfunc/gibbon/jobs/491624056#L1288
[2] STACK_NIX: https://travis-ci.org/iu-parfunc/gibbon/jobs/491624057#L1299

Update: This looks related commercialhaskell/stack#996

laithsakka pushed a commit that referenced this issue Feb 11, 2019
… "no space left on device")

re: "Prelude.read no parse" error that RRN reported:

`nix-shell` sets an environment variable, SIZE=size. I've not been
able track down what specific package is responsible for this. I tried
to write another minimal shell.nix script and that shell had this
environment variable too.

Gibbon tries to parse "size" as an Int (in Gibbon.Common.getRunConfig)
and that doesn't work out very well. Until we figure out the source of
this rogue variable, we *unset* it run_all_tests.sh.

Now, Travis fails with "No space left on device" while trying to
install Gibbon's dependencies (the Haskell ones, via Stack) :(
@ckoparkar
Copy link
Member

ckoparkar commented Feb 11, 2019

The size of /tmp on Travis is constrained[1] and it looks like we hit the limit by using both Nix and Stack on one VM. That Stack thread has some good information on how to fix this. Basically, we use a different temporary directory by setting TMPDIR=$HOME/tmp, and that seems to fix the (No space left on device) issue. With that, COARSE_NIX=1 mode works!

STACK_NIX still fails because of a Gibbon issue (TestRunner: chdir: does not exist (No such file or directory)). I haven't debugged this one, but it shouldn't be difficult to fix.

TODO: Docker modes, and maybe OSX.

[1]https://travis-ci.org/iu-parfunc/gibbon/jobs/491743125#L481

@rrnewton
Copy link
Member Author

@ckoparkar - btw, regarding the SIZE env var, I think we should wean ourselves off using any env vars as unqualified as SIZE or DEBUG. I.e., we should prepend GIBBON_ or some such.

@ckoparkar
Copy link
Member

I think we should wean ourselves off using any env vars as unqualified

+1 unsetting was just a quick fix to move things along. I'll update all environment vars used in our scripts later today.

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

No branches or pull requests

2 participants