Tuesday, 2019-01-15

dmsimardapollo13: it's beautiful :p http://logs.openstack.org/03/630303/8/check/ara-integration-fedora-2.7.5/9f9f2ad/logs/data/server/01:41
dmsimardnow, pretend we have that database file right there02:14
dmsimardgvincent: tristanC had some interesting ideas on how we could get the interface to work without the django api server running03:00
dmsimardI was pondering how to properly reproduce something that is similar to the current ara-report approach03:01
tristanCyeah, what i suggested is that for the "ci job report" interface, it would be great if the webclient could talk directly to the sqlite file, without having to bother with a rest-api service03:05
dmsimardThe other thing to think about is that "ara generate html" doesn't scale very well in 0.x, to the point where I don't like to recommend it03:05
tristanCand perhaps, we could add ara to the zuul's packages.json and then integrate the rendering component directly inside the zuul dashboard03:05
dmsimardapollo13: ^ if you have an opinion03:06
dmsimardoh, that too, yes03:06
gvincent@tristanC, How do you want to do this: "it would be great if the webclient could talk directly to the sqlite file, without having to bother with a rest-api service"07:03
tristanCgvincent: https://github.com/kripken/sql.js/#usage ?07:26
tristanCgvincent: perhaps we generate a javascript interface out of the django_rest relational model sql query?07:27
tristanChttps://github.com/kripken/sql.js/#loading-a-database-from-a-server07:28
tristanCor perhaps the (standalone) "ci job report" interface could just be a subset of the main interface, using manually written sql expression07:39
gvincentI don't understand tristanC the problem we try to solve here07:44
gvincent"how we could get the interface to work without the django api server running" < this?07:45
tristanCgvincent: this is the "ci job report" use-case, where the ara databases is just copied to a remote logserver. How would you setup an api service to expose those files content?07:46
gvincentok07:46
gvincentso maybe instead of producing a sqlite.db file07:47
gvincentwe can create a result.json file07:47
gvincentand load it with the configuration on startup07:47
gvincentlike we load the config.json file07:47
gvincentconfig.mode = "standalone"07:47
gvincentconfig.db = "results.json"07:47
tristanCgvincent: if sql.js could work, or that intermediary result.json file, then you would just go to "logserver/ara-ui.html?job=check/project/job/build/uuid/ara-report"07:48
gvincentyes07:48
gvincentthe main idea is then to create a interface for the persistence07:49
gvincentand choose the interface depending on the configuration07:49
tristanCgvincent: note that zuul is already producing a job-output.json... what would be the difference with the results.json? :-)07:49
gvincentI don't see the job-output.json07:50
gvincent:D07:50
tristanCgvincent: http://logs.openstack.org/56/535556/17/check/tox-pep8/5995841/job-output.json.gz07:50
gvincentI'm thinking about a json file with the interface of the API07:50
tristanCgvincent: sounds like exactly what we need :) (again, for the standalone ci job report use case)07:51
gvincentyeah the interface is not the same as the ARA api07:51
gvincentbut yeah07:51
*** themroc has joined #ara08:06
apollo13dmsimard: opinion on what exactly?08:47
apollo13oh hai tristanC :D08:47
apollo13having that whole stuff in zuul would be great08:48
*** herald85 has joined #ara08:52
tristanCapollo13: greeting, it seems like a great integration opportunity between zuul and ara dashboard09:15
apollo13absolutely09:15
gvincenthum manage.py was removed in ara server?09:41
gvincentok moved in ara/server/__main__.py09:42
gvincentthis introduce some cognitive effort ^09:45
gvincentlogger in test in the server are anoying10:04
*** jungleslow has quit IRC10:24
*** jungleslow has joined #ara10:26
openstackgerritGuillaume Vincent proposed openstack/ara-server master: Add Tasks, Records and Plays to Playbook serializer  https://review.openstack.org/63092610:29
ara-slackkelian.saintbonnet: @kelian.saintbonnet has joined the channel11:10
ara-slackkelian.saintbonnet: I everyone!11:18
ara-slackI am trying to make ARA work with AWX but I cannot get it work. I've successfully installed ARA in the awx_task container and configured it. If I try a playbook with the ansible-playbook command throught cli, the database is populated after the playbook run. However, if I try a playbook with AWX (via the web ui), the database is unchanged. Do you have any idea why it is not working?11:18
*** openstackgerrit has quit IRC11:22
apollo13kelian.saintbonnet probably awx uses it's own callbacks?12:28
ara-slackdmsimard: @kelian.saintbonnet there is an issue getting ara to work in the default virtualenv: https://github.com/ansible/awx/issues/1737#issuecomment-44245451912:49
ara-slackdmsimard: Create a new venv without inheriting system-site-packages, install ara in it, set it as callback and then select that new virtualenv you created in the awx web interface12:50
ara-slackkelian.saintbonnet: Thanks apollo13, I changed the callback plugin path in AWX web ui and I don't have error anymore. However, running a playbook still does not populate the database.13:52
ara-slackkelian.saintbonnet: I'll try your suggestion @dmsimard, thank you!13:52
ara-slackkelian.saintbonnet: @dmsimard I modified the /etc/ansible/ansible.cfg file to set the newly created virtualenv as callback and I set it in AWX as well. Is it the only field to be edited?14:06
ara-slackdmsimard: In your job templates, you should have a field to select the venv you're interested in14:08
ara-slackdmsimard: There might also be a field somewhere to use a specific virtualenv by default, I forget14:08
ara-slackdmsimard: I've been meaning to write docs about this for a long time but haven't got around to it. Would gladly accept a patch though :p14:10
*** etienne has quit IRC14:32
ssbarnea|roverdmsimard: please let me know when you have 10 free minutes as I want to check something with you about ARA UX.14:35
dmsimardssbarnea|rover: what's up ?14:48
*** openstackgerrit has joined #ara14:51
openstackgerritDavid Moreau Simard proposed openstack/ara-server master: Add Tasks, Records and Plays to Playbook serializer  https://review.openstack.org/63092614:51
dmsimardgvincent: ^ fixed the linters job error, was a minor thing14:51
ssbarnea|roverdmsimard: nothing in particular, but wanted to share some minor pains I have and see if newer versions are going to fix them, or if I could attempt to make a PR to address them14:54
ssbarnea|roverdmsimard: can we bj?14:54
dmsimardgvincent: left a comment in https://review.openstack.org/#/c/630926/14:55
dmsimardssbarnea|rover: unless there's anything confidential can we do it here so other people can weigh in if appropriate? :D14:55
ssbarnea|roverno confidential but more about visual, i want to show the layout.14:56
ssbarnea|roverexample: https://logs.rdoproject.org/openstack-periodic/git.openstack.org/openstack-infra/tripleo-ci/master/periodic-tripleo-centos-7-master-containers-build/ff19bca/ara-report/14:57
ssbarnea|rovera) content does not use full page width.14:57
dmsimardssbarnea|rover: the UI is being rewritten from scratch14:57
ssbarnea|roverdmsimard: ok. so no need to continue.14:58
ssbarnea|roverany previews?14:58
ssbarnea|roveri asked because i wanted to know if it would worth spending time making PR to alter current UI.14:58
ssbarnea|roverif is rewritten, it means that it should not try to do anythign.14:58
dmsimardssbarnea|rover: https://review.openstack.org/#/q/project:openstack/ara-web14:59
dmsimardhttp://logs.openstack.org/51/628451/7/check/ara-web-build-dashboard/ef65311/npm/html/playbooks14:59
dmsimardnote that it's far from finished, we are still working on getting the right pieces in the right places with the API14:59
ssbarnea|roverdmsimard: yep, looks easy stage but i like the direction. really happy to see that you already did something I wanted but didn't had time to say15:00
dmsimardcredit goes to gvincent :)15:01
ssbarnea|roverclicking on the playbook row should open the list of tasks, like a folder. another click should collapse it.15:01
ssbarnea|roveri see the playbook like  collapsable folder made of tasks15:01
dmsimardwe'll try to learn from the mistakes of the first ui15:02
openstackgerritGuillaume Vincent proposed openstack/ara-server master: Add Tasks, Records and Plays to Playbook serializer  https://review.openstack.org/63092615:02
gvincentssbarnea|rover> clicking on the playbook row should open the list of tasks, like a folder > yes this is a WIP https://review.openstack.org/#/c/628451/15:03
ssbarnea|rovergvincent: will I be able to expand/collapse multiple playbooks?15:04
gvincentnope15:05
gvincentssbarnea|rover, what problem you try to solve when you want to expand multiple playbook?15:05
dmsimardgvincent: re: manage.py -- what's the problem ?15:08
gvincenthere the etherpad we started https://etherpad.openstack.org/p/ara-ui15:08
dmsimardlogs are too verbose ?15:09
gvincentdmsimard, manage.py doesn't exists anymore15:09
gvincentand the replacement doesn't work15:09
dmsimardgvincent: it's been working for me? ara-manage <something>15:09
dmsimardara-manage runserver, ara-manage makemigrations, etc15:09
gvincenthow to you get ara-manage?15:09
dmsimardit's in $PATH when installed or in virtualenv bin directory15:10
dmsimardfor example https://github.com/openstack/ara-server/blob/master/tox.ini#L23-L2915:11
gvincentyeah so "pip install -e . && ara-manage test" doesn't work15:11
gvincentdjango.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.15:13
gvincentand except this, when somebody use to work with django, the command he run is "python manage.py test"15:14
gvincentremoving it force the user to read the doc15:15
gvincentthat is why I spoke about cognitive effort15:15
gvincent"pip install tox" doesn't work, the command is "pip install --user tox" or better "python -m pip install --user tox"15:16
dmsimardwe can maybe add manage.py back15:16
dmsimardI think I took it out when we switched the configuration to dynaconf15:17
gvincentthe commit message spoke about "python -m ara.server"15:18
dmsimardyeah but dynaconf required to be loaded dynamically at every endpoint (manage.py, wsgi, etc)15:18
dmsimarduntil apollo13 switched things around to not require that15:19
dmsimardso we can probably add manage.py back in15:19
apollo13didn't you leave manage.py as symlink anyways?15:19
apollo13gvincent: the SECRET_KEY will be missing when you use manage.py too ;)15:20
gvincent@apollo13, yeah it's more a configuration issue15:20
dmsimardI'm very on the fence about SECRET_KEY not being set by default15:20
gvincenttest should work out of the box15:20
dmsimardI know why it exists and why it is important15:21
dmsimardbut it's that one extra step that people didn't need to care about before15:21
gvincentI disagree15:21
gvincenthttps://github.com/lesspass/lesspass/blob/master/containers/backend/lesspass/settings.py#L11-L1415:21
dmsimardgvincent: so you have a different secret key at each runtime ?15:22
apollo13yeah, but then again that won't even work for the tests15:22
gvincentbut for test you can overwrite the configuration https://github.com/lesspass/lesspass/blob/master/containers/backend/lesspass/settings.py#L162-L17115:22
apollo13because currently integration or so has two invocations15:22
apollo13gvincent: that is a hack at best imo15:22
apollo13but I'd be okay with that15:22
dmsimardwhat we could do15:22
dmsimardis persist a generated random key in the config file15:22
dmsimardthe config file we generate at the end of settings.py15:22
gvincent@apollo13,  "yeah, but then again that won't even work for the tests" if you generate the secret key at startup if not in conf no15:23
dmsimardi,e, this file http://logs.openstack.org/03/630303/8/check/ara-integration-fedora-2.7.5/9f9f2ad/logs/data/server/default_config.yaml15:23
gvincentdmsimard, we should differenciate test from normal run15:23
dmsimardgvincent: tox takes care of setting the vars15:23
gvincentout of the box test should not require anything15:24
apollo13gvincent: they don't, tox takes care of that15:24
gvincentdmsimard, tox yes, but you need to read the doc15:24
apollo13*shrug*15:24
gvincentI try to follow the adage "don't make me think"15:24
apollo13I am fighting all day with people who don't think and then break something, so…15:25
apollo13ala; oh awx did lost my data15:25
apollo13well did you tell it to use a persistent storage for postgres? no why would I? because the supplied compose is for testing only…15:26
dmsimardgvincent: so I can address the missing manage.py15:26
dmsimardwe can agree on that15:26
gvincent@apollo13, fact is people don't read the doc, and a good interface is self documented15:27
dmsimardI think we agree that it would also be nice for SECRET_KEY to have a default15:27
apollo13gvincent: those people are not my target area though15:27
apollo13bbl gotta run15:27
apollo13anyways I am -1 on any default that decreses security to non-existant15:28
gvincentI can read the doc, my point was, I know django and python, and I needed to open the tox.ini and the readme to understand how I can only run unit test in a django project15:28
dmsimardapollo13: I'll try and see if I can propose something, we can discuss in the review15:28
dmsimardwould manage.py be exactly the same file as __main__.py ? should we symlink it ?https://github.com/openstack/ara-server/blob/master/ara/server/__main__.py15:29
gvincenthttps://www.amazon.com/Dont-Make-Me-Think-Usability/dp/032134475815:30
gvincentDon't Make Me Think: A Common Sense Approach to Web Usability, 2nd Edition15:30
*** etienne has joined #ara15:34
gvincentapollo13, we don't have the same target: my target are python devs who want to contribute on ara15:35
gvincentpython django dev* more precisely15:35
openstackgerritDavid Moreau Simard proposed openstack/ara-server master: Re-add manage.py to the root of the repository  https://review.openstack.org/63100615:36
apollo13dmsimard: afaik yes15:43
apollo13gvincent: don't get me wrong, I am not against running tests and even a dev server without any settings -- I am all in favor for that15:44
apollo13I just do not want to end up with a static SECRET_KEY in most deployments15:44
gvincentI agree with you so15:44
gvincent:D15:44
apollo13gvincent: and don't make me think is relatively; I think you usually cannot run any tests in a complex project without reading the docs15:45
apollo13ie what if you have a hard requirement on redis and postgres?15:45
gvincentfor you unit tests?15:45
apollo13yes15:45
apollo13ie if you are using json fields in your models, sqlite will not cut it15:46
apollo13or really, anything from contrib.postgres15:46
gvincentunit test should not rely on your implementation15:46
apollo13in theory yes, in practice it is rather hard to mock out your database15:46
gvincentI prefer integration tests for those, and design pattern to create good unit tests15:47
gvincentin lesspass I'm using docker to do some integration tests https://github.com/lesspass/lesspass/blob/master/containers/test.sh15:48
apollo13well yes, though most projects tend to mix unit and integration tests and I am not even sure django would let you start without pg if you use pg features15:48
apollo13gvincent: haha, now we are going full circle, as a django dev I'd expect manage.py test and now I should find a shell script to start a docker run? :D15:49
gvincent@apollo13, python manage.py works15:49
gvincenthttps://github.com/lesspass/lesspass/tree/master/containers/backend15:50
gvincentthose are different tests15:50
apollo13yeah, but the point being to execute the tests you need to read the docs15:50
apollo13the tests == all of them15:50
apollo13oh you are working on lesspass?15:51
gvincentI'm the creator of lesspass15:51
apollo13I never understood that project /o\15:51
apollo13I mean I understand, I just could never find a usecase15:51
gvincentI spoke about the unit test, the tox -e py3 on ara15:51
gvincentbut yeah if you want to run all the tests, on complex projects you will need to read the doc, or see the .travis.yml file :D15:52
gvincenthttps://github.com/lesspass/lesspass/tree/master/containers/backend15:52
ara-slackslackbot: Pssst! I didn’t unfurl https://github.com/lesspass/lesspass/tree/master/containers/backend because it was already shared in this channel quite recently (within the last hour) and I didn’t want to clutter things up.15:52
gvincenthttps://raw.githubusercontent.com/lesspass/lesspass/master/.travis.yml15:53
apollo13"unfurl"? what is that bot thingy trying to do?15:53
apollo13gvincent: right15:53
dmsimardnot sure what happened with the slackbot there15:54
dmsimardI think it just relayed a message that slackbot sent to it15:55
dmsimarder15:55
dmsimardara-slack is something I wrote to bridge irc and slack15:55
apollo13anyways, I am fine with setting the SECRET_KEY in tests with the hack lesspass uses and probably also fine to generate a random otherwise15:55
dmsimardthen there's slackbot which is that integrated slack bot thing15:55
apollo13I just think that the user experience from the latter is subpar if someone deploys it and wonders why they cannot login after a server restart15:55
openstackgerritDavid Moreau Simard proposed openstack/ara-server master: Create a persistent default random secret key if none are set  https://review.openstack.org/63101115:56
dmsimardapollo13, gvincent: what do you think about ^15:56
dmsimardIt seems like it works at first glance15:56
apollo13dmsimard: import get_random_string from django.utils.crypto15:57
apollo13https://github.com/django/django/blob/master/django/utils/crypto.py#L4815:57
dmsimardapollo13: sure15:57
apollo13that should work without settings module set15:57
apollo13(hopefully)15:57
gvincentyes random is cryptographically not a good generator15:58
apollo13otherwise looks good, though it will break if you split that out into a cli command :)15:58
gvincentI use SECRET_KEY=$(LC_ALL=C tr -dc A-Za-z0-9_ </dev/urandom | head -c 32)15:58
gvincentin lesspass to generate the env variable15:58
apollo13nice defensive coding, wouldn't have thought to set LC_ALL for tr :D15:59
gvincentit works on mac and linux15:59
gvincent@apollo13, it was in a hacker news comment when lesspass reach the main page16:00
gvincentit's not from me :D16:00
openstackgerritDavid Moreau Simard proposed openstack/ara-server master: Create a persistent default random secret key if none are set  https://review.openstack.org/63101116:00
dmsimardgvincent: there's a lot of smart people on HN if you can filter the trolls16:00
gvincenttrue16:00
dmsimardgetting to the front page of HN can be both a blessing and a curse :p16:00
dmsimardhappy to see you're still alive16:01
apollo13btw what do you folks think if we added some code to manage.py that would a) check if there is a tty and then b) ask to generate a default config before going on?16:01
gvincentbut troll are a good way to found the pain point of the user16:01
apollo13this would make it explicit that a config is generated and could also tell the user the location of it16:01
gvincentand if you read carrefully you have all the problem you need to solve if you want to be successful16:01
gvincentthis is my secret sauce :D for all startuper16:01
dmsimardgvincent: yeah, you need to try to find the useful feedback in there16:01
gvincentahah everyfeedback is good, the more hate you have, the better is16:02
dmsimardapollo13: could we perhaps just print something all the time ? regardless if there's a tty or not ?16:02
gvincentif people insult you, you know that the problem they have is big!16:02
dmsimardlike default configuration created at $path16:02
gvincentI think apollo13 imagine something like print("Secret not found, generating one ...")16:03
apollo13dmsimard: yes, and probably even "using config $xxx"16:03
dmsimardsure16:04
apollo13gvincent: I was mainly after an indication to tell the user what's going on16:04
gvincent+116:04
apollo13I'd be fine with either approach16:04
dmsimardwe can do both16:04
apollo13actually I think a print ala "generating secret key" in get_secret_key would be very nice to have and a good indication of what is going on16:07
apollo13sorry to be a pain in the ass, but I care strongly about security :(16:08
dmsimardno, we're on the same wavelength16:12
dmsimardI'm trying to see if I can use logging instead of a print16:12
dmsimardit's not printing right now :D16:12
apollo13ah yes, which logger are you using?16:13
apollo13oh wait16:13
dmsimardI'm thinking there might be some sort of race16:13
apollo13logging at this point might be weird16:13
dmsimardbecause logging is configured during settings16:13
dmsimardyeah16:13
apollo13because django might have cleared logging conf, yeah16:13
dmsimardso just a print then? :/16:15
apollo13I think that would be the safest16:15
*** dougbtv has joined #ara16:15
apollo13you could inspect & reconfigure the logging config but probably not worth it16:16
apollo13also I think the runserver messages are also print16:16
apollo13(not the access log, but the startup messages)16:16
dmsimardoh, wait, I know16:19
dmsimardhang on16:19
dmsimardok, it works, sending it in a sec16:22
*** themroc has quit IRC16:29
dmsimardah crap16:34
dmsimardfailed16:35
dmsimardammended my commit (muscle memory) while I wanted to create a new one haha16:35
apollo13reflog?16:35
dmsimardlet me split it out and send it16:35
openstackgerritDavid Moreau Simard proposed openstack/ara-server master: Create a persistent default random secret key if none are set  https://review.openstack.org/63101116:38
openstackgerritDavid Moreau Simard proposed openstack/ara-server master: Load logging from settings.py to tell users about the things we do  https://review.openstack.org/63101816:38
dmsimardapollo13, gvincent: ^16:38
dmsimardoops, stray comment16:39
apollo13hehe16:40
apollo13so I can discard my "You just did though ;)" comment on your print comment?16:40
openstackgerritDavid Moreau Simard proposed openstack/ara-server master: Load logging from settings.py to tell users about the things we do  https://review.openstack.org/63101816:40
dmsimardapollo13: yeah :p16:41
dmsimardah, wait16:41
dmsimardcaught something else16:41
openstackgerritDavid Moreau Simard proposed openstack/ara-server master: Create a persistent default random secret key if none are set  https://review.openstack.org/63101116:41
openstackgerritDavid Moreau Simard proposed openstack/ara-server master: Load logging from settings.py to tell users about the things we do  https://review.openstack.org/63101816:42
dmsimardsorry for the spam16:42
dmsimardhere, let me even get the new integration jobs to run on top of that tree16:43
openstackgerritDavid Moreau Simard proposed openstack/ara-infra master: WIP: New ARA 1.0 integration jobs  https://review.openstack.org/63030316:44
dmsimardapollo13: ^ so Zuul has this "depends-on" syntax that allows for preparing a git repo with a patch that hasn't landed yet16:45
dmsimarduseful when working with multiple projects16:45
apollo13interesting16:45
apollo13I just manually write the gerrit review url in there?16:46
dmsimardit also won't let the "child" patch merge so long as the "parent" patch hasn't merged16:46
dmsimardit works for projects that zuul knows about, yes16:46
dmsimardfor example if you're writing something in ara-plugins that won't work until something has landed in ara-server, you can put your patch in ara-plugins as depends-on of that ara-server patch16:46
dmsimardso when zuul runs the jobs for ara-plugins, it will pull that patch when installing ara-server16:47
dmsimardso you can test that it works without needing to merge16:47
apollo13nice16:47
dmsimardif we really wanted to16:48
dmsimardopenstack's zuul is also set up to know about ansible's github repo16:48
dmsimardso we could even use a depends-on a github PR link16:48
apollo13mhm, I have an idea16:48
dmsimardalthough right now we install ansible from pip16:48
dmsimardso we would need to adjust the job to use ansible from source if need be16:49
apollo13actually no, if we want to use logging at that level we have to do it like this16:49
apollo13grml, merge zuul I want to test that locally :D17:02
apollo13dmsimard: would it make sense to only write a default config if no ARA_SETTINGS are specified?17:03
openstackgerritMerged openstack/ara-server master: Re-add manage.py to the root of the repository  https://review.openstack.org/63100617:06
openstackgerritMerged openstack/ara-server master: Create a persistent default random secret key if none are set  https://review.openstack.org/63101117:06
openstackgerritMerged openstack/ara-server master: Load logging from settings.py to tell users about the things we do  https://review.openstack.org/63101817:06
apollo13dmsimard: haha, we need to make ara/server/__main__.py executable for the symlink to work properly, that is if we want to execute it without "python manage.py"17:07
dmsimardErrr17:11
dmsimardI... guess ?17:11
dmsimardapollo13: re: ARA_SETTINGS17:12
dmsimardMaybe17:12
openstackgerritFlorian Apolloner proposed openstack/ara-server master: Adjusted requirements to include yaml for dynaconf.  https://review.openstack.org/63102617:12
apollo13or we make it an actual file and just import the stuff, probably nicer17:12
openstackgerritFlorian Apolloner proposed openstack/ara-server master: Alternative approach to manage.py instead of symlink.  https://review.openstack.org/63102717:14
apollo13hehe and we are not even using the default config file17:15
dmsimardOh yeah, that's nice17:16
dmsimardI'll review after lunch17:17
apollo13this is what ara tries to load https://dpaste.de/cooS :D17:17
apollo13obviously not our default config :þ17:17
dmsimardThat's dynaconf ?17:19
apollo13yes17:20
apollo13that's where it looks by default17:21
apollo13that is if we do not set ARA_SETTINGS17:21
dmsimardI guess I will also need to update docs for SECURE_KEY17:21
apollo13which we need to set before loading the settings obviously, which means SERVER_DIR gets a chicken egg problem, though I'll just hardcode that for that17:21
apollo13SECRET_*17:21
dmsimardYes :)17:21
*** herald85 has quit IRC17:22
apollo13actually, default config like we set it now will break if you have a config and change server_dir there17:23
apollo13then it will write a new config :D17:23
apollo13I'll go fixing17:23
dmsimardThanks for fixing my stuff :p17:25
openstackgerritFlorian Apolloner proposed openstack/ara-server master: Fixed default configuration loading and do not write default config if a config is specified.  https://review.openstack.org/63102917:28
openstackgerritFlorian Apolloner proposed openstack/ara-server master: Fixed config code example if the path has spaces.  https://review.openstack.org/63103017:31
apollo13dmsimard: I am also going to lunch; any objections to rename DEFAULT_CONFIG to DEFAULT_SETTINGS to be in line with django/dynaconf terminology?17:32
dmsimardSure17:33
dmsimardNo objections17:33
openstackgerritFlorian Apolloner proposed openstack/ara-server master: Renamed most of config to settings and dropped the default_ prefix.  https://review.openstack.org/63103417:39
apollo13all yours17:39
apollo13sorry for the spam, I guess :þ17:45
dmsimardapollo13: if only I could get spam bug fixes every day18:43
dmsimardI would be soooo happy18:43
dmsimards/spam bug fixes/spammed by bug fixes/18:43
apollo13If I wouldn't have to work, I'd be soooooooo happy18:43
apollo13actually no, I like my work and wouldn't know what to do with my free time^^18:43
dmsimardapollo13: https://review.openstack.org/#/c/631029/ is failing on ERROR! Unexpected Exception, this is probably a bug: [Errno 2] No such file or directory: '/home/zuul/.ara/server/default_config.yaml'18:47
dmsimardhttp://logs.openstack.org/29/631029/1/check/ara-server-ansible-integration/b2c8d3b/ara-report/result/4f78e88f-aa59-4a19-83da-5d2823e3ce88/18:47
dmsimardand it's making the two other reviews failing since they're based on top of it18:47
apollo13no it's not a bug18:48
apollo13at least not in my code18:48
apollo13I think18:48
apollo13is ARA_SETTINGS set there?18:48
apollo13haha, I know why it fails18:49
apollo13because you did set SERVER_DIR externally but the default config should end up in the default location if not specified18:49
apollo13so yeah, default config creation probably needs an os.makedirs18:50
apollo13open to ideas, the thing is we need to construct something as default that does not need anything else from settings18:50
apollo13although we could place it in server dir if that is in os.environ18:52
apollo13I'll upload a new patch set18:52
apollo13this will get ugly18:54
dmsimardhmmmm18:54
apollo13I am not sure what the best approach is18:55
apollo13ARA_BASE_DIR is basically a setting18:55
apollo13so the default settings file should not depend on it18:55
dmsimardit should ideally not be hardcoded either18:56
openstackgerritMerged openstack/ara-server master: Adjusted requirements to include yaml for dynaconf.  https://review.openstack.org/63102618:56
openstackgerritMerged openstack/ara-server master: Alternative approach to manage.py instead of symlink.  https://review.openstack.org/63102718:56
apollo13dmsimard: I disagree, either we use a settings file from a hardcoded location or we set ARA_SETTINGS to specify our own18:57
dmsimardWe could "bypass" dynaconf for ARA_BASE_DIR and ARA_SERVER_DIR ?18:57
apollo13we could, though we'd have to reevaluate it right after loading because the config file could change those again18:57
dmsimardwe can call them something else18:57
apollo13although env variables would win I guess18:57
dmsimardand not include them in the config file template18:58
apollo13now that would be getting ugly :D18:58
dmsimardas to not induce confusion18:58
apollo13the thing is, if we do rely on those variables at all we write a new settings default file everytime this variable is changed18:58
apollo13which feels weird at best18:58
dmsimardok let's take a step back18:59
dmsimardultimately, these two variables are used to define where the default configuration file will be generated and where the database will be stored by default19:00
apollo13ultimately just one though, ARA_SERVER_DIR19:00
dmsimardI guess19:01
apollo13it might make sense to reduce it to one19:01
apollo13and then maybe use that to generate the config file19:01
apollo13the two feel kinda weird19:01
dmsimardI'm not sure I fully remember why these two exist19:01
apollo13I think it is just because django had base_dir and you probably then wanted different folders for client & server and what not19:02
dmsimardyeah19:02
apollo13I think we could drop server_dir and just use base_dir as base for ~/.ara/server19:02
apollo13~/.ara doesn't really matter for anything we do19:02
dmsimardsure19:02
apollo13we need one folder19:02
dmsimardok so now we have one setting instead of two19:02
dmsimarddoes that help us ? not really ?19:03
apollo13no, we still need to read it from the environment19:03
apollo13but that should be okay19:03
dmsimardcan we do something like19:03
apollo13still better than two19:03
dmsimardhmm19:03
dmsimardnevermind19:03
dmsimardyeah let's go with that for now19:03
dmsimardif it feels clunky we can iterate on it19:04
dmsimardos.getenv("ARA_BASE_DIR", os.expanduser("~/.ara/server")) ?19:04
dmsimardor ARA_SERVER_DIR, I suppose19:04
dmsimardoh, that's where django will end up sending static files too19:05
apollo13yeah19:06
apollo13although that is just defaults, users can change it then anyways19:07
apollo13so BASE_DIR = os.getenv("ARA_BASE_DIR", os.expanduser("~/.ara/server")) sounds fine to me19:07
apollo13with the fact that we need to reread it after loading settings if someone did change it there19:07
openstackgerritFlorian Apolloner proposed openstack/ara-server master: Fixed default configuration loading and do not write default config if a config is specified.  https://review.openstack.org/63102919:12
apollo13dmsimard: ^ next try, let's see what zuul says19:13
*** weshay has joined #ara19:26
openstackgerritFlorian Apolloner proposed openstack/ara-server master: Fixed default configuration loading and do not write default config if a config is specified.  https://review.openstack.org/63102919:38
apollo13typo ;)19:38
*** dougbtv has quit IRC19:44
dmsimardapollo13: +2 on https://review.openstack.org/#/c/631029/3 but left a comment22:55
openstackgerritMerged openstack/ara-server master: Add Tasks, Records and Plays to Playbook serializer  https://review.openstack.org/63092623:19

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