Une reponse par maître CROSSBAR/WAMP lui même :
14:16 < foxmask> hi
14:16 < foxmask> I have a question :)
14:17 < foxmask> I made a webapp that permits to deploy what I want where I want ; typcally I deploy EAR & WAR & config file in an applications server
14:17 -!- oberstet [~email@example.com] has joined #autobahn
14:18 < foxmask> I made a webapp that permits to deploy what I want where I want ; typcally I deploy EAR & WAR & config file in an applications server
14:18 < oberstet_> foxmask: yes?
14:18 < foxmask> I made it with django + celery (for the async part) ; and when I trigger a deployment from the webpage ; i'd like to get the result in that webpage but
currently the log stay in the console
14:19 < foxmask> I thought that could be the perfect use case for using autobahn/crossbar
14:19 < foxmask> but I dont see how to :)
14:20 < oberstet_> not sure if I get it yet .. let me reread for a moment
14:21 < foxmask> I read the exemple about django and the admin console that display the cpu/memory usage ; may be that could be the same path in a less complicated way
14:21 < oberstet_> so the goal is to press a button in a Web UI, and then this triggers the deployment of a Java WAR onto some appserver, and you want to get the deployment
log in the Web UI?
14:22 < foxmask> yes
14:22 < foxmask> exactly
14:22 < foxmask> currently
14:22 < foxmask> I use django + celery + ansible that do that
14:22 < oberstet_> here is how I'd approach that given a clean slate:
14:22 < oberstet_> the Web UI is a single-page Web app .. means: static HTML, and everything else comes via WAMP
14:23 < oberstet_> the button press will issue a WAMP call
14:23 < oberstet_> the procedure that receives the WAMP call (com.myapp.deploy_war) would be implemented by a backend WAMP component
14:24 < oberstet_> eg you could have a AutobahnPython/Twisted WAMP backend component implementing com.myapp.deploy_war() .. and then use Twisted awesome process spawning
support to spawn your WAR deployment tool
14:25 < oberstet_> the WAMP backend component would spawn the WAR deployment tool, and receive it's output (what it writes to stdout), and then ..
14:25 < oberstet_> 3 options: a) it accumulates all output from the WAR tool and only returns if the tool has completely finished
14:26 < oberstet_> b) the com.myapp.deploy_war uses progressive results, and then can already provide the output of the WAR tool to the caller (the Web UI thing) "as it comes"
14:26 < oberstet_> c) mix that with pubsub and let the WAMP backend thing publish "per-line" events for each line from stdout from the WAR tool
14:26 < oberstet_> still with me?
14:27 < foxmask> yes yes I read :)
14:27 < oberstet_> so this is easy to do, all real-time and bla bla, and you don't need to fuss with django, celery, etc at all
14:28 < oberstet_> unless you have other requirements that make you use django, I'd approach it roughly like above
14:28 < oberstet_> the WAMP backend component that spawns the actual WAR deployment tool can again run somewhere (does not have to run where CB runs .. but it can of course ..
and then you can have it started by CB automatically)
14:29 < foxmask> the requirement is my ability to use the SPA vs Django :)
14:29 < oberstet_> right;)
14:30 < oberstet_> JS is your friend;) nowerdays, and at least at the frontend (browser) ..
14:30 < foxmask> yes
14:30 < foxmask> I know :(
14:32 < oberstet_> there is a small, initial learning curve to get beyond the "server generates HTML" mindset and cramp everything into that model
14:33 < foxmask> I know but I dont know if we give me the time to learn that as my primary job is not to code but to admin application server
14:33 < oberstet_> there are a lot of upsides. e.g. think about testability. and and .. but granted, SPA vs dynamic server-generated HTML is a decision you must make first
14:34 < foxmask> In any case, I thank you for all your advice
14:35 < oberstet_> np;) come again. if you don't want/can use SPA, we can talk about doing it the "old way". we can make that work too, but it'll be more wheels, feel less
natural, etc .. cu!
14:35 < foxmask> thanks:)