Re: [Catalyst] Deployment in practice

2009-10-09 Thread John Goulah
2009/10/9 Octavian Râşniţă :
> Hi,
>
> I've recently started to use Mercurial for revision control and the pages
> regarding the deployment of a Catalyst app from the Catalyst wiki also help
> me very much, but I still don't know what would be the best method for
> uploading the files to the server.
>
> How do you do it?
> Archive the entire app an dupload to the server then change the permissions
> of the files and folders there?
> Or upload the modified files one by one?
> Or generate a tarball on each revision and unarchive and make, make test it
> on the server?
> Or something else?
>

I like to have a revision per code push and rsync it out.   What I
don't recommend is updating code directly from a repo on the server,
it will get you eventually.

http://blog.johngoulah.com/2009/03/code-deployment-techniques/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Newbie Question about Database

2009-01-19 Thread John Goulah
On Mon, Jan 19, 2009 at 3:10 PM, Giancarlo Corcuera
 wrote:
> Hi:
>
> I'm building an App but I want to have my database in another IP. Is there a
> way to enter the parameters to do this instead of the normal connection that
> appears in the manual?
>
> This is my model (a very standar one):
>
> package App::Model::ModelDB;
>
> use strict;
> use base 'Catalyst::Model::DBIC::Schema';
>
> __PACKAGE__->config(
>   schema_class => 'App::Schema::ModelDB',
>   connect_info => [
>   'dbi:mysql:model',
>   'model',
>   'model',
>   {
>   mysql_enable_utf8   => 0,
>   on_connect_do   => [
>   "SET NAMES 'utf8'",
>   "SET CHARACTER SET 'utf8'",
>   ],
>   }
>   ],
> );
>
> How can I change it to connect to a DB in another IP?
>


You probably want to do this in the config, something like this:

If the config is yaml

Model::ModelDB:
 connect_info:
  - 'dbi:mysql:dbname=my_db_name;host=my_host_or_ip'
  - 'my_dbuser'
  - 'my_dbpass'
  - AutoCommit: 1
mysql_auto_reconnect: 0


Or if the config is conf


connect_info   dbi:mysql:dbname=my_db_name;host=my_host_or_ip
connect_info   my_dbuser
connect_info   my_dbpass

AutoCommit   1
mysql_auto_reconnect   0





Thanks,
John

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: new catalyst version breaks test in Catalyst-Model-Adaptor-0.02 and Catalyst-Plugin-Unicode-0.8

2008-05-23 Thread John Goulah
On Mon, May 19, 2008 at 5:35 PM, John Goulah <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> I've narrowed down that the new version (5.7013) breaks tests in both
> of these modules, but I'm not sure why  (they work against the last
> version of Catalyst 5.7012, so there has been some change thats
> affected this)
>
>
> Heres the test output, as you can see its looking for the wrong output.
>
>
> Catalyst-Model-Adaptor-0.02
>
> t/00-loadok
> t/live-test..1/47 [error] No default action defined
>
> #   Failed test 'get main page'
> #   at t/live-test.t line 17.
> # 500
> # Internal Server Error
>
> #   Failed test 'see if it has our text'
> #   at t/live-test.t line 18.
> #  got: " #   length: 3747
> # doesn't match '(?i-xsm:it works)'
> # Looks like you failed 2 tests of 47.
> t/live-test.. Dubious, test returned 2 (wstat 512, 0x200)
>  Failed 2/47 subtests
>
> Test Summary Report
> ---
> t/live-test.t (Wstat: 512 Tests: 47 Failed: 2)
>  Failed test number(s):  2-3
>  Non-zero exit status: 2
> Files=2, Tests=51,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.52 cusr
>  0.08 csys =  0.62 CPU)
> Result: FAIL
> Failed 1/2 test programs. 2/51 subtests failed.
> make: *** [test_dynamic] Error 2
>
>
>
>
> -
>
>
>
> Catalyst-Plugin-Unicode-0.8
>
>
>
>
>
>
>
> t/01use..ok
> t/02pod..skipped: set TEST_POD to enable this test
> t/03podcoverage..skipped: Test::Pod::Coverage 1.04 required
> t/live-test..1/12 [error] No default action defined
>
> #   Failed test 'get main page'
> #   at t/live-test.t line 22.
> # 500
> # Internal Server Error
>
> #   Failed test 'see if it has our text'
> #   at t/live-test.t line 23.
> #  got: " #   length: 3747
> # doesn't match '(?i-xsm:it works)'
> # Looks like you failed 2 tests of 12.
> t/live-test.. Dubious, test returned 2 (wstat 512, 0x200)
>  Failed 2/12 subtests
> Test Summary Report
> ---
> t/live-test.t(Wstat: 512 Tests: 12 Failed: 2)
>  Failed test number(s):  2-3
>  Non-zero exit status: 2
> Files=4, Tests=13,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.44 cusr
>  0.08 csys =  0.54 CPU)
> Result: FAIL
> Failed 1/4 test programs. 2/13 subtests failed.
> make: *** [test_dynamic] Error 2
>




