Wednesday, 2017-03-15

*** cliles has quit IRC00:15
*** cliles has joined #ara00:38
*** cuongnv has joined #ara01:24
*** cuongnv has left #ara08:52
*** karimb has joined #ara09:05
*** permalac has quit IRC09:26
*** permalac has joined #ara09:33
*** openstackgerrit has quit IRC10:18
*** karimb has quit IRC10:49
*** karimb has joined #ara11:15
*** karimb has quit IRC11:26
*** karimb has joined #ara11:29
*** Haros has joined #ara11:32
Haroshello11:33
Harosis anyone online? I have a quick question regarding ara and wsgi =)11:34
dmsimardHaros: hey, go ahead11:49
Haroshey dmsimard11:52
Harosso I used to run ara with wsgi in a virtualenv like this:11:52
Harosactivate_this = '/home/tlpmgm/virtualenv/bin/activate_this.py' execfile(activate_this, dict(__file__=activate_this))11:53
Harosfrom ara import app as application11:53
Harosbut now it seems with the latest update (0.12.3) that it doesnt work anymore11:53
Harosi get an ImportError: cannot import name app11:54
Harosprobabbly something is changed11:54
HarosI have seen the new documentation about configuring ara on apache11:54
Harosbut I was wondering if my "old" method can still work.11:55
dmsimardHm, I haven't run ara from within a virtualenv, it would be great to get it working so we can document it11:55
*** karimb has quit IRC11:55
Haroswith the previous version and my config everything was fine11:55
dmsimardHaros: I believe the difference is that now you need to call create_app explicitely while before that may have not been necessary11:56
dmsimardCan you look at https://github.com/openstack/ara/blob/master/ara/wsgi.py and compare ?11:56
*** karimb has joined #ara11:56
dmsimardHaros: ^ let me know if you're able to get it working12:17
Harosyep. I am on it now. It seems more TRICKY than I thought :P12:18
Harosops caps sorry12:18
*** karimb has quit IRC12:24
Harosoh cool made it. just had to improt the right modules / calls12:29
Harosimport ara.webappapplication = ara.webapp.create_app()12:29
Harosmaybe I can send you in your e-mail or somethign a more detailed view of how I run it in a virtualenv12:30
Harosin case you need it for documentation12:30
dmsimardHaros: you could even submit a documentation update if you wanted to! :D12:31
*** karimb has joined #ara12:34
*** karimb has quit IRC12:43
*** karimb has joined #ara12:46
*** openstackgerrit has joined #ara13:03
openstackgerritMerged openstack/ansible-role-ara master: add apache+mod_wsgi support to ara  https://review.openstack.org/43557613:03
*** JakeDEvans has joined #ara13:15
dmsimardleifmadsen: o/13:17
leifmadsendmsimard: ohai!13:17
dmsimardI got JakeDEvans in here for this docker thing13:17
leifmadsenJakeDEvans: ohai!13:18
dmsimardthere's four people working on docker things13:18
leifmadsenheard you've been doing some good work on a Dockerfile13:18
JakeDEvansheya13:18
leifmadsenyea, let's coordinate :)13:18
dmsimardso I figure I'd try to get people working together to do something great13:18
JakeDEvansI have this... https://github.com/JakeDEvans/docker-ara13:18
leifmadsen+113:18
JakeDEvansyou can decide if it's good or not13:18
JakeDEvansfirst attempt at docker, be kind13:18
leifmadsenJakeDEvans: so I have a small change to that which might be useful13:18
leifmadsenall good, it looks sane enough :)13:18
leifmadsenlet me pastebin mine13:18
dmsimardleifmadsen: can you poke doug to come in here too ?13:18
leifmadsenyou did show me yours...13:19
leifmadsendmsimard: yea!13:19
*** Ravi_ has joined #ara13:19
leifmadsen /invite dougbtv13:19
dmsimardfail13:19
leifmadsenoh maybe he's not in freenode, let me check13:19
dmsimardleifmadsen: you prepended a space yo13:19
leifmadsenyea, because otherwise it would have run :)13:19
leifmadsenI'm not a channel o[13:20
leifmadsenop13:20
leifmadsenso it won't work for me :)13:20
*** dougbtv has joined #ara13:20
dougbtvmornin'!13:20
dmsimarddougbtv: o/13:20
leifmadsenhi!13:20
dmsimardhey, so, I have an opinion13:20
dmsimardis this ansible-container thing sort of ready for production yet ? I used it a while back but it wasn't really mature yet.13:20
leifmadsendmsimard: good question! I was looking at using it for TOAD maybe13:21
dougbtvjust talking about it yesterday :) haha13:21
dmsimardit allows to build container images and deploy them with the same usual playbook and roles13:21
leifmadsenJakeDEvans: https://paste.fedoraproject.org/paste/EAT5bNhXLT3QAahObNrqXV5M1UNdIGYhyRLivL9gydE=13:21
dougbtvI'm not sure about maturity, though13:21
leifmadsensame13:21
dmsimardwe have this ansible role for ara that's not quite ready for prime time (yet) but it's getting there13:21
leifmadsenfor our usecase here, I can't imagine it's so complicated that it won't work13:21
dmsimardthe thing that's great about ansible-container13:21
dmsimardis that it doesn't require ansible o_O13:21
leifmadsenin the container itself right?13:22
dmsimardit builds a container with ansible in it and goes from there13:22
leifmadsenand I assume it doesn't use ssh13:22
dmsimardno, docker socket iirc13:22
leifmadsenright right, that's good13:22
leifmadsenthat's our problem with TOAD right now, in that we have to enable ssh in the container13:22
leifmadsen(not right)13:22
JakeDEvans@leifmadsen just use that instead and push?13:22
leifmadsenJakeDEvans: I do have a review open, but I have to update it13:23
dmsimardleifmadsen: well, I mean, ansible-container bootstraps itself with ansible in a container it builds13:23
dmsimardleifmadsen: after that it's free for all13:23
leifmadsenbecause I was trying something else initially, where I wanted to run ARA in one container, and then execute from another container13:23
dmsimardit can use ssh or whatever13:23
dmsimardit just runs ansible from inside a container13:23
dmsimardregular playbook and all13:23
leifmadsendoes it leave any remnants of ansible in the container post build?13:24
JakeDEvansI would run ansible from a container but I need my ssh-key + kerberos tokens to pass though13:24
dmsimardleifmadsen: let me make a drawing or something13:24
leifmadsenok! :)13:24
dmsimardleifmadsen: ok I suck at drawing13:27
JakeDEvansleifmadsen: do you know which starts first, entrypoint or cmd in dockerfile?13:27
dmsimardlet me type instead13:27
dougbtvJakeDEvans, entrypoint iirc13:27
dougbtv(you can parameterize your entry point with CMD)13:27
dmsimardleifmadsen: so you do "pip install ansible-container", this installs ansible-container (this does not install ansible)13:27
JakeDEvansleifmadsen: See I need to use that wait script if I'm using a mysql database, the app fails if it can't open that socket at boot13:28
dmsimardleifmadsen: you then do ansible-container init which will bootstrap the directory tree, create sample yaml files (say, docker-compose.yml/playbook.yml)13:28
dmsimardleifmadsen: and then you put your things, playbooks, roles, etc, just like a regular ansible thing13:28
dmsimardleifmadsen: and then you run ansible-container build which will create a "special" container where it will install ansible inside and run ansible from there as if it was your laptop, basically13:29
dmsimardand from the different ansible-container/compose.yml files, it defines what container images it will create and orchestrate13:29
dmsimardyou can only have it build the images but you can also deploy them13:30
dmsimardleifmadsen: maybe this will help, it was a reproducer for a bug but to give you an idea https://github.com/dmsimard/ansible-service-issue13:30
dmsimardhttps://github.com/dmsimard/ansible-service-issue/blob/master/ansible/main.yml is the playbook13:30
dmsimardhttps://github.com/dmsimard/ansible-service-issue/blob/master/ansible/container.yml is the docker-compose thing13:31
dmsimardthat's it13:31
dmsimardno need for docker files and whatnot13:31
dmsimardam I making sense or did I lose everyone ? :p13:35
JakeDEvansyou lost me but that's irrelevent13:35
dougbtvnow I'm itching to use it13:36
dougbtvI actually like Dockerfiles13:36
dmsimarddougbtv: s/like/hate/ ?13:36
dougbtvbut in the context of a larger ansible project, ansible-container makes sense13:36
dougbtvlolz13:36
dmsimarddougbtv: so what I hate about Dockerfile is that it's just bash13:37
dmsimardbasically13:37
dmsimardSo you end up having to do a lot of ugly bash to do things13:37
JakeDEvanslike pulling scripts and running them...13:38
dmsimardthat you get for free in ansible -- i.e, distribution/OS dependant logic.. or dynamic variables, or whatever13:38
JakeDEvansthe constant need to 'fix' race conditions13:38
dougbtvI know whatchya mean, but it's nice to be like "here's my image, here's the dockerfile that created it" the ansible abstracts it13:38
dougbtvwhich ansible is nicer to use than say.... a million bash scripts13:38
dmsimarddougbtv: sure13:38
dougbtvso depending on the context, I think both have their place13:39
dmsimarddougbtv: I mean you've seen kolla, right ? That's not just one Dockerfile :P13:39
dougbtvrofl13:39
dougbtvyeah, kolla is........ a piece of work13:39
* dougbtv understates heavily13:39
dougbtvso yeah, flip side of the coin is -- sometimes as a consumer of an image, who cares how it was created13:40
dougbtv...assuming you can trust it13:40
dmsimardyou mean docker is not secure by default ?13:40
dmsimardwhat is this nonsense13:40
dougbtvXD13:40
leifmadsenJakeDEvans: I think the "right" way is to use docker compose and use depends_on along with a wait in the compose file to let mysql start first13:44
leifmadsensorry, I was gone, so now I'm reading scrollback13:44
JakeDEvanslol no problem, working on adding 2000 lines of inventory to my ansible....13:45
leifmadsensounds like someone needs a dynamic inventory ;)13:45
JakeDEvanswaiting on devs...13:45
JakeDEvansyou thought waiting on OP was bad13:45
leifmadsenalways. waiting. on. devs.13:45
leifmadsenlike i mean yesterday, I had to wait a whole 10 mins for dmsimard to fix something for me13:46
JakeDEvanslol13:46
leifmadsenthe worst!13:46
JakeDEvansIt's been 4 months13:46
dmsimardten minutes13:46
dmsimarddamn13:46
JakeDEvansops must go on13:46
leifmadsendmsimard: you must really like me13:46
dmsimardsorry13:46
dmsimardleifmadsen: oh yeah btw I submitted something to clean up that config mess13:46
JakeDEvansso that was the source of my question, do I just RUN the wait in compose or add a CMD line?13:47
dmsimardhttps://review.openstack.org/#/c/445518/13:47
dmsimardleifmadsen: tested it myself from 2.1 through 2.3, lgtm13:47
JakeDEvansor dmsimard could just allow that mysql socket to retry13:47
JakeDEvansI mean, if wordpress can do it...13:47
dmsimardJakeDEvans: you mean ara gives up if mysql isn't available ?13:48
JakeDEvanscorrect13:48
JakeDEvansjust dies13:48
JakeDEvansspecify a VAR for the mysql database, and it's not there, socket fails, app dies13:48
dmsimardJakeDEvans: yeah that should be improved, I haven't yet used ara extensively with mysql myself, I have a use case for it but I need to get going13:48
dmsimardJakeDEvans: there's probably something built in in sqlalchemy to do that13:48
JakeDEvansI have a dockerfile you can test with :)13:49
leifmadsendmsimard: merge away! :)13:49
JakeDEvansyeah if you fix that we can just use entrypoint and drop a ton of hack/patch13:49
leifmadsenso personally, I don't think you should build in ANY wait logic to the ARA container13:49
leifmadsenthe container needs to be dynamic, and the orchestration engine (whatever that is) should provide the spin up / control / orchestration for you13:50
leifmadsenif you need to add it to the container, I consider that "doing it wrong"13:50
dmsimardso, hang on just a sec13:50
dmsimardhow many containers are we talking about here13:50
JakeDEvansleifmadsen: I literally had to install IIS SMTP on a box cause the dev expected a socket for smtp to ALWAYS be available and his api app was crashing his app13:51
dmsimardi.e, 3 ? ara+ansible+callback, mysql, ara+webapp ?13:51
dougbtvdocker-compose sometimes isn't enough, like say.... on a first spin up of mysql, it's gonna take some time13:51
dougbtvand another container might come up, try to connect, fail, and... wave goodbye13:51
JakeDEvansdougbtv: did you look at the git repo I posted, it has a wait in the dockerfile for compose13:51
leifmadsendougbtv: I feel like I saw yesterday a "wait" command or something where it can do a health check, and until it passes, the next container doesn't start13:51
dougbtvdidn't know you can do that in compose!13:52
JakeDEvansI tried the health check, might be a version issue on my end but it didn't work13:52
JakeDEvans2.1 you can13:52
dougbtvkubernetes has readiness probes, which is what you use there13:52
JakeDEvansdougbtv: https://docs.docker.com/engine/reference/run/#/healthcheck13:52
dougbtvJakeDEvans, thank you!13:53
leifmadsenhttps://docs.docker.com/compose/startup-order/13:53
JakeDEvansfor that to work properly you then need to also add (to your container) some way to do a proper healthcheck, netcat isn't enough.13:53
leifmadsenah gotcha13:53
JakeDEvansdepends_on is nice, but it's not ready state13:53
leifmadsenJakeDEvans: I think you can externalize your wait.sh script though13:54
dougbtvhealthcheck is tight, I had definitely used the wait-for-it as a crutcch for sure13:54
leifmadsenso the command is run by compose, not the container13:54
JakeDEvanshmm that would be good13:54
leifmadsensee that link above13:54
leifmadsenit's basically the same approach, but the command for wait.sh would be from compose, not the container13:54
JakeDEvansI'll say it again, first time making docker13:54
leifmadsenwhich is the "right" way to do this13:54
leifmadsenall good, you seem to be doing fine13:54
leifmadsenI had to google how to do this, I didn't "just know" :)13:54
leifmadsenbut I've used enough docker to know when I don't like something :D13:54
JakeDEvansso that command is not containerized ?13:55
*** Ravi_ has quit IRC13:56
leifmadsenright, I think it would live with your docker-compose.yml13:57
leifmadsenlooks like there are scripts provided by the community you can use13:58
leifmadsenhttps://github.com/vishnubob/wait-for-it13:58
leifmadsenhttps://github.com/jwilder/dockerize13:59
dougbtvoh snaaaap, you can use wait-for-it outside of the container?13:59
dougbtvcause yeah I'd totally crutched it by putting those inside the containers13:59
leifmadsenI think that's the intention yea13:59
leifmadsenlet docker compose (the host) run the command to know when to start the next container14:00
dougbtvthe example shows: `command: ["./wait-for-it.sh", "db:5432", "--", "python", "app.py"]`14:00
dougbtvwhich implies it's in the container14:00
dougbtv"These are small wrapper scripts which you can include in your application’s image" - These are small wrapper scripts which you can include in your application’s image14:00
dougbtvdammnit, double paste14:00
leifmadsenugh14:00
dougbtvtried to paste the url, it's the startup-order from docker-compose14:00
dmsimarddougbtv: I want that second of my life back14:00
dougbtvLOL14:00
leifmadsenwhat if you created a wait-for-it container that you could run against? :D14:01
dougbtvleifmadsen, this is why I go easy on you mom sometimes, that's such a nice idea14:01
leifmadsen.glare14:01
dougbtv:D14:01
leifmadsenthis docker stuff is just a fad anyways14:01
leifmadsenhack away~!14:01
leifmadsenoh so I had an idea...14:02
*** kvoz has joined #ara14:02
dougbtvthe containers are nice, but, just like 15 iterations of puppet scripts, or 5 iterations of ansible scripts.... everyone makes a bunch of iterations getting their scheduling right for containers14:02
dougbtvalright, welp... such good convo and thanks for the invite14:02
kvozIf I have a suggestion for improvement, where do I leave that?14:02
leifmadsenyou could use a wait-for-it type container, and then use depends_on: wait-for-it, pass the wait-for-it container a command, and that would be used to signal a return, so that it would move to the next line in the depends_on?14:02
dougbtvbut, i gtg for a bit, I'll be back in a while14:02
leifmadsendougbtv: back to work!14:03
dougbtvoh I'll be back, but only after I ski this wicked nice snow :D14:03
leifmadsenlol14:04
leifmadsensweet pow pow14:04
dougbtvgnar pow brah!14:04
leifmadsentriggered14:04
dougbtvXD14:04
* dougbtv gets pitted, so pitted14:04
leifmadsenright?!14:04
*** tbielawa has joined #ara14:04
kvozIt would be very nice if you were able to filter on specific playbooks in the report view14:05
JakeDEvansdmsimard: ara_1    | sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'mysql' ([Errno 113] No route to host)")14:06
JakeDEvansbtw.14:06
leifmadsendmsimard: is github issues an appropriate place to file issues?14:06
JakeDEvansara doesn't have issues for me14:06
dmsimardleifmadsen: kinda sorta, use storyboard if you don't mind https://storyboard.openstack.org/#!/project/84314:06
leifmadsenah perfect14:07
leifmadsenkvoz: ^^^14:07
dmsimardJakeDEvans: if you have an ubuntu launchpad, please use storyboard linked above ^14:07
dmsimardubuntu launchpad account*14:07
dmsimardJakeDEvans: otherwise I won't scold you if you file issues at github.com/dmsimard/ara (original upstream)14:07
dmsimardkvoz: so there's a way to do that14:07
dmsimardkvoz: it's not super convenient though -- depends on what you actually envision14:08
kvozdmsimard: Oh? How would I go about doing that?14:08
dmsimardkvoz: There's a variable ARA_PLAYBOOK_OVERRIDE that allows you to customize which playbooks will be shown in the UI. It's what is used under the hood to generate a static html report for one or many specific playbooks.14:08
dmsimardi.e, "ara generate html --playbook uuid"14:09
dmsimardyou get the playbooks uuid with something like "ara playbook list"14:09
dmsimardIf you mean being able to filter and search live in the UI, eh, maybe but I've sort of done an html/css/js overdose with the recent UI refactor so it might be a while unless someone else contributes it :)14:09
kvozdmsimard: ah okay. Yeah I suppose I could do that for a static page, but Yeah was more of a live search I had in mind :)14:10
dmsimardkvoz: I created it for you here https://storyboard.openstack.org/#!/story/200092014:11
dmsimardJakeDEvans: yeah, can you file an issue somewhere about needing to retry a bit14:11
*** tbielawa has quit IRC14:12
JakeDEvansdmsimard: https://github.com/dmsimard/ara/issues/11814:12
leifmadsenI have a crazy request that dmsimard isn't going to like :)14:12
leifmadsenit probably doesn't even make any sense anyways14:12
leifmadsenbut I want an API for ARA so I can run commands remotely on a server that has ARA installed :)14:12
* leifmadsen is doing it wrong...14:12
leifmadsenok gotta run, I need to eat14:12
leifmadsenback soon14:12
JakeDEvansleifmadsen: my docker doesn't like your entrypoint14:13
JakeDEvansleifmadsen: ara-manage: error: too many arguments14:13
kvozdmsimard: Cool thank you :) It is so requested here that I might write it and submit for review myself14:13
dmsimardkvoz: that would be super awesome, I'd help reviewing it.14:14
dmsimardleifmadsen: an API is something I want to14:14
dmsimardtoo*14:14
dmsimardleifmadsen: ara is still mostly living off of the foundation of the early prototype. I eventually want to do a better split: callback, server, client, API14:15
leifmadsendmsimard: nice!14:15
dmsimardThat will take a lot of time and effort because while doing that, I want to keep ARA as simple as possible because that's one of advantages I want to keep. "pip install ara; ANSIBLE_CALLBACK_PLUGINS=ara" and go14:15
leifmadsenJakeDEvans: I ran into that yesterday too... let me look at what I did wrong14:16
leifmadsenI thought it was fixed though14:16
leifmadsenhrmmmm14:16
leifmadsenJakeDEvans: try:  docker pull nfvpe/ara14:16
leifmadsensee if that works14:16
JakeDEvansit does14:17
JakeDEvansmight need to clean out my builds14:17
leifmadsenok so.... huh14:17
leifmadsenit should work :\14:17
JakeDEvansoohh...can't with command14:18
JakeDEvansso back to that issue14:18
leifmadsendmsimard: yea I'm mostly thinking for wanting to push logs into a server somewhere14:18
JakeDEvansleifmadsen: beats!14:18
dmsimardleifmadsen: push what where14:18
leifmadsenJakeDEvans: actually that's probably right14:18
dmsimardleifmadsen: cause I eventually want to try sending everything to logstash through the CLI14:18
leifmadsendmsimard: basically in my situation, I want to run oooq on a jenkins slave, and then push the logs to my infra14:18
JakeDEvansleifmadsen: docker run -it nfvpe/ara /bin/bash = poop14:19
dmsimardi.e, ara result list --all --format json |something > logstash14:19
leifmadsendmsimard: you don't even need logstash any more :)14:19
leifmadsenfilebeat can basically replace what logstash does14:19
dmsimardleifmadsen: bah, upstream has logstash so that's free14:19
JakeDEvansit can, but I like mutators14:19
leifmadsenJakeDEvans: I was under the impression that was all added to the latest filebeat14:19
leifmadsenand that I could mutate at the host14:19
leifmadsenI haven't tried the latest though14:19
JakeDEvansleifmadsen: you may be right, I can't keep track with the major changes in minor version of elastic14:20
leifmadsenI wrote a gnarly regex to parse Ansible output14:20
leifmadsenJakeDEvans: +114:20
leifmadsenI don't even ELK bro :)14:20
JakeDEvansthat's another fight, get all devs to log json, and proper json14:20
JakeDEvansfriggen 3 tier nested crap14:20
leifmadsenok really out, but JakeDEvans I tested latest Dockerfile and it started for me with:  docker create --name ara nfvpe/ara ; docker start ara14:21
leifmadsenI did break out some of the args into CMD but that was the only change, and I know I tested the ENTRYPOINT one14:21
leifmadsenmight just be that you're using another image hash?14:22
JakeDEvansI dunno, I'll mess with it later.14:22
JakeDEvansor I could wait for devs14:23
JakeDEvansdmsimard: (that issue I submitted, ;) )14:23
dmsimardpfff14:26
dmsimardit'll take like 10 minutes14:26
dmsimardor not14:26
*** Haros has quit IRC14:27
openstackgerritDavid Moreau Simard proposed openstack/ansible-role-ara master: Clean up ansible-role-ara  https://review.openstack.org/44598414:28
dmsimardJakeDEvans: okay, saw the issue -- I'll eventually look into it (not now, sorry)14:29
JakeDEvansthat's fine, I'll pull the patch from my dockerfile when it's fixed, then maybe we can get an official compose/dockerfile in the repo14:30
JakeDEvanswe ops like using docker for testing apps before we use them at scale/production14:31
dmsimardYeah, I'd be down for supporting something "official" -- I mean it's obviously requested a lot14:31
dmsimardFor python stuff I just use virtualenvs14:31
dmsimard¯\_(ツ)_/¯14:31
JakeDEvansmost people do, and for consultants using ansible it's perfect, but I have a dozen people running ansible in a mix of local, remote, jumpboxes, all over14:32
openstackgerritMerged openstack/ara master: Cleanup ARA configuration module  https://review.openstack.org/44551814:34
leifmadsenI haz done that returning thing!14:48
*** tbielawa has joined #ara14:56
*** tbielawa has quit IRC15:01
*** tbielawa has joined #ara15:04
*** tready has joined #ara15:13
treadyI'm trying to use nginx instead of apache & it's got me all turned around - has anyone done this setup?15:15
JakeDEvansdid you follow https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uwsgi-and-nginx-on-ubuntu-16-0415:16
treadyI was following this one: https://www.digitalocean.com/community/tutorials/how-to-set-up-uwsgi-and-nginx-to-serve-python-apps-on-ubuntu-14-0415:17
treadyI'll try that one15:17
JakeDEvanspersonally I'd try with an galaxy role15:18
JakeDEvanshttps://galaxy.ansible.com/Stouts/wsgi/15:18
JakeDEvansbut I haven't done that with ara yet15:18
dmsimardtready: hey o/15:18
dmsimardtready: the easy way with nginx is to reverse proxy to the embedded development server15:18
openstackgerritLeif Madsen proposed openstack/ara master: [WIP] Add Dockerfile for building ARA  https://review.openstack.org/44505815:19
dmsimardtready: I haven't come up with documentation to do it with nginx and wsgi yet (i.e, proxy to uwsgi)15:19
dmsimardtready: I'd be happy to accept a proposal for documentation on how to do it :)15:19
treadydmsimard: if I can manage it, I'll certainly let you know15:19
dmsimardtready: if I had to do it, I'd probably set up uwsgi (with the provided ara-wsgi script) and then have nginx reverse proxy to uwsgi15:20
dmsimardthere's probably other ways and that's okay too15:20
dmsimardideally no supervisor :)15:20
dmsimardtready: what's probably the important bit is that you *need* to pass an ANSIBLE_CONFIG env variable somewhere or the application won't know where to find/bootstrap it's configuration15:22
dmsimardi.e, https://github.com/openstack/ara/blob/master/ara/wsgi.py#L2215:22
dmsimardand http://ara.readthedocs.io/en/latest/webserver.html#apache-configuration (see SetEnv)15:23
*** kvoz has quit IRC15:40
openstackgerritDavid Moreau Simard proposed openstack/ansible-role-ara master: Clean up ansible-role-ara  https://review.openstack.org/44598415:41
*** gundalow has quit IRC15:55
*** gundalow has joined #ara15:55
openstackgerritDavid Moreau Simard proposed openstack/ansible-role-ara master: Clean up ansible-role-ara  https://review.openstack.org/44598416:04
*** karimb has quit IRC16:15
openstackgerritDavid Moreau Simard proposed openstack/ansible-role-ara master: Clean up ansible-role-ara  https://review.openstack.org/44598416:25
openstackgerritDavid Moreau Simard proposed openstack/ansible-role-ara master: Clean up ansible-role-ara  https://review.openstack.org/44598416:28
rattboihi all. We just started using ara a few days ago. Is there a preferred way to purge older data from the run database?17:02
rattboiwe have a 15-minute cron that runs ansible, and so ARA already has 370 separate runs in just the last few days.17:04
rattboiwe are investigating running ansible more based on update events instead of time-based, but in the meantime, it'd be useful if we could purge older runs from the db.17:04
rattboioh, I see there's a "playbook delete" in the cli17:05
leifmadsendmsimard: I would consider the PR 445058 "ready" at this point (I'll update the WIP tag")17:11
leifmadsenthe real question will be whether you want a Dockerfile at all17:11
leifmadsenI suppose it's harmless until we determine if ansible-container is better or not17:11
openstackgerritLeif Madsen proposed openstack/ara master: Add Dockerfile for building ARA  https://review.openstack.org/44505817:12
leifmadsendone17:12
*** dougbtv_ has joined #ara17:34
*** dougbtv has quit IRC17:34
*** dougbtv__ has joined #ara17:44
*** dougbtv_ has quit IRC17:46
dmsimardrattboi: hey, yeah, there is a playbook delete command17:56
rattboiyeah, I just tried it and had some success17:56
dmsimardrattboi: there's no logic to delete playbooks based on their age (although this has been requested before)17:56
dmsimardrattboi: but you could implement your own logic, say  -- "ara playbook list |logic |xargs ara playbook delete"17:56
rattboiI removed the oldest 20 plays, and it worked17:56
rattboiI was surprised that each removal took ~30 seconds, maybe more17:57
rattboialso, since the sqlite backend doesn't implement auto-vacuum, I had to go back in after the fact and run a sqlite vacuum17:57
rattboito recover any space17:57
dmsimardrattboi: is there a lot of data for each playbook ? how many tasks/hosts/results ?17:58
dmsimardDeleting a playbook isn't just deleting a playbook, it's a hierarchical delete that needs to also clean up everything that is tied to the playbook17:58
rattboiit also pegged the CPU at 100% :P17:58
rattboidmsimard: http://contrasjc-bastion.portbleu.com/ara/reports/17:59
rattboiI don't know what is considered a lot17:59
dmsimardSay I wanted to delete that first playbook, that's 5 hosts (and their facts), 8 plays, 37+1 files, 402 tasks, 612 results18:00
dmsimardI can see how that can take a bit of time, maybe it can be improved18:00
rattboiwe can just cron to remove the oldest hour or something for now18:02
dmsimardsure18:03
rattboiI have another question. We have this architecture where we have a script called ansible-runner that runs on a cron every 15 minutes, checking out the newest changes from our repo, then ansibling. It runs as a root cron to self-ansible the bastion, and as a less privileged user to ansible a handful of other hosts from the bastion18:05
rattboiif you look at the ara link above, you'll see install-ci.yml vs bastion.yml18:06
rattboibastion runs as root, install-ci runs as cideploy18:06
rattboiI had some difficulty getting ara working because of perms related around that18:07
dmsimard"getting ara working" = what ? the ansible callback ? the web application ?18:07
rattboiyes, both18:07
*** tbielawa is now known as tbielawa|lunch18:08
dmsimardoh I think I understand18:08
rattboifor the callback, there was a bootstrapping problem18:08
dmsimardyeah, both the web application and the callback expect read/write permissions to the database18:08
rattboibecause there's not a good shared place to set local_tmp18:08
rattboiso right now, I'm not even setting that, and I suspect that ara_log doesn't work because the little RPC file write would fail18:09
dmsimardlocal_tmp is only really required for the callback, it's where ara ends up writing temporary files18:09
dmsimardthere could probably be a dependency on it from the web application context but it doesn't use it -- maybe I can look into that18:09
dmsimardthe "dir" config is where the database and logs would be read/written from18:10
rattboiI also had a lot of problems trying to use your wsgi example from the docs, because we installed into a venv18:10
rattboiI ended up using uwsgi instead, and had better success18:10
dmsimardrattboi: ah, someone asked about venv deployment this morning too -- maybe it can help: http://eavesdrop.openstack.org/irclogs/%23ara/%23ara.2017-03-15.log.html#t2017-03-15T11:33:1918:11
dmsimardI'd welcome docs around deployment in venv and uwsgi(+nginx)18:11
rattboiyeah, I acutally did uwsgi + apache because we already have a solid apache role18:11
rattboibut it should be minor differences18:12
dmsimardSure, that's fine -- docs are there to get you started18:12
dmsimardI just don't want to document *everything* and every deployment scenario or else it doesn't end :)18:12
rattboiyeah, for sure.18:12
dmsimardI think I'd be happy to have embedded webserver, apache+mod_wsgi, nginx+uwsgi and venv somewhere in there18:12
dmsimardthat way people have somewhere to start18:13
rattboisince really 3 users need access to the ansible.sqlite file, I ended up having to chmod 666 the dir, which I'm not thrilled with18:13
rattboibut yeah, we're happy with ara so far. Just gotta get it tuned in.18:14
dmsimardrattboi: maybe mysql would be a better fit ?18:18
rattboiyeah, maybe18:25
rattboisqlite was the easiest to get somethign going18:25
*** karimb has joined #ara18:33
*** karimb has quit IRC18:52
*** JakeDEvans has quit IRC19:00
*** tready has quit IRC19:14
*** tbielawa|lunch is now known as tbielawa19:15
*** dougbtv__ is now known as dougbtv19:56
*** tbielawa has quit IRC20:58
*** tready has joined #ara21:24
dmsimardleifmadsen: hey I'll look at your stuff tomorrow21:38
leifmadsensounds good22:31
leifmadsenno rush :)22:31
leifmadsendmsimard: if we merge that Dockerfile in, then we could just setup a Docker hub link to build it for us22:32
leifmadsenat least until we determine if ansible-container is the way forward22:32
dmsimardleifmadsen: I thought those automated build things were a paid feature ?22:41
leifmadsenpretty sure you can trigger builds with webhooks and such22:41
leifmadsenhttps://docs.docker.com/docker-hub/github/22:42
leifmadsenas long as the repo is public, everything should be free22:42
dmsimardokay22:42
leifmadsenI've already got an NFVPE organization if you want to piggy back on that?22:42
dmsimardleifmadsen: oh that's not gonna work22:42
leifmadsen(basically, I could set it up)22:42
leifmadsenoh?22:42
dmsimarddon't have access to openstack repo settings22:42
leifmadsenoh right22:43
dmsimardbut22:43
dmsimardI guess on the openstack end we could have a post-merge job that'd build the container and push it to dockerhub or something22:43
dmsimardso the other way around22:43
*** tready has quit IRC22:44
dmsimardI'll try and come up with a POC tomorrow, there's too much snow today I *have* to go snowboarding22:44
leifmadsenyea, or could just make it part of the release process and "docker build -t foo/ara:<tag> ; docker push foo/ara"22:44
leifmadsennot like releases happen daily :)22:44
*** tready has joined #ara23:20

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