ara-slack | <harlowja> @dmsimard did we get a release, | 02:44 |
---|---|---|
ara-slack | <harlowja> will start patch removal if so, ha | 02:45 |
*** harlowja_ has quit IRC | 02:53 | |
*** bcoca has quit IRC | 03:20 | |
*** harlowja has joined #ara | 03:22 | |
*** harlowja has quit IRC | 04:52 | |
*** resmo has joined #ara | 06:58 | |
hiroki | I'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 befor | 07:45 |
hiroki | '/static/packaged.....' | 07:46 |
hiroki | However, 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 avail | 07:47 |
_KaszpiR_ | nginx rewrite would be the easies | 10:04 |
hiroki | That 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 it | 10:53 |
hiroki | Another 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|off | hiroki: hi | 11:41 |
dmsimard|off | That would be the application context path | 11:41 |
hiroki | hi dmsimard|off , let me check | 11:42 |
*** rvgate has joined #ara | 11:42 | |
hiroki | You don' | 11:42 |
hiroki | You don't mean, ' @app.route('/static/packaged/<module>/<path:filename>')', right ? | 11:42 |
dmsimard|off | https://github.com/openstack/ara/blob/master/ara/wsgi_sqlite.py#L138 | 11:43 |
dmsimard|off | You 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 it | 11:44 |
hiroki | Ah, 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 |
hiroki | Let me try adding that line to webapp.py | 11:44 |
dmsimard|off | The concept is the same | 11:45 |
dmsimard|off | Or should be | 11:45 |
hiroki | dmsimard|off: https://ptpb.pw/mbmR | 11:46 |
dmsimard|off | hiroki: aaaahh, don't use match, that's just in the context of that particular wsgi middleware | 11:48 |
dmsimard|off | Put whatever prefix | 11:48 |
hiroki | You mean, app.config['APPLICATION_ROOT'] = 'whatever_prefix' ? I'll try it out right away | 11:49 |
dmsimard|off | Like = 'ara' would yield /ara/ | 11:49 |
hiroki | I've done app.config['APPLICATION_ROOT'] = 'ara' in webapp.py right under 'def create_app(....' | 11:51 |
hiroki | Not sure if that's what you meant, Python is not my best fu unfortunately | 11:52 |
hiroki | dmsimard|off: i've done -> https://ptpb.pw/0zGi it does not yield a working http://url/ara/ unfortunately | 11:58 |
dmsimard|off | hiroki: ok, I'll have to take a look after some back to back meetings | 12:00 |
hiroki | No worries dmsimard|off thanks so much for now ! | 12:01 |
hiroki | Been struggling for more than a day now, that's how much we're set in including ARA in our system baseline ;) | 12:01 |
dmsimard|off | hiroki: oh the least I can do is to help you get started then :D | 12:03 |
dmsimard|off | you should have come sooner haha | 12:03 |
dmsimard|off | hiroki: 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-routes | 12:04 |
hiroki | I'll check right away, thanks ! | 12:04 |
dmsimard|off | also the embedded webserver is managed by the "manage.py" module | 12:05 |
dmsimard|off | https://github.com/openstack/ara/blob/master/ara/manage.py | 12:05 |
dmsimard|off | which is flask-script https://flask-script.readthedocs.io/en/latest/ | 12:06 |
dmsimard|off | be back in a while | 12:06 |
hiroki | Great ! I'm going to do some trial & error | 12:09 |
dmsimard|off | hiroki: there's some notes here as well -- see the last comment https://storyboard.openstack.org/#!/story/2001123 | 12:11 |
dmsimard|off | (that's with apache though) | 12:11 |
hiroki | I'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/2xJS | 12:14 |
dmsimard|off | ara != 'ara' | 12:15 |
dmsimard|off | don't bother with the defaults for now | 12:15 |
dmsimard|off | or webapp | 12:15 |
dmsimard|off | any changes you do in the manage.py file will work | 12:15 |
dmsimard|off | (I think?) | 12:15 |
dmsimard|off | oh wait I see what you mean | 12:16 |
hiroki | Regardign the storyboard link with the referecne, we're basically doing the same. redirect /ara to /ara/ and then a proxypass: https://ptpb.pw/4zi0 | 12:16 |
dmsimard|off | yeah what you're doing should work but instead of ara, put 'ara' so it's a string and not a class reference | 12:16 |
hiroki | Ah ! Lemme try | 12:16 |
hiroki | Added -> APPLICATION_ROOT = 'ara' <- to manage.py . Yields the following error: https://ptpb.pw/GaeY https://ptpb.pw/KraG | 12:20 |
dmsimard|off | hiroki: app.config['APPLICATION_ROOT'] = 'ara' | 12:21 |
dmsimard|off | hiroki: where is the subfolder argument ? | 12:22 |
dmsimard|off | it doesn't seem like a valid arg according to https://github.com/smurfix/flask-script/blob/6ee7a6a2a0f26915107e8b16c2c7515898eca0d3/flask_script/commands.py#L348-L449 | 12:23 |
hiroki | woops, was left-over from before, you can ignore that. Reverted all changes and only touched manage.py -> https://ptpb.pw/450Z | 12:23 |
hiroki | That was me adding 'subfolder=app.config['APPLICATION_ROOT'],' in manage.py. I reverted that now | 12:24 |
hiroki | Tried 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 after | 12:36 |
dmsimard|off | sure, I'm still in meeting for a while | 12:37 |
dmsimard|off | need 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 :P | 12:46 |
*** tbielawa|woodysB is now known as tbielawa | 12:51 | |
*** tbielawa is now known as tbielawa|brb | 12:56 | |
*** tbielawa|brb is now known as tbielawa | 13:08 | |
dmsimard|off | ssbarnea: 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 |
ssbarnea | dmsimard|off: sure. just used it as a personal notepad :D | 13:15 |
dmsimard|off | that's fair, just want to manage your expectations | 13:15 |
ssbarnea | i am looking now at the right way to get the paths, checking the code. | 13:15 |
dmsimard|off | so for https://github.com/pycontribs/ara/issues/5 | 13:15 |
dmsimard|off | these have landed in master but haven't been released yet | 13:15 |
ssbarnea | i guess that your example was for checkout code, not installed module. | 13:16 |
dmsimard|off | you might be looking at the "latest" docs instead of "stable" | 13:16 |
dmsimard|off | https://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 |
ssbarnea | in fact i was looking at master README : https://github.com/openstack/ara | 13:17 |
dmsimard|off | I 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|off | ah, hrm | 13:18 |
ssbarnea | i guess you refactored it a little bit | 13:18 |
ssbarnea | i hope that my beta testing would prove useful | 13:18 |
dmsimard|off | I 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 yet | 13:22 |
dmsimard|off | I don't think this will happen often but I'll keep it in mind for the future | 13:23 |
ssbarnea | i think is time to enable pytest --doctest-modules | 13:27 |
*** bcoca has joined #ara | 13:31 | |
*** bcoca has joined #ara | 13:31 | |
dmsimard|off | interesting, didn't know about that feature | 13:33 |
dmsimard|off | ssbarnea: 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 valuable | 13:34 |
ssbarnea | dmsimard|off: in fact I need bit more to enable this, i will raise a CR for it. good idea. | 13:35 |
ssbarnea | i 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 upstream | 13:36 |
dmsimard|off | sure, I feel it's important to sync sometime next week so you know what's coming -- the API will likely be very interesting to you | 13:38 |
dmsimard|off | in 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 future | 13:38 |
ssbarnea | do you have anything against bumping pytest version? there are some useful features in newer version. | 13:39 |
dmsimard|off | ssbarnea: pytest is not pinned right now ? so it should be installing the latest version | 13:40 |
ssbarnea | dmsimard|off: well, not really unless you tell it to upgrade. anyway, i will include as part of my CR. | 13:41 |
ssbarnea | still trying to get all the options in place for testings the docs. | 13:41 |
openstackgerrit | Sorin Sbarnea proposed openstack/ara master: wip: enable doctests with pylint https://review.openstack.org/562587 | 13:43 |
ssbarnea | alembic.context.config does not exist is another problem | 14:04 |
openstackgerrit | Sorin Sbarnea proposed openstack/ara master: wip: enable doctests with pylint https://review.openstack.org/562587 | 14:06 |
*** Bakey has joined #ara | 14:20 | |
Bakey | apparently my ara install has died | 14:24 |
dmsimard|off | Bakey: died ? :( | 14:35 |
Bakey | yeah, dunno what happened, I'm sure it was self inflicted | 14:43 |
Bakey | I 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 seems | 14:44 |
dmsimard|off | Bakey: was database are you using ? | 14:46 |
Bakey | builtin | 14:46 |
dmsimard|off | Bakey: anything in ~/.ara (or wherever you are storing your things) | 14:48 |
Bakey | yeah there's a sqlite file with todays date stamp | 14:50 |
Bakey | and an ara.log from Nov 28 | 14:50 |
dmsimard|off | Bakey: ok -- so you ran a playbook but there's still nothing in the database ? | 15:16 |
Bakey | turns 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 from | 15:18 |
Bakey | it was causing all sorts of havok | 15:18 |
Bakey | so I ran another playbook and ansible.sqlite has data in it | 15:21 |
Bakey | and the timestamp for last change lines up with the playbook run | 15:21 |
Bakey | but the web UI still thinks the DB is empty | 15:21 |
Bakey | waiiiit a minute | 15:22 |
Bakey | I think I see the issue | 15:22 |
Bakey | ara is writing to /root/.ara | 15:24 |
Bakey | it needs to be writing to /var/www/ara | 15:24 |
Bakey | it needs to be writing to /var/www/ara/.ara | 15:24 |
dmsimard|off | ok so it's running as root | 15:24 |
dmsimard|off | and it defaults there because there's no "dir" configuration (or database) | 15:25 |
Bakey | is that an ENV variable or something I can set somewhere | 15:25 |
Bakey | also what happens if I copy root's sqlite file into /var/www/ara/ | 15:26 |
Bakey | or is it a stupid idea to symlink it | 15:26 |
*** resmo has quit IRC | 15:28 | |
Bakey | ok TIL why my ara broke | 15:31 |
Bakey | I copied my sqlite file over | 15:31 |
Bakey | and it broke again | 15:31 |
dmsimard|off | Bakey: if you're using /var/www/ara, I suppose it's because you're hosting it with apache and mod_wsgi ? | 15:32 |
Bakey | yes | 15:32 |
hiroki | dmsimard|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 |
hiroki | result) 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 a | 15:32 |
hiroki | HTTP 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 |
hiroki | See 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|off | hiroki: 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 |
hiroki | Working link: "GET /ara/file/7d0eb24b-0892-4dac-86be-fc9f5be5d48d/ HTTP/1.1" 200 - | 15:33 |
dmsimard|off | Bakey: if you look at the docs, there's a SetEnv directive in the apache vhost that points to an ansible.cfg file | 15:33 |
Bakey | yeah I got that working | 15:33 |
hiroki | Yes most definitely ! I'll be online the whole evening to try out anything you suggest :) | 15:33 |
Bakey | but something with my old sqlite file is hosed | 15:33 |
Bakey | when I tried to reuse it, ARA puked again | 15:33 |
Bakey | I renamed it and bounced apache and ARA created a new one and it's happy again | 15:34 |
Bakey | I would like to see if I can get that old history back, but you said you were going to lunch, this can wait | 15:34 |
dmsimard|off | Bakey: 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 it | 15:35 |
dmsimard|off | so basically, if you're running Ansible as root, it needs to be configured to use that database in /var/www/ara/ | 15:35 |
Bakey | yep, again, I'm working with a new sqlite db | 15:35 |
dmsimard|off | stepping away for a while, let me know if you end up figuring it out | 15:37 |
*** tbielawa is now known as tbielawa|around | 15:44 | |
Bakey | dmsimard|off: is this a sqlite3 db? | 17:09 |
Bakey | sqlite3_analyzer says my old db is OK | 17:16 |
Bakey | but ara pukes if I try to use it | 17:16 |
*** harlowja has joined #ara | 20:03 | |
*** gvincent has quit IRC | 21:11 | |
*** tbielawa|around is now known as tbielawa|pto | 21:23 | |
*** tbielawa|pto has quit IRC | 21:27 | |
openstackgerrit | Paul Belanger proposed openstack/ara master: Switch to debian-stable (stretch) nodeset https://review.openstack.org/562844 | 21:57 |
hiroki | dmsimard|off: could this be a possible bug somewhere ? -> https://ptpb.pw/HrCv | 22:05 |
openstackgerrit | Paul Belanger proposed openstack/ara master: Switch to debian-stable (stretch) nodeset https://review.openstack.org/562844 | 22:12 |
openstackgerrit | Merged openstack/ara master: Switch to debian-stable (stretch) nodeset https://review.openstack.org/562844 | 22:49 |
Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!