Monday, 2018-10-15

dmsimardapollo13: doing code reviews can be helpful too btw, the changes are pretty focused and simple (I think)00:38
dmsimardYou can set yourself a dashboard based on searches, for example: https://review.openstack.org/#/q/project:%255Eopenstack/ara-.*+status:open00:38
*** njt has quit IRC07:12
*** njt has joined #ara07:12
*** gvincent has joined #ara07:53
*** jungleslow has quit IRC08:09
*** jungleslow has joined #ara11:11
jungleslowHey guys ! Ara is really great ! Congrats for all your efforts11:13
jungleslowCan we do authentication with the current version ?11:15
dmsimardjungleslow: no, the web interface is read only and authentication can be done with a web server like nginx or apache11:38
dmsimardThere won't be any authentication/permissions/acl/rbac even in the upcoming 1.0 release. This is so far by design to keep things simple.11:39
jungleslowSure, thanks a lot11:40
*** themurph has joined #ara11:41
jungleslowAnother question, I'm using apache and postgresql. So I'm connecting to the DB using in my ansible.cfg "database = postgresql+psycopg2://..." It's working with the password but now I want to hide it within git or with vault, is it possible ?11:50
dmsimardjungleslow: in 1.0 there'll be an API which will make this a bit more straightforward but for now it needs to be there12:06
dmsimardHow you put the data in your ansible.cfg is up to you, though12:06
dmsimardI mean, you can have a role that retrieves your database password from vault and put it there12:07
jungleslowOh I see. When do you plan to release Ara 1.0 ? :D12:11
dmsimardI've been working on it for >1 year now ? So any time soon I guess ? :p12:11
jungleslowNice ! Good luck dude !12:12
dmsimardIf you want to look: https://github.com/openstack/ara-server12:12
dmsimardhttps://github.com/openstack/ara-server/blob/master/doc/source/_static/graphs/recording-workflow.png12:14
dmsimardEr, I meant to link https://github.com/openstack/ara-server/blob/master/doc/source/arch.rst12:14
jungleslowThanks I will have a look !12:22
*** themurph has quit IRC12:46
*** themurph has joined #ara12:59
*** jrist has quit IRC13:34
*** jrist has joined #ara13:38
*** themurph has quit IRC13:44
*** themurph has joined #ara13:46
*** sshnaidm_ has joined #ara13:53
*** sshnaidm has quit IRC13:54
gnupyxdmsimard, hi, the graph is for the 1.0 release?14:00
dmsimardgnupyx: that particular graph explains a little bit how 1.0 works, yes14:03
dmsimardgnupyx: 0.x is similar but doesn't have an API14:03
dmsimardand everything is coupled together into the same backend14:03
*** tbielawa has joined #ara14:04
gnupyxyes I saw today that there is no API in ara 0.16 :)14:24
*** sshnaidm_ has quit IRC14:25
dmsimard1.0 is almost ready for wider beta testing. It's no longer a matter of months, it's a matter of weeks14:33
*** sshnaidm_ has joined #ara14:45
apollo13dmsimard: around?14:50
dmsimardapollo13: asquare14:51
apollo13what does that mean :)14:52
dmsimarda round14:52
dmsimarda square14:52
dmsimarddifferent shapes14:52
apollo13oh14:52
dmsimardsorry I'm tired lol14:52
apollo13not my day for that :D14:52
dmsimardapollo13: how cna I help14:53
apollo13dmsimard: do we need the nested router for playbook/files?14:54
apollo13I mean it is all nice and well, but what does it offer over the normal files endpoint?14:54
dmsimardapollo13: I need to go through my logs with gvincent to remember why it was relevant14:54
dmsimardgive me a few14:54
apollo13mhm, maybe because it was a m2m; I am just wondering if we want to "enfore" the extra package just so we can have a little bit nicer url14:56
*** tbielawa is now known as tbielawa|mtg14:59
dmsimardapollo13: so... between reading old discussions and looking at today's code14:59
dmsimardI'm failing to understand why we moved away from tying everything back to a playbook14:59
dmsimardin 0.x, almost everything has a fk to playbook.id14:59
dmsimard(including files)14:59
dmsimardOH15:00
dmsimardI remember15:00
dmsimardsort of15:00
* dmsimard hamster running15:00
apollo13yeah that would have been the next question; before I attack filtering and so I would have tied results and tasks to playbooks if you still think it should be there15:01
dmsimardSo in 0.x, we have this very very ugly piece of code: https://github.com/openstack/ara/blob/master/ara/models.py#L199-L23915:01
dmsimardThe gist of the issue being that there was a very racey condition where the playbook could have been created but not it's file (yet)15:02
dmsimardbut yeah, in hindsight15:03
dmsimard1) I'm not convinced we need a nested router15:04
apollo13how did you manage that in 0.x? I mean if you use transactions and all it would be all or nothing15:04
dmsimard2) I think we probably need to add the playbook.id fk to the models that are missing it15:04
dmsimardapollo13: someone hitting ctrl+c at the wrong time15:04
apollo13even then, a (db) transaction is all or nothing15:04
dmsimardthe file addition came later15:05
dmsimardbecause to add the file, you need the playbook id :)15:05
dmsimardbecause you need to tie the file to the playbook15:05
apollo13sure, but one db transaction…15:05
dmsimard¯\_(ツ)_/¯15:05
apollo13okay15:05
dmsimardanyway15:05
apollo13so it is not because ansible didn't give you access to the file yet or though15:05
dmsimardI think we can handle this better in 1.015:05
dmsimardright, it was someone hitting ctrl+c at a very unfortunate moment15:06
apollo13speaking from an API perspective, it would be great if one could for instance create a playbook with it's acompaning file via one API call15:06
dmsimardat least that's my understanding of it15:06
apollo13otherwise you have to prepare for all situations that can happen in between15:06
dmsimardapollo13: I think that was more or less the entire point of that nested router15:06
dmsimard(creating playbook and file together)15:07
apollo13ok, so lets reevaluate that as we go and I'll add the playbook as a start to everywhere15:07
apollo13ok, cause the nested router currently fails greatly at doing that as far as I can see :D15:07
dmsimardI'm not sure if we're even using it15:07
dmsimardI think the callback uses files directly15:08
apollo13perfect, I'll also remove it in a review request then and see what the integration tests say15:08
dmsimardapollo13: oh, it does use the nested router https://github.com/openstack/ara-plugins/blob/master/ara/plugins/callback/ara_default.py#L231-L23815:08
dmsimardhowever, at that point, we already have a playbook id available so we can fairly easily substitute that to use /api/v1/files instead15:09
apollo13ok, but nothing in there forces it to be nested15:09
apollo13yes15:09
dmsimardso we need to add playbook.id to files15:09
dmsimardplaybook.id to tasks and playbook.id to results15:09
dmsimardafaict15:09
dmsimardlet me merge the batch of changes in flight since it impacts the model15:10
apollo13well which would bring up one question about the datastructure as a whole15:10
apollo13if File points to playbook; the m2m from playbook to files beconmes redundant15:10
apollo13it also means that a file can only belong to a single playbook, which was probably the intention in the first place15:11
apollo13(file contents are shared but files are unique)15:11
dmsimardapollo13: yes15:11
apollo13on the other hand, there is also a foreignkey from playbook to file15:12
apollo13that one will become rather weird :D15:12
apollo13that file link is probably for the root play file itself?15:12
dmsimardyeah, we can remove that fk15:12
dmsimardthe objective here15:12
dmsimardis to positively identify the playbook file15:12
dmsimardvs any other file (tasks, roles, etc.)15:12
dmsimardin 0.x, there's a field in files "is_playbook"15:13
*** gvincent has quit IRC15:13
apollo13okay, what about a filetype choice field instead?15:13
apollo13like it would be interesting to know if a file is a template or a task etc…15:13
apollo13we do not have to use it initially, just as marker for is_playbook, but in the longrun it would be nice to mark all types15:14
dmsimardsure, but I don't know if ansible provides a way to meaningfully differentiate different file types -- all it does it to provide a list15:14
dmsimardso basically in 0.x15:16
dmsimardwe did like15:16
dmsimardselect * from files where playbook_id=foo and is_playbook=true to identify the playbook file15:16
dmsimardwhich feels overkill when there could be a quick lookup somehow15:17
apollo13*shrug* is lookup feels rather fast if properly indexed15:18
apollo13this lookup*15:18
dmsimardI don't have a strong opinion15:18
dmsimardeither way15:18
apollo13that is, performance wise I wouldn't rule it out15:18
apollo13same goes for playbook_id=foo and file_type="playbook"15:19
apollo13let me check the ara 0.x callback to see where and how you get the files15:19
dmsimardyeah15:19
dmsimardI can give you that15:19
dmsimardapollo13: https://github.com/openstack/ara/blob/master/ara/plugins/callbacks/log_ara.py#L318-L34315:19
apollo13as for types, I think we could infer it from the name15:19
*** gvincent has joined #ara15:19
apollo13dmsimard: ah now I understand your race condition15:20
apollo13the https://github.com/openstack/ara/blob/master/ara/plugins/callbacks/log_ara.py#L340 commit right in there ;)15:20
dmsimardyup15:20
dmsimardbut the commit is also necessary to get the ID of the playbook back iirc15:20
dmsimardI don't know, 0.x is over 2 years old now and I don't remember everything lol15:21
apollo13ok and on task start you get the task file? https://github.com/openstack/ara/blob/master/ara/plugins/callbacks/log_ara.py#L284-L298 ?15:22
dmsimardYeah, there's a couple places where we check to make sure we have files15:22
dmsimardSome files are included dynamically and aren't available or known to ansible when we look at first15:23
dmsimardyou can search for _load_files in 1.0 https://github.com/openstack/ara-plugins/blob/master/ara/plugins/callback/ara_default.py15:24
dmsimard1.0 also captures way more files than 0.x FWIW15:24
dmsimardit actually does capture vars files, meta, handlers, etc. stuff that wasn't in 0.x15:24
apollo13okay, but that's where it gets interesting15:24
*** gvincent has quit IRC15:25
dmsimardI wrote this almost a year ago now.. I should probably write a new update lol https://dmsimard.com/2017/11/22/status-update-ara-1.0/15:26
dmsimardA lot of the things in that last update are still relevant but I hadn't yet canned the 1.0 flask branch15:26
dmsimardI should probably tag that and delete the branch15:27
apollo13haha, you actually playbook_id on files there :D15:28
dmsimardif you're curious what 1.0 looked like with a flask-restful API instead: https://github.com/openstack/ara/tree/feature/1.015:28
dmsimardi.e, https://github.com/openstack/ara/tree/feature/1.0/ara/api15:28
dmsimarda lot of work went into it, thousands of lines of codes.. >100 commits :(15:29
apollo13what made you drop it?15:29
dmsimardflask-restful vs django-rest-framework15:29
dmsimardhttps://github.com/flask-restful/flask-restful vs https://github.com/encode/django-rest-framework15:30
dmsimardI was running into issues with flask-restful that were not easily fixable and the project isn't very active15:30
*** tbielawa|mtg is now known as tbielawa15:32
dmsimardgvincent showed me a poc of the ara API with drf in a few hours .. it took a long time to make up my mind and it was a hard decision but hopefully it's the best one for the long term15:32
apollo13certainly not a bad one ;)15:33
dmsimardI felt that keeping with flask-restful was just going to be digging ourselves into a hole deeper and that the longer we stayed on it, the harder it'd be to come out15:33
apollo13best is always relative15:33
dmsimardwell, drf provides a lot of things out of the box that flask-restful doesn't15:33
apollo13anyways, gotta think about a good way on how the api will look like15:33
dmsimardthe API browser is an example15:33
apollo13because you obviously don't want to post file contents more often than needed15:33
apollo13like in the end you'd probably will have specialized api endpoints that allow the creation of lets say a playbook and that will also return information on whether the playbookfile with name xyz and sha blabla already exists15:34
dmsimardapollo13: about file contents15:34
dmsimardI recently added a few commits to help us with that15:35
dmsimardhttps://github.com/openstack/ara-server/commit/be649f16d359cd48c1e549234d58a9ddf141beb315:35
dmsimardhttps://github.com/openstack/ara-server/commit/7f2b3c2802e3033e07c36c54b28727bfda52927515:35
apollo13yeah, saw that -- that will be absolutely needed15:36
dmsimardThe hashing should be deterministic so we can run it client side for looking it up if necessary15:36
dmsimardWe need to create a *file* but we might not need to create a *file_content*15:36
apollo13right, one question; currently Task has a FK to file15:37
apollo13to be want __every__ Task have it's own file?15:37
dmsimardno, many tasks can relate to one file15:37
dmsimardlike, if you have 15 tasks in a file15:37
apollo13ok, yeah15:37
dmsimardit'll have one file and one file content15:37
dmsimardbut 15 tasks15:38
dmsimardso again, the idea is for us to be able to determine which file this task was in15:38
apollo13fwiw, how married are you to sha?15:38
dmsimardI'm not, it's just what seemed like the most straightforward and wasn't md515:38
dmsimarddo you have any suggestions ?15:39
apollo13well, I see people moving to blake2b for that kind of stuff which is in python since 3.5 or 3.6 iirc15:39
apollo13mhm, 3.615:41
dmsimardapollo13: it's in the stdlib ?15:41
apollo13jupp, hashlib.blake2b15:42
apollo13either way, can we agree that I can open a PR to add playbook to Task and Result? and then later to File + remove files() from Playbook15:46
dmsimardyes15:47
dmsimardapollo13: something we need to think about also is what kind of data we should return for /api/v1/playbooks15:47
apollo13no files ;)15:48
dmsimardbecause it's going to end up returning basically everything15:48
dmsimardplaybook.tasks, playbook.results, playbook.files etc15:48
apollo13yeah, less than that :)15:48
apollo13I mean it's nice to have a "generic" api but the callback should still perform well :D15:49
dmsimardWe should probably return a list of IDs ? I remember working on HATEOAS slightly in the flask 1.0 https://spring.io/understanding/HATEOAS15:49
apollo13also the web UI if it is going to use that API15:49
dmsimardYeah the web UI is definitely going to be using that API15:50
dmsimardBut ideally in a way that makes it react (pun intended) quickly15:50
dmsimardSo loading data just-in-time instead of pre-loading everything15:50
apollo13yeah, but for that you do not really need a list of ids for instance15:50
apollo13also that list can be long for large projects ;)15:51
dmsimardright15:51
dmsimardThe web UI is likely going to retrieve a playbook id and then query the different other endpoints with that playbook id15:51
apollo13yeah15:52
apollo13although if that results in a shitload of api calls you might have to rethink that anyways15:52
dmsimardwell, it depends what's the best tradeoff between simplicity and performance15:52
dmsimardi.e, one large API call that returns everything vs one small API call that returns only what you care about15:53
dmsimardIf we keep the UI in 1.0 fairly similar to what we currently have in 0.x: http://logs.openstack.org/82/610382/1/check/tox-format/06b3af2/ara-report/15:54
dmsimardI could see the actual tasks only being loaded when I click on "tasks", for example15:54
apollo13jupp15:55
dmsimardright now in 0.x, everything is loaded although there are some clever hacks to shift some of that to be asynchronous or just in time15:55
dmsimardlike iframes inside modals15:55
dmsimard¯\_(ツ)_/¯15:55
apollo13hihi15:56
apollo13dmsimard: ok, did a first stab at it in https://review.openstack.org/#/c/610635/ -- integration tests obviously fail. does gerrit/zulu have a good idea on how to handle that now? I mean the reference to the ara-plugins@master will prevent this from working till ara-plugins is fixed…16:12
apollo13can I somehow reference another version or will we just merge as is and retest later…16:12
apollo13gotta see if I can fix it locally, lets see16:13
dmsimardapollo13: the intent is that the integration jobs should take the components from source if they have been prepared by zuul16:17
dmsimardZuul allows you to declare that a patch depends on another patch in another project16:17
dmsimardSo you can make an API change that implements a new feature, and then create your callback patch that uses the new feature16:19
apollo13ok, let me do that and lets see how we can link it up :)16:19
dmsimardI need to look at how we can make "ansible-integration" actually do this16:20
dmsimardBecause the dependencies can go both ways16:20
apollo13ok, got you https://review.openstack.org/#/c/610635/ and https://review.openstack.org/#/c/610640/ for now16:24
apollo13I think ara-plugins will still be green since it doesn't require ara-server changes16:24
apollo13so if that passes you can merge it and retest the server changes16:24
*** sshnaidm_ is now known as sshnaidm|afk16:24
apollo13gotta take a break, still on sick leave…16:25
dmsimardapollo13: all good, please take care of yourself :)16:43
dmsimardapollo13: huh, looks like we were already passing the playbook id when creating the task https://github.com/openstack/ara-plugins/blob/master/ara/plugins/callback/ara_default.py#L20917:20
dmsimardI guess it was just silently discarded17:21
*** tbielawa is now known as tbielawa|lunch17:27
*** bcoca has joined #ara18:10
*** sshnaidm|afk has quit IRC19:06
*** tbielawa|lunch is now known as tbielawa19:16
*** themurph has quit IRC20:23
*** tbielawa has quit IRC20:37
*** bcoca has quit IRC22:30
*** openstackgerrit has joined #ara23:58
openstackgerritMerged openstack/ara-plugins master: Pass playbook along during result creation.  https://review.openstack.org/61064023:58

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