Logbot

#sandstorm
AUTO⬇
  • 00:59:18 XgF Yay, my C++ sandstorm app is working
  • 00:59:43 XgF Hah, my sandstorm-files.list contains 3 entires <3
  • 01:09:03 dwrensha nice
  • 01:11:40 XgF Writing things as a statically linked C++ app is hax :P
  • 01:11:53 dwrensha what does the app do?
  • 01:12:08 XgF It's going to be a simple IRC channel bot
  • 01:12:30 XgF I'll factor out the IRC engine as its' own capability so maybe that'll be reusable as a driver one day
  • 01:26:16 XgF Ooh, no impl of stayAwake yet, bummer
  • 01:27:49 XgF Ooh, I see, jparyani was working on it but it hasn't been merged yet
  • 02:55:22 kentonv XgF: are you using the IP networking API? You are probably the first user. :)
  • 02:55:36 XgF kentonv: I was going to fiddle with it
  • 02:55:51 XgF Though an IRC bot isn't very useful if it closes down each time I leave the page :-)
  • 02:56:07 itscassa XgF: Share it nao!
  • 02:56:18 itscassa :D
  • 02:56:28 kentonv you could merge Jason's PR and help test. :)
  • 02:56:32 XgF My code does little more than send "it works" back to the UI so far :P
  • 02:57:03 kentonv did you write it from scratch or use sandstorm-rawapi-example?
  • 02:57:44 XgF I should have probably looked for sandstorm-rawapi-example :P
  • 02:57:55 kentonv haha
  • 02:58:29 kentonv well I'm impressed you figured out the API without it
  • 02:58:40 XgF I was referencing http-bridge a bit
  • 02:59:09 kentonv https://github.com/sandstorm-io/sandstorm-rawapi-example FWIW
  • 03:00:48 kentonv well I'm excited that someone is working at that level! We don't get much feedback about the raw API. And you can actually plausibly create an IRC bot at that level right now, since you'll have no problem using the Cap'n Proto interfaces for networking rather than the standard sockets API.
  • 03:26:14 paulproteus Dear XgF, You are amazing. Sincerely, Asheesh.
  • 03:26:43 paulproteus XgF: If you want to write things as statically linked _rust_ binaries, see e.g. https://github.com/sandstorm-io/check-for-unprivileged-userns (thanks to kmc)
  • 03:32:30 paulproteus Just added more context here, https://github.com/sandstorm-io/check-for-unprivileged-userns
  • 03:33:56 kentonv probably getting the binary down to ~150 bytes is not essential for a Sandstorm app. :)
  • 03:34:47 kentonv David's Acronymy is an example of a Sandstorm app written in Cap'n Proto. Although Cap'n Proto Rust has been in flux lately so that code is probably horribly outdated.
  • 03:35:10 paulproteus kentonv: Probably true (-:
  • 03:39:58 XgF Thinking "Hmm, I need to write some kind of serialization system". Wait a minute...
  • 03:40:55 kentonv what are you trying to serialize?
  • 03:41:07 XgF Bot configuration
  • 03:41:35 XgF Spent a while thinking "Hmm" before going "Doh, I'll just dump it in a capnp serialized file"
  • 03:42:39 paulproteus XgF: I hear Google's Protocol Buffers is really good and has great C++ bindings!
  • 03:43:04 kentonv lol
  • 03:44:00 dwrensha I'm noticing that `spk dev` now prints out "WriteResult({ "nRemoved" : 1 })". I'm guessing that has to do with the mongo upgrade.
  • 03:59:33 kentonv grr mongo
  • 04:01:34 paulproteus XgF: Perhaps sandstorm-http-bridge or something should link to sandstorm-rawapi-example in the comments, or something, to have helped you find it sooner?
  • 04:01:46 XgF Maybe
  • 04:02:16 paulproteus https://github.com/sandstorm-io/sandstorm/wiki/Sandstorm-App-Developer-Handbook also doesn't link to sandstorm-rawapi-example; perhaps it should, too.
  • 04:02:51 kentonv the porting guide links to it
  • 04:03:11 kentonv in the same place where it links to meteor-spk and the ruby guide
  • 04:04:10 paulproteus I don't see it; when I search for "raw" in https://github.com/sandstorm-io/sandstorm/wiki/Porting-Guide/_edit , no matches for me.
  • 04:04:51 XgF Also I'm not sure the porting guide is where you'd look for greenfields development
  • 04:05:04 paulproteus Interesting point.
  • 04:05:13 XgF Hmm, passing a CallContext through a lambda's capture list (using MVCAP) seems to be making it const =/
  • 04:05:54 kentonv XgF: you need to declare the lambda mutable
  • 04:05:59 kentonv [](...) mutable { ... }
  • 04:06:10 XgF ooh
  • 07:06:56 dcb dwrensha: is there a recommended way to go from MallocMessageBuilder to some kind of MessageReader? I used to use SegmentArrayMessageReader, but its ctor needs to be changed to take an OutputSegments to continue doing that, which may break other users
  • 07:07:49 dcb I guess I could just do a serialization round trip, I'm only doing this in tests
  • 07:41:25 kentonv dcb: You can do getRoot<Whatever>().getReader() to get a reader for the root object.
  • 07:42:04 kentonv dcb: If you need a full MessageReader, then SegmentArrayMessageReader is the easiest way. I don't think you should have had to change anything. Can you describe what went wrong?
  • 07:43:10 kentonv SegmentArrayMessageReader reader(builder.getSegmentsForOutput()) should work
  • 07:43:18 Guest1 kentonv: dwrensha pushed a change this morning that tweaks how MessageBuilder lends out it's segments, and as a result it's now not possible to create a SegmentArrayMessageReader from a MessageBuilder
  • 07:43:49 kentonv Guest1: Oh, I guess you're talking about rust?
  • 07:43:54 kentonv funny, the names are exactly the same as C++
  • 07:44:01 kentonv so I was confused. :)
  • 07:44:03 Guest1 kentonv: yes, sorry for not specifying
  • 08:05:44 dwrensha yeah, I should probably rename my MallocMessageBuilder to HeapMessageBuilder or some such
  • 08:07:04 dwrensha dcb: If `x : OutputSegments` then `&*x : &[&[Word]]`, no?
  • 08:08:12 dcb dwrensha: yes, but the borrow checker yells because the OutputSegments doesn't live long enough
  • 08:08:30 dwrensha can you show me an example?
  • 08:08:46 dcb like if you do SegmentArrayMessageReader::new(&*my_message_builder.get_segements_for_output());
  • 08:09:04 dwrensha can you add a let binding
  • 08:09:06 dcb the borrow is not of `my_message_builder` but the anonymous OutputSegments
  • 08:09:08 dwrensha to force it to live longer?
  • 08:09:16 dcb not generally
  • 08:09:52 dcb I'm not actually blocked by this, I'm going the round trip route
  • 08:10:06 dwrensha `let x = met_message_builder.get_segments_for_output(); SegmentArrayMessageReader::new(&*x)` does not work?
  • 08:10:23 dcb It works, but it
  • 08:10:49 dcb but it's impossible to make a method that takes a &MallocMessageBuilder and returns a SegmentArrayMessageReader, which was what I was trying
  • 08:11:13 dwrensha ah, right
  • 08:11:17 dcb fn into_reader(message: &MallocMessageBuilder) -> SegmentArrayMessageBuilder
  • 08:11:18 dwrensha you can't return it
  • 08:11:21 dcb yep
  • 08:11:54 dwrensha can we switch something to pass-by-move to get around this?
  • 08:13:14 dcb oh, I think the issue is with Deref actually
  • 08:13:36 dcb If you had a get method, you could return &'a [&'a [Word]], where 'a is the MessageBuilder's lifetime
  • 08:13:58 dcb But deref forces it to be &'b [&'a [Word]] where 'b is the OutputSegments lifetime
  • 08:14:31 dwrensha The deref thing is convenient though. Maybe I can just add a get() method?
  • 08:14:37 dcb yah, I wouldn't remove it
  • 08:15:11 dcb oh wait, maybe you can do it with deref
  • 08:15:23 dwrensha I was thinking `pub fn get(self) -> [&'a [Word]]`
  • 08:15:28 dcb does it work to get rid of 'b here and just use 'a http://docs.capnproto-rust.org/src/capnp/lib.rs.html#223?
  • 08:15:54 dwrensha error: lifetime name `'a` shadows a lifetime name that is already in scope
  • 08:16:00 dcb fn deref(&self) -> &'a [&'a [Word]] {
  • 08:16:48 dcb I doubt deref lets you get away with that
  • 08:16:52 dwrensha I agree
  • 08:16:58 dcb but anyway an additional get would solve it
  • 08:18:55 dwrensha heh, I guess I can't return something that's not sized
  • 08:21:18 dwrensha maybe I should take a step back
  • 08:22:14 dwrensha dcb: what does into_reader() accomplish that you couldn't do with get_root() and as_reader()?
  • 08:23:05 dwrensha (I think you meant `fn into_reader(message: &MallocMessageBuilder) -> SegmentArrayMessageReader` above)
  • 08:23:55 dcb dwrensha: I have a state machine that takes OwnedSpaceMessageReaders and returns MallocMessageBuilders (meant to be applied to another state machine). To test this I have to do the conversion
  • 08:23:58 dcb dwrensha: yes, thanks
  • 08:24:19 dcb but basically the actual message unpacking is done behind the interface I'm testing
  • 08:26:54 dwrensha Lol, I just accidentally typed a "~" when I meant "Box<>". Old habits die hard.
  • 08:27:32 dcb Maybe it's simpler to think of it as testing a networked objects, locally. So I have n object A that sends messages to object B. So A outputs MessageBuilders and B takes in MessageReaders. Normally the conversion is done on the network bits, but I want to test without the network
  • 08:30:16 dwrensha I can definitely do `pub fn get(self) -> Box<[&'a [Word]]>`
  • 08:30:26 dwrensha for OutputSegments
  • 08:31:48 dcb What's the issue with &'a [&'a [Word]]?
  • 08:34:50 dwrensha things won't live long enough
  • 08:35:20 dwrensha the function should be called `into_boxed_slice()`, like this: https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.into_boxed_slice
  • 08:36:09 dwrensha ( that's the function you would call if OutputSegments were just Vec<&[Word]> )
  • 08:37:45 dwrensha It'd be nice if there were a way for you to design your function to take typed messages, rather than untyped root containers.
  • 08:37:53 dwrensha I understand there are ownership issues
  • 08:39:45 dcb ah because the internal Vec is still owned by the OutputSegments
  • 08:40:00 dcb yah that's not going to work
  • 08:41:32 dcb Probably easiest to just make a new MessageReader type that takes ownership of an OutputSegments
  • 08:49:01 dwrensha hm. I guess into_boxed_slice() doesn't actually solve your problem unless there's a way to construct a message reader that takes ownership of the Box<[&[Word]]>
  • 09:04:02 dwrensha dcb: since you only need this for testing, would be a big deal just to copy the message to convert from a builder to a reader?
  • 09:04:29 dcb dwrensha: that's what I'm doing, serializing to a Vec and then back. It will be fine for that use case
  • 09:05:03 dcb I can write an OutputSegmentsMessageReader if I need it
  • 09:11:56 kentonv Major new etherpad release.
  • 09:13:29 dwrensha kentonv: in case you're curious, the change we made today in capnproto-rust would translate back to c++ as changing the signature of `writeMessage` to be `void writeMessage(OutputStream& output, const MessageBuilder& builder)`
  • 09:13:47 dwrensha (at least I think that's where the const-qualifier would go)
  • 09:23:18 dwrensha etherpad has comments now!?
  • 09:23:39 dwrensha and we have a "commenter" role!?
  • 09:23:44 dwrensha \o/
  • 09:31:07 kentonv :D
  • 09:34:07 kentonv dwrensha: what do you think of the sidebar authorship highlighting?
  • 09:34:29 kentonv note that all the new stuff in this release is from adding plugins.
  • 09:34:32 dwrensha oh
  • 09:35:16 dwrensha does that mean the colors are always to the side now? never directly on the text?
  • 09:35:59 kentonv the side color is the primary author of the paragraph. There is inline highlighting for other editors.
  • 09:36:51 kentonv https://alpha.sandstorm.io/shared/hBFtxona3EPJzi1Zr9cOulkv4SmMDUeAiM5nCgl8yJT
  • 09:37:06 dwrensha heh, beat me to it
  • 09:38:52 kentonv ok so who was the anonymous user? :P
  • 09:40:02 * XgF raises hand
  • 09:49:21 dwrensha kentonv: I think "YYYY.MM.DD (upstream version)" is a nice choice for appMarketingVersion
  • 09:49:49 kentonv heh, yeah, I wasn't sure what to write since there hasn't been a new Etherpad release
  • 09:50:03 kentonv also I rebased to Etherpad's "develop" branch since the comments feature depends on it
  • 09:52:46 ocdtrekkie kentonv: Look at the appMarketingVersion you set. :P
  • 09:52:57 ocdtrekkie Closely.
  • 09:53:15 kentonv goddammit
  • 09:53:37 ocdtrekkie Sidebar authorship highlighting is awesome. Way better than the rainbow color text.
  • 09:54:07 kentonv "2014" would have been one thing but how the hell did I type 2012?
  • 09:54:08 dwrensha 2012 how did I not notice that?
  • 09:54:31 paulproteus That was the year they shut down Google Wave.
  • 09:54:34 paulproteus Must be for that reason.
  • 09:54:38 ocdtrekkie lol
  • 09:58:10 kentonv ok everyone that never happened. You can't prove anything.
  • 09:59:11 kentonv look here it is running on blackrock https://testrock.sandstorm.io/shared/3uG27L0IljT1IVIwUwHHYRlHfVfu_OUwaWfi7fC-BlY
  • 10:00:14 kentonv ok gtg watch GoT now
  • 12:06:31 kentonv ocdtrekkie: congrats, you can now make grains on testrock. zarvox didn't log in, no grains for him.
  • 12:06:43 ocdtrekkie lol
  • 12:07:13 zarvox kentonv: okay, okay, I'll log in :P
  • 12:07:20 kentonv IT'S TOO LATE HAHAHAHAHAHA
  • 12:07:42 zarvox nooooooooooo
  • 12:07:48 ocdtrekkie It looks just like the alpha server, just without all my :stuff:
  • 12:07:49 kentonv note that at this time I estimate 95% chance it will crash at some point and I won't notice for a day, and maybe 50% chance all data is randomly deleted at some point. (That should go down quickly over the next few days though.)
  • 12:07:51 zarvox also haha at the buildstamp
  • 12:08:11 zarvox "Build [kenton@megaman Sat May 30 21:13:07 PDT 2015]"
  • 12:08:20 ocdtrekkie That has the right year in it. :)
  • 12:08:39 kentonv I mean I am kenton, and I built in on megaman, so I don't know what you want. :P
  • 12:09:47 kentonv it's funny, if you crack the frontend and run arbitrary code, you won't be able to tell it isn't sandstorm, except that /var/sandstorm is eerily empty.
  • 12:10:25 zarvox I mean, normally that's a major.minor, not a "[$user@$host $date]"
  • 12:11:00 kentonv zarvox: if you build sandstorm from source without pushing a release you normally see that kind of build stamp.
  • 12:12:02 kentonv testrock will get non-official buildstamps. The actual hosting service, when it goes live, will get normal buildstamps.
  • 12:12:17 kentonv and will be updated in sync with Sandstorm
  • 12:12:27 zarvox Ahhh, I guess I've mostly spent time with vagrant-spk, which uses packaged releases, so I never noticed that!
  • 12:12:59 kentonv so basically no one will be able to tell that they're not on Sandstorm. Not that I'm trying to hide it, I just like the symmetry.
  • 12:16:06 kentonv maybe it'll throw off some competitors too. :)
  • 12:25:48 ocdtrekkie I had kinda figured Blackrock was "a thing that ran Sandstorms" as opposed to an entirely separate backend.
  • 12:36:24 zarvox ocdtrekkie: There's a bunch of APIs that are decently well-defined in Sandstorm! Which API did you expect that Blackrock would provide an alternate implementation of?
  • 12:37:36 ocdtrekkie I just mean like, the way I visualized Sandstorm and Blackrock in my head were like... ESXi and vSphere. ESXi is free, and you can run apps and stuff on it, but vSphere allows you to do a lot more things with your ESXis, including cluster management and stuff.
  • 12:42:10 ocdtrekkie kentonv: Wouldn't your About page be "About Blackrock" and "Blackrock Server" and such?
  • 14:47:16 kentonv ocdtrekkie: it's effectively equivalent to a thing that runs Sandstorms, but a few orders of magnitude more efficient than literally running a Sandstorm VM for every user. Since most users aren't using their resources most of the time, we can distributed them far more effectively with a few tricks.
  • 14:50:42 kentonv so basically we can give you the equivalent of a $50/mo private VM for $6/mo.
  • 14:51:33 ocdtrekkie Well, I didn't suppose it was making a whole VM for each user.
  • 14:52:34 kentonv then it's pretty much what you expect. FWIW, pretty much all of the open source Sandstorm code is used by Blackrock. There's just some added plumbing to distribute nicely over a cluster of machines.
  • 14:53:08 ocdtrekkie I mean that when you use vSphere, you're still using the same ESXi. My analogy was that I didn't think Blackrock would actually run a different build of Sandstorm. Just more something telling which Sandstorm to run which grain and such.
  • 14:54:20 ocdtrekkie But then, ESXi is closed source, so I assume they can easily put the "enterprise" code in there, and just disable it, moreso than one can do with an open source free program.
  • 14:57:36 ocdtrekkie I'm pretty excited though, Blackrock working + Etherpad looking a lot more professional with the plugins really makes everything feel a lot closer to 'done'.
  • 14:59:29 kentonv Blackrock is only kind of working, but yeah. :)
  • 15:00:02 kentonv backup/restore and web publishing are still not working. The former obviously being pretty important for beta users, the latter a little less but still important.
  • 15:00:28 kentonv hopefully will get that figured out this week then start the beta
  • 15:04:16 ocdtrekkie Some sort of meta-backup of "all your stuff" would probably be helpful too.
  • 15:04:55 ocdtrekkie I try to back up my halfway-decently-valuable grains on occasion, but if I could script a download of it every day, I'd probably do it every day.
  • 15:05:24 kentonv my plan is to make an API so you can have "backup apps"
  • 15:06:19 kentonv and we'll actually back up Blackrock's data that way, but also you'll be able to back up your self-hosted data to Blackrock (encrypted)
  • 15:06:38 kentonv but perhaps someone will write an app for dropbox, etc.
  • 15:06:56 zarvox speaking of dropbox, I'm still eagerly awaiting the day that the hackpad source gets released
  • 15:07:42 kentonv me too, though having discovered etherpad plugins reduces that pain quite a bit
  • 15:08:26 kentonv I feel like it's actually reasonably close to Hackpad now, just needs some design work and polish
  • 15:09:10 zarvox yeah, the new release feels way better
  • 15:13:11 kentonv bed time here, 'night
  • 22:05:21 erikoeurch any updates on when the beta might launch?
  • 22:09:29 dwrensha erikoeurch: there was some discussion last night http://logbot.g0v.tw/channel/sandstorm/2015-06-01#143
  • 22:15:29 erikoeurch dwresha: thanks, seems close then -- just need to get rid of high probability of all data getting erased :D

Date: