Seaside packaging - help for a simple example

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Seaside packaging - help for a simple example

Postby marten » Mon Nov 22, 2010 1:16 pm

I include a simple application with ONE class for Seaside producing ONE page, which repeats loading itselfs. Actually this application was used to make a memory stress test for Seaside under VA.

What I would like to ask here:

* is anyone able to produce a packaged image for this simple application and perhaps explain the needed steps (I do not ask for a headless image :-))))
* is anyone able to tell, how a startup sequence of such a simple application looks like under VA/Seaside


Any help needed ....
Attachments
MSKSeasideTestForPackagingApp.txt
(1.8 KiB) Downloaded 30 times
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: Seaside packaging - help for a simple example

Postby marten » Mon Nov 22, 2010 2:10 pm

Ok, for a normal reduced image I will post a solution. This is actually needed, because the packager of VA simply fails everywhere when producing a Seaside application (or the other way around: Seaside is by far NOT packager friendly written).

These are my packaging rules for this simple application:

Code: Select all
packagingRulesFor: aRuleCreationInterface
   "ACTION
      Specify packaging rules via the rule creation interface
      specific to these packaging instructions.
      This method was created by ENVY/Packager.

   PARAMETERS
      <IepRuleCreation>
"

aRuleCreationInterface excludeClassInstanceVariable: 'configurationExpression' inClassNamed: #'SubApplication'.
aRuleCreationInterface excludeClassInstanceVariable: 'defined' inClassNamed: #'SubApplication'.
aRuleCreationInterface excludeClassInstanceVariable: 'dependentApplications' inClassNamed: #'Application'.
aRuleCreationInterface excludeClassInstanceVariable: 'extended' inClassNamed: #'SubApplication'.
aRuleCreationInterface excludeClassInstanceVariable: 'privileges' inClassNamed: #'SubApplication'.
aRuleCreationInterface excludeClassInstanceVariable: 'timeStamp' inClassNamed: #'SubApplication'.
aRuleCreationInterface excludeClassInstanceVariable: 'timeStamps' inClassNamed: #'SubApplication'.
aRuleCreationInterface excludeClassInstanceVariable: 'undefined' inClassNamed: #'SubApplication'.
aRuleCreationInterface excludeClassInstanceVariable: 'subApplications' inClassNamed: #'SubApplication'.
aRuleCreationInterface excludeClassInstanceVariable: 'parent' inClassNamed: #'SubApplication'.
aRuleCreationInterface excludeClassInstanceVariable: 'rootApplication' inClassNamed: #'SubApplication'.
aRuleCreationInterface excludeClassInstanceVariable: 'isScratchEdition' inClassNamed: #'SubApplication'.
aRuleCreationInterface excludeClassInstanceVariable: 'library' inClassNamed: #'SubApplication'.
aRuleCreationInterface excludeInstanceVariable: 'classPool' inClassNamed: #'Class'.
aRuleCreationInterface excludeInstanceVariable: 'description' inClassNamed: #'ClassDescription'.
aRuleCreationInterface excludeInstanceVariable: 'sharedPoolNames' inClassNamed: #'Class'.
aRuleCreationInterface excludeInstanceVariable: 'transcriptMenus' inClassNamed: #'EmSystemConfiguration'.
aRuleCreationInterface excludeMethod: #'info' inClassNamed: #'ClassDescription'.
aRuleCreationInterface excludeMethod: #'info:' inClassNamed: #'ClassDescription'.
aRuleCreationInterface excludeMethod: #'printOn:' inClassNamed: #'CwAccelerator'.
aRuleCreationInterface replaceMethod: #'closeWidget' with: #'epRuntimeCloseWidget' inClassNamed: #'CwWMShell'.
aRuleCreationInterface ignoreExcludedClassReferencesInClassVariable: 'LoadedSubApplications' inClassNamed: #'SubApplication'.
aRuleCreationInterface ignoreExcludedClassReferencesInClassVariable: 'LoadedApplications' inClassNamed: #'Application'.
aRuleCreationInterface ignoreReferenceErrorsInMethodNamed: #'packagingRulesFor:'.
aRuleCreationInterface ignoreExcludedClassReferencesInClassVariable: 'EsVMRegistry' inClassNamed: #'Core'.
aRuleCreationInterface includeGlobalVariable: #'AbtPrimitiveNLSStrings'.
aRuleCreationInterface reducePoolDictionary: #'AbtPrimitiveNLSStrings'.
aRuleCreationInterface includeGlobalVariable: #'AbtMsgBase'.
aRuleCreationInterface reducePoolDictionary: #'AbtMsgBase'.
aRuleCreationInterface includeGlobalVariable: #'AbtMsgPrimBase'.
aRuleCreationInterface reducePoolDictionary: #'AbtMsgPrimBase'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCanvasTags'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCanvas'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCanvasApp'.
aRuleCreationInterface symbolUsedForStateInformation: #'cacheCapacity'.
aRuleCreationInterface symbolUsedForStateInformation: #'cacheTimeout'.
aRuleCreationInterface symbolUsedForStateInformation: #'cacheReapInterval'.
aRuleCreationInterface symbolUsedForStateInformation: #'passwordHash'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCoreConfiguration'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCoreCallbacks'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCoreCache'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCoreBacktracking'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCore'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCoreDocument'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCoreDocumentElements'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCoreExceptions'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCoreFilter'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCoreHTTP'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCoreLibraries'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCoreRendering'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCoreRequestHandling'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCoreServer'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCoreUtilities'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideCoreApp'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideAdaptorsSst'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideAdaptorsSstApp'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideRenderLoop'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SeasideRenderLoopApp'.
aRuleCreationInterface symbolUsedForStateInformation: #'general'.
aRuleCreationInterface doNotReduceSubApplicationNamed: #'SstHttpServletSupport'.

