I'm working on a haskell web app using yesod that I eventually want to deploy to EC2, can someone recommend an AMI that has a recent haskell platform and a git client install-able from the repositories?
To find a Linux AMI using the AMIs pageOpen the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . From the navigation bar, select the Region in which to launch your instances. You can select any Region that's available to you, regardless of your location. In the navigation pane, choose AMIs.
The term “baking into an AMI” refers to the practice of installing preconfigured software onto the instance that your Amazon Machine Image (AMI) is based on. When doing this with the Deep Security Agent, we recommended that you preactivate the agent before you bake it into your AMI.
'Baking the agent' is the process of launching an EC2 instance based on a public AMI, installing the agent on it, and then saving this custom EC2 image as an AMI. This AMI (with the agent 'baked in') can then be selected when launching new Amazon EC2 instances.
Bootstrapping in AWS simply means to add commands or scripts to AWS EC2's instance User Data section that can be executed when the instance starts. It is a good automation practice to adopt to ease configuration tasks.
If you look at Michael Snoyman's setup script here, it contains the steps he used to get an EC2 instance going on a Ubuntu AMI.
https://github.com/yesodweb/benchmarks/blob/master/setup.sh
I also have Yesod running from source on Amazon Linux. It takes a few hours to build everything but I think any of the standard boxes with at least 8G of memory should do it (otherwise GHC can't link). This is how I did it:
# install what packages are available
sudo yum --enablerepo=epel install haskell-platform git make ncurses-devel patch
# make and install ghc
wget http://www.haskell.org/ghc/dist/7.0.4/ghc-7.0.4-src.tar.bz2
tar jxf ghc-7.0.4-src.tar.bz2
rm ghc-7.0.4-src.tar.bz2
cd ghc-7.0.4
./configure
make -j 4
# wait a few hours
sudo make install
cd
rm -rf ghc-7.0.4
# make and install haskell-platform
wget http://lambda.haskell.org/platform/download/2011.4.0.0/haskell-platform-2011.4.0.0.tar.gz
tar zxf haskell-platform-2011.4.0.0.tar.gz
cd haskell-platform-2011.4.0.0
./configure
make -j 4
sudo make install
cd
rm -rf haskell-platform-2011.4.0.0
You shouldn't compile on an EC2 instance. Choose a generic AMI like Ubuntu, and perform the compile on a local computer, then upload the static binary to EC2.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With