mst thinks this is almost certainly an error screen, anyone care to comment?


Thanks,
John

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] new catalyst version breaks test in Catalyst-Model-Adaptor-0.02 and Catalyst-Plugin-Unicode-0.8

2008-05-19 Thread John Goulah
Hi folks,

I've narrowed down that the new version (5.7013) breaks tests in both
of these modules, but I'm not sure why  (they work against the last
version of Catalyst 5.7012, so there has been some change thats
affected this)


Heres the test output, as you can see its looking for the wrong output.


Catalyst-Model-Adaptor-0.02

t/00-loadok
t/live-test..1/47 [error] No default action defined

#   Failed test 'get main page'
#   at t/live-test.t line 17.
# 500
# Internal Server Error

#   Failed test 'see if it has our text'
#   at t/live-test.t line 18.
#  got: "http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Anybody who fancies some LWP poking ...

2008-05-15 Thread John Goulah
On Thu, May 15, 2008 at 7:35 AM, Thomas Klausner <[EMAIL PROTECTED]> wrote:
> Hi!
>
> On Sun, May 11, 2008 at 07:10:27PM +0100, Leon Brocard wrote:
>> 2008/5/10 Daniel McBrearty <[EMAIL PROTECTED]>:
>>
>> > I'd like Leon's opinion on this. Forwarding to him again.
>>
>> I understand many bits of it but have given up trying to get it
>> working. I would love a patch which passes tests on both old and new
>> lib-www-perls.
>
> Today we where hit by this, and I dug into the code...
>
> The problems seems to lie in WWW::Mechanize and
> Test::WWW::Mechanize::Catalyst.
>
> I was able to (sort of) fix it with the attached two patches.
>
> T:W:M:C tests work after those patches (as do our tests...), but
> WWW::Mechanize spews some "Parsing of undecoded UTF-8 will give garbage
> when decoding entitie" warnings. And I'm not in the mood for utf8
> debugging ...
>
> I have to say that I did not analyse the whole problem, and in fact we
> just downgrade to libwww-perl-5.808. But if these findings help someone
> with deeper knowledge to really solve the problem, I'd be delighted!
>


Since these fix tests, will these modules get patched and released
with this applied?


Thanks
John

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] FastCGI: incomplete headers (0 bytes) received from server

2008-05-06 Thread John Goulah
On Tue, May 6, 2008 at 1:01 PM, Ryan Pack <[EMAIL PROTECTED]> wrote:
>
>
>
>
> I'm having an issue with my Catalyst app but I can only get it to break
> about 1 in 100 tries.  The error log shows:
>
>
>
> [Tue May 06 11:02:46 2008] [error] [client 12.37.36.66] FastCGI: comm with
> server "/u/lxlib/BookingEngine/script/bookingengine_fastcgi.pl" aborted:
> idle timeout (60 sec), referer: http://be.genares.net/11
>
> [Tue May 06 11:02:46 2008] [error] [client 12.37.36.66] FastCGI: incomplete
> headers (0 bytes) received from server
> "/u/lxlib/BookingEngine/script/bookingengine_fastcgi.pl", referer:
> http://be.genares.net/11
>
>
>


