Login  Register

Re: running Pharo8 in Digitalocean

Posted by Sven Van Caekenberghe-2 on May 17, 2020; 6:28pm
URL: https://forum.world.st/running-Pharo8-in-Digitalocean-tp5115160p5116777.html

Hi Sanjay,

When you do a metacello configuration or baseline install with the command line tools, the image is saved automatically at the end (if the load is successful).

My current approach is described here

 https://github.com/svenvc/minimal-pharo-server-tools

which is a newer version of

 https://github.com/svenvc/pharo-server-tools

Much of this goes beyond Pharo and requires some Unix/Linux knowledge, but it is all standard stuff.

Sven

> On 17 May 2020, at 18:39, Sanjay Minni <[hidden email]> wrote:
>
> @Sven,
>
> (While going thru the book ".../DeployForProduction...")
>
> seems section 1 & 2 would have to be updated ...
>
> In section 3 Build Your Image ...
> what is the script for installing dependencies from github and having a
> Baseline (instead of Configuration) as practically all packages have moved
> to Github
>
> and
> In this method it seems the image is never saved / persistent. In the event
> of a stoppage it begins ground up. Is that correct ?
>
>
> Sven Van Caekenberghe-2 wrote
>>> On 16 May 2020, at 11:15, Sanjay Minni &lt;
>
>> sm@
>
>> &gt; wrote:
>>>
>>> Can I run this way the same image which otherwise runs fine thru the
>>> graphical environment
>>>
>>> When I run that image in graphical environment it immediately starts as
>>> the
>>> application server. So cwould it work from the command line tools without
>>> changes.
>>>
>>> ...$ ...
>>> ...$ nohup ./pharo
>> <myPharo.imageWithCompletePath>
>> In principle, yes.
>>
>> But I recommend to not have running servers/services in the saved image,
>> but instead to save (better auto build) a new clean image with nothing
>> open (close all windows), nothing running, just your code. And then use a
>> startup script.
>>
>> Either use a run.st file which does all the work, or a class side 'MyStart
>> startForProduction'.
>>
>> Please read the book chapter.
>>
>>> Sven Van Caekenberghe-2 wrote
>>>>> On 16 May 2020, at 09:22, Sven Van Caekenberghe &lt;
>>>
>>>> sven@
>>>
>>>> &gt; wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> Everybody is free to do whatever they want, of course.
>>>>>
>>>>> My advice would be to not use graphical tools to deploy server
>>>>> applications (unless as add ons afterwards, like a dashboard or
>>>>> management app).
>>>>>
>>>>> Use Linux (Ubuntu is the safest choice).
>>>>>
>>>>> Stick with headless (no gui) command line tools.
>>>>>
>>>>> Pharo is very good at this.
>>>>
>>>> Also use 64-bit (that is 64-bit Pharo on 64-bit Linux), it will make
>>>> your
>>>> life much easier.
>>>>
>>>> Here is a short example:
>>>>
>>>> stfx@audio359:~$ mkdir pharo8
>>>>
>>>> stfx@audio359:~$ cd !$
>>>> cd pharo8
>>>>
>>>> stfx@audio359:~/pharo8$ curl get.pharo.org/64/80+vm | bash
>>>> % Total    % Received % Xferd  Average Speed   Time    Time     Time
>>>> Current
>>>>                                Dload  Upload   Total   Spent    Left
>>>> Speed
>>>> 100  3054  100  3054    0     0  67866      0 --:--:-- --:--:-- --:--:--
>>>> 69409
>>>> Downloading the latest 80 Image:
>>>>   http://files.pharo.org/get-files/80/pharo64.zip
>>>> Pharo.image
>>>> Downloading the latest pharoVM:
>>>> http://files.pharo.org/get-files/80/pharo64-linux-stable.zip
>>>> pharo-vm/pharo
>>>> Creating starter scripts pharo and pharo-ui
>>>>
>>>> stfx@audio359:~/pharo8$ nohup ./pharo Pharo.image eval --no-quit
>>>> 'ZnServer
>>>> startOn: 9090' &
>>>> [1] 84125
>>>> nohup: ignoring input and appending output to 'nohup.out'
>>>>
>>>> stfx@audio359:~/pharo8$ curl http://localhost:9090/random
>>>> CF4173824EF6E0D9F336E5464A5FACB8ABEFFD1A6EE7A5F9F6631186F619606
>>>>
>>>> stfx@audio359:~/pharo8$ jobs
>>>> [1]+  Running                 nohup ./pharo Pharo.image eval --no-quit
>>>> 'ZnServer startOn: 9090' &
>>>>
>>>> stfx@audio359:~/pharo8$ kill %1
>>>> [1]+  Terminated              nohup ./pharo Pharo.image eval --no-quit
>>>> 'ZnServer startOn: 9090'
>>>>
>>>> BTW, nohup is one way to keep something running after you log out
>>>> (systemctl services being the pro/real way)
>>>>
>>>>> The following book chapter explain things reasonably well:
>>>>>
>>>>> https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfulBuild/artifact/book-result/DeploymentWeb/DeployForProduction.html
>>>>>
>>>>> Nowadays, you would use Baselines and git though.
>>>>>
>>>>> I can give you more info if you want. Feel free to ask questions.
>>>>>
>>>>> Sven
>>>>>
>>>>>> On 16 May 2020, at 07:00, Sanjay Minni &lt;
>>>
>>>> sm@
>>>
>>>> &gt; wrote:
>>>>>>
>>>>>> Hi
>>>>>>
>>>>>> Eventually in a Digitalocean Ubuntu droplet, I connected from Windows
>>>>>> 10
>>>>>> to
>>>>>> a Ubuntu Graphical desktop, installed PharoLauncher and couple of
>>>>>> images
>>>>>> and
>>>>>> got seaside up, installed Mongo DB and a Pharo App. pretty smooth and
>>>>>> can
>>>>>> share how to step by step if anybody is interested.
>>>>>>
>>>>>> (note: no additional software is required on Windows 10 except chrome
>>>>>> -
>>>>>> as
>>>>>> SSH, Remote Desktop is inbuilt, Chrome only for its VNC app)
>>>>>>
>>>>>> Question: what is the best way to run and leave the Pharo App as a
>>>>>> seaside
>>>>>> server running.  
>>>>>> Currently I am running thru the X Desktop and if I Disconnect / logout
>>>>>> from
>>>>>> the remote desktop session then the pharo app may go down. also is
>>>>>> that
>>>>>> the
>>>>>> most stable and resource optimised way
>>>>>>
>>>>>> further: is Apache recommended
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> -----
>>>>>> cheers,
>>>>>> Sanjay
>>>>>> --
>>>>>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>>>>>
>>>>>
>>>
>>>
>>>
>>>
>>>
>>> -----
>>> cheers,
>>> Sanjay
>>> --
>>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>
>
>
>
> -----
> cheers,
> Sanjay
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html