The story around PharoMinimal

Hi,

What is the story around PharoMinimal and related images ?

Is there a writeup somewhere with instructions ?

Right now the minimal (Metacello) image based on Pharo 7 is used only as intermediate step in building of the full Pharo and the only real (successful) attempt to use it for something else is PharoLambda (https://gitlab.com/macta/PharoLambda).
In general it can be used for building of own (server) applications. E.g. this way you can install and run Teapot on it:
./pharo Pharo7.0-metacello-32bit-d13eed2.image config http://smalltalkhub.com/mc/zeroflag/Teapot/main ConfigurationOfTeapot –install=stable
./pharo Pharo7.0-metacello-32bit-d13eed2.image eval –no-quit “Teapot on GET: ‘/welcome’ -> ‘Hello World’; start.”
You can load baselines from the Git repositories too but we currently do not have any command line handler for it so you need to do it using “eval” command or *.st flile. Something like this:
Metacello new
baseline: ‘Seaside3’;
repository: ‘github://SeasideSt/Seaside:master/repository’;
load
To make it more usable we probably should extend it with SUnit and Fuel. If you want to extend it with some packages from vanilla Pharo, you should load them using FileTree from your local Pharo repository clone.
Gofer it
url: ‘filetree:///path-to-my-pharo-repository-clone/pharo/src’;
package: ‘Multilingual-OtherLanguages’;
package: ‘Multilingual-TextConverterOtherLanguages’;
load.
It still needs some care. E.g. some classes from Zinc are not properly initialized (I know about DigitalSignatureAlgorithm MD5NonPrimitive RxMatcher RxParserRxsPredicate SHA1 ZnByteEncoder ZnConstants ZnMimeType ZnNetworkingUtils ZnServer ZnSingleThreadedServer TextConstants TextAction TextStyle).
I tried to load Seaside into it today (from the example above) and it failed (some strange error probalby related to Unicode processing). But we will fix it. If you will tell me what exactly you need we can make it work together as in case of PharoLambda.
followed by
Hi Pavel,

Thanks a lot for the explanation. To summarise: 70-minimal is the one with monticello and metacello in it that can load code via the config handler.

I was confused, because that failed for me.

Now, first doing

$ ./pharo pharo-minimal.image eval ‘ZnMimeType initialize’

fixed my loading problem. I also did the following because some of my project don’t separate tests (I known 😉

$ ./pharo pharo-minimal.image eval –save ‘Object subclass: #TestCase’

With those fixes I was able to load different projects

$ ./pharo pharo-minimal config http://mc.stfx.eu/Neo ConfigurationOfZTimestamp –install=stable

$ ./pharo pharo-minimal config http://mc.stfx.eu/Neo ConfigurationOfNeoConsole –install=bleedingEdge

The image remains equally fast in startup

$ time ./pharo pharo-minimal.image eval ZTimestamp now
2017-10-08T16:55:00Z
real    0m0.062s
user    0m0.025s
sys     0m0.029s

And it works perfectly as a server, like

$ ./pharo pharo-minimal eval –no-quit ‘NeoConsoleTelnetServer new start’ &

$ telnet localhost 4999
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
Neo Console Pharo-7.0+alpha.build.172.sha.d13eed2f80fe19f29fd85ede8c4809d6a6986d4f (32 Bit)
> get
known metrics:
system.status – Simple system status
memory.total – Total allocated memory
memory.free – Free memory
memory.gc – Garbage collect, return free memory
system.uptime – Image uptime human readeable
system.uptimeseconds – Image uptime seconds
system.date – Current date
system.time – Current time
system.timestamp – Current timestamp
process.count – Current process count
process.list – Current list of processes
system.version – Image version info
system.mcversions – Monticello packages version info
> get process.list
Delay Scheduling Process
Low Space Watcher
Idle Process
WeakArray Finalization Process
NeoConsoleTelnetServer port 4999
NeoConsoleTelnetServer port 4999 Connection Handler
> SessionManager default startupList collect: #handledId

#(#SmallInteger #Delay #ProcessorScheduler #OSPlatform #FileLocator #MCMethodDefinition #WeakArray #FileStream #MultiByteFileStream #EndianDetector #Symbol #LanguageEnvironment #Stdio #NonInteractiveTranscript #WeakFinalizationList #DiskStore #BasicCommandLineHandler #SourceFileArray #ASTCache #UUIDGenerator #InternetConfiguration #ZnLogEvent #ZnServer #Color #UIManagerSessionHandler #ZTimestamp)
>
Bye!
Connection closed by foreign host.

Image size remains ~11Mb.

Very nice !

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: