The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2016-10-24

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:51 aborazmeh joined #mojo
00:53 irqq_ joined #mojo
00:55 zivester joined #mojo
00:55 asarch joined #mojo
01:28 asarch Any good place for free CSS3 templates?
01:29 jberger asarch: I've been using startbootstrap lately
01:30 asarch Thank you!
01:30 asarch Thank you very much jberger :-)
02:28 stryx` joined #mojo
02:52 noganex_ joined #mojo
04:09 bpmedley xinming : https://gist.github.com/brianmed/7668ff472f2cc7c6831227d3b5292b5e <-- This may be helpful in your minion scenario.  If you find any issues, please let me know..
04:33 kryp joined #mojo
05:02 inokenty-w joined #mojo
06:40 Vandal joined #mojo
06:45 dod joined #mojo
06:50 dod joined #mojo
07:04 polettix joined #mojo
07:10 mbudde joined #mojo
07:13 dod joined #mojo
07:40 trone joined #mojo
07:46 trone joined #mojo
08:53 osfabibisi joined #mojo
08:55 Zx3 joined #mojo
08:55 rshadow joined #mojo
09:03 kryp joined #mojo
09:04 Atog joined #mojo
09:21 ashimema_ joined #mojo
09:22 rshadow joined #mojo
09:32 kes joined #mojo
10:09 irqq joined #mojo
10:09 kaare_ joined #mojo
10:29 polettix joined #mojo
10:38 lluad joined #mojo
10:59 tchaves joined #mojo
11:01 howitdo joined #mojo
11:02 tholen joined #mojo
11:02 tholen joined #mojo
11:23 kryp joined #mojo
11:35 bpmedley joined #mojo
11:47 mib_pg1v3u joined #mojo
11:58 gizmomathboy joined #mojo
12:07 sri i think overriding config files in tests is not easy enough yet
12:08 sri not that i have a solution yet
12:28 rshadow joined #mojo
12:30 Jonis overriding how? using a different config file for test?
12:37 kryp joined #mojo
12:37 sri yes
12:37 sri or even providing a hash inside the test that overrides the file search logic
12:49 aborazmeh joined #mojo
12:52 sri Grinnz: little disappointed with Mojo::SQLite at the moment
12:52 sri the tempfile logic is sloppy
12:52 sri https://metacpan.org/source/DBOOK/Mojo-SQLite-1.000/lib/Mojo/SQLite.pm#L103
12:53 sri you could have at least created a tempdir and removed it on Mojo::SQLite destruction
12:53 sri that would have been so convenient for testing
12:54 Lee won't that happen anyway with File::Temp?
12:55 sri guess that was the intention actually
12:55 sri it sticks around in between test runs though
12:55 Lee hmm, i guess that means the object isn't going out of scope
12:56 sri the test exits ;p
12:56 sri doesn't get much more out of scope
12:56 Lee oh :/
12:57 Lee possibly the dir not being empty is preventing proper cleanup
12:59 sri oops
12:59 sri Grinnz: sorry, my bad
12:59 sri i messed up
13:01 sri problem is it picks up the default dsn from my config file and my temp db override in the test doesn't work
13:01 sri which actually brings me back to the original config problem
13:03 jberger sri: I feel almost silly asking this, but are you using (our could you use) mouse specific config files?
13:04 jberger s/our/or/
13:04 sri mouse?
13:04 purl i think mouse is a lightweight Moose. it strives for compat with Moose so you can upgrade/downgrade when it makes sense or do not use it or Sartak will break your kneecaps or moose for preoptimizing weenies or http://shadow.cat/blog/matt-s-trout/moo-versus-any-moose/
13:05 jberger Gah sorry. Mode
13:05 jberger It's too early for swipe type
13:05 * jberger gets coffee
13:07 sri Grinnz: ok, looks like my real problem is that it's incredibly hard to use your tempfile code for an already instantiated Mojo::SQLIte object
13:07 sri my first instinct was $app->sqlite->from_string('')
13:08 sri to replicate the Mojo::SQLite->new() you mention in the docs
13:08 sri and use yourself in tests
13:08 sri the proper way is $app->sqlite->from_string('sqlite::temp:')
13:08 zivester joined #mojo
13:08 sri which is a little unexpected
13:13 ramortegui joined #mojo
13:23 sri jberger: honestly, i guess we should have been doing a better job with mode separation from the beginning
13:23 sri like defaulting to "testing" mode in tests or so
13:40 Janos joined #mojo
13:56 vicash sri: that would be awesome if Test::Mojo automatically set MOJO_MODE to "testing" or "test". Currently, I have to set $ENV{MOJO_MODE} in each unit test file
13:56 Janos joined #mojo
14:11 stryx` joined #mojo
14:13 rshadow joined #mojo
14:16 * jberger tries to decide if he likes Test::Mojo automagically setting MOJO_MODE
14:17 jberger I'm not saying I don't I just don't know yet
14:21 mcsnolte joined #mojo
14:24 CandyAngel My abuse of Mojolicious has created victory! :D
14:24 CandyAngel I mean, use
14:27 polettix joined #mojo
14:29 Atog YAY
14:40 vicash jberger: another way is to auto-load myapp.testing.conf or similarly named config files just like the development/production config files get auto-loaded.
14:41 jberger CandyAngel++
14:41 jberger vicash: those don't get auto-loaded
14:42 CandyAngel jberger: It helped with reverse engineering USB packets :)
14:42 jberger daemon/morbo automatically set MOJO_MODE to development unless otherwise set, hypnotoad/prefork do the same but production
14:42 jberger those are external though, Test::Mojo is inside a script
14:43 jberger CandyAngel: ouch, that sounds less than fun
14:43 vicash jberger: i see. i didn't know that. to clarify I am doing "local $ENV{MOJO_MODE} = 'test';" in each of my test files so that it is local to that test.
14:44 jberger <offtopic>Does anyone have a dotfile manager that they like? I'm thinking of adding a couple more dotfiles to my repo and it starts to get unmanagble</offtopic>
14:47 CandyAngel It wasn't too bad. Mojo::IOLoop allowed me to give the user instructions and then take the packets with what the user was doing so when I graphed the values later, I could see what actions caused what values :D
14:49 CandyAngel https://ibin.co/2zYtvwok9V0j.png
14:50 CandyAngel For example, this is a graph of byte[12] of the payload
14:50 CandyAngel Shows that byte 12 is most likely involved with ROLL ^_^
14:50 jberger that sounds like a great blog post!
14:51 jberger (hint hint)
14:51 vicash CandyAngel: yes please write a blog post so we can learn more
14:52 CandyAngel Hmm.. I could write it up for VRonLinux!
14:53 vicash jberger: i use Rex (rexify.org)  to manage dot files and deploy it on various servers for the same user account. the dotfiles are stored in an internal SVN repo along with the Rex file and with one command i can deploy it to all my servers from a central location.
14:55 jberger personally I think Rex is heavier than I want to get into for this application, but you do make an interesting point, it could be in the same repo as the dotfiles themselves
14:58 vicash jberger: it may be heavy but once you start using it, you can end up managing all your linux servers/VMs etc with it.. and i mean package management, CPAN upgrades, custom repos, building and installing custom libraries across systems . and it works well with different Linux distros too... i have a mix of Debian and Ubuntu and I can write the same command/function and both distros are handled appropriately
14:58 jberger vicash: for servers etc we already have large sets of ansible
14:58 jberger this is just for my personal dotfiles
14:59 vicash jberger: yes then you may want to use Ansible for dotfiles too... there is no simple solution.. otherwise rsync
15:05 itaipu joined #mojo
15:13 rshadow joined #mojo
15:19 asarch joined #mojo
15:27 zivester joined #mojo
15:42 blonewolfs joined #mojo
15:45 kryp joined #mojo
15:47 blonewolfs i'm having a problem with query params.  one of my params has spaces in it like: '389-ds-base 1.2.8.2-1.el6 x86_64'.  when i put it in a variable with my $pkg = $self->param('pkg'); and then print the variable, it only shows: 389-ds-base.  what am i doing wrong?
15:52 VVelox joined #mojo
15:52 vicash blonewolfs: you can use Mojo::Util::url_escape() to escape the spaces if it is in your controller...
15:53 blonewolfs vicash:  thanks.
15:59 jberger vicash: I just stole this https://github.com/jberger/dotfiles/blob/master/install.sh (and slightly modified it) from someone at $work
16:28 disputin joined #mojo
16:28 dod joined #mojo
16:30 kes joined #mojo
16:30 kes joined #mojo
16:38 kes joined #mojo
16:41 disputin joined #mojo
16:47 disputin joined #mojo
16:54 disputin joined #mojo
17:05 itaipu joined #mojo
17:18 xinming bpmedley: Thanks, I think I know the idea.
17:18 xinming set the job finished, then, we make it retry
17:22 xinming I still got some confustion on how the queue is implemented, When the job is enqueued, Will all "workers" receive the new job? Or, It's distributed by the server one by one.
17:23 preaction a worker will ask for a job to run (dequeue) and then it will run it. one worker gets the job
17:25 xinming Ok, Thanks, I thought It's server who inform workers to get the job. :-)
17:25 xinming Let me check again. :-)
17:25 xinming let me think it over agian.
17:27 Janos joined #mojo
17:33 xinming preaction: So, for a worker, We need either a timer or a loop to pull jobs from the "server", Can it be safely used with IO::Async::Procss?
17:33 preaction are you asking how Minion works, or are you writing your own job queue?
17:35 preaction were you the person who was earlier asking about using Minion and Catalyst together?
17:35 xinming preaction: Nope, I'm trying to implement worker in minion, and wish to know how it worked. :-)
17:35 xinming preaction: certainly not.
17:35 sri you don't
17:36 sri http://mojolicious.org/perldoc/Minion#DESCRIPTION
17:36 preaction Minion _is_ a worker. you run the "minion worker" process and you have a worker. your job could use IO::Async::Process, but it doesn't need to, because blocking in a minion job is fine since it's not part of the user's request
17:38 xinming I'm not talking about user's request actually,
17:38 xinming What I'm asking is job control in worker.
17:39 xinming Yesterday I asked about a question that 16G ram, and some job may need 8G, some may need 4G, and we can have 8G+4G and 4G+4G+4G jobs running in parallel.
17:39 preaction sounds like you want mesos
17:39 xinming so, I need to think about how job control implemented in minion in this case.
17:39 preaction http://mesos.apache.org
17:40 sri talking about minion, this change could use some feedback https://github.com/kraih/minion/commit/a42fae8a19439f1095c5b55bcca18f5b638a1ee3
17:40 xinming sri: I did read the doc, But since this is my first time using a job queue. I don't fully understand how minion worked. :-)
17:41 jberger sri: have we pinged crab over that?
17:42 xinming preaction: I don't think I need that, I just need to do some job control with limited ram resource.
17:42 preaction which is what mesos is designed to do, and minion is not
17:43 xinming It seems mesos is a bit "big" for my purpose
17:44 preaction you could do what jberger did for us and make your own dequeue method which takes into account whatever you want, like resources on the machine. i think sri mentioned that a custom minion backend could be used so as to minimize the changes you need to make
17:44 preaction (but that's not how we did it, but anyway)
17:44 jberger preaction: the first version of it was an extended minion backend
17:44 jberger I really WANTED to do it that way
17:45 jberger but I eventually had too many competing needs
17:45 jberger s/competing/mismatched/
17:45 jberger but any two or three of them would have been ok
17:45 xinming jberger: What have you done to the minion?
17:45 preaction that isn't an accusation. i'm just explaining what we did
17:46 jberger oh, I know, I was just providing context, that indeed such an extension is possible
17:46 jberger xinming: I ended up writing my own job runner, which may be open sourced at some point
17:46 jberger but not for a while yet
17:46 jberger job dependencies was backported from that effort actually
17:47 xinming jberger: Ok, So, It seems I need to write my own runner for this too.  *_*
17:47 jberger xinming: this was the last version that was still a minion backend: https://gist.github.com/jberger/3cb978b1a376b87f5f3bff827c13f96d
17:48 jberger I copied the Pg backend (it was still pg backed) and the tests and started adding features and tests
17:48 jberger you can do the same for your own purposes
17:48 jberger (don't put it on CPAN unless you intend to maintain it of course)
17:48 jberger (and properly attributed etc)
17:50 eseyman joined #mojo
17:53 irqq joined #mojo
18:45 PryMar56 joined #mojo
18:49 PopeF joined #mojo
18:58 xinming Just curious, I saw that we can have plugin Minion => {Pg => 'postgresql://sri:s3cret@localhost/test'};
18:59 xinming We can have  plugin like to enable the command for the myapp.pl, Is it possible to make the config not hard code in the myapp.pl?
19:00 xinming ignore me, Just realized we can have it in %ENV
19:00 preaction yes, you can use the Config plugin to get the config from a config file
19:00 preaction or ENV, whichever
19:05 stokachu joined #mojo
19:07 stokachu joined #mojo
19:18 kryp joined #mojo
19:48 mishanti1 jberger: was it you who had done some fiddling with Lets Encrypt? Strong feelings on the various clients?
19:48 jberger mishanti1: it was indeed me
19:49 Grinnz https://metacpan.org/pod/Mojo::ACME this guy on the right
19:49 mishanti1 Looking at acme-tiny for doing automated setup and renewals. Looks to be able to work nicely.
19:49 jberger as for opinions, I wrote a plugin which does a lot of the work for you, including handling challenge requests
19:49 mishanti1 Grinnz: Will check it out. :)
19:49 jberger it was based on acme-tiny
19:49 Grinnz ive just been using acme-tiny too. since i'm not actually running mojo apps
19:49 jberger if you don't want the plugin then I recommend acme-tiny
19:50 jberger Grinnz: yeah, I need to make mine friendlier for non-mojo usage
19:50 jberger but it isn't so urgent because acme-tiny exists
19:50 Grinnz indeed
19:53 mishanti1 I've got nginx in front of mojo, so I'm _guessing_ it'll be easier for me to just let puppet throw the correct stuff together for nginx, and fire up acme-tiny. But I must say the mojo-plugin looks very interesting.
19:55 mishanti1 Oh wow. That's not a lot of code.
19:55 tholen_ joined #mojo
19:56 mishanti1 Hehe. I wonder how huge that module would be if it wasn't for the goodies that Mojo provide.
20:04 jberger mishanti1: there is some amount of code in the command too
20:04 jberger but yeah, it was nice
20:04 jberger especially given what it is doing
20:17 xinming If I write a script which is something like   my $minion = Minion->new(...);   while (my $job = $minion->repair->worker->register->dequeue(1)) { $job->perform }
20:18 xinming Why won't the worker get the "job"?
20:18 xinming Is it possible that different timezone may also cause the  problem?
20:20 xinming Or do I miss something?
20:20 jberger xinming: you shouldn't need to register the worker on each iteration
20:20 jberger nor repair
20:21 jberger that doesn't affect getting the job though
20:21 jberger (unless the worker unregisters once no longer referenced)
20:22 xinming jberger: I need to explain, That I write a normal perl script, Which doesn't   use Mojolicious::Lite;
20:22 jberger why?
20:23 xinming What I've done is just something like,    use strict; use warnings;  use Minion;   ...
20:23 jberger you can quite easily make a shell application which then uses minion
20:23 jberger I mean, what you are doing is possible
20:23 xinming yes, What I think is, how they worked. :-)
20:24 jberger ok, you are certainly welcome to explore for learning purposes
20:24 xinming I'm new on Mojolicious.
20:25 polettix hello all
20:25 purl It's a crazy world, but hello to you too!
20:27 polettix I have a deployment with a nginx acting as reverse proxy and terminating TLS, using a backend Mojolicious app that uses websockets. The nginx configuration has X-Forwarded-Proto set etc. etc.
20:29 polettix I noticed that the url_for(…) the websocket is set to ws:// instead of wss://
20:29 polettix is there any hint on how to change this?
20:29 pink_mist did you set the mojo env var that tells it it's being proxied to?
20:31 pink_mist http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#PSGI-Plack mentions it
20:31 polettix fang-tastic, I’ll try that immediately thanks!
20:31 pink_mist (arguably it should be mentioned in the nginx and apache mod_proxy configs too
20:31 pink_mist )
20:34 polettix worked like a charm, thanks
20:41 jberger polettix / pink_mist : it is also configurable via the hypnotoad settings: http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Hypnotoad
20:46 itaipu joined #mojo
20:47 xinming jberger: Do you have idea idea on how I can write a shell application which just uses Minion?
20:48 xinming I mean url on these topics is enough.
20:48 xinming w
20:48 jberger xinming: I haven't done that, and unfortunately I don't have time to walk someone through learning in that (very intensive) way
20:50 xinming Ok, I won't use that approach
20:50 xinming Will rewrite some of my scripts. :(
20:51 jberger sorry, I don't mean to squash your curiosity
20:51 jberger I'm at $work and even if I werem
20:51 jberger weren't, I'm presenting at Chicago.pm this week
20:51 jberger so I have to write the talk
20:51 xinming Ok.
20:51 xinming :-)
20:53 stokachu joined #mojo
20:53 kryp joined #mojo
21:05 lluad joined #mojo
21:09 xinming http://paste.scsys.co.uk/537677    <-- Anyone here knows why will this script doesn't dequeue job correctly please?
21:09 xinming the code is saved in worker.pl
21:09 xinming And in db backend, I tried something like, select * FROM minion_jobs
21:16 xinming BTW, the db can be connected correctly via cli.
21:16 xinming and there is an inactive job.
21:57 Janos joined #mojo
22:19 ssm joined #mojo
22:50 tchaves joined #mojo
23:20 zivester joined #mojo
23:25 Sebbe joined #mojo
23:40 cstamas joined #mojo
23:56 bpmedley xinming : Howdy, do you desire using Minion without Mojolicious::Lite?

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary