Issue with 1.0.2 and rake rubber:config

24 views
Skip to first unread message

Tobias Crawley

unread,
Oct 2, 2009, 4:59:36 PM10/2/09
to rubbe...@googlegroups.com
Matt:

I'm working on building a rubber cluster with the 1.0.2 gem. I've
built a staging instance with ROLES=web,app,db:primary=true without a
problem, but I'm running in to an issue building the real thing. I'm
trying to build two instances, one web,app (as webapp01), and one
db:primary=true (as db01).

When bootstrapping, I ran in to the following error:

* executing "sudo -p 'sudo password: ' sh -c 'cd
/mnt/app-production/releases/20091002203700 &&
FILE=\"role/mysql_master|role/db/my.cnf\" RUBBER_ENV=\"production\"
rake rubber:config'"
servers: ["db01.mydomain.com"]
[db01.mydomain.com] executing command
** [out :: db01.mydomain.com] (in /mnt/app-production/releases/20091002203700)
** [out :: db01.mydomain.com] Instance not found for host: db01
command finished
failed: "sh -c 'sudo -p '\\''sudo password: '\\'' sh -c '\\''cd
/mnt/app-production/releases/20091002203700 &&
FILE=\"role/mysql_master|role/db/my.cnf\" RUBBER_ENV=\"production\"
rake rubber:config'\\'''" on db01.mydomain.com

From looking at the rubber:config task, it tries to get the instance
from Rubber::Configuration, which loads the instances from
config/deploy/instance-production.yml on the server. Since I'm
deploying from git, that file does not exist. The temporary solution
is to add & push instance-production.yml after cap rubber:create and
before cap rubber:bootstrap.

A better solution may be to scp instance-production.yml to /tmp on the
server, then have ConfigHolder#initialize check there as well. If that
sounds good to you, I'll fork and add that, then send you the pull
request.

Tobias

Matthew Conway

unread,
Oct 2, 2009, 5:09:21 PM10/2/09
to rubbe...@googlegroups.com
I feel in general its a good practice to only deploy what is checked
in, so everything including my instance*.yml are checked in. However,
when building a cluster (or experimenting on staging), it is a pain to
continually check stuff in. As a result, you can configure this
behavior by setting push_instance_config in deploy.rb. By default it
looks like:

# Lets us work with staging instances without having to checkin config
files
# (instance*.yml + rubber*.yml) for a deploy. This gives us the
# convenience of not having to checkin files for staging, as well as
# the safety of forcing it to be checked in for production.
set :push_instance_config, RUBBER_ENV != 'production'

which only lets you be a little looser in staging. If you set it to
true, it will always push whatever instance*.yml you have locally,
which makes it easier when building a cluster from scratch. Once your
cluster matures, yoou might want to consider setting it back to the
way it is...up to you :)

Matt

Tobias Crawley

unread,
Oct 2, 2009, 7:38:55 PM10/2/09
to rubbe...@googlegroups.com
Matt:

Thanks for the tip. I saw that option a couple of weeks ago when I
started on this project, but promptly forgot about it. I'll let you
know how it all goes.

Tobias
Reply all
Reply to author
Forward
0 new messages