Deploying Crossbar.io applications

217 views
Skip to first unread message

tim.in...@gmail.com

unread,
Aug 18, 2014, 6:22:40 AM8/18/14
to autob...@googlegroups.com
Hi Tobias,

We have the first instance of our app working and are in the process of tidying it
up ready to let a first customer have a look, so I am thinking about deployment (on Windows).

I don’t want the customer to have to install Python, twisted, autobahn, crossbar.io,
and all the other python dependencies, as that can be quite daunting, and error prone
too when you consider the need to configure the PATH etc.
so I am thinking about creating Windows executables as a tidier solution, maybe using py2exe.
I think I would need to create one such executable for our Python app and another for crossbar.io
itself.

Does that sound reasonable to you ?

Thanks,
Tim

Tobias Oberstein

unread,
Aug 18, 2014, 3:40:58 PM8/18/14
to autob...@googlegroups.com
Hi Tim,

Am 18.08.2014 12:22, schrieb tim.in...@gmail.com:
> Hi Tobias,
>
> We have the first instance of our app working and are in the process of
> tidying it
> up ready to let a first customer have a look, so I am thinking about

Oh, cool! Congrats!

> deployment (on Windows).
>
> I don’t want the customer to have to install Python, twisted, autobahn,
> crossbar.io,
> and all the other python dependencies, as that can be quite daunting,
> and error prone
> too when you consider the need to configure the PATH etc.
> so I am thinking about creating Windows executables as a tidier

I agree, in can be a challenge on Windows for people not doing this on a
daily basis.

And I agree and self-contained, portable EXE can make this easier.

> solution, maybe using py2exe.
> I think I would need to create one such executable for our Python app
> and another for crossbar.io
> itself.
>
> Does that sound reasonable to you ?

Yes, that sounds reasonable. In particular since it allows the customer
to "update" (download) new versions of CB and your app independently.

We had this kind of packaging for WebMQ (the predessor of Crossbar.io).

And we want to have it again:

https://github.com/crossbario/crossbar/issues/100

We were using

http://www.pyinstaller.org/

I have uploaded the old build stuff here

https://github.com/oberstet/scratchbox/tree/master/python/pyinstaller/webmq_exe

(with no cleanups .. it's a bit messy .. we should do better now).

This would be a welcome contribution to Crossbar.io: if you figure out
how to package CB to EXE .. maybe taking above as a starting point.

I guess it's some fiddling around .. but it should work.

Cheers,
/Tobias


>
> Thanks,
> Tim
>
> --
> You received this message because you are subscribed to the Google
> Groups "Autobahn" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to autobahnws+...@googlegroups.com
> <mailto:autobahnws+...@googlegroups.com>.
> To post to this group, send email to autob...@googlegroups.com
> <mailto:autob...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/autobahnws/8d06afed-b5d0-429b-a18a-2724db8cd7e1%40googlegroups.com
> <https://groups.google.com/d/msgid/autobahnws/8d06afed-b5d0-429b-a18a-2724db8cd7e1%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Gelin Yan

unread,
Aug 21, 2014, 11:42:46 AM8/21/14
to autob...@googlegroups.com
Hi 

 Another option I used before is to make a portable python (you can search portable python on google).  This portable python contains all libs you want to use.

 zip your app as a zip file and execute use a .bat file like

python xxx.zip

     just like execute an executable jar.

Regards

gelin yan 

Travis Painter

unread,
Aug 22, 2014, 10:08:55 AM8/22/14
to autob...@googlegroups.com
Just to add another option, I have successfully used cx_freeze to package an autobahn|python application for windows users.

tim.in...@gmail.com

unread,
Sep 12, 2014, 8:27:04 AM9/12/14
to autob...@googlegroups.com
Hi Tobias,


I have been working on this and manged to overcome some initial hurdles and now stuck at the next one.
When I run the standalone executable, crossbar starts, appears to find and open the config.json configuration
file, and then issues the warning:

2014-09-12 13:04:59+0100 [Controller   3880]    WARNING: Running on Windows, but cannot use IOCP Twisted reactor.
2014-09-12 13:04:59+0100 [Controller   3880]
2014-09-12 13:04:59+0100 [Controller   3880]     => 'iocp'
2014-09-12 13:04:59+0100 [Controller   3880]
2014-09-12 13:04:59+0100 [Controller   3880]    Will let Twisted choose a default reactor (potential performance degradation).

whereas, if I run crossbar normally, from the Windows command prompt, I would expect to see output like this..

2014-09-12 13:08:02+0100 [Controller   7940] Running on CPython using IOCPReactor reactor


So it looks like crossbar is not able to select the twisted reactor it would like to.
I think this problem is likely to be due to the 'hidden import' problem that is widely reported
on the web.
Do you have any suggestions as to which package/module I need to force to be included?
And, if so, please let me have any suggestions you might have as to what the hook module(s)
should look like as they currently have the appearance of hidden secrets !

I have attached files showing output from crossbar during a normal run and when run from the
stand-alone executable, together with my config file and the pyinstaller spec file.
Note that I used the Python -v flag in the standalone executable to force Python to show
all the modules it is importing.

Thanks,
Tim

tim.in...@gmail.com

unread,
Sep 12, 2014, 8:28:56 AM9/12/14
to autob...@googlegroups.com

And now with the attachments ;-)
cli.spec
config.json
Output when corssbar run normally.txt
Output when crossbar run as standalone executable.txt
Reply all
Reply to author
Forward
0 new messages