Migrating pier experiences

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

Migrating pier experiences

Stephan Eggermont-3
Diego and I are looking at migrating the moose site to a newer pier.
We use the PierCodeExporter for that.
The moose site is a pretty old pier (Pier1 on Pharo 1.0rc1 10492). It doesn’t have grease loaded.
The exporter doesn’t use a lot of grease functionality.
We could have tried loading Grease, but decided to just copy paste
the functionality needed.
  http://smalltalkhub.com/mc/Pier/Pier3Addons/main/Pier-Exporter1-DiegoLont.1.mcz

Then the compilation fails because there are too many news entries,
resulting in a method that is too large to compile.
In PRKernelCodeExporter>>writeCodeFor: structure
we changed the repeated
  structure addChild: (self newsABCD: aKernel).
to an array of selectors with a perform: loop.

+ stream << ' #('.
+ structure enumerator do: [ :each | stream << ' #''' << (each asSelector) << ':''' ] separatedBy: [ stream cr ].
+ stream << ' ) do: [ :each | ' << String cr << ' structure addChild: (self perform: each with: aKernel) ].' << String cr.
-
- structure enumerator do: [ :each |
- stream << ' structure addChild: (self ' << (each asSelector) << ': aKernel).' << String cr ].

This was enough for moose, but needs method splitting for larger sites.
  http://smalltalkhub.com/mc/Pier/Pier3Addons/main/Pier-Exporter-Code-DiegoLont.55.mcz

With this we are able to generate the code. Next step is loading in a newer Pier.

to be continued.
  Stephan
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Migrating pier experiences

Tudor Girba-2
Great!

Please keep us posted,
Doru


On Mon, Feb 3, 2014 at 11:01 AM, Stephan Eggermont <[hidden email]> wrote:
Diego and I are looking at migrating the moose site to a newer pier.
We use the PierCodeExporter for that.
The moose site is a pretty old pier (Pier1 on Pharo 1.0rc1 10492). It doesn’t have grease loaded.
The exporter doesn’t use a lot of grease functionality.
We could have tried loading Grease, but decided to just copy paste
the functionality needed.
  http://smalltalkhub.com/mc/Pier/Pier3Addons/main/Pier-Exporter1-DiegoLont.1.mcz

Then the compilation fails because there are too many news entries,
resulting in a method that is too large to compile.
In PRKernelCodeExporter>>writeCodeFor: structure
we changed the repeated
  structure addChild: (self newsABCD: aKernel).
to an array of selectors with a perform: loop.

+               stream << '     #('.
+               structure enumerator do: [ :each | stream << '  #''' << (each asSelector) << ':''' ] separatedBy: [ stream cr ].
+               stream << ' ) do: [ :each | ' << String cr << ' structure addChild: (self perform: each with: aKernel) ].' << String cr.
-
-               structure enumerator do: [ :each |
-                       stream << '     structure addChild: (self ' << (each asSelector) << ': aKernel).' << String cr ].

This was enough for moose, but needs method splitting for larger sites.
  http://smalltalkhub.com/mc/Pier/Pier3Addons/main/Pier-Exporter-Code-DiegoLont.55.mcz

With this we are able to generate the code. Next step is loading in a newer Pier.

to be continued.
  Stephan
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Migrating pier experiences

Stephan Eggermont-3
In reply to this post by Stephan Eggermont-3
So the next steps are (after updating and moving a few packages):

Gofer new
 url: 'http://www.smalltalkhub.com/mc/Pier/Pier3/main';
 package: 'ConfigurationOfPier3';
 load.

(Smalltalk at: #ConfigurationOfPier3) load.

Gofer new
 url: 'http://www.smalltalkhub.com/mc/Moose/Fame/main';
 package: 'ConfigurationOfFame';
 load.

((Smalltalk at: #ConfigurationOfFame) project version: '1.2') load: 'Core'.

Gofer new
 url: 'http://www.smalltalkhub.com/mc/ObjectProfile/Roassal/main';
 package: 'ConfigurationOfRoassal';
 load.

(Smalltalk at: #ConfigurationOfRoassal) project latestVersion load.

Gofer new
 url: 'http://smalltalkhub.com/mc/RMoD/Citezen/main';
 package: 'ConfigurationOfCitezen';
 load.
 
((Smalltalk at: #ConfigurationOfCitezen) version: '2.1') load: 'Web'.

Gofer new
 url: 'http://www.smalltalkhub.com/mc/Pier/Pier3Addons/main';
 package: 'Pier-Blog';
 package: 'Pier-Documents';
 package: 'Pier-Exporter-Code';
 package: 'Pier-JQuery';
 package: 'Pier-Google';
 package: 'Pier-Fame';
 package: 'TopFeeder-Pier-Widgets';
 load.

" manually load exported code "
" roll back Magritte-Exernal-FileModel to version 'Magritte-Pharo-Model-DamienCassou.29' "

PRKernelCreatorForPier register
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Migrating pier experiences

Tudor Girba-2
Brilliant!

Thanks a lot,
Doru


On Tue, Feb 4, 2014 at 11:16 AM, Stephan Eggermont <[hidden email]> wrote:
So the next steps are (after updating and moving a few packages):

Gofer new
 url: 'http://www.smalltalkhub.com/mc/Pier/Pier3/main';
 package: 'ConfigurationOfPier3';
 load.

(Smalltalk at: #ConfigurationOfPier3) load.

Gofer new
 url: 'http://www.smalltalkhub.com/mc/Moose/Fame/main';
 package: 'ConfigurationOfFame';
 load.

((Smalltalk at: #ConfigurationOfFame) project version: '1.2') load: 'Core'.

Gofer new
 url: 'http://www.smalltalkhub.com/mc/ObjectProfile/Roassal/main';
 package: 'ConfigurationOfRoassal';
 load.

(Smalltalk at: #ConfigurationOfRoassal) project latestVersion load.

Gofer new
 url: 'http://smalltalkhub.com/mc/RMoD/Citezen/main';
 package: 'ConfigurationOfCitezen';
 load.

((Smalltalk at: #ConfigurationOfCitezen) version: '2.1') load: 'Web'.

Gofer new
 url: 'http://www.smalltalkhub.com/mc/Pier/Pier3Addons/main';
 package: 'Pier-Blog';
 package: 'Pier-Documents';
 package: 'Pier-Exporter-Code';
 package: 'Pier-JQuery';
 package: 'Pier-Google';
 package: 'Pier-Fame';
 package: 'TopFeeder-Pier-Widgets';
 load.

" manually load exported code "
" roll back Magritte-Exernal-FileModel to version 'Magritte-Pharo-Model-DamienCassou.29' "

PRKernelCreatorForPier register
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Migrating pier experiences

DiegoLont
In reply to this post by Stephan Eggermont-3
Hi all,

Load script below still should be made nicer (using the ConfigurationOfPier3Addons), but for now this gives a reasonable result. There are a few notes:
- you should not forget to copy the files. Preferable before creating the Pier instance.
- there are still some does not understands in Citizen, because there are no accessors to build this tree. If someone can give me rights to this, I will add the accessors needed.
- pier3 requires {{{ }}} to embed html. This is not converted, and gives some flaky results.
- testing the site, shows that some parts do not work yet, because some of the used components do not work in Pier3.

Export script:
" Load exporter code "
Gofer new
package: 'Pier-Exporter-Code';
load.

" Check the kernel name, for moose-technology this was the default (pier) "
(Smalltalk at: #PRKernelCodeExporter) exportAsPier3Kernel: 'pier'.

self doStuffInComment.
" Save exported code with Monticello "

Import script: (tested in a fresh pharo 2.0, tailored to work for the moose-technology website, as it loads the used packages for this website.)
" Load Pier"
Gofer new
package: 'ConfigurationOfPier3';
load.

(Smalltalk at: #ConfigurationOfPier3) load.

" Load things we need for some of the extensions "
Gofer new
package: 'ConfigurationOfFame';
load.

((Smalltalk at: #ConfigurationOfFame) project version: '1.2') load: 'Core'.

Gofer new
package: 'ConfigurationOfRoassal';
load.

(Smalltalk at: #ConfigurationOfRoassal) project latestVersion load.

Gofer new
package: 'ConfigurationOfCitezen';
load.
((Smalltalk at: #ConfigurationOfCitezen) version: '2.1') load: 'Web'.

" Load Pier extensions "
Gofer new
package: 'Pier-Blog';
package: 'Pier-Documents';
package: 'Pier-Exporter-Code';
package: 'Pier-JQuery';
package: 'Pier-Google';
package: 'Pier-Fame';
package: 'TopFeeder-Pier-Widgets';
package: 'Pier-Randomizer';
load.

self doStuffInComment.
" manually do the following things 
- load exported code
- roll back Magritte-Exernal-FileModel to version 'Magritte-Pharo-Model-DiegoLont.27'
- Copy the folder '/files' to the (resource folder of the) new image or configure Magritte-External-FileModel to point to the right place.
"

" remove old occurrences: "
PRKernel reset.
" and load and register the new one: "
PRKernelCreatorForPier register

Diego


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Migrating pier experiences

Tudor Girba-2
Great work.

When we see things that are not supported in Pier3, we will remove it altogether. For example, Citezen will not be used anymore. It was only for publications, but it is not important enough to warrant the overhead.

I want to rework the site completely. We will only use the contexts for some of the existing parts, and ditch those that are not useful anymore.

Doru




On Tue, Feb 4, 2014 at 11:51 AM, Diego Lont <[hidden email]> wrote:
Hi all,

Load script below still should be made nicer (using the ConfigurationOfPier3Addons), but for now this gives a reasonable result. There are a few notes:
- you should not forget to copy the files. Preferable before creating the Pier instance.
- there are still some does not understands in Citizen, because there are no accessors to build this tree. If someone can give me rights to this, I will add the accessors needed.
- pier3 requires {{{ }}} to embed html. This is not converted, and gives some flaky results.
- testing the site, shows that some parts do not work yet, because some of the used components do not work in Pier3.

Export script:
" Load exporter code "
package: 'Pier-Exporter-Code';
load.

" Check the kernel name, for moose-technology this was the default (pier) "
(Smalltalk at: #PRKernelCodeExporter) exportAsPier3Kernel: 'pier'.

self doStuffInComment.
" Save exported code with Monticello "

Import script: (tested in a fresh pharo 2.0, tailored to work for the moose-technology website, as it loads the used packages for this website.)
" Load Pier"
Gofer new
package: 'ConfigurationOfPier3';
load.

(Smalltalk at: #ConfigurationOfPier3) load.

" Load things we need for some of the extensions "
Gofer new
package: 'ConfigurationOfFame';
load.

((Smalltalk at: #ConfigurationOfFame) project version: '1.2') load: 'Core'.

Gofer new
package: 'ConfigurationOfRoassal';
load.

(Smalltalk at: #ConfigurationOfRoassal) project latestVersion load.

Gofer new
package: 'ConfigurationOfCitezen';
load.
((Smalltalk at: #ConfigurationOfCitezen) version: '2.1') load: 'Web'.

" Load Pier extensions "
Gofer new
package: 'Pier-Blog';
package: 'Pier-Documents';
package: 'Pier-Exporter-Code';
package: 'Pier-JQuery';
package: 'Pier-Google';
package: 'Pier-Fame';
package: 'TopFeeder-Pier-Widgets';
package: 'Pier-Randomizer';
load.

self doStuffInComment.
" manually do the following things 
- load exported code
- roll back Magritte-Exernal-FileModel to version 'Magritte-Pharo-Model-DiegoLont.27'
- Copy the folder '/files' to the (resource folder of the) new image or configure Magritte-External-FileModel to point to the right place.
"

" remove old occurrences: "
PRKernel reset.
" and load and register the new one: "
PRKernelCreatorForPier register

Diego


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Migrating pier experiences

DiegoLont
In reply to this post by DiegoLont
Hi all,

As below is quite a complete manual, that can put in a book, I reply to this message to add 2 more things to this chapter:

Security:
User passwords in an old version of Pier have a different method of hashing then in the newer version. So when converting it might be possible you loose your password. In order to be able to login again, you need either to modify the code the code exporter makes and put a new password hash in. The hash can be created by evaluating the following command:
GRPlatform current secureHashFor: ‘<your password>’,
or you modify the password of the administer after you make the import by performing:
(PierKernel named: ‘pier’) adminUser password: ‘<your password>'

Updater
To make life easier to deploy, there is also an auto updater. This updater needs to be loaded after you load the exported code. Currently the package name is not configurable. It expects the package: ‘Pier-Exported-Code’ and if it can update this package, it installs it into seaside and when a newer version is available it refreshes this install.

The following code can be used to install a production version, that only has a Pier (and files) without any development tools:
Gofer new 
smalltalkhubUser: 'Pier'
project: 'Pier3Addons';
configurationOf: 'Pier3AddOns';
load.

((Smalltalk at: #ConfigurationOfPier3AddOns) project version: #'development') load: 'Pier-Exporter-Code'.

(Smalltalk at: #WAAdmin) clearAll.
(Smalltalk at: #WAAdmin) defaultDispatcher  
register: (Smalltalk at: #WAFileHandler) default
at: 'files'.
(Smalltalk at: #WAAdmin) disableDevelopmentTools.

Gofer new
directory: <the local server directory as string where the exported code is stored>;
package: 'Pier-Exported-Code';
load.
Gofer new 
smalltalkhubUser: 'Pier'
project: 'Pier3Addons';
package: 'Pier-Updater';
load.

(Smalltalk at: #WAAdmin) defaultDispatcher defaultName:'pier'.
(Smalltalk at: #ZnZincServerAdaptor) startOn: 8080.

Cheers,
Diego

On 04 Feb 2014, at 11:51, Diego Lont <[hidden email]> wrote:

Hi all,

Load script below still should be made nicer (using the ConfigurationOfPier3Addons), but for now this gives a reasonable result. There are a few notes:
- you should not forget to copy the files. Preferable before creating the Pier instance.
- there are still some does not understands in Citizen, because there are no accessors to build this tree. If someone can give me rights to this, I will add the accessors needed.
- pier3 requires {{{ }}} to embed html. This is not converted, and gives some flaky results.
- testing the site, shows that some parts do not work yet, because some of the used components do not work in Pier3.

Export script:
" Load exporter code "
Gofer new
package: 'Pier-Exporter-Code';
load.

" Check the kernel name, for moose-technology this was the default (pier) "
(Smalltalk at: #PRKernelCodeExporter) exportAsPier3Kernel: 'pier'.

self doStuffInComment.
" Save exported code with Monticello "

Import script: (tested in a fresh pharo 2.0, tailored to work for the moose-technology website, as it loads the used packages for this website.)
" Load Pier"
Gofer new
package: 'ConfigurationOfPier3';
load.

(Smalltalk at: #ConfigurationOfPier3) load.

" Load things we need for some of the extensions "
Gofer new
package: 'ConfigurationOfFame';
load.

((Smalltalk at: #ConfigurationOfFame) project version: '1.2') load: 'Core'.

Gofer new
package: 'ConfigurationOfRoassal';
load.

(Smalltalk at: #ConfigurationOfRoassal) project latestVersion load.

Gofer new
package: 'ConfigurationOfCitezen';
load.
((Smalltalk at: #ConfigurationOfCitezen) version: '2.1') load: 'Web'.

" Load Pier extensions "
Gofer new
package: 'Pier-Blog';
package: 'Pier-Documents';
package: 'Pier-Exporter-Code';
package: 'Pier-JQuery';
package: 'Pier-Google';
package: 'Pier-Fame';
package: 'TopFeeder-Pier-Widgets';
package: 'Pier-Randomizer';
load.

self doStuffInComment.
" manually do the following things 
- load exported code
- roll back Magritte-Exernal-FileModel to version 'Magritte-Pharo-Model-DiegoLont.27'
- Copy the folder '/files' to the (resource folder of the) new image or configure Magritte-External-FileModel to point to the right place.
"

" remove old occurrences: "
PRKernel reset.
" and load and register the new one: "
PRKernelCreatorForPier register

Diego



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev