Newbie question deploying smalltalk applications

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Newbie question deploying smalltalk applications

Torsten Bergmann
If you want to deploy a source package for others to consume just use
Monticello and SqueakSource. But I think you talk about deploying
to an end user (commercial product, ...) not about making code
available for other pharo developers.


So how to deploy a "consumer" app with Pharo:
=============================================
As always that depends on kind of application and the target system
you want to deploy to.
Typically you distribute an image with the running/prepared
application together with the VM for the target platform:

First the VM
============

Some scenarios:

 A. If you have written a seaside web application you can deploy
    the image/VM on your own root server or on a seaside hosting
    platform (like www.seasidehosting.com). There is a good
    description in the seaside book [1].

    Thats an easy deployment since you just have to tell your
    customer a URL where the app runs.

 B. If you want to deploy to iPhone just ask John McIntosh
    how he packaged the app (iphone vm + image) for the Apple Store
    Since the memory is limited you may have to reduce the image
    size (unload packages, ...) with an own custom shrinking script

 C. If you want to deploy a desktop like app/or web app to
    multiple platforms use the one click distribution since there
    are already VM's for Linux, Win, Mac. Just exchange the image
    with your own one. Have a look at the piercms.com application
    or the seaside image. They use this kind of deployment with a ZIP.

 D. If you deploy to windows (Win32 only) you may want to
    be closer to Windows app rules - so you may want to build a
    custom Win VM executable (*.exe) with your own icons and a
    platform specific installer copying the image and VM.

    See [2] how to do that. The Pharo Win32 Installer is built
    this way. If you think VM building is rocket science  
    you can also exchange the icons using reshacker [3] in
    a standard Pharo windows VM.
   
And the image
=============

Anything other depends on how you prepare the image. Typically
you may want to

1. Reduce the image size by throwing out anything that
   is not required by your app and which is useless for your
   customer (unit tests, dev tools).

   This process is called "shrinking" an image. Take care since it
   is often usefull to keep dev tools inside since you can easily
   debug a failure situation at your customers place later.
   At least you typically may want to disable developer facilities,
   implement a different walkback window so the customer gets
   a notification instead of a "debug it" button and so on, ...

   To reduce the size of the image I would also clear
   Monticello caches, throw out unused Form instances, ...
   There are many tricks here - depends on how far you want
   to go. Google for "Squeak" and "shrinking" and you will find more.

   If size doesnt matter just use the image as it is or
   use a pharo-dev image for development and a pharo-core image
   for deployment.  

2. However - typically you just want to deploy the VM only together
   with the image, no changes and source file necessary for your
   customer.
   Therefore you may want to disable the two preferences
   "warnIfNoSourcesFile" and "warnIfNoChangesFile" (see [2]) before
   saving the image. So you dont have to redistribute the changes
   and source files

3. Open your application, either manually or by a custom launcher
   and the startup list (see [2])

4. Save your image in this predefined "ready" state so when the
   customer starts the image with the VM he can instantly use
   your app.

So "deployment" in Smalltalk is different and a little bit more
complicated since you have many options.

It would help if you would tell us a little bit more so we
can answer specific questions...

Bye
Torsten


[1] http://book.seaside.st/book/advanced/deployment
[2] http://squeakvm.org/win32/custom.html
[3] http://angusj.com/resourcehacker/
   
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question deploying smalltalk applications

Stéphane Ducasse
excellent!

Stef

On Feb 4, 2010, at 12:07 PM, Torsten Bergmann wrote:

> If you want to deploy a source package for others to consume just use
> Monticello and SqueakSource. But I think you talk about deploying
> to an end user (commercial product, ...) not about making code
> available for other pharo developers.
>
>
> So how to deploy a "consumer" app with Pharo:
> =============================================
> As always that depends on kind of application and the target system
> you want to deploy to.
> Typically you distribute an image with the running/prepared
> application together with the VM for the target platform:
>
> First the VM
> ============
>
> Some scenarios:
>
> A. If you have written a seaside web application you can deploy
>    the image/VM on your own root server or on a seaside hosting
>    platform (like www.seasidehosting.com). There is a good
>    description in the seaside book [1].
>
>    Thats an easy deployment since you just have to tell your
>    customer a URL where the app runs.
>
> B. If you want to deploy to iPhone just ask John McIntosh
>    how he packaged the app (iphone vm + image) for the Apple Store
>    Since the memory is limited you may have to reduce the image
>    size (unload packages, ...) with an own custom shrinking script
>
> C. If you want to deploy a desktop like app/or web app to
>    multiple platforms use the one click distribution since there
>    are already VM's for Linux, Win, Mac. Just exchange the image
>    with your own one. Have a look at the piercms.com application
>    or the seaside image. They use this kind of deployment with a ZIP.
>
> D. If you deploy to windows (Win32 only) you may want to
>    be closer to Windows app rules - so you may want to build a
>    custom Win VM executable (*.exe) with your own icons and a
>    platform specific installer copying the image and VM.
>
>    See [2] how to do that. The Pharo Win32 Installer is built
>    this way. If you think VM building is rocket science  
>    you can also exchange the icons using reshacker [3] in
>    a standard Pharo windows VM.
>
> And the image
> =============
>
> Anything other depends on how you prepare the image. Typically
> you may want to
>
> 1. Reduce the image size by throwing out anything that
>   is not required by your app and which is useless for your
>   customer (unit tests, dev tools).
>
>   This process is called "shrinking" an image. Take care since it
>   is often usefull to keep dev tools inside since you can easily
>   debug a failure situation at your customers place later.
>   At least you typically may want to disable developer facilities,
>   implement a different walkback window so the customer gets
>   a notification instead of a "debug it" button and so on, ...
>
>   To reduce the size of the image I would also clear
>   Monticello caches, throw out unused Form instances, ...
>   There are many tricks here - depends on how far you want
>   to go. Google for "Squeak" and "shrinking" and you will find more.
>
>   If size doesnt matter just use the image as it is or
>   use a pharo-dev image for development and a pharo-core image
>   for deployment.  
>
> 2. However - typically you just want to deploy the VM only together
>   with the image, no changes and source file necessary for your
>   customer.
>   Therefore you may want to disable the two preferences
>   "warnIfNoSourcesFile" and "warnIfNoChangesFile" (see [2]) before
>   saving the image. So you dont have to redistribute the changes
>   and source files
>
> 3. Open your application, either manually or by a custom launcher
>   and the startup list (see [2])
>
> 4. Save your image in this predefined "ready" state so when the
>   customer starts the image with the VM he can instantly use
>   your app.
>
> So "deployment" in Smalltalk is different and a little bit more
> complicated since you have many options.
>
> It would help if you would tell us a little bit more so we
> can answer specific questions...
>
> Bye
> Torsten
>
>
> [1] http://book.seaside.st/book/advanced/deployment
> [2] http://squeakvm.org/win32/custom.html
> [3] http://angusj.com/resourcehacker/
>
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question deploying smalltalk applications

Mariano Martinez Peck
In reply to this post by Torsten Bergmann

  To reduce the size of the image I would also clear
  Monticello caches, throw out unused Form instances, ...
  There are many tricks here - depends on how far you want
  to go. Google for "Squeak" and "shrinking" and you will find more.


The best way I know how to do that is evaluate "ScriptLoader new cleanUpForProduction"
 
Thanks Torsten for this wonderful tutorial. I have created a wiki page for it, and I formatted for the wiki:

http://code.google.com/p/pharo/wiki/HowToDeployAnApplication

Feel free to edit it :)

Mariano

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project