Timeout when deploying to Heroku - haskell

I'm pushing a Haskell web app with quite a few dependencies to heroku, which requires heroku to download and compile all of the dependencies.
Things consistently seem to just "stop" suddenly in the logs after a certain amount of time. The log just stops abruptly mid-line, at a slightly diferent spot each time
After looking at heroku logs it seems that time between the receive and the message saying it is beginning to compile and the time between the end of compilation is always exactly 15 minutes (plus a few seconds). The buildpack works fine, I've used it for applications in the past. If I remove all required packages from the dependencies, it attempts to compile my web app and it behaves exactly as it would on a local machine (it stops after complaining about a missing dependency). I've done this with almost all of the required packages one-by-one ... but when I put a lot of them together, it fails in much the same way.
Here is an example of what the log looks like:
... (lots of similar lines, nothing out of the ordinary) ...
Downloading feed-0.3.9.1...
Downloading texmath-0.6.4...
Configuring resource-pool-0.2.1.1...
Building tagsoup-0.12.8...
Building resource-pool-0.2.1.1...
Installed hexpat-0.20.3
Configuring case-insensitive-1.1...
Building case-insensitive-1.1...
Configuring void-0.6.1...
Installed resource-pool-0.2.1.1
Configuring unordered-containers-0.2.3.2...
Installed case-insensitive-1.1
Downloading http-types-0.8.1...
Building void-0.6.1...
Building unordered-containers-0.2.3.2...
Building lifted-base-0.2.1.0...
Confi
! Push rejected, failed to compile Multipack app
And every time, it stops on a different line and a different place in the line. I've tried it with various buildpacks and it all seems to work the same way.
All signs seem to point to a timeout error ... the most incriminating being the fact that all failed attempts are exactly 15 minutes long ... or maybe a disk space error. Does anyone know if there is a way to increase the timeout or speed up compilation? Is it possible for me to pre-compile all of my binaries?

It is possible to compile the binary on your machine, commit it to the Heroku-only repository and push that. Here is a script I used to deploy:
#!/bin/sh -e
cabal configure
cabal build
cd heroku # this is my Heroku-only repository
git rm -r *
cp ../dist/build/labyrinth-server/labyrinth-server .
cp -r ../public/ . # this is the static files directory
echo "web: ./labyrinth-server" > Procfile
touch requirements.txt # pretend to be a Python app, otherwise Heroku doesn't know what to do
git add *
git commit -m "New version."
git push
cd - >/dev/null
Note: I switched to OpenShift later, and the OpenShift deploy script has a few enhancements.
Another note: you should make sure you are building on a machine with compatible architecture and link against an existing libc version. You can check all that yourself if you SSH onto the server manually (rhc ssh or heroku run bash). For the current OpenShift, a Debian Wheezy x64 machine produces compatible binaries.

Wrote a write-up addressing this problem and full step-by-step instructions for such a pre-compiled deploy.

Related

npm t killed and git diff not working because of an added addon.node

For the past couple of days I have been struggling with this issue. I have this addon.node that is built using neon-cli trough npm. once this file is introduced to the git environment git diff stops working and the npm test gets killed before running any test even the ones unrelated to the specified addon.node.
This was mainly due to macOS code signing cache. The M1 requires shared libraries to be signed. It caches those validation by file location.
One solution was to remove addon.node before building it again.
another when there is git involvoled sometimes just checking out the file would do the trick

Installing Node in a linux grid server

So some background, I'm installing Node on a host server, but it's a grid server not a server that's solely for my website.
The grid server doesn't have a root user/ administrative powers. So to install node I found this workaround: http://iantearle.com/blog/media-temple-grid-and-nodejs . It's a Linux Grid server, I've never used Linux so if someone could explain to me what the commands mean, especially: ./configure --prefix=~/opt/
Lastly I followed the steps but when I try to run the node command in the server it says node:command not found - which is why I'm trying to understand the steps. Thanks
To explain the process:
Configure
The configure script is responsible for getting ready to build the software on your specific system. It makes sure all of the dependencies for the rest of the build and install process are available, and finds out whatever it needs to know to use those dependencies.
Unix programs are often written in C, so we’ll usually need a C compiler to build them. In these cases the configure script will establish that your system does indeed have a C compiler, and find out what it’s called and where to find it.
Make
Once configure has done its job, we can invoke make to build the software. This runs a series of tasks defined in a Makefile to build the finished program from its source code.
The tarball you download usually doesn’t include a finished Makefile. Instead it comes with a template called Makefile.in and the configure script produces a customised Makefile specific to your system.
3.Make Install
Now that the software is built and ready to run, the files can be copied to their final destinations. The make install command will copy the built program, and its libraries and documentation, to the correct locations.
--prefix=~/opt/ -> will set the build directory to /home/yourhome/opt directory.
Now if you didnt get errors while doing those 3 steps explained above make sure you did the following:
nano ~/.bash_profile
export PATH=~/opt/bin:${PATH}
nano is a text editor and you are opening .bash_profile file with it.
you need to add export PATH=~/opt/bin:${PATH} in that file and save it using ctrl+x
Then restart your terminal.
Specified github repository for nodejs is outdated. use the following link instead.
git clone https://github.com/nodejs/node.git
P.S node:command not found usually happens when the program is not installed correctly or it's executable isnt in your terminal's PATH variable.

