Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt applications on Amazon AWS AppStream; any experiences?
I've had my eye on Amazon's AppStream for a while ( https://aws.amazon.com/appstream/ )
(NB not to be confused with freedesktop's multi-distro application installers project of the same name!)
Basically it runs Windows applications on some AWS EC2 HW with virtualized "Grid" GPUs (with HW video compression courtesy of NVidia) and serves it up to anything with a suitable thin client app (well, and sufficient bandwidth and latency). So: potentially a nice solution to multi-platform, and/or for applications which are too heavyweight to run on a puny mobile device.
Last time I looked at it, to use it you needed to modify your source code to integrate the AppStream SDK. I concluded the necessary modifications would probably be deep in the depths of the Qt libs and beyond me.
However Amazon have recently announced the ability to host unmodified executables on AppStream; see http://aws.amazon.com/blogs/aws/appstream-win-apps-on-devices/ . Now the only thing that's stopped me trying it myself is the fact I haven't done a Qt Windows app for ages: my platform priorities are currently Linux-Mac-iOS-Android-Windows. However if Qt-on-AppStream was any good, Windows development could easily move up to 2nd place there as the easiest way of serving up the application (in thin client form) to a wide range of client OS. (Well there's other factors like it'd also need figuring out how to build windows installers, and the fact there's only two Amazon datacentres hosting AppStream currently and neither of them are in Europe where I am... so latency is unlikely to be good).
So, before I start hacking on a Windows build of one of my Qt projects: anyone had any experiences with Qt on AppStream? Main thing I'd be worried about would be if whatever magic it's doing is just incompatible with Qt for some reason...
Well as a first step I have successfully built and run an C++/OpenGL/QML app on EC2 and it runs nicely with OpenGL acceleration on a g2.2xlarge instance (NVidia K520 GRID card) using TeamViewer to view it (RDP is incompatible with GPU - more on this "here":http://aws.amazon.com/blogs/aws/build-3d-streaming-applications-with-ec2s-new-g2-instance-type/ ; certainly if I try and run the application in an RDP session it crashes out in the depths of some OpenGL stuff).
(it's a trivial medical image viewer using OpenGL shaders and 3D textures to render various planes in a CT scan).
Next step is to get an installer together (which is what's needed to set up AppStream hosting), but windows installers may be a learning curve... (Linux .debs, Mac .app and iOS .ipa files I've done... but .msi is new territory).
Are you using cmake ? If so, it should provide you with a base to create packages automatically
No, I opened the .pro file in QCreator (running on the EC2 instance) and used it to do all of running qmake, building the project and launching it.
The obvious thing to try next looked like it was http://qt-project.org/wiki/Qt-Installer-Framework (although I've not used it before).
Update: Hmmm... seems that Qt installer framework thing is nice for creating applications with installer-wizard-like workflows, but less help for figuring out what you actually need to put in it (which is macdeployqt's great strength). Was interested to find http://qt-project.org/forums/viewthread/26972/
Update: OK windeployqt seems to do the necessary as far as getting everything into one dir alongside my exe which then appears to support double clicking the exe and have it work as expected. Hmmm 53MByte! But anyway as far as I'm concerned that's 90% of the effort needed to create an "installer"; last time I was in that situation on windows (a few years ago) I just fired up VisualStudio and created an installer project which built a nice .msi without doing much more than mass selecting the files in a wizard... this time I'm dismayed to discover VisualStudio Express I'm using doesn't include installer building functionality. OK you get what you pay for... but Gah! Windows! OK so it's back to the Qt-Installer-Framework for packaging that lot up...
Yes, very good idea !
OK got around to trying this with a Qt 5.4 application (C++ QQuickView; some C++&OpenGL plugins including 3D textures, QML&js UI and logic).
It works, or at least it does via the Chrome browser's AppStream app: "screenshot":https://picasaweb.google.com/lh/photo/qsPl-yGo4LjwVav5X0vNuAREL0rlVI664y8OfkTsUQk?feat=directlink.
Pretty laggy, but hardly surprising when the server is in a different continent. Does reasonably well over my handful-of-megabits bandwidth. Some odd performance characteristics; all runs fine and fast once a dataset is loaded, but something in the initialization/setup (there is a previous screen for volume selection) takes multiple seconds (c.f being instant on a local machine). Guessing it's something to do with virtualized disk or GPU (the datasets are a couple of hundred MBytes), but hard to tell what's going on on the AppStream server without building some instrumentation into the application.
Less luck with windows client (needs retrying; didn't really understand what I was doing with the single-use test URL AppStream gives you) and Mac OSX client (crashes, but I'm still on 10.8). Android/iOS clients yet to be tried (I see there's no generally available AppStore iOS client; you have to build your own).
The installer stuff mentioned in previous posts turned out to be mostly a distraction. AppStream gives you an RDP session to a desktop to setup a machine image you you have quite a bit more freedom than just giving a single msi or exe; all I needed to do was fetch and unpack a zip of the windeployqt-prepared folder, and add a few redistributable DLLS (Microsoft.VC120.CRT).
Thanks for sharing your findings
krekeltronics last edited by
That's cool @timday !
What do you think about using Windows on EC2 as a Jenkins slave to run Windows builds of cross-platform Qt apps? We are doing it on a VirtualBox VM running on an OS X Server but one client needs their jobs migrated to their own managed instances. Any ideas?
@krekeltronics I don't actually have a Windows machine in the house; what little Qt-on-Windows I have done (mainly for the purposes of trying out AppStream, which is Windows) has actually been entirely on an AWS EC2 Windows instance. Works fine. Think the real question isn't whether you should think about which of these cloud services you should use, but which one (MS Azure or Google Compute Cloud being the obvious other choices).