For what its worth, I also get the latter error quite a bit in my
error logs.  Haven't really had time to trace it down, looks similar
something like:

  [Tue May 06 10:09:34 2008] [error] [client 204.2.215.55] FastCGI:
incomplete headers (0 bytes) received from server
"/opt/myapp.com/app/MyApp/1.007556/fake/www"


I think the only thing in common here is Session::State::Cookie;  we
use Session::Store::Cache.   Probably doesn't help much but I guess
the problem does exist for various reasons if anyone has any ideas I'd
be glad to try, but "adding some debug messages in key places" isn't
going to cut it.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Memory leak under FastCGI?

2008-03-31 Thread John Goulah
On Mon, Mar 31, 2008 at 5:22 AM, Matthieu Codron <[EMAIL PROTECTED]> wrote:
> There was something about growing FastCGI processes in the Catalyst advent
> calendar:
>
> http://www.catalystframework.org/calendar/2007/18
>
> In short: Apparently this is normal behavior, and the article recommends
> you, like you suggested, to periodically restart fastcgi processes to keep
> memory usage reasonable.
>
>
>
> On 3/19/08, Matt Pitts <[EMAIL PROTECTED]> wrote:
> > We have a Catalyst app that I recently (about a month ago) converted
> > from running under mod_fcgid to external under mod_fastcgi and it
> > appears to be leaking memory. There are 2 application backends and they
> > both suffered oom-killer events within six minutes of one another
> > yesterday and one of them again this morning after a cron job ran that
> > experienced some deep recursion calls.
> >
> > Both backends were running out of PARs when the first OOM events
> > occurred. To eliminate the PAR setup itself as a cause, I started one of
> > the backends by directly invoking myapp_fastcgi.pla and its memory
> > behavior is the same, so I'm pretty confident the invocation via PAR is
> > not a cause.
> >
> > I also checked my versions of CGI::FormBuilder to ensure I was up to
> > 3.501 and these all checked out.
> >
> > I have not yet determined if the conversion from mod_fcgid to
> > mod_fastcgi external is when the RAM usage started climbing - still
> > awaiting system reports - but, there haven't been an substantial changes
> > to the app since then that I would consider potential causes of a memory
> > leak. I'm guessing it's been there for a while, but it's only now
> > evident because the app instances were getting automatically recycled by
> > mod_fcgid and now they're not.
> >
> > I'm hoping someone here might have some light to shine on common FastCGI
> > memory leak issues.
> >
> > Is it generally an acceptable practice to just restart the external
> > fastcgi process periodically to free its memory?
> >
> > Any input is greatly appreciated.
> >



We wrote a plugin at work to deal with this at the handle_request
phase, that way nothing dies mid request.  You'll just have to bug
John Napiorkowski to release it :-)   I think its under the heat lamp
ready to go..

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Automatically uri_unescape parameters

2008-03-17 Thread John Goulah
On Mon, Mar 17, 2008 at 4:05 PM, Jonathan Rockway <[EMAIL PROTECTED]> wrote:

> * On Mon, Mar 17 2008, Stef T wrote:
> > Hello Alex,
> >I would assume that if Catalyst-Plugin-HTML-Scrubber-0.01 doesn't
> > do what you want, it will probably point you in the right direction ;)
> >
> >You could probably also do this using the DBIx inflate_column I
> > dare say.
>
> I don't think this is what he is talking about.  If it is, the module he
> is looking for is URI::Escape.
>
> If he's talking about unescaping the querystring, that should be handled
> by Catalyst and if something is going wrong, a failing test case would
> be appreciated.
>


