Thursday, 2018-04-19

ara-slack<harlowja> @dmsimard did we get a release,02:44
ara-slack<harlowja> will start patch removal if so, ha02:45
*** harlowja_ has quit IRC02:53
*** bcoca has quit IRC03:20
*** harlowja has joined #ara03:22
*** harlowja has quit IRC04:52
*** resmo has joined #ara06:58
hirokiI'm trying to achieve ARA to serve me on 'http://fqdn:port/ara', instead of 'http://fqdn:port'. I've achieved this by modifying webapp.py and adding '/ara' to the ara.view.* directives and to the app.route right befor07:45
hiroki'/static/packaged.....'07:46
hirokiHowever, i'm still having trouble retrieving all statics 'css,images,js'. For some reason I can't get ARA to include '/ara' as a prefix for those generated URL's. Does anyone have a pointer perhaps ? I tried moving folders around and trying to change the template HTML files, but to no avail07:47
_KaszpiR_nginx rewrite would be the easies10:04
hirokiThat doesn't work, that's the whole reason i'm trying to resort to suboptimal solutions ;) Apache/NGINX/Hiawatha all don't work rewriting. I -can- however rewrite '^/static/$', but i'd rather have ARA add a prefix to it10:53
hirokiAnother issue i'm hitting in addition (just found out) is that clicking on a used yaml file redirects me to the HTTP version of the site, whereas the reverse proxy is accepting HTTPS and forwarding it locally to HTTP.10:54
dmsimard|offhiroki: hi11:41
dmsimard|offThat would be the application context path11:41
hirokihi dmsimard|off , let me check11:42
*** rvgate has joined #ara11:42
hirokiYou don'11:42
hirokiYou don't mean, '    @app.route('/static/packaged/<module>/<path:filename>')', right ?11:42
dmsimard|offhttps://github.com/openstack/ara/blob/master/ara/wsgi_sqlite.py#L13811:43
dmsimard|offYou could probably try adding that application root parameter -- if it's useful we can add support for it so you don't have to manually edit it11:44
hirokiAh, let me rephrase, i'm using the ara-manage runserver, not the WSGI interface. We only have access to hiawatha on the baselined hosts (hundreds of hosts, running reverse proxy with netdata, monit, and ara behind it to the local host).11:44
hirokiLet me try adding that line to webapp.py11:44
dmsimard|offThe concept is the same11:45
dmsimard|offOr should be11:45
hirokidmsimard|off: https://ptpb.pw/mbmR11:46
dmsimard|offhiroki: aaaahh, don't use match, that's just in the context of that particular wsgi middleware11:48
dmsimard|offPut whatever prefix11:48
hirokiYou mean, app.config['APPLICATION_ROOT'] = 'whatever_prefix' ? I'll try it out right away11:49
dmsimard|offLike = 'ara' would yield /ara/11:49
hirokiI've done app.config['APPLICATION_ROOT'] = 'ara' in webapp.py right under 'def create_app(....'11:51
hirokiNot sure if that's what you meant, Python is not my best fu unfortunately11:52
hirokidmsimard|off: i've done -> https://ptpb.pw/0zGi it does not yield a working http://url/ara/ unfortunately11:58
dmsimard|offhiroki: ok, I'll have to take a look after some back to back meetings12:00
hirokiNo worries dmsimard|off thanks so much for now !12:01
hirokiBeen struggling for more than a day now, that's how much we're set in including ARA in our system baseline ;)12:01
dmsimard|offhiroki: oh the least I can do is to help you get started then :D12:03
dmsimard|offyou should have come sooner haha12:03
dmsimard|offhiroki: FWIW if you're interested in looking at this while I have these few meetings, the direction you need to look at is a bit like this: https://stackoverflow.com/questions/18967441/add-a-prefix-to-all-flask-routes12:04
hirokiI'll check right away, thanks !12:04
dmsimard|offalso the embedded webserver is managed by the "manage.py" module12:05
dmsimard|offhttps://github.com/openstack/ara/blob/master/ara/manage.py12:05
dmsimard|offwhich is flask-script https://flask-script.readthedocs.io/en/latest/12:06
dmsimard|offbe back in a while12:06
hirokiGreat ! I'm going to do some trial & error12:09
dmsimard|offhiroki: there's some notes here as well -- see the last comment https://storyboard.openstack.org/#!/story/200112312:11
dmsimard|off(that's with apache though)12:11
hirokiI've just tried to add '    'APPLICATION_ROOT': ara,' in config.py under the DEFAULTS, and in manage.py 'subfolder=app.config['APPLICATION_ROOT'],' under the commands.Server section. It yields an error during a restart: https://ptpb.pw/2xJS12:14
dmsimard|offara != 'ara'12:15
dmsimard|offdon't bother with the defaults for now12:15
dmsimard|offor webapp12:15
dmsimard|offany changes you do in the manage.py file will work12:15
dmsimard|off(I think?)12:15
dmsimard|offoh wait I see what you mean12:16
hirokiRegardign the storyboard link with the referecne, we're basically doing the same. redirect /ara to /ara/ and then a proxypass: https://ptpb.pw/4zi012:16
dmsimard|offyeah what you're doing should work but instead of ara, put 'ara' so it's a string and not a class reference12:16
hirokiAh ! Lemme try12:16
hirokiAdded -> APPLICATION_ROOT = 'ara' <- to manage.py . Yields the following error: https://ptpb.pw/GaeY https://ptpb.pw/KraG12:20
dmsimard|offhiroki: app.config['APPLICATION_ROOT'] = 'ara'12:21
dmsimard|offhiroki: where is the subfolder argument ?12:22
dmsimard|offit doesn't seem like a valid arg according to https://github.com/smurfix/flask-script/blob/6ee7a6a2a0f26915107e8b16c2c7515898eca0d3/flask_script/commands.py#L348-L44912:23
hirokiwoops, was left-over from before, you can ignore that. Reverted all changes and only touched manage.py -> https://ptpb.pw/450Z12:23
hirokiThat was me adding 'subfolder=app.config['APPLICATION_ROOT'],' in manage.py. I reverted that now12:24
hirokiTried to reproduce https://gist.github.com/svieira/3434cbcaf627e50a4808 Did not work however. The DispatcherMiddleware block makes it complain that it isn't defined: 'NameError: name 'DispatcherMiddleware' is not defined'. I'm AFK for an hour or two, driving home. Will pick up straight away after12:36
dmsimard|offsure, I'm still in meeting for a while12:37
dmsimard|offneed to pay attention a little bit :)12:37
ara-slack<dmsimard> @harlowja new release is not out right, PTO has been getting in the way :P12:46
*** tbielawa|woodysB is now known as tbielawa12:51
*** tbielawa is now known as tbielawa|brb12:56
*** tbielawa|brb is now known as tbielawa13:08
dmsimard|offssbarnea: would appreciate if you could ask your questions here instead of github so other people might answer or benefit from the answers (also read: I wouldn't personally scale if everyone started asking questions on github :p)13:14
ssbarneadmsimard|off: sure. just used it as a personal notepad :D13:15
dmsimard|offthat's fair, just want to manage your expectations13:15
ssbarneai am looking now at the right way to get the paths, checking the code.13:15
dmsimard|offso for https://github.com/pycontribs/ara/issues/513:15
dmsimard|offthese have landed in master but haven't been released yet13:15
ssbarneai guess that your example was for checkout code, not installed module.13:16
dmsimard|offyou might be looking at the "latest" docs instead of "stable"13:16
dmsimard|offhttps://ara.readthedocs.io/en/latest/ vs http://ara.readthedocs.io/en/stable/13:16
dmsimard|off(there's a dropdown menu at the bottom left)13:16
ssbarneain fact i was looking at master README : https://github.com/openstack/ara13:17
dmsimard|offI was hoping to cut a release for 0.15.0 (from master) this week but it'll likely have to wait for next week :(13:17
dmsimard|offah, hrm13:18
ssbarneai guess you refactored it a little bit13:18
ssbarneai hope that my beta testing would prove useful13:18
dmsimard|offI suppose it's appropriate that the README has the latest information (based on master) -- i.e, the new setup modules from 0.15.0 but I can definitely understand how someone reading that might be confused if that feature is not released yet13:22
dmsimard|offI don't think this will happen often but I'll keep it in mind for the future13:23
ssbarneai think is time to enable pytest --doctest-modules13:27
*** bcoca has joined #ara13:31
*** bcoca has joined #ara13:31
dmsimard|offinteresting, didn't know about that feature13:33
dmsimard|offssbarnea: we should sync sometime next week (with PTO and stuff this week is not ideal) so I can share some of the details around where 1.0 is going -- that's where your feedback (and contributions) would be most valuable13:34
ssbarneadmsimard|off: in fact I need bit more to enable this, i will raise a CR for it. good idea.13:35
ssbarneai cannot promise long term involment but if i succeed introducing it to few simple jobs, i think people will like it, especially as it would make downstream experience closer to upstream13:36
dmsimard|offsure, I feel it's important to sync sometime next week so you know what's coming -- the API will likely be very interesting to you13:38
dmsimard|offin the meantime https://dmsimard.com/2017/08/16/whats-coming-in-ara-1.0/ and https://dmsimard.com/2017/11/22/status-update-ara-1.0/ should give you an idea.. and there's another overdue status update that will be posted in the near future13:38
ssbarneado you have anything against bumping pytest version? there are some useful features in newer version.13:39
dmsimard|offssbarnea: pytest is not pinned right now ? so it should be installing the latest version13:40
ssbarneadmsimard|off: well, not really unless you tell it to upgrade. anyway, i will include as part of my CR.13:41
ssbarneastill trying to get all the options in place for testings the docs.13:41
openstackgerritSorin Sbarnea proposed openstack/ara master: wip: enable doctests with pylint  https://review.openstack.org/56258713:43
ssbarneaalembic.context.config does not exist is another problem14:04
openstackgerritSorin Sbarnea proposed openstack/ara master: wip: enable doctests with pylint  https://review.openstack.org/56258714:06
*** Bakey has joined #ara14:20
Bakeyapparently my ara install has died14:24
dmsimard|offBakey: died ? :(14:35
Bakeyyeah, dunno what happened, I'm sure it was self inflicted14:43
BakeyI am attempting a reinstall now, and while it appears I have everything set up again, I've got nothing in the web UI so callbacks aren't making it into the database it seems14:44
dmsimard|offBakey: was database are you using ?14:46
Bakeybuiltin14:46
dmsimard|offBakey: anything in ~/.ara (or wherever you are storing your things)14:48
Bakeyyeah there's a sqlite file with todays date stamp14:50
Bakeyand an ara.log from Nov 2814:50
dmsimard|offBakey: ok -- so you ran a playbook but there's still nothing in the database ?15:16
Bakeyturns out I had some other issues when I dug deeper: this is a shared box and someone dropped an empty "ansible.cfg" in the git repo we normally run playbooks from15:18
Bakeyit was causing all sorts of havok15:18
Bakeyso I ran another playbook and ansible.sqlite has data in it15:21
Bakeyand the timestamp for last change lines up with the playbook run15:21
Bakeybut the web UI still thinks the DB is empty15:21
Bakeywaiiiit a minute15:22
BakeyI think I see the issue15:22
Bakeyara is writing to /root/.ara15:24
Bakeyit needs to be writing to /var/www/ara15:24
Bakeyit needs to be writing to /var/www/ara/.ara15:24
dmsimard|offok so it's running as root15:24
dmsimard|offand it defaults there because there's no "dir" configuration (or database)15:25
Bakeyis that an ENV variable or something I can set somewhere15:25
Bakeyalso what happens if I copy root's sqlite file into /var/www/ara/15:26
Bakeyor is it a stupid idea to symlink it15:26
*** resmo has quit IRC15:28
Bakeyok TIL why my ara broke15:31
BakeyI copied my sqlite file over15:31
Bakeyand it broke again15:31
dmsimard|offBakey: if you're using /var/www/ara, I suppose it's because you're hosting it with apache and mod_wsgi ?15:32
Bakeyyes15:32
hirokidmsimard|off: i'm back. Is there something I can try ? The only workaround we've found so far to get it 'working' is by doing: 1) a redirect from /ara to /ara/ and 2) reverse proxy /ara/ to https://127.0.0.1:9191 and 3) reverse proxy /static/ to https://127.0.0.1:9191 (both reverse proxies strip ara/ at the end of the proxied requests) and 4) edit webapp.py to change the views (about, file, hosts, reports,15:32
hirokiresult) to include /ara as a prefix (note: leaving the static route on the bottom intact deliberately) and 5) the ara runserver must offer HTTPS (our reverse proxies do incoming TLS and HTTP to the backends (ara)), if ARA offers HTTP instead of HTTPS, all works well except for the 'Files' section of a entry. Clicking on a included file has werkzeug/flask/something_else_i_am_not_aware_off sending the browser a15:32
hirokiHTTP link and therefore failing (the reverse proxy is HTTPS only incoming). It looks like for number 5) ARA sends a redirect because it's missing a trailing slash, which other links don't suffer from (tasks, the playbook link itself, etc). Changing the URL for a individual file works right away, so i'm suspecting the missing trailing slash is causing this ?15:32
hirokiSee also the redirect ARA sends when hitting a link to one of the included playbook files links: "GET /ara/file/71bf11a9-e3e0-4215-8819-61bc7b8ee65e HTTP/1.1" 301 -15:32
dmsimard|offhiroki: I'm going to need a while to parse that and I was on my way out to lunch, can I get back to you a bit later ?15:33
hirokiWorking link: "GET /ara/file/7d0eb24b-0892-4dac-86be-fc9f5be5d48d/ HTTP/1.1" 200 -15:33
dmsimard|offBakey: if you look at the docs, there's a SetEnv directive in the apache vhost that points to an ansible.cfg file15:33
Bakeyyeah I got that working15:33
hirokiYes most definitely ! I'll be online the whole evening to try out anything you suggest :)15:33
Bakeybut something with my old sqlite file is hosed15:33
Bakeywhen I tried to reuse it, ARA puked again15:33
BakeyI renamed it and bounced apache and ARA created a new one and it's happy again15:34
BakeyI would like to see if I can get that old history back, but you said you were going to lunch, this can wait15:34
dmsimard|offBakey: ok, so the general idea is that if you're running Ansible and Apache on the same machine, they both need to "agree" on where things are and have access to it15:35
dmsimard|offso basically, if you're running Ansible as root, it needs to be configured to use that database in /var/www/ara/15:35
Bakeyyep, again, I'm working with a new sqlite db15:35
dmsimard|offstepping away for a while, let me know if you end up figuring it out15:37
*** tbielawa is now known as tbielawa|around15:44
Bakeydmsimard|off: is this a sqlite3 db?17:09
Bakeysqlite3_analyzer says my old db is OK17:16
Bakeybut ara pukes if I try to use it17:16
*** harlowja has joined #ara20:03
*** gvincent has quit IRC21:11
*** tbielawa|around is now known as tbielawa|pto21:23
*** tbielawa|pto has quit IRC21:27
openstackgerritPaul Belanger proposed openstack/ara master: Switch to debian-stable (stretch) nodeset  https://review.openstack.org/56284421:57
hirokidmsimard|off: could this be a possible bug somewhere ? -> https://ptpb.pw/HrCv22:05
openstackgerritPaul Belanger proposed openstack/ara master: Switch to debian-stable (stretch) nodeset  https://review.openstack.org/56284422:12
openstackgerritMerged openstack/ara master: Switch to debian-stable (stretch) nodeset  https://review.openstack.org/56284422:49

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