Lately, I have been trying to automate our build process on Amazon EC2 and I am impressed by what Amazon is offering. I am 90% done with my build process. We have managed to reduce our build time from 90 hours to just 4 hours by using 15 EC2 instances at a time. There are just 2 missing links. I have tried to find the answer but with no results.
Background
I launch multiple EC2 instances from my C# application and each EC2 instance does some Matlab computation. The number of instances to launch is a user defined parameter and the code load balances the build process accordingly. I have an executable on the EC2 that executes the Matlab commands. Also, my EC2 instance is a custom AMI with Windows Server 2008 and my own set of files and binaries installed.
Question 1)
After launching the EC2 instance, I have to wait for about 15 minutes for Remote Desktop to be available but I see that the instance is in “running” state within 2 minutes after I launch. Is there a way to directly launch my executable on EC2 from my local system without remote logging? That would save me those 15 minutes and this way, I could completely automate the build process. No need to RDP into EC2 to fire the executable. I looked at PsExec and other 3rd party tools to fire remote commands. I just couldn’t figure out how to use them with EC2. I even tried setting up a batch file that calls the executable on Windows startup but unfortunately that batch file is not called until I RDP into EC2. Is there any other way to achieve this?
Question 2)
How do I retrieve (stream) my log files from EC2 to my local system while the build is in progress? The build is expected to take about 12 hours (worst case with few instances running) and I would want some way of monitoring the build. I was thinking about streaming the log file from EC2 to S3 and then stream it from S3 to my local system but that does not sound too feasible. There has to be a better way to do this.
Forgive me if these questions have been answered before. It would be very kind if someone can point me to the right source or answer my questions here.
Thank you everyone.
If you use Linux,
user datais what you need. Here is RightScale example for you: What is the EC2 User Data field, and how can I use it?We use remote rsyslogging for this purpose. SYSLOG: SENDING LOG FROM REMOTE SERVERS TO SYSLOG DAEMON
Can you switch to Linux?