IRC logs for #buildstream for Wednesday, 2020-07-08

*** hasebastian has joined #buildstream02:32
*** tristan has quit IRC05:58
WSalmoncrash has https://gitlab.com/celduin/crash/jetbot-system-bst/-/blob/master/elements/application/testing/application-test.bst but the fundimental issue is that while you can cache the "build-root" for use in a shell you can not bring it back in to a new element08:21
WSalmonso for python were the "build" is supper cheap then tests work ok but for anything with a big compile time then there is not good solustion altho i hvae been in many conversations about this over the years08:22
WSalmonsome work are to build with buildroot on and then use a build shell and runt the test in the shell but as a seperate invocation of bst08:23
WSalmon`bst shell -bt always element.bst -- make test` <- i havent tested that but it should run `make test` in the build directory as it was when the element finished08:25
*** tristan has joined #buildstream08:35
*** ChanServ sets mode: +o tristan08:35
juergbiWSalmon: we have https://gitlab.com/BuildStream/buildstream/-/issues/776 to track this08:42
juergbiit's considered a 2.0 blocker (at least a proposal to figure out whether this requires breaking changes)08:42
*** santi has joined #buildstream08:46
*** benschubert has joined #buildstream09:31
*** hasebastian has quit IRC09:37
tristanbenschubert, this is showing promise: https://gitlab.com/BuildStream/buildstream/-/blob/tristan/partial-variables-manual-string-join/src/buildstream/_variables.pyx#L53909:50
benschubertoh my :'D09:52
benschubertnice09:52
benschubertOn the scheduler side, I'm almost happy with the state to have a WIP MR for review+testing09:52
tristanI will still have to rewind to another version before some shuffling to try to get better performance09:53
benschubertmain blocker being the CI for bst-plugins-experimental so that I could push a new ostree plugin :)09:53
tristanbut just looking at Value.resolve(), that seems to be a net gain according to the profile09:53
benschuberthttps://gitlab.com/BuildStream/buildstream/-/merge_requests/1988 also if you have time, should be a quick one :)09:53
* tristan is really falling behind because of this variables nonsense, quite stressful :'(09:54
tristancoding_guidelines.rst09:54
tristanbenschubert, Do you think we could fix that so that patching it is not effectively a useless effort ?09:54
benschuberttristan: so that patching it is not effectively a useless effort -> not sure I understand?09:55
tristanMany months ago, there was a valuable effort in splitting out the CONTRIBUTING.rst guide into sections09:55
tristanAnd the result was that everything not directly in the CONTRIBUTING.rst is no longer in a TOC anywhere09:55
tristanyou have to "just magically know" where the subpage is and find it somehow with your browser09:56
benschubertoh, what?09:56
tristanSo all of that stuff, is as good as non-existant09:56
tristanThe release process, etc09:56
benschubertwhich explains why I couldn't find in in the docs09:56
benschubertdo we want this in the BuildStream docs directly? If so, I can add a new "Contribute to BuildStream" part?09:56
benschubertand we could cleanup things as we go?09:57
tristanHard to say, there is a hack we do I think for CONTRIBUTING.rst and for README.rst09:57
tristanwhich is that gitlab itself renders it, and they are *also* included in the docs09:57
tristanSo maybe we want a minor restructure so that in the docs, the CONTRIBUTING.rst is like an introduction page of the contributing section ?09:58
tristanSo it still says something relevant on gitlab.com ?09:58
tristanI don't really care personally if we have a CONTRIBUTING.rst file to satisfy gitlab.com's craving for one at all honestly09:59
benschuberttristan: So: A new 'contributing' section in the docs, which first page is our CONTRIBUTING.rst and then has sub categories with the rest?09:59
tristanbenschubert, I would say that CONTRIBUTING.rst is the first ToC entry in the new 'contributing' section in the docs10:00
benschubertyep, ok let me try something10:00
tristanbenschubert, that way, we get to keep rendering it in both10:00
benschubertyeah, will try something :) should we go in with this MR already though?10:00
tristanbenschubert, does "_can_" do anything in rst ?10:03
tristanI don't think so, that's my only comment though10:03
tristanI'll do it in the MR10:03
benschubertoh I don't know actually good point I'll double hceck :)10:05
benschubertthanks!10:05
benschuberttristan: also, around the messenger: https://gitlab.com/BuildStream/buildstream/-/merge_requests/1982/diffs?commit_id=82197ded517fd2a37370de58d0c65043cb33084b what do you think about this commit?10:06
tristanI don't know :-S10:15
benschubertwhat do you dislike?10:15
tristanWell, the fact that there is a root message handler hehe10:16
tristanI'm not seeing where the not-root message handler is being processed10:16
benschubertin every job10:16
benschubertbasically everytime you would use `Messenger.set_message_handler`10:17
tristanEvery time you launch a thread/job you internally set a job specific message handler ?10:17
benschubertyep https://gitlab.com/BuildStream/buildstream/-/merge_requests/1982/diffs?commit_id=82197ded517fd2a37370de58d0c65043cb33084b#d7d6127e94f4700edb5c77e9594ff85138d19dcd_546_54110:18
tristanAnd what does that job specific message handler do, it passes the message along to the root message handler ?10:18
benschubertthat was done since the start :)10:18
benschubertthe job specific message filters out 'LOG' messages, and passes it up yes10:18
benschubertwhile writing it into a log file10:19
tristanAnd stamps the task_id ?10:19
benschubertcorrect10:20
benschubertas was done before, though before it went through the 'queue'10:20
benschubertnow it is going through the 'root handler'10:20
tristanbenschubert, in terms of naming, I would prefer the opposite I think; e.g. set_job_message_handler()10:20
benschubertSure, I can do that :) or : `set_thread_local_message_handler` ?10:20
tristanBut I still wonder if it doesnt just make more sense to have an internal function which does the job-specific stuff if it's in a job, and unconditionally passes the messages along to the message handler10:21
tristans/if it doesn't make more sense/if it would be less complicated/10:21
tristanAlso note that your current commits don't document the differences between these two handlers (they just have different names and the doc comments don't explain why)10:22
benschubertright I should document that10:22
tristanCan I see the bit which propagates the message ?10:23
benschuberthttps://gitlab.com/BuildStream/buildstream/-/merge_requests/1982/diffs?commit_id=82197ded517fd2a37370de58d0c65043cb33084b#d7d6127e94f4700edb5c77e9594ff85138d19dcd_695_68910:23
benschubertI can actually use `use_job_handler` instead, which would make later re-work easier10:23
tristanWhich file ?10:23
benschubertjob.py10:24
tristanRight, I think that whole thing can be much simplified, without having two handlers10:25
tristanJust one handler for the frontend to handle messages10:25
tristanYou don't really need these codepaths for "propagation of messages" anymore, if they need not be propagated from a subprocess to the main process10:25
benschuberttristan: we seem to not propagate every LOG message though10:26
benschubertand add information on the element and such10:26
tristanbenschubert, The way I see it, before getting to job.py _child_message_handler(), there is a generic entry point to pushing a message10:26
benschubertso it's not such a trivial change10:26
benschuberttristan: correct10:26
tristanSomething which consumes a Message() object before pushing it into the complex shebang of message propagation10:26
tristanNow, that is a complex shebang of message propagation *because* of multiprocessing and Queues10:27
tristanInstead of keeping the complex shebang around10:27
tristanJust "if thread_local_job_data_is_around: do_thread_local_job_data_related_stuff(message)" and then "message_handler(message)"10:28
tristanYou just need to know if the thread local data has a job reference, and use that to do the local LOG message filtering and task_id stamping10:28
tristanwithout sending it all the way to another function before getting to the message handler (much less another function which needs to be "registered" with the Messenger)10:29
benschuberttristan: I like this idea better. Will need to jump to a meeting. be back in an hour (or two with lunch :/ )10:29
benschuberttristan: but basicallly pushing the knowledge of "am I in a job" to the messenger right?10:30
tristanBasically yeah10:30
tristanLess code, I think that code is no longer justified10:30
* tristan remembers adding it (before Messenger existed but same difference)10:30
benschubertI likw the idea. I'll try a change and send you th eocmmit :)10:30
tristanit was there because of Job <--> Main process Queues10:31
tristanWSalmon, before I try to diagnose your sample project's use of `link` element, you can confirm that this is indeed `master` you are working with, and not some tagged version ?10:50
*** tristan has quit IRC10:56
*** hasebastian has joined #buildstream11:05
douglaswinshipDoes anyone know how to restart / recreate the runners for bst-plugins-external?11:07
douglaswinshipFrom conversation yesterday, I understand that "group runner bastion-debian10-c-2-4gib-ams3-01" is gone.11:07
douglaswinshipThis has been holding up an MR and at least one other pipeline since Monday evening, and I've got no idea how they work so I don't know how to fix.11:07
traveltissuesit needs to use the group runners right? i don't have access to that11:13
douglaswinshipFrom earlier conversation, yes, I think so. It's a shared runner that buildstream also uses.11:14
douglaswinshipIn other news, "Completely abolish job pickling" may be the best commit title I've seen in a long time.11:21
traveltissuesjuergbi, do you have access to ci settings? ^^11:21
juergbiyes11:21
juergbibut afaik the issue is on the runner side, not the ci settings11:22
*** tristan has joined #buildstream11:22
*** ChanServ sets mode: +o tristan11:22
juergbimaybe I could move the still working bastion runner from the buildstream project to the buildstream group11:23
juergbiI've enabled bastion-debian9 for bst-plugins-experimental11:25
juergbithis should unblock CI there11:25
traveltissuesok, i thought that it was a group runner already, seems not11:26
traveltissuesthanks11:26
traveltissuesdouglaswinship: ^11:27
douglaswinshipjuergbi: brilliant, thanks!11:28
douglaswinshiphttps://gitlab.com/BuildStream/bst-plugins-experimental/-/pipelines/163620251 <== It's running. :D11:29
tristandouglaswinship, Are you going to follow through with your completions fix ?11:36
* tristan thinks we might not have https://gitlab.com/BuildStream/buildstream/-/issues/1358 if that was fixed :-S11:37
douglaswinshiptristan: sorry, I completely forgot about it. I've started using docker images whenver I do local builds, so the issue went away for me personally.11:43
douglaswinshipAnd I didn't fully understand the fix that we came up with either.11:43
douglaswinshipBut I can take another look at it later today.11:45
tristandouglaswinship, the cli.py tries to get the current API version in the global scope in order to print a pretty default in the click options for `bst init`12:10
tristandouglaswinship, just remove that noise for "2.0" and everyone is happy :)12:11
douglaswinshipI remember seing something about that code working fine, for its intended purpose in bst init, and the problem was that it couldn't be run during tab-completion.12:13
douglaswinshipI wonder if there's a straightforward way to get it to run as intended, when intended, without being called (and causing the exception), when it's not needed?12:14
tristandouglaswinship, global scope when parsing cli.py the version stuff is not in context12:15
tristanit becomes in context only when executing a command, but not at completion time12:15
tristandouglaswinship, An alternative might be to use the latest in the function body of `bst init` as a default, and set the click function declaration to something like "<LATEST>" or <"CURRENT VERSION"> to indicate in the --help or man pages that the default is the current version12:17
tristanand then special case it inside the function `if version=="<CURRENT VERSION>": call utils.get_api_version()`12:17
tristandouglaswinship, but I doubt we have to be that picky, really, this is just the default min-version to use for a freshly created project.conf, whether it should depend on latest of baseline 2.0 by default is up for debate12:18
tristandouglaswinship, fwiw, I've been poking fun at you for selfishly hoarding your functional bash completions for a week now, I thought you would have noticed :)12:21
tristandouglaswinship, I hope you don't mind hehe12:21
douglaswinshipI.... honestly haven't spotted any of that.12:22
douglaswinshipSo don't know whether to mind or not.12:23
douglaswinship:)12:23
tristandouglaswinship, some of it on this channel while I know your nick was around, some of it in channels where I expect you'd have a bouncer to reply missed messages12:23
tristanbut basically just that... completions came up a couple times, and I mentioned the reason why they don't work is because you are hoarding them to yourself12:24
douglaswinshipI don't have anything like that set up. If my nick isn't around, then I won't see the messags.12:24
douglaswinshiphah!12:24
* tristan thought highlighting your nick would be enough for you to notice them the following day, sorry if I misread that ;-)12:25
*** santi has quit IRC12:26
*** santi has joined #buildstream12:27
douglaswinshipoh, if i'm actually in the chat, then yes. I may have missunderstood.12:32
douglaswinshipEither way, message received now.12:32
tristanWSalmon, This is what I get: https://bpa.st/WWCA12:38
tristanWSalmon, I did the following: (A) checkout bsp-boardsupport.git, (B) checkout your bst2 branch in there, (C) edit sample/rpi4-features/elements/bsp-boardsupport.bst to set the tracking branch to also point to your branch12:39
tristan(D) cd sample/rpi4-features (E) bst source track bsp-boardsupport.bst (F) bst show deploy/image.bst12:40
tristan(E) is something that (F) otherwise asks me to do of course12:40
tristanIf I edit elements/freedesktop-sdk.bst I get a different error :-S12:43
tristanI think I found an issue with the landed juncle, but it's not the same as what WSalmon pointed out12:51
tristandouglaswinship, of course, I could do it myself, but I know you've been sitting on a patch so I sort of thought it would come :)12:58
Frazerhi, im trying to get a valid output from artifactcache in the tests so i can use `bst artifact list-contents` i have built it and tried other ways to try and get it to work, but seem to get `None of the specified artifacts are cached.` does anyone know why they wouldnt be?12:58
tristanFrazer, better to paste your test case somewhere, I presume it is an added pytest ?13:00
Frazertristan do you mean paste my commands and output?13:01
juergbiabderrahim[m]: fyi: https://gitlab.com/BuildGrid/buildbox/buildbox-fuse/-/merge_requests/3813:03
*** hasebastian has quit IRC13:08
tristanFrazer, when you said "in the tests" I suppose you mean the pytest test cases you added in the buildstream tests/ directory somewhere13:44
tristanFrazer, but sure, commands and output could give an indicator :)13:44
Frazerno sorry, just went into the project of artifactcache and ran `bst build` etc, will get it up. in the docs it said in order to use bst artifact you need to be in a project that caches it, which i assumed happened after `bst build`13:46
Frazertristan https://pastebin.com/wk50H2fE13:51
coldtomFrazer, i suspect you need to pass an element to the command, e.g. `bst artifact list-contents compose-all.bst`13:54
Frazerthanks, think i tried that before but with elements/....bst. sometimes forget that13:55
Frazeris there way to list all of the contents in the elements bst scripts, not just one13:56
tristanFrazer, for artifacts, the `element.bst` target is just a convenience, what `bst artifact *` commands take as input is generally /artifact names/14:01
tristanwhich is a path including the projectname/element-name/cache-key14:02
tristanIt was intended to support wildcards, not sure if that was implemented14:02
tristanFrazer, I would expect `bst artifact list-contents *` would show you "every content of every artifact", including every different build of every given element in the local artifact cache14:03
Frazercant seem to get it working that way with a wildcard or .(current directory which it suggested). can work on implementing that since itll prove useful when doing `bst source show` if we go through with it14:03
tristanOhhhhh14:07
tristanFrazer, you are probably giving the wildcard to bash, not to bst14:07
Frazerits done within `tox -e venv /bin/bash` so you maybe right14:08
tristanI also don't know if wildcarding was ever supported14:09
tristanI said it was the plan, I don't know if it was implemented14:09
tristanNot documented to at least: https://docs.buildstream.build/master/using_commands.html#bst-artifact-list-contents14:09
tristanFrazer, to try it, you might try single quotes14:10
Frazeroh yeah with quotes it works around *14:10
tristan`bst artifact list-contents '*'` or `bst artifact list-contents 'project-name/element.bst/*'` for every artifact produced by that element14:10
tristannote that specifying just an element, will only work if there is an artifact cached for the specific cache key of that element14:11
tristan(so it wont work if you modify the element after building it, but the old artifact matching the old key will still be there)14:11
Frazerok thanks, will keep that in mind when i start work on `bst source show` and elsewhere14:11
tristanSources of course are quite different as they don't have cache keys... although with the 'source cache' it might make sense to expose source cache keys :)14:13
tristanjuergbi, do sources have cache keys after all ? I wonder if that would make sense14:13
tristanFrazer, it also might make sense to have `bst artifact list`, i.e. list the artifacts which exist in the local cache14:14
juergbitristan: they do have cache keys right now with some caveats14:14
tristanwe don't have such a beast at the moment14:14
juergbiartifact list is actually something I need to bring up on the list14:15
juergbiwith remote asset API this would not be possible anymore14:15
tristanjuergbi, just wondering if it makes sense to consider exposing source cache keys in the CLI and making a more consistent CLI for artifacts and sources14:15
tristanif so, this might be a suitable blocker too14:15
tristanAh14:15
tristanNo more ?14:15
juergbiright now we internally have artifact list for shell completion of artifacts14:16
tristanWait, `bst artifact list` would not be possible ?14:16
tristanYes, lets not lose that :'(14:16
juergbithat's what needs to be discussed14:16
juergbithe remote asset API as remote protocol doesn't block local listing, of course14:17
tristanRight14:17
tristanI wouldn't have expected, thought that surprising14:17
juergbihowever, it's not something that is possible in the protocol (wasn't different with the current protocol)14:17
tristanAh, `bst artifact list` would not be possible remotely ?14:17
tristanAnd wildcarding in `bst artifact list-content` remotely would not either ?14:18
juergbiyes, this won't work14:18
tristanI mean, I'm more concerned with listing content of artifacts I have locally anyway, but it would be nice to have this power on a dedicated remote too14:18
juergbiand the current plan would be to use casd for the local storage of 'remote assets', so we would have the same limitation for the local case. however, locally, we could extend it, of course14:18
tristanperhaps `bst --remote foo.org/artifacts artifact list-contents 'project/*'`14:19
tristanlike that14:19
tristanHmmm14:19
tristanSo remote assets cannot be listed14:19
juergbiyes but besides protocol limitation, that would also be a potential security issue14:20
tristanReally ? I was of course thinking of extending the protocol in the future while remaining backwards compatible...14:20
tristanI think, once you have access to a remote, you have access to it14:20
tristanif you want to hide stuff, then dont give up the keys to that remote14:21
juergbiwhere you want strict isolation, you would probably not share instances14:21
juergbihowever, I think it's a nice attribute that it easily provides very simple although limited isolation14:22
juergbiI don't know whether anyone would rely on this, though (and I suppose listing could always be disabled)14:22
juergbitristan: what's your use case of artifact listing?14:23
tristanMostly local14:23
tristanI've built stuff, I want to know what's there, I want to download stuff that I've built, check out various versions of things I've built, etc14:23
tristanI want to know what comes out of the oven and "have" it14:24
tristanFor various reasons, I might also want to compare sizes of files for instance14:24
tristanI *definitely* want to be able to sort `bst artifact list` output by date, and by size14:25
tristanIf I think of it remotely, then I think: Everything I can do locally, I can do remotely14:25
tristanInstead of my own machine, I'm gonna swap it out for this remote build service14:25
tristannow my artifacts and builds happen on this other machine or cluster14:26
tristanSo I basically want everything I would want locally, but remotely14:26
tristanIdeally remoteness is totally transparent to me as a user14:26
juergbitristan: I'm wondering whether storing manifests (with all cache keys) for completed build sessions could be interesting14:27
tristanMaybe14:27
juergbithat could be stored locally for local sessions independent of whether remote execution was used or not14:27
tristanBut then you're creeping into "isolation on shared services" land, I can smell it ;-)14:28
juergbiand even if some artifacts themselves never hit the local cache (as this is optional at least for build-only dependencies)14:28
tristanAs a user, I would be surprised, I would say... but gitlab has been contributing to this cache all week, how come I can't see all the artifacts it created for this element and observe their sizes choronologically ?14:29
juergbinot sure what you mean with that. my suggestion would be a purely local log14:29
tristanOr "Hey jim, didn't you build that artifact yesterday ? it's not coming up in my `bst artifact list` output"14:29
tristanRight, I'm projecting14:29
juergbitbh, I don't want users to work like that14:30
tristanI'm thinking the local log is something you would use internally in the BuildStream cli to achieve separation14:30
juergbiI would want to use versioning on the bst project (source) side14:30
tristanI don't purport to know what users will do, I rather give them everything and enjoy seeing what they end up doing14:30
juergbiand you can always get artifact cache keys from a certain bst project version14:30
tristanYeah, but that's not convenient14:31
juergbinot sure I agree14:31
juergbiI'd want a change log14:31
tristanChecking this stamped version from last week in order to just observe the artifact output from last week ?14:31
juergbinot just some random builds with dates14:31
juergbimaybe the same element is built from 10 different branches in arbitrary order14:31
juergbiwhat does the build timestamp help?14:31
tristanSure, it's the same element though14:32
tristanWell, that's a good point for the timestamp14:32
juergbiwhy would I care about random builds of a single element?14:32
tristanWell, one would assume that you do14:32
tristanBecause you are the one building it, you and your colleagues14:32
tristanIn all likeliness, the artifacts from last year are purged14:33
juergbithe LTS branch from last year or even older might still be building14:33
tristanYou might be reusing some of them, but if you are looking at a specific one (say a compose or a late stage element ready for deployment), then you pretty much know it's the one you've been building all week14:33
tristanI get it; and agree, BUT - I think we get better context incrementally14:34
juergbiI'd rather be interested in annotating git log output with information about cached artifacts for a particular commit14:34
tristanI.e. we add `bst artifact list` and `bst artifact list-contents`14:35
tristanThen we expose more metadata over time14:35
tristanFeature requests pour in14:35
tristanPerhaps such change-log related data gets added14:35
juergbiso maybe stop it before, nudge it in the right direction ;)14:35
tristanEventually we get something more and more usable14:35
tristanIf we stop it before, we likely never get there14:35
tristanAnd instead we get this inconvenient experience of having to check out project source data at specific revisions in order to have the data we *just built* at our finger tips14:36
juergbiI would suggest improving the user experience of that but without losing the connection to the git log14:37
tristanBut there is no git log14:37
tristanI'm not sure that there ever really should be14:37
juergbiwe could cache mappings from bst project trees to cache keys14:38
juergbiwhich could make it fairly efficient to integrate it with git log (or any other VCS) to get artifact history without explicit checkout14:39
tristanAnd this would provide context somehow... for a single client, perhaps; a history of builds, could be interesting14:39
tristanMoreso for CI builds14:39
juergbibuild manifests could potentially be stored in a remote asset server14:39
juergbiso it could also be available for CI builds14:39
juergbiit's probably far from trivial but from the UX perspective this sounds much more interesting to me14:40
tristanI'm just saying; I don't know if another golden age will come when we get to do that much design up front; it might14:40
tristanAnd it all sounds pretty nice14:40
tristanI think realistically, if we have those kinds of build logs for given CI topologies (serieses of builds), it would compliment well the low hanging fruits of at least being able to talk to your artifacts, display their file lists, file sizes/artifact sizes and build dates14:41
tristanI think that if we block progress in that direction on better design, we are less likely to get there14:43
tristanIt would be nice to look at a "branch" in my artifact cache and observe it's history, though; that'd be awesome14:44
douglaswinshiphttps://gitlab.com/BuildStream/buildstream/-/merge_requests/198914:44
douglaswinship^^ tristan: the hoarding has ended!14:44
tristanI could checkout built revisions of it, possibly rebuilding missing revisions; possibly without even needing to reproduce the original project data14:45
tristanyay !14:45
douglaswinshipThanks for letting me do it, and not just doing it yourself.14:45
Frazersince the new remote asset api will affect the implementation of `bst artifact list` and needs to be discussed, will `bst source show` be discussed there too since i think that will hvae a similar affect?14:47
tristandouglaswinship, already reviewed :)14:48
tristanFrazer, No14:48
Frazerok, just checking14:49
tristanFrazer, this is quite unrelated, regardless of whether we use source cache or not, `bst source show` is still interesting/important14:49
tristanFrazer, from what I can tell, the aspects of (A) Addressing sources by cache keys and (B) Listing cached sources using wildcarded cache keys, are affected by this conversation14:50
tristanThat's all pretty pie in the sky anyway14:50
tristanpossibly closer than I imagine, all depends, let's see how these remote assets things land before thinking of more cool stuff we can potentially do with them :)14:51
Frazerthanks for the info14:51
tristanWow, that hour flew by14:51
tristanI thought I was going for a midnight walk14:51
tristanhmmm14:51
douglaswinshiptristan: good comments. Updated.15:00
* tristan hands completions to marge ;-)15:01
douglaswinshipOooops. We were both editing the MR at the same time. I appear to have unintentionally unassigned marge-bot.15:06
douglaswinshipDidn't realise that Gitlab doesn't do edit-locks15:06
douglaswinship(have reassigned it to her)15:07
*** benschubert has quit IRC16:56
*** cphang has quit IRC17:11
*** Frazer has quit IRC17:11
*** Frazer has joined #buildstream17:38
*** santi has quit IRC17:57
*** benschubert has joined #buildstream19:00
benschuberttristan: do you prefer something like: https://gitlab.com/BuildStream/buildstream/-/merge_requests/1982/diffs?commit_id=ce5b818dc8f71d4d5a58e429338681974d3a8ed5 ?19:19
benschubertMy idea of extending it later would be to allow passing a 'job' object in any API that we would need on the messenger to overwrite the 'default' context19:19
tristanbenschubert, I was just gonna ask you if you were still around ;-P19:19
tristanat 4am !19:19
tristanBen never sleeps !19:19
tristanhehe19:19
benschubertit's only 20:20 for me ;)19:20
tristanWhat am I looking at... so many files19:20
benschuberttristan: _messenger.py mainly19:20
benschubertthe rest are changes necessary to make this work :)19:20
*** xjuan_ has joined #buildstream19:21
tristanstill looks more beefy than I'd have expected19:22
tristanI guess we need the terminator signal handling for log flushing19:23
benschubertwe probably don't19:23
tristanAnd we would want the fd open for the duration of a job, regardless of how many threads get launched over the course of a job19:23
tristanWe don't ?19:23
benschubertWell we're in a context manager19:24
benschubertso we're guaranteed that it will be closed when we exit unless we have a really bad error (MemoryError)19:24
tristanWell, if we only handle SIGTERM in the main process, we still want it to join() the threads, flush etc19:24
benschubertor os._exit()19:24
benschubertyep, which we do :)19:24
benschubert(and it seems that it actually doesn't terminate as I would have liked to I need to fix a few things)19:24
tristanBut I suppose we we still want to flush on SIGTERM anyway19:25
tristanBecause we'll want to pass that fd along to child processes which block and cannot be expected to return to a .join()19:25
benschubertsigterm raises an exception and calls __exit__ on all CMs, so we'd be good19:25
benschubertthat's potentially true. Anyways we can try to remove that later on, I'd rather not right now :D19:26
tristanwhen to we enter record_job() ?19:26
tristanMy thoughts are really, we want this state (the log filename, the open log FD, etc) to be persistent across the lifetime of a job19:27
benschubertin job.py() https://gitlab.com/BuildStream/buildstream/-/merge_requests/1982/diffs?commit_id=ce5b818dc8f71d4d5a58e429338681974d3a8ed5#d7d6127e94f4700edb5c77e9594ff85138d19dcd_552_54519:27
tristanand whenever we fire a message, we know if we're in a job related thread, and we just branch and do the right thing19:27
benschuberttristan: that's fine as long as the whole job is done in a separate thread19:27
benschubertand I'd like to remove part of that job later on to be run on the main thread19:28
benschubertas I believe I could make a few things more efficient like this19:28
benschubertSo, the default now is, yes we don't need to know, everything works transparently19:28
tristanI think we're saying the same thing19:28
benschubertoh, awesome :)19:28
tristanI.e. the lifetime of a job sees it's resources allocated, and not redundantly opened and closed19:29
benschubertThat's correct!19:29
tristanIf that takes multiple threads during the lifetime, fine19:29
tristanWhich is what makes me wonder about this context manager approach19:29
benschubertand the _JobRecorder is the state for it, so we can pass it around if we want19:29
benschubertI think the context manager should be slightly re-worked later to generate a _JobRecorder but not actually set it for the thread19:30
benschubertand then we can have full explicit control when we want19:30
benschubertand when we enter a thread, we first set it globally19:30
benschubertso the plugins never have to know19:30
benschubertbut the core _can_ know19:30
benschubertanyways I need to go and eat. We can probably continue that tomorrow?19:30
tristanbenschubert, Can you just launch a benchmark for me ?19:31
tristanI might have something close19:31
benschuberttristan: let me know which branch, I'll run it after food!19:31
tristanhard to say with the shape of this data I'm testing against19:31
tristanI'll want the tip and the previous commit to the tip though (and master)19:32
tristanbenschubert, tristan/partial-variables-manual-string-join (7095f4336), and the commit before the tip (69ba55a0d)19:33
tristanand master19:33
*** lchlan has joined #buildstream19:34
tristanI have a feeling the tip might be close performance wise, and I'm curious if the before-tip would be more performant with more usual data19:34
tristanOne approach has Value.resolve() looking for resolved values in the dict (which is now double-suck because I need two loops in order to determine string length/width)19:36
tristanThe other approach has the values all lined up upon entry, which one would think *should* be more performant19:36
tristanBut with valentind's test data, the shape is such that there are many redundant variables to resolve in a single string, e.g. "%{foo}%{foo}%{foo}%{foo}%{foo}%{foo}%{foo}%{foo}%{foo}%{foo}%{foo}%{foo}%{foo}%{foo}"19:37
tristanMeaning it gets extra loopy in order to pass along one silly resolved "foo" to Value.resolve()19:37
tristanIt's a bit wild that the dict approach was doing better and my branch regressed after lining up the values :-S19:38
*** jjardon has joined #buildstream19:40
*** ChanServ sets mode: +o jjardon19:40
benschuberttristan: running!19:51
benschubertFor the messenger, withouth a proper review, which one would you rather go for, this version or the previous one?19:51
benschubertI'm getting close to a POC where I think the scheduler would be good enough :) Still have a few experiments I want to do and then, calls for testing and I'll split in multiple MRs19:52
benschuberttristan: here you go: https://gitlab.com/snippets/199407219:57
*** benschubert_ has joined #buildstream19:58
benschubert_tristan: we actually have the coding documentation in the toctree already: https://buildstream.gitlab.io/buildstream/CONTRIBUTING.html#further-information20:02
valentindtristan, There should not be more than one of every variable directly.20:14
tristanvalentind, hmmm, okay, I'll take that into account when pondering how these two approaches differ20:17
tristanbenschubert_, I can see it's still back a ways off, that same obnoxious .5 seconds, but believe I'm closing in on it :-S20:19
valentindBut note that it might use a two variables that expand using the same variables.20:19
tristanvalentind, right, when non-recursively collecting variables, you get to loop through a lot of vars to collect inputs, at varying depths20:20
tristanThe shape is certainly significantly different than many elements with similar, shallow-in-comparison variable tables20:20
tristanbut, the results are consistent20:21
tristanoh, no they're not20:22
tristanwell, in a way, anyway20:22
tristanI have a double-hash-lookup now so, with a single it would probably be cheaper than aligning the values20:22
tristanwhich tells me, there's got to be something wrong with the loop accumulating those values in the first place20:23
tristanalthough; it's all quite close - .5 seconds off of 6K elements when going from recursive to non-recursive20:24
* tristan turns off brain for tonight20:24
*** Trevinho_ has joined #buildstream20:25
*** benschubert has quit IRC20:28
*** benschubert_ is now known as benschubert20:28
*** xjuan_ has quit IRC22:44
*** benschubert has quit IRC23:28

Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!