VA Smalltalk Automation

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

VA Smalltalk Automation

Thomas Koschate-2
As some of you may know from my blog, I have more than a passing interest scripting and build automation of VA Smalltalk.  The recent release of 8.5 has broken the basic tool I created to load code into an out-of-the-box image, and I'm working with Instantiations on that, but it did raise the broader question of automation support in VA Smalltalk.

John O'Keefe has challenged us to come up with a set of requirements for this, so I'm going to do the OO thing and delegate the challenge on to the rest of the community.  I'm willing to put together a summary document, but I need your input.  I know there's been a lot of individual efforts to to retrofit automation into VA Smalltalk, so let's hear about what's good and bad about what's been done.  I know that the Pharo community has been busy with Jenkins for automated builds - can somebody talk about what they've been doing?

For myself, I'll try to summarize my series of blog posts in a subsequent message, but basically what I'm looking for are these abilities:
  • Load and save an image given a config map.
  • Package an image, be it headful, headless or IC.
  • Run a test suite and record the results.
  • Run a Smalltalk script
At the very least, I want to be able to do these things from a script, without human intervention, on Windows or UNIX.  Ideally, this would all be controllable from a continuous integration server such as Jenkins and allow me to report operational results there.

Let's hear your thoughts!

Tom Koschate [|]

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/IHd6TrqJydEJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: VA Smalltalk Automation

gcotelli
Hi Tom,
we're doing almost all this stuff in VA 8.5 with Jenkins as the build automation server. I'm using the VA provided image with just a few classes loaded (just the ones to load configuration maps) but would be cool to have some support for instantiations already provided.

I'm using a combination of some simple shell scripts and Smalltalk code loaded in the image. Currently we have the following features implemented:
  • Automatically login some specified user
  • Load a configuration map in the development image reading the configuration map name and version for a file provided in a command line argument
  • Save the image with a new name
  • Run test suites and export the results it in a format readable by jenkins
  • Create an XD image 
  • Load a configuration map in the XD image
  • Package an XD image or a development image
We're running this setup in Windows (but packaging XD images for Unix also).

For my current experience would be good that instantiations provide at least some support for:
  • Running some smalltalk script specified in a command line parameter (instead of using abt.cnf) and executing it after the image startup is complete (we have some ugly hack to wait for the image to be ready).
  • Loading easily a Configuration Map Version (without requiring user interaction (we are using another ugly hack to avoid this).
  • Creating, Loading Configuration maps and Packaging XD Images (this was the hardest part... many hours of trial and error to get it working). For example when using -l option to redirect the console log to a file and using the TranscriptTTY as the error log it was impossible to load anything in the XD image because asumes some protocol that TranscriptTTY doesn't have.
Find attached some sample script.

Regards,
Gabriel

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/P5Wrm5-ft8IJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.

sampleStScript.st (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: VA Smalltalk Automation

jtuchel
Tom, Gabriel,

we're using a very similar approach as Gabriel describes it: a pre-loaded base image and a few scripts to execute certain tasks automatically at image startup. Combined with a stream concept for code management (using the Required Maps feature heavily), this allows for very convenient automated tasks like packaging, testing, code metrics, SmallLint Checks, deployment and of course building a development image (we usually start with a fresh image every morning). This has helped improve code quality and the stability of our deliverables a lot.

A few months ago we added Hudson to the mix and now we have a really slick and shiny build environment with full SVN and ANT integration for all the stuff that happens around us (checkout of jar and other files and building a deployment path with latest contents etc.). Hudson (or Jenkins) allows for
re: Image startup: We use the following snippet:
[System imageStarted] whileFalse: [(Delay forSeconds: 1) wait].
Not particularly nice, but it does the job. I should add that our task starting code forks off a new process for all the automation stuff, otherwise the effect of this snippet would probably be not extremely helpful ;-)

Our main problems in automation were
* finding the pieces (packaging is not very well documented)
* finding out about return codes from the image (how do I return an error code ~= 0 ?)
* packaging and envy are packed with System message and Transcript show instead of proper exception handling. This can be tamed a bit using lots of kung-fu and dirty hacksm, but in some places we found no other solution than hope. I hope Instantiations will comb through these places and exchange all this logging to the Transcript or even dialogs with exception handling and plugs it into log4s. (I like to think the whole point of introducing log4s was to clean up such places in VAST)
* sUnit doesn't keep error texts (the second parameter of assert:description: et. al.), so there's no way to log TestResults in a nice way for hudson. For now we create the jUnit-compatible xml file but have no error description other than "Run the tests in a dev image for more details". My attempts to bend sUnit to my logging needs all ended in hacks so dirty I decided to leave it this way for now

We didn't use abt.cnf mainly because I didn't know about the feature back then. Maybe using it would allow us to use plain new images on our automation server, but preparing a little pre-loaded image for the task is not so bad after all. The only occasions where you have to do it is if our automation code changes or when we migrate to a newer VAST version.

So if I had just one wish for Instantiations in the automation area, I'd like them to introduce proper exception handling and logging into envy and packaging code. Second would be better documentation.

Joachim

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/qTZlM8SCGiwJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: VA Smalltalk Automation

jtuchel
I forgot to mention: you can see the first part (without hudson integration) of this tool in action in a recording of my talk "Get (your project) back to shape" I gave at the VA Smalltalk Forum Europe 2010 in Frankfurt:

slides: http://www.objektfabrik.de/Downloads/VASTForum2010/VASTForum2010_GetYourProjectBackInShape_JoachimTuchel.pdf
video: http://www.objektfabrik.de/Downloads/VASTForum2010/VFM10-04-GetBackToShapre-Tuchel.mp4


--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/oS_VWDHPz7EJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: VA Smalltalk Automation

gcotelli
In reply to this post by jtuchel
Hi Joachim,
for the return codes from the image just do:

System exit: "errorCodeNotZero" withObject: nil (replacing errorCodeNotZero with a number)

I'm doing this in several handlers when something unexpected happens to make the build fail.

Gabriel

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/NnQzH9L1Y7IJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: VA Smalltalk Automation

jtuchel
Gabriel,

thanks. I'm using the exact expression and the return code 9001 in my code. Works like a charm. What I wanted to say in my mail was that it was hard to find out that you need to return 9001 instead of 1 to get the result I was looking for. NOt that I found a place where there is an explanation on why that is, just a posting on the support form that mentions the fact ;-)

Joachim

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/yt3CeVeWNUcJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: VA Smalltalk Automation

Marten Feldtmann-2
Hello Joachim,

it's mentioned in the documentation of the product (see my other posting about Fatal Application Error dialog)

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/xMFFOoe5tCUJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.