1 (edited by v.90 2011-05-31 03:06:22)

Topic: [howto] Build OpenWRT with Amazon EC2

http://wiki.openwrt.org/inbox/build.with.amazon.ec2

I recently completed this experiment and thought others might find it useful.

The wiki article is still a WIP, but I thought it was worth posting here in case anyone else has already tried it and would like to share their own experience, or would like to try using AWS for the first time.

Re: [howto] Build OpenWRT with Amazon EC2

Out of curiosity, how long does it take to compile a build on the High CPU setting?

How was your experience with AWS in general?

3 (edited by v.90 2011-06-07 20:05:53)

Re: [howto] Build OpenWRT with Amazon EC2

You had to ask, so I tried it from scratch. I updated the wiki with build times and cost here. Short answer: 3h 20m for backfire (and 40m for trunk)

My next question is how long the c1.medium instance takes. It's a fraction of the cost and I suspect c3.xlarge is overkill because the 'top' showed CPU utilization at only 10% during the build. I'll gladly run another test but not tonight. I'm convinced there's a better way to do this, which probably involves running 'make' with a script that stops the instance using ec2-api-tools. That way, when the job is finished so is the cost.

I have zero complaints about AWS. They've done a great job in making a simple abstraction of a very complicated technology. I'm actually quite amazed that they've managed to give an average user the power to instantly create unlimited VMs and storage with the push of a button. My instructions don't do it justice, it really is a point-and-click process once you have all of the basics figured out.

Re: [howto] Build OpenWRT with Amazon EC2

v.90 wrote:

You had to ask, so I tried it from scratch. I updated the wiki with build times and cost here. Short answer: 3h 20m.

Is the time table based on building all packages or only some selected packages?

Mazi

Re: [howto] Build OpenWRT with Amazon EC2

Build configuration is the bare minimum required for the 'AR71XX / WRT160NL' profile to produce a .bin. Everything is default, no extras, no LuCI, no QoS, no IPv6, etc.

Output of 'make defconfig' from my puttylog is here:
http://pastebin.com/raw.php?i=UkguiLbe

(Sorry I couldn't find anywhere to attach the .txt)

Re: [howto] Build OpenWRT with Amazon EC2

3 hours seems awfully long for a bare build on such a platform.  did you set it up to compile multiple packages at the same time (set it to like 8+ at a time)?  My laptop can make a build in about that time from scratch with some packages included.  I am not sure where it is in the configuration, its been a while since i did a build.

7 (edited by v.90 2011-06-01 21:46:25)

Re: [howto] Build OpenWRT with Amazon EC2

I used 'make -j 9' , specifically 'nohup make -j 9 &' .

Output is here:
http://pastebin.com/raw.php?i=RjwbCuL3

When I did this a few months ago on my laptop (dual core, 2g ram) I remember it taking around 7-8 hours. So while this is an improvement I was hoping it would be a bit faster. I don't know enough about make to know if its using more than one job, can you tell from the output? (Perhaps I should have made it verbose)

Re: [howto] Build OpenWRT with Amazon EC2

v.90 wrote:

Build configuration is the bare minimum required for the 'AR71XX / WRT160NL' profile to produce a .bin. Everything is default, no extras, no LuCI, no QoS, no IPv6, etc.

I configure my AMD64 PhenomII X3 with 2GB RAM to built AR71XX all generic firmwares for a Fry's Electronics FR-54RTR (a.k.a. DLink DIR-600-A1) with a bare minimum + LuCI, QoS, MultiWAN, etc. in less than 1 hr. I enabled Compile certain packages parallelized with 4 Number of package submake jobs and use ionice -c3 nice -n20 make -j10.

Mazi

Re: [howto] Build OpenWRT with Amazon EC2

mazilo wrote:

I enabled Compile certain packages parallelized with 4 Number of package submake jobs and use ionice -c3 nice -n20 make -j10.

Where did you configure this? make menuconfig?

I'm guessing you are building trunk as I only find the PKG_BUILD_JOBS option in trunk/Config.in. I was building plain old 'backfire' where this option isn't present.

Building trunk is on my list of TODOs so I'll re-run the t1.micro vs c3.xlarge test again once I figure out how to auto-stop the instance. (I won't bother testing c1.medium against 'backfire' source either).

Re: [howto] Build OpenWRT with Amazon EC2

v.90 wrote:
mazilo wrote:

I enabled Compile certain packages parallelized with 4 Number of package submake jobs and use ionice -c3 nice -n20 make -j10.

Where did you configure this? make menuconfig?

it is under Global build settings.

I'm guessing you are building trunk as I only find the PKG_BUILD_JOBS option in trunk/Config.in. I was building plain old 'backfire' where this option isn't present.

IIRC, the Compile certain packages parallelized option was added to SVN trunk at the beginning of 2011.

Mazi

Re: [howto] Build OpenWRT with Amazon EC2

I built trunk today using the c3.xlarge instance, using ' nohup time make -j 9 & ' and '8 Number of package submake jobs'

Total time: 40m 02s  (aka $0.68)

So yeah I'd say its quite a bit faster. I wouldn't expect the t1.micro to be much better on trunk than it is on backfire, but testing that and c1.medium still might be worth the evaluation. Right now figuring out auto-shutdown is my priority, the command itself (ec2-stop-instances) is quite easy but properly nesting everything is not.