<     May 2017     >
Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6  
 7  8  9 10 11 12 13  
14 15 16 17 18 19 20  
21 22 23 24 _2_5 26 27  
28 29 30 31
00:04 sfbw joined
00:05 harrow joined
00:06 ivan joined
00:09 micmus joined
00:12 pesnk joined
00:13 cevado joined
00:20 srxa_ joined
00:23 nighty-- joined
00:30 kronicdeth joined
00:32 Reshi joined
00:33 <Reshi> Is there a pretty way to log phoenix socket messages on the client in development? I am using `console.log` as the `logger` option for the socket for now. Is there something prettier?
00:33 nighty-- joined
00:34 <Ankhers> Reshi: What exactly are you looking for?
00:39 griffinbyatt joined
00:40 Cohedrin joined
00:42 mmonkey joined
00:46 jhack joined
00:49 zodiak_ joined
00:50 <asonge> Reshi: you can use whatever the node ecosystem provides. Phoenix just gives you some reasonable brunch defaults and lets you go
00:50 sfaxon joined
00:54 sevenseacat joined
00:55 zodiak_ joined
00:56 codestorm_ joined
00:57 yonkeltron joined
00:58 <codestorm_> I need to make a simple web service that resizes an image given a URL and size. Any suggestions for a package I could use for that?
00:59 <Radar> codestorm_: https://imgix.com <- seems like you already built it?
00:59 <sevenseacat> lol
00:59 <Radar> Why re-invent that particular wheel?
01:00 <yonkeltron> codestorm_: Does this section of the list have anything you can use? https://github.com/h4cc/awesome-elixir#images
01:00 <codestorm_> actually, there's a DB lookup involved, sorry, I oversimplified
01:01 <yonkeltron> codestorm_: Ok so Phoenix might be a little heavy for you, then?
01:01 <codestorm_> yonketron, thanks, i was just going through that list
01:01 <codestorm_> this is one endpoint of a larger API, so I'm using phoenix
01:01 <Radar> codestorm_: What does the DB lookup do?
01:01 <yonkeltron> codestorm_: ok so have you got Ecto laying around?
01:01 <yonkeltron> codestorm_: also Radar asked the $64 question.
01:02 <codestorm_> the DB lookup finds the image URL
01:02 <codestorm_> yes, I'm using Ecto as well
01:03 <yonkeltron> codestorm_: you have several different concerns here, right?
01:03 kronicdeth joined
01:03 <Radar> codestorm_: uh, imgix handles that one too. If the image doesn't exist on their server they'll fetch it from a preconfigured location on your own.
01:04 <Radar> https://docs.imgix.com/setup/serving-images <- See "Web Folder Sources" here
01:04 <Reshi> asonge: Yeah I am passing the function `console.log` I just wanted more colors haha
01:04 <yonkeltron> codestorm_: are you doing this for learning how to do it or to get it done? If the latter, listen to Radar.
01:05 sfbw joined
01:06 icecreamcohen_ joined
01:06 <codestorm_> this is for a real project. I could suggest using a service like imgix
01:06 <yonkeltron> codestorm_: Radar's point, that this goodness already exists, shouldn't go underappreciated.
01:07 cevado joined
01:08 <yonkeltron> Radar: how did you find imgix that fast?
01:08 <codestorm_> thanks for the suggestion, I'll bring it up
01:08 <Radar> yonkeltron: I have experience with this sort of thing. Worked on an ecommerce project that used it to serve images of products
01:08 <yonkeltron> Radar: that's so cool!
01:08 <yonkeltron> Radar: Thanks for teaching me about something new. I'll keep this one in my back pocket...
01:09 <Radar> yonkeltron: Yes it is :) We were serving images from our local server. We noticed that page load times were slow because where we were serving the requests from wasn't close to the user. The majority of the request time was images, and so we looked into image CDNs, found imgix and started using it. It really helped cut down the response times.
01:09 <Radar> We also uploaded the images to an S3 bucket as they were uploaded so that imgix would read from S3 rather than our own servers.
01:09 <yonkeltron> Radar: Just curious, do you happen to recall the delta?
01:09 <Radar> Nope, sorry. It was 2 years ago nwo
01:10 <yonkeltron> Of course, of course. Even so, very cool.
01:10 <codestorm_> thanks again, all, I'm out for now
01:10 <Radar> np :)
01:11 <yonkeltron> codestorm_: be well!
01:14 bobbobbins joined
01:21 liuzhoou joined
01:27 sfaxon joined
01:29 <asonge> yonkeltron: if you want a free cdn, cloudflare is a thing.
01:29 <Cloudflare> I'm free anytime ;)
01:29 <asonge> unfortunate nickname there
01:30 <bobbobbins> Hey,
01:32 <bobbobbins> I'm trying to set up a messaging service in phoenix, and i have a fairly boilerplate module created for creating my channel and consuming messages, but I want to be able to pass in a function as the consumer so I can reuse the module. When I pass a consumer into Basic.consume though, it stops recognizing my handle calls...I'm very new to this so I'm not sure what is going on here, but any help is appreciated...code
01:32 <bobbobbins> is here: https://gist.github.com/anonymous/949c86534bdb07b0793d4889be4de36f
01:33 dj_goku joined
01:37 proteusguy joined
01:37 <asonge> bobbobbins: and there are no crashes or errors or anything?
01:38 icecreamcohen joined
01:38 tomterl joined
01:40 griffinbyatt joined
01:40 <bobbobbins> asonge: ah, I suppose showing the error would help, sorry...let me find it
01:42 zodiak__ joined
01:42 <bobbobbins> ** (FunctionClauseError) no function clause matching in :amqp_network_connection.handle_message/2
01:44 <bobbobbins> this gist is better, it shows how I'm trying to pass the consumer: https://gist.github.com/anonymous/f3b6ab12d84213bce47c3cda2a79106a
01:44 <bobbobbins> (line 26)
01:46 Zeptepi joined
01:46 Zeptepi left
01:47 fmccann joined
01:48 sfbw joined
01:49 ssswitch joined
01:49 liuzhoou joined
01:51 mika_ joined
01:53 hugo_dc joined
01:55 justelex_ joined
01:58 <asonge> bobbobbins: well, on line 28, i'd get rid of the 1-tuple {:ok, channel} is what you probably want
02:00 aedigix joined
02:00 <asonge> bobbobbins: also, the pattern match on 13 should probably be changed Keyword.* api, as that will only match options that are in order (keyword lists are unordered, but list matching is ordered)
02:01 cevado joined
02:02 cschneid_ joined
02:03 <bobbobbins> asonge: good call, of course that is one of the only lines i added...shows I don't know what I'm doing yet
02:03 <asonge> bobbobbins: if you mind running this again, and putting a gist of the full error and the module together (so i can be confident about the line number), that'd help
02:03 <bobbobbins> sure, one sec
02:03 cschneid_ joined
02:06 kronicdeth joined
02:11 <bobbobbins> here you go: https://gist.github.com/aztecapps/b5141abbd3c0d045580e02dfdadd1237
02:13 <asonge> bobbobbins: error on line 13, replace `= args` with `= Map.new(args)`
02:14 elgenie joined
02:15 <bobbobbins> ok
02:17 <bobbobbins> updated it with the new error message
02:17 liuzhoou joined
02:17 __charly__ joined
02:18 papachan joined
02:19 <asonge> bobbobbins: okay, so this is gonna be fun. the basic.consume tuple is a record, not a 2-tuple with the event and a map
02:20 <asonge> a record is an erlang thing...some syntax around a tuple
02:20 <bobbobbins> asonge: haha, that sounds like greek to me
02:21 <asonge> oh wait
02:22 <asonge> strike that, i need the ConnectionService
02:22 <asonge> that's where the error is.
02:22 <asonge> not ChannelService
02:22 <bobbobbins> oh ok, one sec
02:22 <bobbobbins> also if it helps, I was using this as my guide for this: https://medium.com/@oivoodoo/elixir-and-rabbitmq-d6bb63419b87
02:23 <bobbobbins> connection service has been added
02:27 notdaniel joined
02:29 <asonge> bobbobbins: so, it seems to probably be dying at line 23 of channelservice in the latest paste, but still trying to reason it out...
02:31 <bobbobbins> that's where it attempts to reconnect if it fails...I'd imagine since the error starts in ChannelService, it dies somewhere between lines 33 and 39
02:32 <asonge> bobbobbins: take out [arguments: ] in the options, for one thing
02:32 <asonge> i had to read the code, as the options aren't documented :/
02:34 <bobbobbins> what line are you referring to with [arguments: ]?
02:36 <asonge> 23
02:36 <asonge> channelservice
02:36 <bobbobbins> oh...wrong file....i see it
02:37 <bobbobbins> it actually runs with no errors now that that is gone
02:38 <asonge> it took reading the amqp source
02:38 <bobbobbins> I had to read the source to see if I could even pass in arguments like that..I guess I read it wrong though and thought it needed that arguments thing
02:39 <asonge> you were really close
02:39 <bobbobbins> well it starts with no errors now, but when I try to send a message it dies
02:39 <asonge> progress \o/
02:40 <asonge> see if you can reason about what the error means?
02:40 <bobbobbins> yeah, I'll take a crack at it for a bit to see if I can figure it out
02:40 <bobbobbins> thanks for your help
02:40 <asonge> just mention me if you get stuck in an hour, i'll probably still be around
02:41 griffinbyatt joined
02:41 <bobbobbins> will do, thanks again
02:44 wong2 joined
02:49 codestorm joined
02:52 Talltree joined
02:52 mika_ joined
02:54 kronicdeth joined
02:54 Cohedrin joined
02:55 Tica2 joined
02:56 cevado joined
02:58 codestorm joined
03:15 dj_goku joined
03:15 dj_goku joined
03:15 rodolfojcj joined
03:16 elgenie joined
03:23 ur5us joined
03:26 Talltree joined
03:40 codestorm joined
03:41 griffinbyatt joined
03:48 sfbw_ joined
03:50 cevado joined
03:53 larshesel joined
04:05 gvaughn joined
04:18 <Nicd-> micmus: no, thanks to you for writing it!
04:24 notdaniel joined
04:31 <wwwd`> Nicd: Thanks for suggesting PUtting Contexts in Context...it was a pretty good read!
04:33 <wwwd`> Would it be correct to say that contexts are just a way of oganizing data and functionality?
04:37 <Nicd-> from what I understand yes, but I have not used them myself
04:40 <wwwd`> Fair enough! I'm getting the impression that it is fairly arbitrary and dependent on the app.
04:42 griffinbyatt joined
04:44 akeating joined
04:44 cevado joined
04:51 <asonge> wwwd`: the way i like to think about it is, if you were to imagine using your app from the shell to do things, what would you want the interface to look like?
04:52 <asonge> then you just wire stuff up from the controllers that way, and then return the stuff to the views/templates.
04:54 <wwwd`> asonge: Does it have to do with controlling/using side effects?
04:55 cemilowski joined
04:55 <asonge> wwwd`: no. it mostly has to do with centralizing concerns, and separating http-specific stuff from the "general case". it's a good layer to inject stuff at (or hook into for testing)
04:55 <asonge> if that makes more sense
04:55 <asonge> you'll have to test side effects at some point anyway
04:59 RexM joined
05:07 <wwwd`> asonge: "Centerlizing" or isolating concerns? The way that I was thinking about it is that it allows you to keep functionality with data. So, I might have an "Accounts" context with functionality to add, update, and remove users. I might also have a "Orders" context where I request a specific user account and use it to place an order. So in the "Order" context I might have funcionality to select items, or to check that the user is
05:07 <wwwd`> allowed to make a transaction. E.g the user is old enough to download adult content or lives in a state where it is legal for them to buy pot online. Then in a "Payment" context I would have functionality to process CC payments and such. Am I even in the ball park?
05:07 bobbobbins joined
05:07 junsuijin joined
05:07 dec0n joined
05:08 <asonge> wwwd`: pretty much
05:09 <asonge> wwwd`: one of the problems that happened is that models became synonymous with tables, but models should actually be more like "mental models"
05:10 <asonge> so, your context is where you express your mental model, which is more than just the fields in a table, but how all the fundamental pieces of your application fit together to form a coherent whole
05:10 Cohedrin joined
05:11 sevenseacat joined
05:11 <asonge> so like, at first phoenix was reacting to "fat models", where all the logic was stuck in implementation-specific abstractions (database table/object hybrids that did validation and state and everything), but the first recommendation was just to stick it in controllers for now. i think the intention was always to have a rich layer, but it wasn't really
05:11 <asonge> *named* well.
05:11 <asonge> and names are kinda important
05:12 <sevenseacat> contexts are just moving non-web-specific logic out of controllers, so it can be reusable by other clients, such as a CLI or tests
05:13 <asonge> i used that explanation earlier, but i do think something deeper is going on...it's just hard to explain that deeper thing.
05:14 mika_ joined
05:14 <sevenseacat> ah right. yeah I haven't used them in the phoenix sense yet (I wanted to say 'in the context of phoenix' but that would just be... no) but the concept makes sense to me
05:14 marr joined
05:15 <asonge> haha, names are funny things.
05:15 <sevenseacat> aye
05:16 <wwwd`> Actually, one of the things I was strugling with before I started reading about 1.3 was how to differentiate between "Users" and "owners"...both of which are from the persons table. What i was thinking is that I would have two different routes with their own controllers and models. So the "owners" route would pull the "person" from teh database and manipulate it in ways that were specific to "ownership" and then put it back. Not sure if
05:16 <wwwd`> that would have worked but it was where my head was going...
05:19 <asonge> wwwd`: were you going to do that to avoid passing a user id that's in the session anyway?
05:21 <bobbobbins> asonge: turns out I was using the wrong approach earlier, I ended up accomplishing what I needed to much easier a different way, but debugging that issue definitely helped me learn more about matching, I think its starting to make sense.
05:21 <asonge> awesome
05:21 <bobbobbins> asonge: i do have one quick question though...hahah
05:22 <asonge> go ahead
05:23 <bobbobbins> asonge: if I have a unrelated function, is there a way to get that connection somehow?...I'm assuming genserver has a method to access persistent connections without having to pass in the connection to every function...am I wrong in thinking that?
05:23 <wwwd`> asonge: I was thinking it would allow me to keep functionality that shared data but had a different orientation(?) in the system seperate. So, I wanted to have a single source of persons...but in my mind a user who might register a student for a class or a pet with a jurisdiction is diffent than a student or a pet owner. And the requisit functionality is different. It seems that this differnce goes beyond user roles...
05:23 <asonge> bobbobbins: you mean the http connection?
05:24 meandi_2 joined
05:24 <wwwd`> asonge: basically, I was trying to limit my concerns with in a given route.
05:24 <bobbobbins> asonge: the rabbitmq connection...I want to post a message to that channel from a plug
05:25 <asonge> bobbobbins: you might want to use the Registry functionality in the latest elixir, it lets you "route" to a genserver using an arbitrary elixir term as a name, not just atoms
05:25 <bobbobbins> asonge: cool, I'll check that out, thanks
05:25 <asonge> bobbobbins: either that, or add it to the "state" you return in `init`, if it's always the same all the time.
05:26 <bobbobbins> awesome, got it
05:26 <asonge> wwwd`: that might work, but you could use function guards to branch on ownership
05:29 <wwwd`> How do you mean "branch on ownership"?
05:31 <asonge> you can pattern match if a session "owned" a resource if you pass in the current user and the resource has the information on who owns it attached
05:31 <asonge> and put the ownership case on top, and the general case after
05:31 <asonge> if they share logic, moved the shared stuff to a private function
05:38 <wwwd`> I didn't think of that! In fact I'm gonna need to think about it some more! ;)
05:42 <wwwd`> In terms of contexts I was thinking I I would have a tables for "persons", "users", and "owners". The contexts would be "Users", and "Owners". Then I the user would request or create an owner with a fk to "persons". Then the functionallity to manipulate the owner would be in the "Owners" context...
05:43 griffinbyatt joined
05:55 cemilowski joined
06:02 notdaniel joined
06:06 liuzhoou joined
06:07 liuzhoou joined
06:13 cemilowski joined
06:30 liuzhoou joined
06:32 tuacker joined
06:33 cevado joined
06:39 sfbw joined
06:40 Guest67 joined
06:40 mattyw joined
06:45 griffinbyatt joined
06:46 manukall joined
06:46 ur5us joined
06:55 mozzarel1 joined
06:56 <OliverMT> asonge: I just think its pretty weird to use "context" when the rest of the world already describes exactly what you are saying with "service"
06:57 <OliverMT> phoenix is reinventing spring ioc with a new word .P
06:57 <asonge> except it isn't a service.
06:57 <OliverMT> :p
06:57 flaviodesousa joined
06:57 <OliverMT> oh it is indeed, *nothing* a context does is outside the scope of a service
06:57 <OliverMT> its a data translation layer capable of handling multiple models/tables/whatever data backend
06:57 <asonge> doesn't a service imply state?
06:57 <OliverMT> I think using context has confused a lot of people
06:57 <OliverMT> no a service is something you use to maybe ALTER state
06:57 <OliverMT> but it doesnt always HOLD state
06:58 <OliverMT> there is a big movement of functional-programming-like style for spring java
06:58 <OliverMT> where your services are basically FP styled acting on various data models
06:58 <OliverMT> you would basically use a service whenever you needed to do something with more than one hibernate model
06:58 <asonge> given that there are already servers, i don't really like having services around. and you can't reuse "business model"
06:58 <asonge> which is what it actually is
06:59 <OliverMT> but why change something that works
06:59 craigp joined
06:59 <OliverMT> regardless of what you think of the naming, a context is a "service" as the de facto meaning of "service" in java and c# world
06:59 <asonge> because programming languages each create their own ontologies and you can't just import stuff over straight and have it make sense?
06:59 <OliverMT> which covers like 70% of enterprise developent between them
06:59 jkreeftmeijer joined
06:59 <OliverMT> this isnt about the language though
06:59 <asonge> everything is about the language.
06:59 <OliverMT> a context has zero to do with elixir
07:00 <OliverMT> its a pure framework construct
07:00 <asonge> it's an ontological entity.
07:00 <asonge> it's a name for a concept, and the concepts of other languages don't map on so neatly, imho.
07:01 <asonge> services also imply a much more narrow silo'ing of concerns, and i don't think that's what contexts do.
07:01 <OliverMT> what does a context do that doesnt fit the concept of a service?
07:02 <OliverMT> the whole reason the service nomenclature and way of doing things arose is exactly identical to the discussions in the phoenix mailing lists and elixirforum prior to contexts being born
07:02 <OliverMT> you can say fancy philosophy words and all that, but the fact is that the *very* main reason contexts were born was that people had shitloads of logic in controllers
07:03 <OliverMT> and then you end up in a situation where you cant reuse that logic to set up test db fixtures
07:03 <asonge> i'm reading the stuff on services in spring, and it's not mapping over well.
07:03 <OliverMT> or you end up having to do rest calls to set up a sample db, or just using the db models directly
07:03 <OliverMT> it depends where you read, spring design is about as fragmented as christianity :P
07:03 <asonge> except contexts aren't *just* that.
07:03 <OliverMT> you still havent said anything of what you think contexts do
07:03 <OliverMT> that a service wont cover
07:04 <OliverMT> a context is a boundary
07:04 <OliverMT> which is what a service is
07:04 <asonge> contexts are the place where you do use db models directly, but it's also the place where you can interact with transient state and other "services"
07:04 <OliverMT> so you are saying a service cant speak to other services?
07:04 <OliverMT> or whats the argument
07:05 <asonge> that when i think of service, outside of any framework concept, i'm thinking of something like "the thing i use to talk to an API that uses a pool of connections" or something like that.
07:09 <asonge> i think there's a real goal of getting rid of the implications of just doing CRUD in a specific layer of a set architecture, and pushing crud inside a some business logic that stands on its own. if you deleted all the phoenix code, you should be able to still fully understand your application and use it from the CLI as a well-supported interface that is
07:09 <asonge> fully idiomatic.
07:16 <asonge> OliverMT: i guess instead of viewing contexts as a layer, i imagine it as the center of everything, and phoenix controllers talks with the context, and the context performs all actions (CRUD, talking to an API, querying ephemeral state, etc) by talking to things outside the context.
07:16 <OliverMT> thats what a service does
07:16 <OliverMT> the only thing our controllers do is handle acl (through calling services after a plug decoded jwt info)
07:16 <asonge> for a well-understood concept, google isn't showing me much of anything like that.
07:16 <OliverMT> then route to a service
07:17 dkh joined
07:17 <asonge> "then route to a service" this doesn't seem like the right verbiage at all.
07:17 <OliverMT> you route the program
07:17 <OliverMT> not as in a router
07:17 <OliverMT> call the service then
07:17 <OliverMT> a controller pulls data out of a json service, checks acl, calls service, sends data back to the caller in a controller specific format
07:18 <OliverMT> that is *exactly* what the goal of a context was
07:18 <OliverMT> do be able to move all the handling logic out of the controllers
07:18 <asonge> that's one goal.
07:18 <OliverMT> the very main goal
07:18 <asonge> i don't think it was the main goal, actually
07:18 <OliverMT> you are a very abstract person when it comes to programming, being able to discuss semantics and concepts all day
07:18 <OliverMT> so you have a lot of things you care about in there
07:18 <sevenseacat> *popcorn
07:18 <OliverMT> but I am dead certain that the main reason contexts came into play
07:18 <OliverMT> is that the generators made people make bad code
07:19 <OliverMT> since it made newbies put everything in the controller
07:19 <OliverMT> I am not saying there are other benefits, but its the bread and butter of why contexts saw the light of day
07:19 <OliverMT> thats my impresison from just following passively on the forums at least
07:19 <asonge> it's more than just an organization question, imho. and i wasn't the only one thinking about this in this way. a few people are pushing hard for making a living idiomatic application.
07:19 <OliverMT> and GH discussion threads
07:20 <OliverMT> you are describing a organization question above here
07:20 <sevenseacat> i think thats overly simplified
07:20 <OliverMT> you cant separate the logic to use it in a cli withoug organizing it outside the controller
07:20 <OliverMT> they wanted phoenix to be a simple web layer, speaking to your "app"
07:20 <OliverMT> so web/ was gone, lib/ got a resurgence and you now put your logic in contexts
07:20 <asonge> right. contexts are just the "app modules", because you have to give it a name for people to do it.
07:21 <OliverMT> yes.. which is the whole reason a service exists in java EE land
07:21 <OliverMT> because there are a lot of consuming sources that are not just from REST or SOAP
07:21 <OliverMT> RPC in abundance etc
07:22 <asonge> sevenseacat: i'm going to have to pop popcorn now, btw.
07:22 <asonge> and i'm supposed to fold clothes later :P
07:22 <sevenseacat> haha sorry
07:22 mark_66 joined
07:23 <sevenseacat> these conversations just seem to be happening a lot and everyone talks past each other because they're saying very similar things in different terminology (as far as I know)
07:23 <asonge> OliverMT: i think that having to solve the code organization was the symptom of the problem, and that from what i'm reading, people think of services pretty narrowly as part of the framework ecosystem.
07:23 <asonge> sevenseacat: right, it's a semantics problem.
07:23 <asonge> (literally)
07:23 ur5us joined
07:23 <asonge> a problem about the meanings of words and the kinds of mental models they can correlate to
07:23 <asonge> and what things actually exist in the language
07:23 <sevenseacat> like, a service here seems to mean something very different in java EE land than say in Rails land
07:25 <asonge> also, one thing that springs to mind (hehe) when i hear service is something like how angular 1.0 worked. i've not looked at any angular since then.
07:25 <sevenseacat> spring also means something totally different in java and rails
07:26 <sevenseacat> isnt programming fun!
07:27 cevado joined
07:27 hbraun joined
07:29 jkreeftmeijer joined
07:31 <* asonge> is working on a 5-min lightning talk titled "The End of Programming" that is really a rant about what even is programming and makes an argument that it's meaning (almost) all the way down.
07:31 <asonge> it belongs in a longer format, but i couldn't subject someone to that kind of punishment.
07:36 srxa joined
07:40 sfbw joined
07:43 <OliverMT> sevenseacat: but.. my argument was just that.. that they are the same thing with different names lol
07:43 elgenie joined
07:44 <asonge> OliverMT: if someone makes different code using the different concept, then it's not quite the same thing...even if they are identically described.
07:44 <asonge> or rather, you can express them in ways that are mathematically identical
07:45 <OliverMT> as I said, you are a very abstract guy who loves to muse philosophically about programming :D
07:46 <OliverMT> I'm about as far in the other end of the spectrum as possible, pragmatism uber alles
07:46 <OliverMT> and in my eyes, context is a confusing word that is more or less a synonym to a service nomenclature that already exists :P
07:46 griffinbyatt joined
07:47 <asonge> it's not like this doesn't play out in every language.
07:47 <Nicd-> I think we should also add Services and Factories and Providers to PHoenix
07:47 <OliverMT> they are both boundaries to separate concerns and they both encapsulate the storage layer for the outside world
07:47 <Nicd-> to have enough options
07:47 <OliverMT> no FactoryFactory Nicd- ?
07:47 <asonge> Nicd-: i like your joking style.
07:48 mika_ joined
07:48 PaReeOhNos joined
07:49 <Nicd-> my only problem with these contexts and umbrellas is that I don't have enough time to refactor everything to make use of them
07:49 <Nicd-> so I end up adding to the mess :(
07:50 <sevenseacat> i like umbrellas
07:50 <asonge> Nicd-: i think contexts make it easy to move to umbrellas
07:51 <Nicd-> yes, I just need to move to contexts
07:51 <Nicd-> but now all my time is going into refactoring the UI and some APIs
07:52 <Nicd-> funny how it's always that code I wrote a year ago looks awful
07:52 <OliverMT> a year ago??
07:52 <OliverMT> I puke in my mouth when I check out last months
07:52 <Nicd-> that also sometimes happens :D
07:55 ejpcmac joined
08:01 jkreeftmeijer joined
08:04 akeating joined
08:05 nd___ joined
08:14 stephen_m joined
08:14 PaReeOhNos joined
08:18 craigp joined
08:21 cevado joined
08:22 craigp_ joined
08:26 craigp joined
08:28 jkreeftmeijer joined
08:42 sfbw joined
08:47 griffinbyatt joined
08:53 fxn joined
08:56 inoas joined
09:02 tuacker1 joined
09:04 gregman_ joined
09:05 bananenmannfrau joined
09:07 srxa joined
09:09 mika_ joined
09:10 tuacker joined
09:12 ur5us joined
09:12 Reshi joined
09:15 cevado joined
09:17 bananenmannfrau joined
09:23 <m1dnight1> Hey guys, I'm trying to debug my slackbot but its a doozy. I am using the Elixir-Slack dependency,and sometimes the websocket fails, but for some reason that crash doesn't propagate to the root supervisor of that dependency, and my supervisor doesn't restart it
09:24 <m1dnight1> I tried killing the root supervisor of the dependency in observer, and that works fine, m y supervisor restarts everything
09:26 <m1dnight1> https://github.com/BlakeWilliams/Elixir-Slack/issues/120 This is the error im talking about and I would like to work around it, but I have no clue how to reproduce it
09:26 <m1dnight1> And since it happens only once every so often I have no idea how I could start fixing this
09:27 <ivan> you could port it to use https://github.com/Azolo/websockex instead
09:28 <m1dnight1> That could be an option, yeah. But I think I might learn a lot from fixing this, though
09:28 isubasti_ joined
09:32 cemilowski joined
09:35 <m1dnight1> One thing I'm trying to figure out is which process that it is that crashed. I have no clue to figure that out post mortem right?
09:35 <m1dnight1> Maybe I should print out all the pid's of the children/supervisors etc before I start so that next time it crashes I can find out which module it is that failed?
09:35 <m1dnight1> or is there a better approach?
09:36 slashrsm joined
09:36 squallstter joined
09:36 <micmus> m1dnight1: start the sasl application, it will log detailed reports when special processes (gen servers, etc) crash
09:37 <m1dnight1> well, I already did that, but I don't see any extra information t be honest
09:37 <m1dnight1> It prints it to stdout/err, right?
09:37 <micmus> for a gen server it should print the name (if registered), the current state, last message, etc
09:37 <m1dnight1> That I see, yeah
09:37 <m1dnight1> But there was no name for this process, so it's ind of hard to figure out where up in the dependency tree a process crashes.
09:37 <m1dnight1> I _guess_ it's not linked properly and thus doesn't propagate the failure into my application.
09:38 <m1dnight1> https://hastebin.com/hetedivuqe.php
09:38 <m1dnight1> This is one example of such an error
09:38 <m1dnight1> So I figure the "Data == {...}" is the state of the process, right?
09:39 <m1dnight1> That lead me to grepping through dependencies' source for "transport", "ssl_error" and whatnot, but can't really find something to go on
09:43 sfbw joined
09:43 <asonge> m1dnight1: yeah, Data is the state of the process
09:43 <micmus> it's a gen_fsm process, so yeah, the Data is like state for gen_server
09:43 <m1dnight1> Yeah I was just googling for the gen_fsm thing, and it seems that the entire application only runs a single gen_fsm
09:43 <m1dnight1> that has got to be it..
09:48 griffinbyatt joined
09:57 notdaniel joined
09:59 harfangk joined
10:06 isubasti_ joined
10:10 cevado joined
10:19 jkreeftmeijer joined
10:19 jkreeftmeijer joined
10:20 jkreeftmeijer joined
10:21 jkreeftmeijer joined
10:22 jkreeftmeijer joined
10:23 jkreeftmeijer joined
10:23 zv joined
10:23 jkreeftmeijer joined
10:25 jkreeftmeijer joined
10:26 isubasti_ joined
10:36 proteusguy joined
10:37 josevalim joined
10:41 bitmod joined
10:43 nighty-- joined
10:43 sfbw joined
10:47 isubasti_ joined
10:48 papachan joined
10:52 <m1dnight1> Just another small question, the "Data == {:context ..}", is the context part of the gen_fsm framework, or should I find a struct that contains this? Because I can't seem to find context using grep.
10:53 gmcabrita joined
10:59 dimitarvp joined
11:03 mattyw joined
11:03 griffinbyatt joined
11:04 mattyw_ joined
11:04 cevado joined
11:05 mattyw__ joined
11:06 tuacker1 joined
11:06 cevado joined
11:08 isubasti_ joined
11:08 tuacker joined
11:10 josevalim_ joined
11:17 craigp joined
11:17 mattyw joined
11:23 <micmus> Has anybody else experienced that when runing iex in releases TAB-completion does not work for aliased moduled?
11:25 jimmyrcom_ joined
11:27 jkreeftmeijer joined
11:28 isubasti_ joined
11:33 mika_ joined
11:39 griffinbyatt joined
11:41 <Ankhers> micmus: Is there anything I can do to help get the ecto-2 branch merged?
11:42 <linduxed> hey guys, i just noticed that when i try to compile erlware_commons get the following error: https://gist.github.com/linduxed/0ed8f931c97ce988c6c0e8602b81b898
11:43 mattyw joined
11:44 sfbw joined
11:47 cemilowski1 joined
11:49 cemilowski joined
11:49 isubasti_ joined
11:50 mika_ joined
11:52 jimmyrcom_ joined
11:52 craigp joined
11:53 kronicdeth joined
11:54 wong2 joined
11:54 cemilowski joined
11:54 sfbw joined
11:54 <micmus> Ankhers: one big thing left is porting over the query generator tests
11:55 <micmus> So everything that's commented in this file https://github.com/michalmuskala/mongodb_ecto/blob/ecto-2/test/mongo_ecto/normalized_query_new_test.exs
11:55 <micmus> (it's copied from the postgres adapter)
11:55 <micmus> here are the ecto 1 tests for those features - a lot can be copied over https://github.com/michalmuskala/mongodb_ecto/blob/ecto-2/test/mongo_ecto/normalized_query_test.exs
11:56 <Ankhers> Cool. I'll take a look at those over the next couple days. Is there anything within Ecto proper that needs to be changed?
11:58 <micmus> Adding tags to tests is probably the biggest one, I have some of those changes ready as well, I'll push them to ecto. This removes some of the failures you listed in https://github.com/michalmuskala/mongodb_ecto/pull/91
12:06 <m1dnight1> Argh, I can't figure it out. When I debug and the state machine crashes the supervisor just restarts it. But in production it doesn't.
12:07 rawkode joined
12:07 cristianR_ joined
12:08 <Ankhers> micmus: Aside from tags, is there anything that needs to be fixed within the ecto 2.0 branch? Either way, I can go through the tests an add tags.
12:10 rawkode joined
12:10 isubasti_ joined
12:11 <rawkode> Hey
12:11 <Ankhers> Hey!
12:27 sfbw_ joined
12:30 srxa joined
12:35 jkreeftmeijer joined
12:39 superherointj joined
12:45 mr_bmt joined
12:45 sfbw joined
12:48 JEG2 joined
12:51 <micmus> Ankhers: i pushed everything I got to both ecto and mongodb_ecto - there are only 9 failing tests now
12:51 dj_goku joined
12:52 <Ankhers> Awesome. I will take a look at what I can do over the next couple days.
12:54 <micmus> It looks like there's still some bug in ecto around schema loading - I'll also try to take a look at it
12:55 jordan0day joined
13:00 josevalim_ joined
13:00 ramortegui joined
13:04 gvaughn joined
13:04 kronicdeth joined
13:05 jerel joined
13:11 akeating joined
13:11 dustinfarris joined
13:12 nighty-- joined
13:18 cdg joined
13:19 griffinbyatt joined
13:23 ssswitch joined
13:24 <craigp> hey all
13:24 <craigp> ecto question, on insert_all
13:24 <craigp> I've noticed data disappearing from my db, worried about my use of `on_conflict: :replace_all`
13:25 <craigp> I'm going to look at the code, but the docs say ":replace_all - replace all entries in the database by the one being currently attempted"
13:25 <craigp> I take that to mean only replace the conflicting entries
13:25 <craigp> just making sure I'm right, and/or hoping I'm not hitting a bug
13:26 tomaz_b joined
13:30 <craigp> it _has_ to be related, since the tables where data is vanishing are only the one's i use :replace_all with insert_all
13:44 <benwilson512> I don't think it implies conflicting entries
13:44 harfangk joined
13:44 <benwilson512> you could create an issue and ask for clarification though
13:44 <benwilson512> ah wait this is for an on_conflict clause
13:45 <benwilson512> hm
13:45 <benwilson512> haven't used on_conflict yet sorry, ignore me......
13:45 Liquid_X joined
13:46 inoas joined
13:53 rodolfojcj joined
13:54 jkreeftmeijer joined
13:56 maxbeizer joined
13:59 tuacker1 joined
14:02 hashpuppy joined
14:07 zodiak__ joined
14:10 poland joined
14:10 akeating joined
14:15 zodiak_ joined
14:15 isubasti_ joined
14:20 griffinbyatt joined
14:21 cevado joined
14:22 samba6 joined
14:24 <samba6> hello
14:24 <Nicd-> hello samba6
14:24 <* samba6> is an elixir noob
14:25 <samba6> I am building an umbrella application
14:27 <samba6> say A and B are apps in the umbrella and B has included A has a dependency in its mix.exs file: {:A, in_umbrella: true}
14:28 <samba6> I know it is now possible for B to call functions declared in A. But is it possible for A to call functions declared in B?
14:28 <josevalim> craigp: what do you mean by data is missing? is there a chance it is not being inserted in the first place?
14:29 <josevalim> samba6: no, that's a cyclical dependency
14:29 <gazler> samba6: No. You can make another dependency with the shared function.
14:29 <gazler> Depends on the use case, there are other ways
14:29 memph1s joined
14:29 <josevalim> if you have cycles it likely means you haven't properly figured the dependencies between your apps
14:29 <samba6> Thanks jose
14:29 <craigp> josevalim: I mean that there are hundreds of thousands of rows in the table and when i looked again, it was empty, has happened multiple times, and only on the tables where I used insert_all with :replace_all, others are all fine
14:30 <craigp> which is three out of many tables, used for importing and tranforming data
14:30 <josevalim> oh wow
14:30 <josevalim> that's very weird
14:30 <craigp> yeah :/
14:30 <samba6> But what I actually want to do is pass data from B to A, and not necessarily call a function
14:30 <craigp> I looked through the ecto code but it's going to take a while to grok
14:30 <craigp> so for now just converting away from using insert_all
14:31 <gazler> samba6: You can pass data, but structs will be treated as maps if the dependency isn't there.
14:31 <craigp> i use it in other places with an update instead, those seem unaffected
14:31 <craigp> i also use on_conflict: :nothing in some places
14:31 <samba6> Thanks at gazler - but how?
14:31 <m1dnight1> What's the most elegant way to pattern match function case inssensitive?
14:32 <m1dnight1> I tried with a guard but that doesn't allow String.downcase :<
14:32 <m1dnight1> now I have def f(<<"abc"::utf8, _rest::bitstring>>) do
14:32 <samba6> I just need to pass a string from B to A
14:32 <m1dnight1> but I'd like to match Abc, aBc, etc
14:32 chrismccord joined
14:32 <Nicd-> samba6: make B call an API function of A?
14:32 <Nicd-> m1dnight1: I don't think it's possible
14:33 <m1dnight1> shucks
14:33 <m1dnight1> no biggie.
14:33 <gazler> samba6: If you give your use case then it may be easier to help.
14:33 <Nicd-> m1dnight1: downcase first and then call a function that matches on "abc"
14:33 <m1dnight1> Hrm, that may be the best solution idd
14:34 <m1dnight1> have a wrapper functino for all, and then stubs for each functionality
14:34 <m1dnight1> loses the pretty pattern matching, though. But You can't have it all.
14:34 <m1dnight1> Thanks Nicd-
14:34 <gazler> I like the sounds of a functino. Like a REALLY small function.
14:34 <m1dnight1> Also, I turned on the SASL logging but forgot to commit. Now I have turned it on properly and I'll see what happens.
14:34 <m1dnight1> gazler: :D Sorry, typing at the speed of light here.
14:34 <samba6> Ok I will tell you what I'm doing
14:38 <samba6> Ok here is what I'm doing - I have phoenix apps in umbrella project. App A is the authentication app. The login and logout urls are defined in A, but after successful login, user will be redirected to A url defined in B
14:39 <samba6> However the code for redirect is in A, but A needs to know the url which is defined in B.
14:41 <samba6> Of course I can hardcode the url string into A, but I don't want to do this. I want to use phoenix path helper to dynamically generate the route
14:41 <benwilson512> usually the way that works
14:42 <benwilson512> is that B would pass the URL to redirect to
14:42 <Nicd-> often you have some path in the url: /login?after_login=/some/path
14:42 <benwilson512> to A when it calls A
14:44 <samba6> benwilson512: ok let me see if that is something I can do
14:44 <samba6> Nicd: I will also try your suggestion
14:45 <Nicd-> remember to sanitize the path
14:45 <Nicd-> to check the user is not messing with it
14:45 tuacker joined
14:45 returntrip joined
14:52 Leryan joined
14:55 samba6 joined
15:00 ejpcmac left
15:04 srxa_ joined
15:13 meh` joined
15:13 cevado joined
15:14 zodiak__ joined
15:17 __charly__ joined
15:17 fowlduck joined
15:20 tuacker joined
15:20 superherointj joined
15:20 griffinbyatt joined
15:22 cemilowski joined
15:24 dustinfarris joined
15:25 cschneid_ joined
15:25 cevado joined
15:26 booyaa[ joined
15:28 fowlduck joined
15:34 wsieroci joined
15:35 jkreeftmeijer joined
15:44 larshesel joined
15:48 davidw joined
15:51 rodolfojcj joined
15:55 vjustov joined
15:59 squallstter joined
16:02 elgenie joined
16:03 nd___ joined
16:05 amclain joined
16:10 rkazak joined
16:21 griffinbyatt joined
16:22 akeating joined
16:27 cevado joined
16:29 papachan joined
16:30 karmajun_ joined
16:31 isubasti_ joined
16:34 dustinfarris joined
16:37 rkazak joined
16:37 marr joined
16:39 jeffweiss joined
16:40 refriedchicken joined
16:48 jkreeftmeijer joined
16:54 Spitz joined
16:55 Spitz left
17:00 wwwd joined
17:14 <wwwd> I installed Phoenix 1.3 "$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez" built a project and had everything working. when I restarted my terminal when I run "phx.server" I get an error: '** (Mix) The task "phx.server" could not be found. Did you mean "phoenix.server"?' When I run "mix help" the only references to "phx" are "phx.new" and "local.phx". Anyone know why this might be the case. Also,
17:14 <wwwd> when I look at my archives at "/home/john/.asdf/installs/elixir/1.4.2/.mix/archives" I see two directories...[hex-0.16.0 phx_new].
17:15 <chrismccord> wwwd : are you sure you cd'd into your project directory afrter you ran `mix phx.new` ?
17:16 <wwwd> Yep! That's a likely guess though! ;)
17:17 <superherointj> chrismccord, I am waiting for 1.4 to buy the new book.
17:18 <benwilson512> phoenix 1.4?
17:18 <Ankhers> wwwd: Do you actually have the dependencies compiled?
17:18 <benwilson512> 1.3 isn't even out yet! hahaha
17:18 <superherointj> Oh. I meant the new version that has new folder structure.
17:19 <benwilson512> that's 1.3
17:19 <superherointj> Right. Sorry.
17:19 <benwilson512> no worries
17:19 <benwilson512> hey has anyone using System.cmd had an issue where output from program being `cmd`ed just prints out
17:19 <benwilson512> and ignores your logger backend config?
17:21 refriedchicken joined
17:23 <wwwd> Ankhers: I just ran "mix deps.get"..."All dependencies up to date". Then ran "mix phx.server" again and got..."Compiling 13 files (.ex)
17:23 <wwwd> Generated phoenix_and_elm app
17:23 <wwwd> "
17:24 <wwwd> So I assume..
17:24 griffinbyatt joined
17:26 josevalim joined
17:26 <chrismccord> wwwd : what does `mix deps | grep phoenix` say?
17:26 laut joined
17:26 <chrismccord> what version is specified for phoenix in mix.exs?
17:27 <chrismccord> wwwd : is it possible you accidentally ran `mix phoenix.new` and generated a project that points to 1.2 stable?
17:28 wsieroci joined
17:28 <wwwd> chrismccord: do you want to know about ..."| grep phoenix or phx"?
17:28 <chrismccord> `mix deps | grep phoenix`
17:28 <chrismccord> My bet is you generated a 1.2 app accidentally
17:29 <chrismccord> which does not include the phx.server task
17:30 PSvils joined
17:31 <wwwd> chrismccord: https://gist.github.com/johnhitz/7ba534cbe40b0e96e69e8f0379f6442a
17:31 <PSvils> Hey everyone! I was wondering if anyone would have any resources on existing Elixir image processing libraries? Specifically focusing on image file parsing, and generating a color palette from said image.
17:31 <benwilson512> wwwd: yea you made a phoenix 1.2
17:31 <chrismccord> wwwd : yep. You ran `mix phoenix.new` and generated a 1.2 project
17:32 <wwwd> chrismccord: I used this to follow a 150pg book.
17:32 <chrismccord> wwwd : I mean that's fine, then continue with the 1.2 project
17:32 <chrismccord> just use the `mix phoenix.server` task
17:32 <chrismccord> and you're all set
17:32 <chrismccord> phx.* tasks are 1.3 (which is rc)
17:32 josevalim joined
17:37 isorehalav joined
17:40 <wwwd> Nope! I ran the right command...just was in the wrong directory! Thanks!
17:44 refriedchicken joined
17:44 OtherAllan joined
17:48 maxbeizer joined
17:49 jkreeftmeijer joined
17:55 icanhazbroccoli joined
17:56 codestorm joined
17:57 Ven joined
18:04 elgenie joined
18:08 Tidur joined
18:13 <besc> Is it possible to match like this: a = "a"; a <> "b" = "ab" somehow? I also tried pinning the variable but apparently that's not allowed (binary field without size)
18:13 <Nicd-> ^a <> "b" = "ab"?
18:14 <Ankhers> That gives an error.
18:14 refriedchicken joined
18:15 elgenie joined
18:16 Ven_ joined
18:17 <Ankhers> besc: Apparently you can't https://github.com/elixir-lang/elixir/issues/3406
18:18 <besc> Ankhers: Thanks, unfortunate
18:18 <Ankhers> Unless you know the size of a
18:19 <Ankhers> And you need to know it at compile time.
18:19 <Ankhers> What are you attempting to do?
18:24 <besc> I want to match on a variable prefix to: ensure the prefix is present and extract the rest of the string at the same time
18:24 griffinbyatt joined
18:27 notdaniel joined
18:27 srxa joined
18:28 cristianR_ joined
18:29 rkazak joined
18:30 mattyw joined
18:32 Ven_ joined
18:33 <Ankhers> besc: And you are okay if the pattern match fails?
18:34 <besc> Ankhers: Used it in a with
18:36 <Ankhers> besc: https://gist.github.com/ankhers/bf4f39c1c5297aaa4751065b7ce9d7f8
18:37 <Ankhers> That may not be ideal if you are dealing with long strings though.
18:39 <besc> It should work for now, definitely not optimal however
18:46 dimitarvp` joined
18:47 isubasti_ joined
18:51 ryker joined
18:54 <ryker> I have a question about mix tasks in a phoenix app. I'm running a task that calls into the app and runs httpoison. It breaks when it gets to that point because httpoison isn't running:
18:54 <ryker> "no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started"
18:55 <ryker> I've been looking around, but I'm not sure how I'm supposed to handle this. I can run the app.start task from within my task, but again, I would like to know how to best handle this
18:55 proteus-guy joined
18:57 rkazak joined
18:58 Ven joined
18:59 <Tica2> put_in is genially
19:00 notdaniel joined
19:00 fxn joined
19:03 hbraun joined
19:04 squallstter joined
19:05 Ven_ joined
19:06 nd__ joined
19:11 MotherFlojo joined
19:11 <jordan0day> @ryker you'll need to determine the minimum set of applications you need to start to run your task. If you're just making a call via httpoision and printing out the result or whatever, Application.ensure_started(:httpoison) is probably sufficient
19:12 <ryker> cool, I did see that somewhere. I'll try it
19:12 <jordan0day> to my understanding, when you do `mix yourapp.your_task` it starts a new erlang node -- so even if you're already running your phoenix application, that task itself runs in a new instance of the vm
19:16 srxa joined
19:25 super joined
19:25 jhon joined
19:27 <jhon> hello everyone... I have a table TAG and a table ItemTag. Is there a way to create a ItemTag, while performing a find or create in the Tag table using only 1 query to DB?
19:29 cevado joined
19:31 zv joined
19:34 <Ankhers> jhon: What database are you using?
19:40 <jhon> Ankhers: pgs
19:40 cevado joined
19:41 srxa_ joined
19:41 lexmag joined
19:43 Ven_ joined
19:49 <Ankhers> It may be worth going and asking in #postgresql. It is fairly database specific. For example, I know for a fact that Mongo couldn't do something like that. But it may be possible with SQL.
19:49 seaword joined
19:49 seaword joined
19:51 <asonge> jhon: you could build that in ecto in some way using an insert with on duplicate (also known as a replace query) that has a returning clause...
19:51 jkreeftmeijer joined
19:52 <dimitarvp> AFAIK, Postgres UPSERT exists only since 9.5 btw,.
19:52 <asonge> dimitarvp: upsert isn't the same thing
19:53 <dimitarvp> oh oops, he said "find or create", _not_ "create or update", my bad.
19:54 <asonge> well, even that isn't quite the same thing...
19:54 <asonge> the difficulty of upsert has to do with things that aren't a single row and the isolation guarantees you get with that
19:54 <asonge> different db vendors offer different guarantees with regards to the consistency of data during an upsert
19:55 <asonge> postgresql wanted rather strong guarantees, as you can poor-man an upsert in postgresql rather easily
19:55 <dimitarvp> you know, I keep thinking that one day one brave dev will create an awesome middleware between any language code and most DBs which actually give you consistent guarantees :D
19:55 <dimitarvp> gets really tiring having to encode adhoc knowledge about the intricacies of your chosen storage system in the code...
19:56 <asonge> i think that's probably provably impossible.
19:56 <dimitarvp> I think so too, but we can dream.
19:57 <benwilson512> dimitarvp: I mean in some sense, postgres IS that if you view the underlying storage system as your FS
19:57 <benwilson512> and your fs IS that if you view the underlying storage system as a hard disk...
19:57 <benwilson512> it's abstractions all the way down
19:57 <asonge> \o/
19:58 MotherFlojo joined
19:58 <asonge> benwilson512: saw your upcoming book getting mentioned on twitter
19:58 <benwilson512> oh cool! I should use twitter...
19:58 <asonge> (don't)
19:59 <benwilson512> heh
19:59 <dimitarvp> benwilson512: I am mostly talking about the CAP theorem problems, but that looks to be impossible to fix unless the internet becomes VERY different compared to what it is today.
19:59 <OliverMT> is the book about having so much to do you never get anything done? if so I can be your co-author benwilson512
19:59 <OliverMT> :D
19:59 <OliverMT> a tongue in cheek comment RE: all our discussions about logging and best ways to deploy
19:59 <benwilson512> OliverMT: heh, you'll be impressed, we're actually fully ECS with cloudwatch logs now
20:00 <OliverMT> (although I actually got consistently good logging across our projects now :P)
20:00 <OliverMT> what the......
20:00 <OliverMT> how much time did you spend on the ECs stuff?
20:00 <benwilson512> the hardest part was that we had various jobs we ran inside docker
20:01 <benwilson512> so I just setup a remote server with docker running on a port and we run against that now. handling input files and all of that took a day or two
20:01 <benwilson512> with the usual interruptions
20:01 <asonge> benwilson512: did you see the new multi-stage docker feature that's coming up?
20:01 <benwilson512> the rest of the ECS stuff another day maybe
20:01 <benwilson512> it was pretty easy tbh
20:01 <benwilson512> should have done it ages ago
20:01 <benwilson512> still working on some of the tooling, keeping it simple
20:02 <benwilson512> bash scripts build docker images, push them to ECS repos, then (planned) another bash script to do the actual deploy via the ECS APi. right now we push images and then click around the UI for deployment
20:02 <benwilson512> which isn't that bad tbh but I'd prefer a cli solution
20:03 freerobby joined
20:03 <benwilson512> tbh I'd use k8s on GCE if I wasn't tied to RDS
20:03 <OliverMT> so no blue/green forward rolling sexyness or similar?
20:03 <benwilson512> ECS does all the blue green stuff
20:03 <OliverMT> oh
20:03 <freerobby> codestorm: Did you ever solve your problem with certificate errors from back in April? If not, I hit a similar problem, fix was bad system time tricking system into thinking it was not valid. For docker, installing and running NTP fixed it.
20:03 <OliverMT> nice
20:03 <tristan__> benwilson512: can't use google cloud sql?
20:04 <OliverMT> you just let your websockets thunder the herd and thats no problem?
20:04 <* asonge> still doesn't know what kinds of things RDS does that google's postgresql beta doesn't do.
20:04 <benwilson512> asonge: failover
20:04 <asonge> ah.
20:04 <benwilson512> which is the critical thing for us
20:04 <benwilson512> tristan__: ^
20:04 <asonge> that's hard to get right.
20:04 <tristan__> oh, so you'll be able to move in the future
20:04 <benwilson512> yup
20:04 <benwilson512> that's the plan
20:04 <asonge> everything at google is so much simpler.
20:05 <benwilson512> yeah I went through their UI tutorial a few weeks ago and was blown away
20:05 <tristan__> and kubernetes on it is awwwwesome
20:05 <OliverMT> I kinda dig k8s
20:05 <benwilson512> OliverMT: the bluegreen stuff works great, accidentally pushed a bum image and had no down time will it tried to run it
20:05 <asonge> benwilson512: you play with shippable much? they've got a lot of deep integration into aws's and google's container infra
20:05 <OliverMT> BUT, the pragmatic side of me really cant see that it brings THAT much over ECS
20:05 <benwilson512> pushed a new good image and then that took over and everything carried on
20:05 <OliverMT> certainly not enough to change vendors
20:05 <benwilson512> asonge: not at all
20:06 <tristan__> I thought ECS was supposed to be terrible?
20:06 srxa joined
20:06 <OliverMT> the google cloud analog to s3 does geodistribution by default, thats way more sexy for me
20:06 <benwilson512> tristan__: if you rely on their scheduler a lot I'm sure it might be but
20:06 <benwilson512> we don't run many services
20:06 <OliverMT> do you run more than one?
20:06 <benwilson512> and can do a pretty simple "1 service per node"
20:06 <tristan__> I thought it also didn't do much
20:06 <benwilson512> it doesn't
20:06 <benwilson512> kubernetes has per pod ips
20:06 <benwilson512> which is great
20:06 <benwilson512> there's no fancy networking in ECS
20:06 <tristan__> does it even give you networking and dns/
20:06 <benwilson512> no
20:06 <tristan__> oh right, ecs doesn't have per pod ips
20:06 <tristan__> terrible
20:07 <benwilson512> so clustering w/ elixir is sub-par
20:07 cdg joined
20:07 <tristan__> yea, clustering on k8s is so easy
20:07 cemilowski joined
20:07 <benwilson512> nonetheless, we have point and click blue green deployment, it integrates w/ all the load balancers nicely, handles the ports, etc
20:07 <benwilson512> which is a big step up from the level of manual stuff we had before
20:08 <OliverMT> we do rolling downtime now
20:08 <benwilson512> AWS application load balancers have a lot fancier rules now
20:08 <OliverMT> works well tbh
20:08 <OliverMT> I like that the ALB can send some traffic to s3 and some to servers
20:08 <OliverMT> dont have to do the CDN dance
20:08 <benwilson512> well and they handle multiple domains/ subdomains now
20:08 <OliverMT> its still pretty idiotic they dont have https redirect built in
20:08 <codestorm> freerobby: The hex.pm certs issue? It's resolvedI tried some fixes, but I think it just ended up resolving itself
20:09 <tristan__> instead of a cdn can't you just put cloudsomethin gin front of the ALB?
20:09 <asonge> cloudfront? the aws CDN?
20:09 <tristan__> and I thought s3 wasn't good for a cdn
20:09 <tristan__> yea, cloudfront
20:09 <OliverMT> cloudfront is the CDN
20:09 <OliverMT> you cant https redirect on s3
20:09 <OliverMT> you need to use cloudfront
20:09 <benwilson512> if you have low traffic and change assets frequently S3 is fine
20:09 <benwilson512> cloudfront you have to invalidate caches and what not
20:09 <OliverMT> its literally one line in bash to do the invalidating
20:10 <OliverMT> took me 2min of google to figure out
20:10 <benwilson512> it's a function of time though
20:10 <codestorm> freerobby: thanks for tipping me about NTP
20:10 <benwilson512> it takes longer to invalidate than it does to clobber the s3 assets
20:10 <OliverMT> then you normally wait at most 1min for refreshed software
20:10 <ericmj> codestorm: freerobby: our CDN updated to a really new certificate which caused issues on docker because it keeps the start up time as system time
20:10 <benwilson512> ah interesting that's faster than I thought
20:10 <tristan__> sure, low traffic is fine. just thought it was meant more for larger objects than web assets, so high latency was an issue
20:10 <benwilson512> we no longer actually use s3 for UI stuff
20:10 <ericmj> because the system time was before the certificate issuing time
20:10 <benwilson512> just have assets out of phoenix
20:10 <OliverMT> tristan__: opposite, it lowers time.. the whole idea of cloudfront is to move data to decentralized pops
20:10 <tristan__> OliverMT: I meant S3
20:10 <OliverMT> yeah we only have one project left that has frontend on s3
20:11 <OliverMT> all the rest simply bundle and serve inside phoenix
20:11 <OliverMT> a LOT easier to manage versioning :P
20:11 <asonge> benwilson512: do you do anything special to manage versioning in the upgrade dance?
20:11 <ericmj> if you version the asset filename you don’t need invalidate in your CDNs
20:12 <asonge> ^^^ i always liked this solution. better yet, hash it. but webpack's hashing is not content-based :(
20:12 <benwilson512> asonge: we tag images with the git ref if that's what you mean, or do you mean with the assets and versioning
20:12 <ericmj> if you want fast and better invalidation you should use fastly instead of cloudfront
20:12 <OliverMT> ericmj: you still need to invalidate the entry point ericmj
20:12 <asonge> benwilson512: more like database schema upgrades
20:12 <OliverMT> or..?
20:12 <ericmj> OliverMT: the entry point you can keep on low cache time
20:13 <ericmj> are we talking SPA here?
20:13 jordan0day joined
20:14 <codestorm> ericmj: so, docker would have a system time that was in the past? Even though I was restarting the container?
20:14 <benwilson512> codestorm: you need to restart the VM that runs the container
20:14 <benwilson512> if on OS X
20:14 <ericmj> ^ this
20:14 <benwilson512> tristan__: do you hit GCE APIs from within elixir?
20:15 <OliverMT> benwilson512: do you run from circleci?
20:16 <benwilson512> OliverMT: no, I'd love to have that setup, but haven't had time
20:16 <benwilson512> aside: anyone else seeing elevated error rates hitting S3 today?
20:16 <codestorm> no sure I follow that, what VM are you referring to? Do you mean restarting docker itself?
20:16 <benwilson512> yes
20:16 <codestorm> and yes, this is OS X
20:17 <codestorm> oh, ok :)
20:17 <codestorm> thanks
20:17 <tristan__> benwilson512: na
20:17 <benwilson512> ah, so no pushing to their S3 equivalent or anything?
20:18 <tristan__> hm? what do you mean
20:19 milmazz joined
20:19 <benwilson512> in many of our services we do a fair bit of moving data in and out of S3, and we use ExAws to do that
20:19 <benwilson512> if we moved to GCE we'd need to use the google storage equivalent, and whatever library exists for talking to it
20:19 <benwilson512> and I was trying to see if you were familiar with that library
20:19 <tristan__> oh. yea, no
20:20 refriedchicken joined
20:22 saurik joined
20:23 <notriddle> benwilson512: https://cloud.google.com/storage/docs/migrating#migration-simple
20:23 <benwilson512> wow
20:26 griffinbyatt joined
20:27 <notriddle> There are actually a lot of providers that offer drop-in replacements for AWS S3. GCS is one. OpenStack Swift is another.
20:27 <OliverMT> cleaning out a temp folder on statup, myapp.ex inside start() ?
20:27 <benwilson512> yeah I knew they existed, I just didn't realize GCS was one of them
20:28 <OliverMT> tristan__: does gc have the analogy to ec2 roles?
20:28 <OliverMT> where you dont need credentials on the box itself, the box is awarded credentials which the software can look up
20:28 <OliverMT> I like that a lot
20:31 Ven joined
20:32 micmus joined
20:33 <notriddle> If I'm reading the docs correctly, Google Cloud does have an analogy in Service Accounts, but that is not compatible with AWS. So you can't use Service Accounts and an S3 app together.
20:34 Leryan joined
20:34 <alisdair> google iam is basically the same as aws iam
20:35 <alisdair> google iam has more precanned roles than aws tho
20:35 <alisdair> so you don't really write your own in my experience
20:35 <alisdair> i haven't gone as deep with google iam as i have with aws iam tho
20:36 <OliverMT> hm
20:36 <OliverMT> I am just about to go deep into aws cognito
20:36 Ilyes512 joined
20:36 <OliverMT> just keep lathering on services :D
20:36 <Ilyes512> hey guys
20:37 <Ilyes512> is there a difference in using import Plug.Conn vs require Plug.Conn?
20:37 <benwilson512> yes
20:37 <benwilson512> import takes all functions in Plug.Conn and makes them available to you without saying the Plug.Conn module
20:38 <benwilson512> so for example Plug.Conn has a get_req_header function
20:38 <benwilson512> so instead of calling Plug.Conn.get_req_header(conn, "blah")
20:38 <Ilyes512> ah okey
20:38 <benwilson512> you can now just do get_req_header(conn, "blah")
20:38 <benwilson512> require will merely let you use any macros in Plug.Conn
20:38 <benwilson512> but you still have to use the module name
20:38 <Ilyes512> so it's like a combo of import and alias
20:38 <benwilson512> Plug.Conn.some_macro
20:38 Ven_ joined
20:38 <benwilson512> no
20:38 <Ilyes512> require and alias
20:38 <benwilson512> sort of, but alias works on the module name itself
20:39 <benwilson512> import removes it entirely
20:39 <benwilson512> aliases can be done circularly
20:39 <benwilson512> imports cannot
20:39 <Ilyes512> circularly?
20:39 <benwilson512> defmodule A, do: alias B end defmodule B do: alias A end
20:39 <benwilson512> this is fine ^
20:39 <benwilson512> defmodule A, do: import B end; defmodule B, do: import A end
20:39 <benwilson512> bad things ^
20:40 <benwilson512> the docs for each cover examples pretty well
20:40 <OliverMT> 22:27:40 <OliverMT> cleaning out a temp folder on statup, myapp.ex inside start() ? <--- anyone?
20:40 <Ilyes512> yes i know.. i always look at them http://elixir-lang.org/getting-started/alias-require-and-import.html
20:40 <OliverMT> basically FileService.clean_tmp/0
20:41 <Ilyes512> i am slowly getting the gist of them...
20:44 <benwilson512> Ilyes512: well there's also specific docs https://hexdocs.pm/elixir/Kernel.SpecialForms.html#import/2
20:44 dustinfarris joined
20:45 <Ilyes512> ah, havent seen this in the guides: "By default functions starting with _ are not imported."
20:45 Ven_ joined
20:46 cemilowski1 joined
20:51 Ven_ joined
20:52 jkreeftmeijer joined
20:56 <freerobby> codestorm: ericmj: no prob; yeah, NTP fixed it by setting sys time to a valid time for the certificate. Helpful to know underlying problem and also have a workaround for the future, thanks.
21:03 isubasti_ joined
21:08 ur5us joined
21:08 freerobby joined
21:08 stephen_m joined
21:10 <tonyc> awwww yisssss. registered for elixirconf!!!
21:10 <tonyc> MY BODY IS READY
21:16 maxbeizer joined
21:16 justelex joined
21:18 <OliverMT> is there a way to... short circuit get_in ?
21:19 <OliverMT> I have a map tree with some branches shorter than others
21:19 <OliverMT> so I end up doing a get_in path that is potentially longer than the actual path you can traverse
21:19 <OliverMT> so you end up doing get_in on a string
21:20 <OliverMT> maybe Access.key(the_key, %{}) ? thanks for being my rubber duck :D
21:21 drewolson joined
21:21 markedfinesse joined
21:22 akeating joined
21:23 markedfinesse joined
21:23 drewolson joined
21:27 griffinbyatt joined
21:28 M-nickgal joined
21:28 M232017[m] joined
21:29 seequ_ joined
21:31 cdg joined
21:31 drewolson left
21:33 markedfinesse joined
21:35 dch_ joined
21:38 markedfinesse joined
21:40 drewolson joined
21:47 MotherFlojo joined
21:50 dustinfarris joined
21:50 blahdodo joined
21:54 griffinbyatt joined
21:58 griffinb_ joined
22:01 icecreamcohen joined
22:01 dimitarvp joined
22:11 dch_ joined
22:15 __charly__ joined
22:23 dch_ joined
22:28 dignifiedquire joined
22:32 seaword joined
22:32 seaword joined
22:35 rodolfojcj joined
22:39 PaReeOhNos joined
22:44 <asonge> benwilson512: btw, there's a google api discovery service where all the google cloud api endpoints are fully described, and input and output types are set using a fork of json-schema 0.3, so it's completely possible to create a 1 codebase to support like 95% of all the apis, but you can't leverage existing libs to do it.
22:44 <asonge> (existing json-schema libs anyway)
22:47 Ilyes512 joined
22:48 <Ilyes512> the default layout file in phoenix for html pages. Where is that set to app.html.eex as the default?
22:49 markedfinesse left
22:50 tomaz_b joined
22:54 jkreeftmeijer joined
22:57 refriedchicken66 joined
22:59 griffinbyatt joined
23:04 proteus-guy joined
23:04 Ilyes512 joined
23:12 griffinbyatt joined
23:26 gvaughn_ joined
23:33 cschneid_ joined
23:35 zv joined
23:50 kronicdeth joined
23:54 isubasti_ joined
23:56 greengriminal joined