I think the question is not for the query string but if its passed in the
URI, which is probably really bad form to pass things with spaces and such,
but sometimes you have to deal with legacy code before its fixed the right
way by moving it out to the query string.  Something like this, where $thing
has spaces, needs specific escaping, which is kind of a pain:

 sub bleh : Local {
my ( $self, $c, $thing ) = @_;

$thing = uri_unescape($thing); # this is necessary if it has spaces, etc
}


Thanks,
John
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Development environments and performance

2008-01-16 Thread John Goulah
On Jan 16, 2008 12:51 PM, <[EMAIL PROTECTED]> wrote:

> "John Goulah" <[EMAIL PROTECTED]> wrote on 01/16/2008 11:13:06 AM:
>
> >
> >
> >
> > Why wouldn't you just use the standalone server bundled with
> > Catalyst?  Fcgi is great for production, but the processes are
> > fairly thick memory wise, so having instances for each developer
> > could be an issue.   We use the cat server for development and works
> > fine for about 5-10 people at any given time on a modest box (4G ram)
>
> Could be a massive assumption,  but usually when you go through the cost
> (time, cap) of building out a dev server environment you want it to mirror
> your production servers as much as possible so that you spend time
> squishing bugs that may exist in your production environment -- not some
> other different environment.  If they are using FCGI in prod it makes
> perfect sense to do so in dev.  Why battle bugs that may be introduced on
> the standalone server, or worse miss bugs that _do_ affect your production
> environment because you are developing on a different environment?
>
>

No, you want your staging environment to mirror prod as closely as
possible.  You shouldn't be pushing straight from dev to prod, if you are
you should rethink your process.   We are running a production app and the
dev servers work great - very rarely do we see a bug in the production
environment that cant be replicated in dev, however, thats why we have a
stage to catch the edge cases and overall QA and -that- runs in the exact
environment as prod.

Also, one box per dev is a fine solution, if you ensure everyone is using
the same modules.  But I've seen it happen where some developer is using a
different module version than prod and that can cause much greater issues.
Either way I'd recommend maintaining a Makefile.PL + local::lib to resolve
this.  If you build the prod modules from the same Makefile this problem
typically goes away.
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Development environments and performance

2008-01-16 Thread John Goulah
On Jan 16, 2008 5:05 AM, Ian Docherty <[EMAIL PROTECTED]> wrote:

> I would just like to canvas opinion on a good development environment
> and practices for Catalyst since we are starting to have some
> performance issues.
>
> We are running on a managed server (Red Hat Enterprise), Apache2, MySql
> 5.1
>
> We have several people developing on this machine (about 5), each with
> their own sandboxes.
>
> I have set up apache so that each developer runs their Catalyst
> application under fast-cgi.
>
> We are beginning to see some performance issues especially with several
> people testing at the same time on different fast-cgi processes.
>
> The 'top' command shows 'server.pl' and 'perl' taking the bulk of the
> cpu time.
>
> Best case for a simple dynamic page in Catalyst to respond is about 5
> seconds. With several people testing at the same time it can take  30
> seconds or more to respond to a simple page. I would have hoped for only
> a second or so on such a lightly loaded server.
>
> so.
> Is the problem likely to be the setup we are using? (we can't use
> mod-perl since I believe we can't run multiple versions of the same
> application)



Why wouldn't you just use the standalone server bundled with Catalyst?  Fcgi
is great for production, but the processes are fairly thick memory wise, so
having instances for each developer could be an issue.   We use the cat
server for development and works fine for about 5-10 people at any given
time on a modest box (4G ram)




>
>
> Could we have problems in the performance of our application. Should we
> start thinking about profiling it to see where the time is going? (If
> so, are there any pointers on how best to do this?)



As mentioned, the catalyst server gives you  a lot of good numbers to
measure performance.


Good luck,
John
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Shared Host Setup

2007-11-20 Thread John Goulah
On Nov 20, 2007 1:16 PM, Mesdaq, Ali <[EMAIL PROTECTED]> wrote:

> Someone said they were going to write a advent calendar entry for using
> local::lib so I was waiting for that. But just wanted to share my
> solution as an alternative because some shared hosts are big pains to
> work with. Some don't even allow outbound connections so using cpan is
> not an option. So you would basically have to package everything up and
> lay it down.



I'll be writing that, but really if you follow bootstrap instructions , that
covers most of it. I'll just cover a couple extras and go into more detail.

Of course, you'd be out of luck without an outbound connection, I try to
avoid those hard to work with hosts :-)
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] In search of a clue ... how do I access _PACKAGE_->config values , or more specifically, values put into myapp.yml ?

2007-11-05 Thread John Goulah
On Nov 5, 2007 12:37 PM, Joe Landman <[EMAIL PROTECTED]>
wrote:

> Hi folks:
>
>   This should be an easy one.  I read and read and read.  The manual is
> fine, but my reading skills may be in doubt.
>
>   This is what I want to do.  I want to set a simple variable named
> myvar in myapp.yml.  Then I want to pick it up later on.
>
> So far so good, I have
>
> myvar:  blahblahblah
>
> in myapp.yml at the top of my application tree (in the same directory as
>  lib, script, root, ...)
>
> Now, in one of my controllers, I want to get access myvar.  I thought I
> can get at it like this:
>
>$c->config->{myvar}
> 



Looks right, did you load the ConfigLoader plugin (
http://search.cpan.org/~bricas/Catalyst-Plugin-ConfigLoader-0.18/lib/Catalyst/Plugin/ConfigLoader.pm)
?
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Shared Host Setup

2007-11-01 Thread John Goulah
On Nov 1, 2007 2:06 PM, Mesdaq, Ali <[EMAIL PROTECTED]> wrote:

>  Been working on setting up Catalyst on a shared host and I have to say
> its been pretty painful. Been trying to use the default install on the host
> and add the modules I need but came across the suggestion to install a new
> version of perl and that helped a lot. But the host I am using (aplus.net)
> has pretty strict setup as opposed to dreamhost having a more open setup so
> its making it even harder. But it seems like everything else works good
> except Module::Build. It seems like you need to have root to install that
> module. I keep getting errors that are related to chdir and it not figuring
> out what directory its built in and permissions issues.
>
> So my question is what are my options? Changing hosts is not an option. Is
> there a way I can cleanly and reliably build it on a system that I do have
> root access like a freebsd vmware image and then move it over? Would par be
> a good option for something like that? I wonder if its possible to just
> build a portable custom install of perl with all catalyst modules and
> everything on a machine with root access and just tar and move the whole
> install. I mean I did build the initial perl install on the vm image because
> I was getting errors with building on the shared host but I didn't want to
> build all the modules there because I thought it might not be a reliable way
> of setting up the environment.
>


Use local::lib  (
http://search.cpan.org/~apeiron/local-lib-1.001000/lib/local/lib.pm)

(I'd actually be happy to do an advent article on installing catalyst under
local::lib if there was any interest)

Thanks,
John
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Preventing Catalyst from loading a Controller pm module

2007-10-30 Thread John Goulah
On 10/30/07, Valentin Tumarkin <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I was wondering if there's a "standard" way for preventing Catalyst from
> loading a Controller module. I would like to keep my base Controller modules
> in the MyApp/Controller directory, but do not want Catalyst treating them as
> http-client accessible modules.
>
> For example:
> MyApp/Controller/BaseController.pm
> MyApp/Controller/AdvancedBaseControllerClass.pm (uses BaseController)
> MyApp/Controller/ActualController.pm (uses AdvancedBaseController)
>
> At this time I'm putting my base classes in the MyApp/Base/.. directories,
> but this method just doesn't seem as "clean" to me.



I believe putting them in something like MyApp/Base is the recommended way-
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/