aRuleCreationInterface rulesAreReadWrite
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: Seaside packaging - help for a simple example

Postby marten » Mon Nov 22, 2010 2:28 pm

Ok, for a headless reduced image the situation becomes a little more stressed. I've no real experience with that stuff.
The packaging instructions above are a good way, but the headlesss image complains, that all these nice "Seaside" applications do not understand "defined". As the Image Startup Class I've chosen "AbtHeadlessRuntimeStartUp".

As John stated in another thread: "loaded" is not executed in a reduced image - therefore all these packager complains are not relevant. This seems to be true in a normal reduced image.

BUT it seams, that xdImageInitialize DOES call #initializeAfterLoad to all classes and #loaded to all applications:

Code: Select all
A Smalltalk, Version 8.0.2
VM Timestamp: 4.0,(NC) 5/3/2010 (80)
(C) Copyright Instantiations 1994, 2010.  All rights reserved.
(C) Copyright International Business Machines Corp. 1994, 2006.  All rights reserved.
Virtual Machine PID: 1900
Option newSpaceSize set to 2097152

The following error(s) were detected during the startup sequence which may interfere with correct operation:





1) MessageNotUnderstood: GreaseCore class>>defined

2) MessageNotUnderstood: GreaseCoreCollections class>>defined

3) MessageNotUnderstood: GreaseCoreExceptions class>>defined

4) MessageNotUnderstood: GreaseCoreText class>>defined

5) MessageNotUnderstood: GreaseCoreUtilities class>>defined

6) MessageNotUnderstood: GreaseVASTCore class>>defined

7) MessageNotUnderstood: SeasideCore class>>defined

8) MessageNotUnderstood: SeasideCoreBacktracking class>>defined

9) MessageNotUnderstood: SeasideCoreCache class>>defined

10) MessageNotUnderstood: SeasideCoreCallbacks class>>defined

11) MessageNotUnderstood: SeasideCoreConfiguration class>>defined

12) MessageNotUnderstood: SeasideCoreDocument class>>defined

13) MessageNotUnderstood: SeasideCoreDocumentElements class>>defined

14) MessageNotUnderstood: SeasideCoreExceptions class>>defined

15) MessageNotUnderstood: SeasideCoreFilter class>>defined

16) MessageNotUnderstood: SeasideCoreHTTP class>>defined

17) MessageNotUnderstood: SeasideCoreLibraries class>>defined

18) MessageNotUnderstood: SeasideCoreRendering class>>defined

19) MessageNotUnderstood: SeasideCoreRequestHandling class>>defined

20) MessageNotUnderstood: SeasideCoreServer class>>defined

21) MessageNotUnderstood: SeasideCoreUtilities class>>defined

22) MessageNotUnderstood: SeasideAdaptorsSst class>>defined

23) MessageNotUnderstood: SeasideCanvas class>>defined

24) MessageNotUnderstood: SeasideCanvasTags class>>defined

25) MessageNotUnderstood: SeasideComponent class>>defined

26) MessageNotUnderstood: SeasideComponentTasks class>>defined

27) MessageNotUnderstood: SeasideComponentVisitors class>>defined

28) MessageNotUnderstood: SeasideSession class>>defined

29) MessageNotUnderstood: SeasideSessionFilter class>>defined

30) MessageNotUnderstood: SeasideRenderLoop class>>defined

31) MessageNotUnderstood: SeasideToolsCore class>>defined
Process reportError: MessageNotUnderstood: GreaseCore class>>defined
MessageNotUnderstood: GreaseCore class>>defined
AbtHeadlessRuntimeStartUp class(EsImageStartUp class)>>#outputWalkback:process:
Last edited by marten on Mon Nov 22, 2010 2:47 pm, edited 1 time in total.
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: Seaside packaging - help for a simple example

Postby marten » Mon Nov 22, 2010 2:44 pm

Ok, for a headless reduced image with that example we need to add the application #EmImageSupport, then the "defined" problems are gone - and the application is starting and serving this little page ....

And an additional comment to headless packaging. You need a configuration map, which loads all needed stuff. For the example above I had to load:

* Platform Portability V 8.0.2
* Server Smalltalk - HTTP Server V 8.0.2
* Seaside Core V 8.0.2

After all I hope that these informations may be helpful for all others doing packaging with Seaside. Please consider, that you may have to do more configuration in your startup method (like setting the session class ).

Marten
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: Seaside packaging - help for a simple example

Postby marten » Mon Nov 22, 2010 3:12 pm

And by the way: now we have the reduced image (headless or not): just start a chrome browser (because it is the fastest one) with four tabs (that's enough for Seaside) with the address "http://127.0.0.1:7777/MemoryUsageTest" and have a look how fast VA consumes your available memory .....
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: Seaside packaging - help for a simple example

Postby jtuchel » Mon Nov 22, 2010 11:33 pm

Hi Marten,

thanks for this important piece of information. Sounds a bit like the result of painful trial and error...
...which only means it's even more appreciated.

Hopefully, Instantiations will come up with the planned piece of documentation on Seaside packaging real soon.

Joachim
jtuchel
[|]
 
Posts: 245
Joined: Fri Oct 05, 2007 1:05 am
Location: Ludwigsburg, Germany

Re: Seaside packaging - help for a simple example

Postby PhotonDemon » Wed Dec 01, 2010 7:23 am

Hi Marten,

I'm interested in building a Seaside app under Windows and then packaging it for Linux. I have gotten good at packaging Windows NT services and have packaged a Seaside app as an NT service. I have a friend who runs some Linux servers and I would like to see if I can run a Seaside app on one of his Linux servers. Any advice will be very helpful.

Thanks, Lou
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:Lou@Keystone-Software.com http://www.Keystone-Software.com
PhotonDemon
[|]
 
Posts: 176
Joined: Thu Dec 20, 2007 1:45 pm

Re: Seaside packaging - help for a simple example

Postby TriSebastian » Wed Dec 01, 2010 9:55 am

Hi Lou,

I just tried packaging a NTService under Windows,... I wasn't able to get a properly running system. I guess my prerequisites, or the reduceing is too strict.

Could you provide some more information on your packaging process? Packaging Instructions and Prerequisites?

Funny thing I had problems with is the Servlet startup. I get a starting servlet when I start my Seaside application once in the packaging image. But this leads me to further problems afterwards. I saw in the forum you might be able to guess what those problems are....
If I don't start the application prior to packaging the Servlet hat trouble connection to the TCPEndpoint.

Any ideas?

Sebastian
TriSebastian
 
Posts: 76
Joined: Sun Jul 20, 2008 9:40 pm
Location: Nanaimo, BC, Canada

Re: Seaside packaging - help for a simple example

Postby PhotonDemon » Thu Dec 02, 2010 2:12 pm

Hi Sebastian,

I thought I had documented the NT service packaging process (for my own use) but can't seem to find it. So, I have created and attached a new document. I made it more specific to Seaside and included some sample code.

The sample code isn't usable as is because it relies on some classes and extensions of my own that I didn't bother to include. I will post them if anyone is interested.

Part of the process of packaging a headless image requires making sure there are no visual parts included. This requires making sure no apps with visual parts are sucked in by prerequisites. That requires setting up apps without prerequisites to visual apps. The default when you make a new app is for it to contain a prerequisite to a visual app. It would be nice if Instantiations could make an option when we create a new app that asks if we want it to be a visual app or not.

I don't grantee that the way I package NT services is the best way to do it but it works for me. If I can be of any more help, just ask.

Lou
Attachments
NT Service Packaging.Txt
(6.23 KiB) Downloaded 52 times
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:Lou@Keystone-Software.com http://www.Keystone-Software.com
PhotonDemon
[|]
 
Posts: 176
Joined: Thu Dec 20, 2007 1:45 pm

Re: Seaside packaging - help for a simple example

Postby koschate » Fri Dec 03, 2010 4:41 am

PhotonDemon wrote:The default when you make a new app is for it to contain a prerequisite to a visual app. It would be nice if Instantiations could make an option when we create a new app that asks if we want it to be a visual app or not.

I'm betting that you use the VisualAge Organizer to manage applications and classes. The Application Manager does not do this. In fact, I've gone so far as to add a line to my abt.cnf that turns off the Organizer by default.
koschate
[|]
 
Posts: 102
Joined: Thu Feb 01, 2007 7:24 am

Re: Seaside packaging - help for a simple example

Postby PhotonDemon » Mon Dec 06, 2010 7:16 am

I'm betting that you use the VisualAge Organizer to manage applications and classes. The Application Manager does not do this. In fact, I've gone so far as to add a line to my abt.cnf that turns off the Organizer by default.


You are correct, I was speaking of the VisualAge Organizer. I seldom use the Application Manager, I guess it is just the habit one gets into. Thanks for pointing this out, it is good to know.

Lou
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:Lou@Keystone-Software.com http://www.Keystone-Software.com
PhotonDemon
[|]
 
Posts: 176
Joined: Thu Dec 20, 2007 1:45 pm

Re: Seaside packaging - help for a simple example

Postby marten » Thu Dec 09, 2010 12:37 pm

PhotonDemon wrote:Hi Marten,

I'm interested in building a Seaside app under Windows and then packaging it for Linux. I have gotten good at packaging Windows NT services and have packaged a Seaside app as an NT service. I have a friend who runs some Linux servers and I would like to see if I can run a Seaside app on one of his Linux servers. Any advice will be very helpful.

Thanks, Lou


The main idea in the example and also in my demo I am actually working on is very simple: do not reduce all application introduced with Seaside (Seaside, Javascript oriented stuff, Raphael, etc ....).

I was suprised by the size of my running image (a full CouchDB and jason oriented application using Seaside, Scriptacolous, Raphael and the whole SST stuff ..): 2.8 MByte in a headless image running under Windows or Linux.

When considering packaging for Linux: consider the fact, that most Linux servers from those providers ARE headless Linux servers - no GUI running etc. You MUST go via ServerWorkbench to build a suitable image for systems like this. Even a packaged client image (without any GUI windows) needs the GUI. Under Windows you will not see the problem - the system will start in a command window without any problems. Under Linux based servers starting such image will bring up errors and your image is NOT starting.

In general when you have made the first step to create a headless image - using the tips mentioned in this thread - the further development is not that difficult.

Actually I am doing my development under Windows and even the main testing is done in a development image. Then when I am ready I finish/close my configuration maps, switch to Ubuntu (with GUI) do some testing here (for Linux), load the application from my configuration map in a Unix ServerWorkbench passive image, do the headless packaging process and start testing here also (Linux - but I have a GUI here also, therefore this is not a headless test). When this works I transfer the headless image to a headless server - and when this image starts its ok for me (to be sure of headless system).
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron