Forum: Ruby on Rails rails app in professional development environment

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F10f95926f620318a71c102f207649b7?d=identicon&s=25 Manish Shah (Guest)
on 2006-03-06 10:58
(Received via mailing list)
I've been working on my rails app which will be a web app that i want to
launch as a business.  Being new to rails i'm wondering what
professional
web app developers do for their development environment.  Right now i'm
developing and testing on my laptop.  I think i've gotten far enough
along
where i want to put it up on a hosting machine to develop further, perf
test, and iterate.  This is also so i can have other people test with
me.

I know i have to wrap my app in subversion but then what?  What's the
normal
process of developing locally on my laptop and then getting the latest
code
running on the hosting machine?

I also want to make it really easy for when i'm ready to flip the switch
to
go from development environment to production environment.  I suspect
that
it should be the same uploa/refresh process with svn.

The reason i made it a point to be a "professional environment" is
because
if and when i hire employees, i want to do things the same way that
other
businesses do things.  This will not just be side project that i can
take
down if things crash or i cant rollback an update.

Thanks in advance.
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Mikkel Bruun (Guest)
on 2006-03-06 11:07
(Received via mailing list)
subversion and switch...ehh capistrano...

you place your code in subversion, which is a revision tracking
system...

capistrano makes it really simple to dpeloy your newest release to your
server...

Its quite simple to set this up, but there is a lot of new concepts you
need to deal with


On Monday, March 06, 2006, at 1:56 AM, Manish Shah wrote:
>running on the hosting machine?
>Thanks in advance.
>
>
>_______________________________________________
>Rails mailing list
>Rails@lists.rubyonrails.org
>http://lists.rubyonrails.org/mailman/listinfo/rails
>


Mikkel Bruun

www.strongside.dk    - Football Portal(DK)
nflfeed.helenius.org - Football News(DK)
ting.minline.dk      - Buy Old Stuff!(DK)
69a88a3d5aa3858f5e905795ba268f4e?d=identicon&s=25 Jeremy Nelson (Guest)
on 2006-03-06 14:18
(Received via mailing list)
>>I've been working on my rails app which will be a web app that i want to
 >>launch as a business.  Being new to rails i'm wondering what
professional
 >>web app developers do for their development environment.  Right now
i'm
 >>developing and testing on my laptop.  I think i've gotten far enough
along
 >>where i want to put it up on a hosting machine to develop further,
perf
 >>test, and iterate.  This is also so i can have other people test with
me.

I'm in a similar position.

I don't have any good advice about hosting services, but I do have some
suggestions about the dev/test/prod cycle and environments.

Fair warning- I got caught up in a train of thought so I'm afraid I
think I strayed from your question. My apologies.

I currently have a neat dev/test environment based around Xen:

http://www.cl.cam.ac.uk/Research/SRG/netos/xen/

I do development in a Xen virtual machine (based on an Ubuntu server
build). As I do development I track any Ubuntu package or ruby gem
dependencies so that these can be automatically installed in the
test/preproduction/production environments. Xen allows me to test the
build of my environment as well as the build of my code.

Life and work have distracted me from progressing these endeavours so it
isn't complete but I'll end up with a 'shipping' process that packages
up everything except the core application into Debian/Ubuntu packages
(so ruby gems etc.. will probably be installed as packages) and puts
them in a private repository, installs them and then ships the core code
using something like swithtower. I can test the whole process using Xen
virtual machines. And I'll install and test a 'cluster' of machines
(probably on the one "real" machine).

I'd install the core application as a Debian package too except the
ActiveRecord::Migration stuff is so damn convenient- and there is a lot
of Rails community development and support around switchtower and that
method of shipping code.

Most of this isn't as laborious as it sounds since it all automates
nicely.

The two main reasons for doing all this are:
   1. You should aim to never manually alter your production
environment- it should be built automatically so that it is repeatable.
This makes it testable which allows you to validate that you've actually
fixed problems when they arise. If you futz with the production
environment you'll find yourself patching the system, forgetting what
you did and then having to debug the problem again six months down the
track when you lose a hard disk/reboot the system/delete the wrong
file/need to build a redundant system...
   2. It makes it much easier to build horizontally scalable systems.

[ Horizontally scalable means 'add more machines to increase capacity'.
Vertically scalable means 'add more CPUs/memory/spend lots more money'.
To make a good horizontally scalable system you do have to think
carefully about how you store your data and how you scale your data
store- but that is another discussion. ]

If you DO make a succesful application you want to make sure it will
scale and at that point you'll really appreciate being able to create an
accurate production environment.

Another neat thing is that is very easy to create development
environments for other developers. They can each have their own virtual
machine and add test machines as required.

As a previous poster mentioned all your source code should be under
version control (probably subversion given the general Rails culture).
This code includes your Xen build scripts, testing infrastructure...
everything. If you are then careful about backing up your production
data stores (including your subversion system) you'll find you can lose
production machines but be able to rebuild without any hassles. Or even
better you'll have built everything clustered so you won't even lose
service.

Jeremy.
59de94a56fd2c198f33d9515d1c05961?d=identicon&s=25 Tom Mornini (Guest)
on 2006-03-06 18:09
(Received via mailing list)
On Mar 6, 2006, at 5:14 AM, Jeremy Nelson wrote:

> >>test, and iterate.  This is also so i can have other people test
> with me.
>
> I can test the whole process using Xen virtual machines. And I'll
> install and test a 'cluster' of machines (probably on the one
> "real" machine).

+1

> The two main reasons for doing all this are:
>   1. You should aim to never manually alter your production
> environment- it should be built automatically so that it is
> repeatable. This makes it testable which allows you to validate
> that you've actually fixed problems when they arise. If you futz
> with the production environment you'll find yourself patching the
> system, forgetting what you did and then having to debug the
> problem again six months down the track when you lose a hard disk/
> reboot the system/delete the wrong file/need to build a redundant
> system...

+1

Spot on, Jeremy!

--
-- Tom Mornini
F10f95926f620318a71c102f207649b7?d=identicon&s=25 Manish Shah (Guest)
on 2006-03-06 20:02
(Received via mailing list)
This is definitely good advice and i will aim to have this type of
setup.
However, i believe i'm a little earlier in this journey.  Right now i'm
reading about capistrano and how to get that setup.

I will be setting up RoR today on a hosting machine (a vps for now).  I
will
also need to setup capistrano and subversion on the hosting machine.  I
want
to create a step by step plan so i know what to do and in what order.

I can find information on how to setup each part individually, but i'm a
little lost on what order to install them.  I'm pretty sure i have to
start
with RoR.  Should i setup capistrano next?  Also, how do i setup my
machine
to host my svn repository and so that capistrano will see it correctly.

Any help here would be very well received.

Thanks.
F10f95926f620318a71c102f207649b7?d=identicon&s=25 Manish Shah (Guest)
on 2006-03-08 06:47
(Received via mailing list)
I finally got my subversion repository setup and my vps setup with
fcgi..woohoo!

However, i run into some tasks that i think will slow things down in
terms
of deployment each time i make a revision.

Here is my current setup.  I develop at home on my laptop.  I make
changes
and test on my laptop using WEBrick.  I have a vps machine running
redhat,
apache, and fcgi.

Obviously the server has its own .htaccess, database.yml, and
dispatch.fcgi.
It will mostly likely have its own environment.rb for sending emails
(whereas on my laptop i just set actionmailer to :test).

Now what is the best/correct way to deploy the most recent source code
from
my repository?  is it just to do svn update on my live rails app's
directory
when i want to deploy new versions?  Will this overwrite the versions of
the
above files that need to be specific to the server?   I'm lost here and
i
would greatly appreciate advice from people in the know.
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Mikkel Bruun (Guest)
on 2006-03-08 09:39
(Received via mailing list)
Use capistrano for deployment...

it basically checks out trunk on the remote server in a timestamp folder
and symlinks it, restarts fcgi etc...

Pretty easy to setup...

regarding database.yml and environments...

These should be the same on your develop machine and your server.
But your server should be setup to use "production" enviroment.
Then it will automatically use your production database from
database.yml and load enviroments/production.rb where you would specify
what ever environmental differences for production...
it is really quite simple...

On Tuesday, March 07, 2006, at 9:44 PM, Manish Shah wrote:
>Obviously the server has its own .htaccess, database.yml, and
>would greatly appreciate advice from people in the know.
>> want to create a step by step plan so i know what to do and in
>>
>> > > professional
>> > > install and test a 'cluster' of machines (probably on the one
>> > > system, forgetting what you did and then having to debug the
>> >
>Rails mailing list
>Rails@lists.rubyonrails.org
>http://lists.rubyonrails.org/mailman/listinfo/rails
>


Mikkel Bruun

www.strongside.dk    - Football Portal(DK)
nflfeed.helenius.org - Football News(DK)
ting.minline.dk      - Buy Old Stuff!(DK)
This topic is locked and can not be replied to.