[Catalyst] Vagrant / Developing with VM / NFS performance
I'm playing around with Vagrant[1] to manage my development VMs and I'm running into some NFS-troubles and just wanted to hear if and how you guys are developing with a guest OS. The thing is that Vagrant by default configures the VM to export a shared directory (where my Catalyst app lives) from the host OS (OS X in my case) to the guest VM (Debian). I'm using the alternative NFS mount option because VirtualBox's shared folder support is known to be super slow. Problem is, Catalyst::Restarter doesn't pick up changes to my files. I suppose this is due to NFS doing attribute caching. If I turn this off (with noac in the NFS mount options), the Catalyst server picks up the changes more quickly but it also takes a full minute to start (as opposed to 3-4 seconds when the files are local). Having the app locally on my host and exporting it into the VM feels more natural to me, but the performance issues really make this a deal-breaker. Does anyone have any advice on how to improve things? How do you share your files between your VM and your host system? Thanks a lot! --Toby [1] http://vagrantup.com/ ___ 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] Vagrant / Developing with VM / NFS performance
Hi Toby, I'm not (yet) using a VM with my new job, but at my last position I was running Parallels which hosted a VM running FreeBSD. In order to be able to use my OS X text editor of choice, I hosted the files on the OS X side and exported via NFS to the FreeBSD VM. The performance was good enough and it solved my problem. The catalyst restarter didn't seem to have any problems with this approach, though it sometimes took a couple seconds to see file changes. I suspect when I do begin using a local VM I'll take the same approach, though this time it will be using MacVIM instead of TextMate. :) Thanks, Drew On Mon, May 14, 2012 at 9:53 PM, Tobias Kremer tobias.kre...@gmail.com wrote: I'm playing around with Vagrant[1] to manage my development VMs and I'm running into some NFS-troubles and just wanted to hear if and how you guys are developing with a guest OS. The thing is that Vagrant by default configures the VM to export a shared directory (where my Catalyst app lives) from the host OS (OS X in my case) to the guest VM (Debian). I'm using the alternative NFS mount option because VirtualBox's shared folder support is known to be super slow. Problem is, Catalyst::Restarter doesn't pick up changes to my files. I suppose this is due to NFS doing attribute caching. If I turn this off (with noac in the NFS mount options), the Catalyst server picks up the changes more quickly but it also takes a full minute to start (as opposed to 3-4 seconds when the files are local). Having the app locally on my host and exporting it into the VM feels more natural to me, but the performance issues really make this a deal-breaker. Does anyone have any advice on how to improve things? How do you share your files between your VM and your host system? Thanks a lot! --Toby [1] http://vagrantup.com/ ___ 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/ -- Opera2Parliament - a 3 day bike ride to support Lymphoma Australia. Please consider donating using the link below. http://lymphomafundraising.org.au/opera2parliament_2012 ___ 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] OpenID authentication just redirects back to the login page
I am trying to add OpenID logins to my site. I've looked at several examples of this, but whenever I run if ($c-authenticate({ openid_identifier = $openid_url }, 'openid')) { ... } It redirects to the OpenID provider, and then redirects back to the login page with added URL paramaters (oic.time, openid-check, openid.assoc_handle, openid.claimed_id, openid.identity, etc.) This doesn't seem like it's doing what it's supposed to be. Any idea's what's happening? ___ 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] Vagrant / Developing with VM / NFS performance
What I usually do (on MacOS) is use SSHFS, with ExpanDrive ($25), It works very nicely, the restarter doesn't complain, and it works with multiple OSes. Francisco On May 14, 2012, at 5:04 AM, Drew Taylor wrote: Hi Toby, I'm not (yet) using a VM with my new job, but at my last position I was running Parallels which hosted a VM running FreeBSD. In order to be able to use my OS X text editor of choice, I hosted the files on the OS X side and exported via NFS to the FreeBSD VM. The performance was good enough and it solved my problem. The catalyst restarter didn't seem to have any problems with this approach, though it sometimes took a couple seconds to see file changes. I suspect when I do begin using a local VM I'll take the same approach, though this time it will be using MacVIM instead of TextMate. :) Thanks, Drew On Mon, May 14, 2012 at 9:53 PM, Tobias Kremer tobias.kre...@gmail.com wrote: I'm playing around with Vagrant[1] to manage my development VMs and I'm running into some NFS-troubles and just wanted to hear if and how you guys are developing with a guest OS. The thing is that Vagrant by default configures the VM to export a shared directory (where my Catalyst app lives) from the host OS (OS X in my case) to the guest VM (Debian). I'm using the alternative NFS mount option because VirtualBox's shared folder support is known to be super slow. Problem is, Catalyst::Restarter doesn't pick up changes to my files. I suppose this is due to NFS doing attribute caching. If I turn this off (with noac in the NFS mount options), the Catalyst server picks up the changes more quickly but it also takes a full minute to start (as opposed to 3-4 seconds when the files are local). Having the app locally on my host and exporting it into the VM feels more natural to me, but the performance issues really make this a deal-breaker. Does anyone have any advice on how to improve things? How do you share your files between your VM and your host system? Thanks a lot! --Toby [1] http://vagrantup.com/ ___ 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/ -- Opera2Parliament - a 3 day bike ride to support Lymphoma Australia. Please consider donating using the link below. http://lymphomafundraising.org.au/opera2parliament_2012 ___ 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/ Francisco Obispo email: fobi...@isc.org Phone: +1 650 423 1374 || INOC-DBA *3557* NOC PGP KeyID = B38DB1BE ___ 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] OpenID authentication just redirects back to the login page
On 14 May 2012, at 16:37, Robert Rothenberg wrote: Any idea's what's happening? No, as we have no idea what code is executing, or how that code has been configured. Need debug logs from the app and details about your auth config to even start guessing, sorry! Cheers t0m ___ 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] OpenID authentication just redirects back to the login page
On 14/05/12 17:34 Tomas Doran wrote: On 14 May 2012, at 16:37, Robert Rothenberg wrote: Any idea's what's happening? No, as we have no idea what code is executing, or how that code has been configured. Need debug logs from the app and details about your auth config to even start guessing, sorry! Thankls. Details below. The __PACKAGE__-config()'s authentication section includes as a realm: authentication = { default_realm = 'users', realms= { openid = { credential = { class = 'OpenID', }, ua_class = LWPx::ParanoidAgent, ua_args = { whitelisted_hosts = [qw/ 127.0.0.1 localhost /], }, }, users = { # [Snip!] } The users authentication works, BTW. I am trying to add an option for OpenID. The Login controller's index method has the code: my $username = lc($c-request-params-{username} // q{}); my $password = $c-request-params-{password}// q{}; my $openid_url = $c-req-params-{openid_identifier} // q{}; if ($openid_url ne q{}) { try { if ($c-authenticate({ openid_identifier = $openid_url }, 'openid')) { $log-debug(URL = . $c-user-url); # TODO if this works, fetch the user w/ $c-user-url? } else { $log-warn(Failed login '${openid_url}'); $c-response-status(HTTP_UNAUTHORIZED); $c-stash( error_msg = $c-loc(Bad OpenID login), ); } } catch { $log-error(Login failure - ${ARG}); $c-stash( error_msg = $c-loc(Login failure.), ); }; } elsif (($username ne q{}) ($password ne q{})) { if ($c-authenticate({ username = $username, password = $password, deleted = 0} )) { # [snip!] } } FWIW, I tried moving the code to a login method in the Root controller, out of cargo-cultish insecurity. Same problem. Debug logs (with specific details omitted for security, replaced with [snip!]): [info] MyApp powered by Catalyst 5.90011 HTTP::Server::PSGI: Accepting connections at http://0:3000/ [info] *** Request 1 (0.007/s) [24751] [Mon May 14 17:49:18 2012] *** [debug] Path is login [debug] POST request for login from 127.0.0.1 [debug] Body Parameters are: .--+--. | Parameter| Value| +--+--+ | openid_identifier| https://www.google.com/accounts/o8/- | | | id | | password | | | submit | Login| | username | | '--+--' [error] Login failure - catalyst_detach [debug] Redirecting to https://www.google.com/accounts/o8/ud?openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0openid.return_to=http%3A%2F%2Flocalhost%3A3000%2Flogin%3Fopenid-check%3D1%26oic.time%3D1337014159-f5836e98720e6c263f84openid.claimed_id=[snip!] [debug] Response Code: 302; Content-Type: text/html; charset=utf-8; Content-Length: 725 [info] Request took 0.284954s (3.509/s) .+---. | Action | Time | ++---+ | /auto | 0.000248s | | /login/index | 0.276124s | | /end | 0.000382s | '+---' [info] *** Request 2 (0.014/s) [24751] [Mon May 14 17:49:19 2012] *** [debug] Path is login [debug] GET request for login from 127.0.0.1 [debug] Query Parameters are: .--+--. | Parameter| Value| +--+--+ | oic.time | 1337014159-f5836e98720e6c263f84 | | openid-check | 1| | openid.assoc_handle | AMlYA9Um_a-[snip!]- | | | pyPPsyVmYE88zfk2YyrwH| | openid.claimed_id| https://www.google.com/accounts/o8/- | |
Re: [Catalyst] OpenID authentication just redirects back to the login page
On 14/05/12 17:34 Tomas Doran wrote: On 14 May 2012, at 16:37, Robert Rothenberg wrote: Any idea's what's happening? No, as we have no idea what code is executing, or how that code has been configured. Need debug logs from the app and details about your auth config to even start guessing, sorry! Well, I figured out the problem. Basically, I checked that username/password were set and assumed if they weren't that it was a new login page. So I separated the methods that displayed the login page vs handling the arguments, and used progressive realms. It works now. ___ 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/