Quantcast

Pharo6 server deployment and no home directory

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Pharo6 server deployment and no home directory

Holger Freyther
Hi,

as Pharo6 is around the corner I have moved my CI build from tracking Pharo5 to Pharo6 but I run into a problem. Either if $HOME is not set at all or $HOME points to a wrong directory I run into the error below.

As this is a server application and I run multiple VMs with the same image and there is no home directory I would prefer that no information is persisted at all. Can this be done? Have there been any changes in Pharo6 in regard to this?

It also seems to change from Fuel->Ston for the identifier? Is this intended?

holger



HOME=/home/blabla ./vm/pharo --nodisplay My.image eval --save '(NonInteractiveTranscript onFileNamed: #stdout)' install
PrimitiveFailed: primitive #createDirectory: in UnixStore failed
UnixStore(Object)>>primitiveFailed:
UnixStore(Object)>>primitiveFailed
UnixStore(DiskStore)>>createDirectory:
UnixStore(FileSystemStore)>>ensureCreateDirectory:
UnixStore(FileSystemStore)>>ensureCreateDirectory:
UnixStore(FileSystemStore)>>ensureCreateDirectory:
FileSystem>>ensureCreateDirectory:
FileReference>>ensureCreateDirectory
FileLocator(AbstractFileReference)>>ensureCreateDirectory
GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>>ensureDirectory
GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>>save:
GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>>load:
GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>>ensure:
GlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:
GlobalIdentifier>>ensure
GlobalIdentifier class>>initializeUniqueInstance
GlobalIdentifier class>>uniqueInstance
SystemSettingsPersistence class>>resumeSystemSettings
[ :persistence | persistence resumeSystemSettings ] in PharoCommandLineHandler>>runPreferences in Block: [ :persistence | persistence resumeSystemSettings ...etc...
BlockClosure>>cull:
SystemDictionary(Dictionary)>>at:ifPresent:
SmalltalkImage>>at:ifPresent:
PharoCommandLineHandler>>runPreferences
PharoCommandLineHandler>>activate
PharoCommandLineHandler class(CommandLineHandler class)>>activateWith:
[ super activateWith: aCommandLine ] in PharoCommandLineHandler class>>activateWith: in Block: [ super activateWith: aCommandLine ]
NonInteractiveUIManager(UIManager)>>defer:
PharoCommandLineHandler class>>activateWith:
[ aCommandLinehandler activateWith: commandLine ] in BasicCommandLineHandler>>activateSubCommand: in Block: [ aCommandLinehandler activateWith: commandLine ]
BlockClosure>>on:do:


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pharo6 server deployment and no home directory

Juraj Kubelka-2
Hi,

> El 14-04-2017, a las 16:17, Holger Freyther <[hidden email]> escribió:
>
> Hi,
>
> as Pharo6 is around the corner I have moved my CI build from tracking Pharo5 to Pharo6 but I run into a problem. Either if $HOME is not set at all or $HOME points to a wrong directory I run into the error below.
>
> As this is a server application and I run multiple VMs with the same image and there is no home directory I would prefer that no information is persisted at all. Can this be done? Have there been any changes in Pharo6 in regard to this?

Do you think that checking if `FileIdentifier home` exist solves the issue?

Can we detect headless state?

>
> It also seems to change from Fuel->Ston for the identifier? Is this intended?

Yes, this is intended and should not produce problems.

Juraj

>
> holger
>
>
>
> HOME=/home/blabla ./vm/pharo --nodisplay My.image eval --save '(NonInteractiveTranscript onFileNamed: #stdout)' install
> PrimitiveFailed: primitive #createDirectory: in UnixStore failed
> UnixStore(Object)>>primitiveFailed:
> UnixStore(Object)>>primitiveFailed
> UnixStore(DiskStore)>>createDirectory:
> UnixStore(FileSystemStore)>>ensureCreateDirectory:
> UnixStore(FileSystemStore)>>ensureCreateDirectory:
> UnixStore(FileSystemStore)>>ensureCreateDirectory:
> FileSystem>>ensureCreateDirectory:
> FileReference>>ensureCreateDirectory
> FileLocator(AbstractFileReference)>>ensureCreateDirectory
> GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>>ensureDirectory
> GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>>save:
> GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>>load:
> GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>>ensure:
> GlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:
> GlobalIdentifier>>ensure
> GlobalIdentifier class>>initializeUniqueInstance
> GlobalIdentifier class>>uniqueInstance
> SystemSettingsPersistence class>>resumeSystemSettings
> [ :persistence | persistence resumeSystemSettings ] in PharoCommandLineHandler>>runPreferences in Block: [ :persistence | persistence resumeSystemSettings ...etc...
> BlockClosure>>cull:
> SystemDictionary(Dictionary)>>at:ifPresent:
> SmalltalkImage>>at:ifPresent:
> PharoCommandLineHandler>>runPreferences
> PharoCommandLineHandler>>activate
> PharoCommandLineHandler class(CommandLineHandler class)>>activateWith:
> [ super activateWith: aCommandLine ] in PharoCommandLineHandler class>>activateWith: in Block: [ super activateWith: aCommandLine ]
> NonInteractiveUIManager(UIManager)>>defer:
> PharoCommandLineHandler class>>activateWith:
> [ aCommandLinehandler activateWith: commandLine ] in BasicCommandLineHandler>>activateSubCommand: in Block: [ aCommandLinehandler activateWith: commandLine ]
> BlockClosure>>on:do:
>
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pharo6 server deployment and no home directory

Holger Freyther

> On 15. Apr 2017, at 00:23, Juraj Kubelka <[hidden email]> wrote:
>
> Hi,

Hey!

>> As this is a server application and I run multiple VMs with the same image and there is no home directory I would prefer that no information is persisted at all. Can this be done? Have there been any changes in Pharo6 in regard to this?
>
> Do you think that checking if `FileIdentifier home` exist solves the issue?
>
> Can we detect headless state?
>
>>
>> It also seems to change from Fuel->Ston for the identifier? Is this intended?
>
> Yes, this is intended and should not produce problems.

Thank you for your quick reply. What I find odd is that this error seems to be coming from within:


GlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:
        self shouldCallPreviousPersistence ifTrue: [
                previousPersistence ensure: existingDictionary ].

So there is the "Fuel" Persistence and we want to migrate things. Fair enough but in the migration we do have:


>>load: existingDictionary
        "It loads stored information into existingDictionary."
        self preferences exists ifFalse: [
                "This is a new computer, so we define new computer UUID.
                User still has to agree about sending data if it is not has been done yet."
                ^ self save: existingDictionary ].


So self preferences exists is true and now the old (non-existent data?) is being saved and we crash and exit on save.

* Why isn't the migration from Ston to Fuel more explicit?
* Why is "load" trying to save?
* Why is "ensure:" used instead of load?
* Not sure why "self preferences exists" seems to end in true?



have a nice weekend

        holger



>> FileLocator(AbstractFileReference)>>ensureCreateDirectory
>> GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>>ensureDirectory
>> GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>>save:
>> GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>>load:
>> GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>>ensure:
>> GlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:
>> GlobalIdentifier>>ensure




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pharo6 server deployment and no home directory

Stephane Ducasse-3
Holger

with guille, damien and two students we are looking at how to improve the deployment of pharo and you scenario is 
really interesting. 

Stef

On Sat, Apr 15, 2017 at 7:59 AM, Holger Freyther <[hidden email]> wrote:

> On 15. Apr 2017, at 00:23, Juraj Kubelka <[hidden email]> wrote:
>
> Hi,

Hey!

>> As this is a server application and I run multiple VMs with the same image and there is no home directory I would prefer that no information is persisted at all. Can this be done? Have there been any changes in Pharo6 in regard to this?
>
> Do you think that checking if `FileIdentifier home` exist solves the issue?
>
> Can we detect headless state?
>
>>
>> It also seems to change from Fuel->Ston for the identifier? Is this intended?
>
> Yes, this is intended and should not produce problems.

Thank you for your quick reply. What I find odd is that this error seems to be coming from within:


GlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:
        self shouldCallPreviousPersistence ifTrue: [
                previousPersistence ensure: existingDictionary ].

So there is the "Fuel" Persistence and we want to migrate things. Fair enough but in the migration we do have:


>>load: existingDictionary
        "It loads stored information into existingDictionary."
        self preferences exists ifFalse: [
                "This is a new computer, so we define new computer UUID.
                User still has to agree about sending data if it is not has been done yet."
                ^ self save: existingDictionary ].


So self preferences exists is true and now the old (non-existent data?) is being saved and we crash and exit on save.

* Why isn't the migration from Ston to Fuel more explicit?
* Why is "load" trying to save?
* Why is "ensure:" used instead of load?
* Not sure why "self preferences exists" seems to end in true?



have a nice weekend

        holger



>> FileLocator(AbstractFileReference)>>ensureCreateDirectory
>> GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>>ensureDirectory
>> GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>>save:
>> GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>>load:
>> GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>>ensure:
>> GlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:
>> GlobalIdentifier>>ensure





Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pharo6 server deployment and no home directory

Holger Freyther
In reply to this post by Holger Freyther

> On 15. Apr 2017, at 07:59, Holger Freyther <[hidden email]> wrote:
>
>
> * Why isn't the migration from Ston to Fuel more explicit?
> * Why is "load" trying to save?
> * Why is "ensure:" used instead of load?
> * Not sure why "self preferences exists" seems to end in true?

Is there an option to not run startUp options at all or single step through them? I have the suspicion that "exists" returns true while it should not. Will see how to move forward.

holger


Breakpoint 4, dir_EntryLookup (pathString=0x84cd258 "/home/build/.config/pharo", pathStringLength=25, nameString=0x84ce920 "org.pharo.gt.spotter.event.recorder.fuel", nameStringLength=40,
    name=0xfffcb1bc "", nameLength=0xfffcb1ac, creationDate=0xfffcb1a4, modificationDate=0xfffcb1b0, isDirectory=0xfffcb1a8, sizeIfFile=0xfffcb198, posixPermissions=0xfffcb1b4, isSymlink=0xfffcb1b8)
    at /home/travis/build/pharo-project/pharo-vm/opensmalltalk-vm/platforms/unix/plugins/FilePlugin/sqUnixFile.c:270
270 in /home/travis/build/pharo-project/pharo-vm/opensmalltalk-vm/platforms/unix/plugins/FilePlugin/sqUnixFile.c
(gdb) p printCallStack()
0xfffd41a0 M UnixStore(DiskStore)>basicEntryAt: 0x842dd28: a(n) UnixStore
0xfffd41c0 M UnixStore(DiskStore)>nodeAt:ifPresent:ifAbsent: 0x842dd28: a(n) UnixStore
0xfffd41e4 M UnixStore(FileSystemStore)>exists: 0x842dd28: a(n) UnixStore
0xfffd4200 M FileSystem>exists: 0x842dd38: a(n) FileSystem
0xfffd421c M FileReference>exists 0x84c9d78: a(n) FileReference
0xfffd4234 M FileLocator(AbstractFileReference)>exists 0x84c32c8: a(n) FileLocator
0xfffd4254 I GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>load: 0x84a6d40: a(n) GlobalIdentifierFuelPersistence
0xfffd4278 I GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>ensure: 0x84a6d40: a(n) GlobalIdentifierFuelPersistence
0xfffd429c I GlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>ensure: 0x84a6d30: a(n) GlobalIdentifierStonPersistence
0xfffd42c0 I GlobalIdentifier>ensure 0x84a6510: a(n) GlobalIdentifier
0xfffd42e0 I GlobalIdentifier class>initializeUniqueInstance 0x9a2def0: a(n) GlobalIdentifier class
0xfffd4300 I GlobalIdentifier class>uniqueInstance 0x9a2def0: a(n) GlobalIdentifier class
0xfffccfd0 I SystemSettingsPersistence class>resumeSystemSettings 0x9a2d9f0: a(n) SystemSettingsPersistence class
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pharo6 server deployment and no home directory

Juraj Kubelka-2


> El 15-04-2017, a las 04:11, Holger Freyther <[hidden email]> escribió:
>
>
>> On 15. Apr 2017, at 07:59, Holger Freyther <[hidden email]> wrote:
>>
>>
>> * Why isn't the migration from Ston to Fuel more explicit?
>> * Why is "load" trying to save?
>> * Why is "ensure:" used instead of load?
>> * Not sure why "self preferences exists" seems to end in true?
>
> Is there an option to not run startUp options at all or single step through them? I have the suspicion that "exists" returns true while it should not. Will see how to move forward.

Maybe GlobalIdentifier should not write and read anything if --no-preferences option is used. I will check this on Monday. I am without computer now.

Juraj

>
> holger
>
>
> Breakpoint 4, dir_EntryLookup (pathString=0x84cd258 "/home/build/.config/pharo", pathStringLength=25, nameString=0x84ce920 "org.pharo.gt.spotter.event.recorder.fuel", nameStringLength=40,
>    name=0xfffcb1bc "", nameLength=0xfffcb1ac, creationDate=0xfffcb1a4, modificationDate=0xfffcb1b0, isDirectory=0xfffcb1a8, sizeIfFile=0xfffcb198, posixPermissions=0xfffcb1b4, isSymlink=0xfffcb1b8)
>    at /home/travis/build/pharo-project/pharo-vm/opensmalltalk-vm/platforms/unix/plugins/FilePlugin/sqUnixFile.c:270
> 270    in /home/travis/build/pharo-project/pharo-vm/opensmalltalk-vm/platforms/unix/plugins/FilePlugin/sqUnixFile.c
> (gdb) p printCallStack()
> 0xfffd41a0 M UnixStore(DiskStore)>basicEntryAt: 0x842dd28: a(n) UnixStore
> 0xfffd41c0 M UnixStore(DiskStore)>nodeAt:ifPresent:ifAbsent: 0x842dd28: a(n) UnixStore
> 0xfffd41e4 M UnixStore(FileSystemStore)>exists: 0x842dd28: a(n) UnixStore
> 0xfffd4200 M FileSystem>exists: 0x842dd38: a(n) FileSystem
> 0xfffd421c M FileReference>exists 0x84c9d78: a(n) FileReference
> 0xfffd4234 M FileLocator(AbstractFileReference)>exists 0x84c32c8: a(n) FileLocator
> 0xfffd4254 I GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>load: 0x84a6d40: a(n) GlobalIdentifierFuelPersistence
> 0xfffd4278 I GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>ensure: 0x84a6d40: a(n) GlobalIdentifierFuelPersistence
> 0xfffd429c I GlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>ensure: 0x84a6d30: a(n) GlobalIdentifierStonPersistence
> 0xfffd42c0 I GlobalIdentifier>ensure 0x84a6510: a(n) GlobalIdentifier
> 0xfffd42e0 I GlobalIdentifier class>initializeUniqueInstance 0x9a2def0: a(n) GlobalIdentifier class
> 0xfffd4300 I GlobalIdentifier class>uniqueInstance 0x9a2def0: a(n) GlobalIdentifier class
> 0xfffccfd0 I SystemSettingsPersistence class>resumeSystemSettings 0x9a2d9f0: a(n) SystemSettingsPersistence class

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pharo6 server deployment and no home directory

Ben Coman
In reply to this post by Holger Freyther
On Sat, Apr 15, 2017 at 3:11 PM, Holger Freyther <[hidden email]> wrote:

>
>> On 15. Apr 2017, at 07:59, Holger Freyther <[hidden email]> wrote:
>>
>>
>> * Why isn't the migration from Ston to Fuel more explicit?
>> * Why is "load" trying to save?
>> * Why is "ensure:" used instead of load?
>> * Not sure why "self preferences exists" seems to end in true?
>
> Is there an option to not run startUp options at all or single step through them?

Highly speculative...
From the command line compile a "self halt" into
   PharoCommandLineHandler>>activate

cheers -ben

> I have the suspicion that "exists" returns true while it should not. Will see how to move forward.
>
> holger
>
>
> Breakpoint 4, dir_EntryLookup (pathString=0x84cd258 "/home/build/.config/pharo", pathStringLength=25, nameString=0x84ce920 "org.pharo.gt.spotter.event.recorder.fuel", nameStringLength=40,
>     name=0xfffcb1bc "", nameLength=0xfffcb1ac, creationDate=0xfffcb1a4, modificationDate=0xfffcb1b0, isDirectory=0xfffcb1a8, sizeIfFile=0xfffcb198, posixPermissions=0xfffcb1b4, isSymlink=0xfffcb1b8)
>     at /home/travis/build/pharo-project/pharo-vm/opensmalltalk-vm/platforms/unix/plugins/FilePlugin/sqUnixFile.c:270
> 270     in /home/travis/build/pharo-project/pharo-vm/opensmalltalk-vm/platforms/unix/plugins/FilePlugin/sqUnixFile.c
> (gdb) p printCallStack()
> 0xfffd41a0 M UnixStore(DiskStore)>basicEntryAt: 0x842dd28: a(n) UnixStore
> 0xfffd41c0 M UnixStore(DiskStore)>nodeAt:ifPresent:ifAbsent: 0x842dd28: a(n) UnixStore
> 0xfffd41e4 M UnixStore(FileSystemStore)>exists: 0x842dd28: a(n) UnixStore
> 0xfffd4200 M FileSystem>exists: 0x842dd38: a(n) FileSystem
> 0xfffd421c M FileReference>exists 0x84c9d78: a(n) FileReference
> 0xfffd4234 M FileLocator(AbstractFileReference)>exists 0x84c32c8: a(n) FileLocator
> 0xfffd4254 I GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>load: 0x84a6d40: a(n) GlobalIdentifierFuelPersistence
> 0xfffd4278 I GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>ensure: 0x84a6d40: a(n) GlobalIdentifierFuelPersistence
> 0xfffd429c I GlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>ensure: 0x84a6d30: a(n) GlobalIdentifierStonPersistence
> 0xfffd42c0 I GlobalIdentifier>ensure 0x84a6510: a(n) GlobalIdentifier
> 0xfffd42e0 I GlobalIdentifier class>initializeUniqueInstance 0x9a2def0: a(n) GlobalIdentifier class
> 0xfffd4300 I GlobalIdentifier class>uniqueInstance 0x9a2def0: a(n) GlobalIdentifier class
> 0xfffccfd0 I SystemSettingsPersistence class>resumeSystemSettings 0x9a2d9f0: a(n) SystemSettingsPersistence class

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pharo6 server deployment and no home directory

Juraj Kubelka-2
In reply to this post by Holger Freyther
Hi Holger,

I will appreciate if you review it and test it.

Basically it tests `FileLocator home exists`, if false, it does not touch disk. We could also add a #disablePersistence method if necessary.

Juraj

On Apr 15, 2017, at 04:11, Holger Freyther <[hidden email]> wrote:


On 15. Apr 2017, at 07:59, Holger Freyther <[hidden email]> wrote:


* Why isn't the migration from Ston to Fuel more explicit?
* Why is "load" trying to save?
* Why is "ensure:" used instead of load?
* Not sure why "self preferences exists" seems to end in true?

Is there an option to not run startUp options at all or single step through them? I have the suspicion that "exists" returns true while it should not. Will see how to move forward.

holger


Breakpoint 4, dir_EntryLookup (pathString=0x84cd258 "/home/build/.config/pharo", pathStringLength=25, nameString=0x84ce920 "org.pharo.gt.spotter.event.recorder.fuel", nameStringLength=40,
   name=0xfffcb1bc "", nameLength=0xfffcb1ac, creationDate=0xfffcb1a4, modificationDate=0xfffcb1b0, isDirectory=0xfffcb1a8, sizeIfFile=0xfffcb198, posixPermissions=0xfffcb1b4, isSymlink=0xfffcb1b8)
   at /home/travis/build/pharo-project/pharo-vm/opensmalltalk-vm/platforms/unix/plugins/FilePlugin/sqUnixFile.c:270
270 in /home/travis/build/pharo-project/pharo-vm/opensmalltalk-vm/platforms/unix/plugins/FilePlugin/sqUnixFile.c
(gdb) p printCallStack()
0xfffd41a0 M UnixStore(DiskStore)>basicEntryAt: 0x842dd28: a(n) UnixStore
0xfffd41c0 M UnixStore(DiskStore)>nodeAt:ifPresent:ifAbsent: 0x842dd28: a(n) UnixStore
0xfffd41e4 M UnixStore(FileSystemStore)>exists: 0x842dd28: a(n) UnixStore
0xfffd4200 M FileSystem>exists: 0x842dd38: a(n) FileSystem
0xfffd421c M FileReference>exists 0x84c9d78: a(n) FileReference
0xfffd4234 M FileLocator(AbstractFileReference)>exists 0x84c32c8: a(n) FileLocator
0xfffd4254 I GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>load: 0x84a6d40: a(n) GlobalIdentifierFuelPersistence
0xfffd4278 I GlobalIdentifierFuelPersistence(GlobalIdentifierPersistence)>ensure: 0x84a6d40: a(n) GlobalIdentifierFuelPersistence
0xfffd429c I GlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>ensure: 0x84a6d30: a(n) GlobalIdentifierStonPersistence
0xfffd42c0 I GlobalIdentifier>ensure 0x84a6510: a(n) GlobalIdentifier
0xfffd42e0 I GlobalIdentifier class>initializeUniqueInstance 0x9a2def0: a(n) GlobalIdentifier class
0xfffd4300 I GlobalIdentifier class>uniqueInstance 0x9a2def0: a(n) GlobalIdentifier class
0xfffccfd0 I SystemSettingsPersistence class>resumeSystemSettings 0x9a2d9f0: a(n) SystemSettingsPersistence class

Loading...