Jenkins tfs plug-in and checkout source on remote node

First, I'm a Jenkins neophyte. I have made a free-style software project in Jenkins to perform my Linux build. The Jenkins server is running on Windows so there are slave nodes configured for doing this Linux build. The sources are kept in a TFS server.
I updated our TFS plugin to the latest of 4.0.0. This plugin says that it is no longer necessary for slave nodes to have the Team Explorer Everywhere package installed as it uses the Java API. However, when I kick off my build, I get this:
Started by user Andy Falanga (afalanga)
[EnvInject] - Loading node environment variables.
Building remotely on dmdevlnx64-01 (PY27-64 CENTOS6-64 LOG4CPLUS PY26-64) in workspace /home/builder/jenkins/workspace/Linux Autotools Build
Deleting project workspace... done
Querying for remote changeset at '$/Sources/Branches/Andy/AutotoolsMigration' as of 'D2015-10-05T18:26:27Z'...
Query result is: Changeset #4872 by 'WINNTDOM\afalanga' on '2015-09-25T23:36:24Z'.
Listing workspaces from http://ets-tfs:8080/tfs/SoftwareCollection...
... Long list of workspaces
Workspace Created by Team Build
Getting version 'C4872' to '/home/builder/jenkins/workspace/Linux Autotools Build'...
Finished getting version 'C4872'.
[Linux Autotools Build] $ /bin/bash /tmp/hudson7081873611439714406.sh
Bootstrapping autotools
/tmp/hudson7081873611439714406.sh: line 4: ./bootstrap: No such file or directory
Build step 'Execute shell' marked build as failure
Notifying upstream projects of job completion
Finished: FAILURE
I log into that system and look in the directory /home/builder/jenkins/workspace/Linux Autotools Build and sure enough, there's nothing there. My configuration is pretty simple.
I have discard old builds checked and a simple rotation (this is just me learning how to use it).
I have it set to "Restrict where the build is done" and a label which associates to the 3 slave nodes for doing this build.
All TFS credentials are input and correct.
No build triggers
A simple shell script for Build->Execute Shell which bootstraps the autotools and calls configure and then make.
What am I doing incorrectly?
I found the answer and am posting it here in case someone runs into this. This seems better than simply deleting the question. The TFS plugin doesn't seem to like spaces in the project name. The name before Linux Autotools Build which didn't work and the name now, LinuxAutotoolsBuild which does.
The errors provided by the Jenkins system didn't provide enough information for this to be apparent. After trying a few other things the thought occurred, "Perhaps the spaces are causing grief."
Hope this helps someone.

Foresight linux repo needs to be rebuild

We have a serious problem with foresight linux. As we know it, foresight has no support due to the conary package method which is shutdown now. However in our application the build fails because the online repo is not reachable (rpath).
This is the error we get during build:
Error occurred opening repository http://foresight.rpath.org/conary/: Connection refused
So we found a way to get a list of conary packages on the local server as a dump(from git - mirror of conary repo).
Now we are really not sure on how and where to update foresight Linux to look over new repo path instead of foresight.rpath.org/conary.
The fact is that we would not expect any major upgrade or update on the packages. This is to let build run without getting exit saying online repo issue, so that we can plan and manage until the application gets completely migrated.
You can edit the repo list by yourself, the path is
cat /etc/apt/sources.list

Keter not picking up new bundle

I'm trying to deploy a Yesod app using Keter. I previously added a *.keter bundle to /opt/keter/incoming, but because I built the file on a different system it failed to start. I've since fixed this problem by building my app on the server itself.
However, now when a new *.keter bundle is added to /opt/keter/incoming/, nothing happens. /opt/keter/log/keter/current.log doesn't have any log messages since I had the first failed deploy. I see several instances of Keter running when I run ps aux | grep kete[r], so it does look to be running.
I copied the *.keter bundle I made to a temporary directory, where I gunzip/untarred it. After doing so, I was able to run the binary directly, so I think that's ok.
Edit: I notice that inside the temp director that Keter uses, there is only a binary there (no static assets or anything). When I try to run this binary it fails with "Segmentation fault".
Trying to run keter /opt/keter/etc/keter-config.yaml is proving really useful—am working through some issues and I think I'm down to just a postgres authentication failure. Will report back in a bit.
Ok so I've worked through all the issues. Roughly, the steps were:
tail -f the app and keter current.log files for information
Run keter manually keter /opt/keter/etc/keter-config.yaml
This would bring up issues like not having the certificate.pem file (I didn't need this because I'm not using https yet)
Use the app's logfile to work out issues like database connection errors.
I didn't end up using Keter to handle this—I just set up postgres manually.
This is sort of an abridged answer—can't quite remember all the things I needed to do. However, the key here was to run keter manually to bubble up any errors that were occurring.

Resources