Pharo6 server deployment and no home directory

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

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
|

Re: Pharo6 server deployment and no home directory

Juraj Kubelka
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
|

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
|

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
|

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
|

Re: Pharo6 server deployment and no home directory

Juraj Kubelka


> 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
|

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
|

Re: Pharo6 server deployment and no home directory

Juraj Kubelka
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

Reply | Threaded
Open this post in threaded view
|

Re: Pharo6 server deployment and no home directory

Holger Freyther

> On 17. Apr 2017, at 21:30, Juraj Kubelka <[hidden email]> wrote:
>
> Hi Holger,

Hey Juraj!


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

I thought I tested it but somehow it is broken (again)? Looks like FileLocator>>#exists fails instead of answering false? Can you reproduce it?

$ unset HOME
$ pharo ...
Error: Can't find the requested origin
UnixResolver(PlatformResolver)>>cantFindOriginError
[ self cantFindOriginError ] in UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed: in Block: [ self cantFindOriginError ]
UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:
UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:
UnixResolver>>home
[ self home / '.config' ] in UnixResolver>>preferences in Block: [ self home / '.config' ]
UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:
UnixResolver>>preferences
UnixResolver(FileSystemResolver)>>resolve:
SystemResolver(FileSystemResolver)>>unknownOrigin:
SystemResolver(FileSystemResolver)>>resolve:
InteractiveResolver>>unknownOrigin:
[ self unknownOrigin: origin ] in InteractiveResolver>>resolve: in Block: [ self unknownOrigin: origin ]
IdentityDictionary(Dictionary)>>at:ifAbsent:
InteractiveResolver>>resolve:
FileLocator>>resolve
FileLocator(AbstractFileReference)>>exists
GlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>shouldCallPreviousPersistence
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:
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Pharo6 server deployment and no home directory

Sven Van Caekenberghe-2
Why would $HOME not be set ?

And if it is not set / seems like a reasonable default.

> On 9 Jun 2017, at 06:06, Holger Freyther <[hidden email]> wrote:
>
>
>> On 9. Jun 2017, at 11:09, Holger Freyther <[hidden email]> wrote:
>>
>>
>
>
>> a.) Behave like unix and resolve $HOME to ''
>>
>> $ unset HOME
>> $ echo $HOME/.config
>> /.config
>>
>> self home / '.config' => '/.config'
>
>
> Implementing UnixResolver>>#home as
>
> home
> ^ self directoryFromEnvVariableNamed: 'HOME' or: [self resolveString: '']
>
> will lead to something creating /.config/pharo (if possible). By itself this change is not good enough but when adding --no-default-preferences.
>
>
> Comments? Opinions?
>
> holger
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Pharo6 server deployment and no home directory

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


Cheers,
Juraj

El 08-06-2017, a las 17:16, Holger Freyther <[hidden email]> escribió:


On 17. Apr 2017, at 21:30, Juraj Kubelka <[hidden email]> wrote:

Hi Holger,

Hey Juraj!


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

I thought I tested it but somehow it is broken (again)? Looks like FileLocator>>#exists fails instead of answering false? Can you reproduce it?

$ unset HOME
$ pharo ...
Error: Can't find the requested origin
UnixResolver(PlatformResolver)>>cantFindOriginError
[ self cantFindOriginError ] in UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed: in Block: [ self cantFindOriginError ]
UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:
UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:
UnixResolver>>home
[ self home / '.config' ] in UnixResolver>>preferences in Block: [ self home / '.config' ]
UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:
UnixResolver>>preferences
UnixResolver(FileSystemResolver)>>resolve:
SystemResolver(FileSystemResolver)>>unknownOrigin:
SystemResolver(FileSystemResolver)>>resolve:
InteractiveResolver>>unknownOrigin:
[ self unknownOrigin: origin ] in InteractiveResolver>>resolve: in Block: [ self unknownOrigin: origin ]
IdentityDictionary(Dictionary)>>at:ifAbsent:
InteractiveResolver>>resolve:
FileLocator>>resolve
FileLocator(AbstractFileReference)>>exists
GlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>shouldCallPreviousPersistence
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:

Reply | Threaded
Open this post in threaded view
|

Re: Pharo6 server deployment and no home directory

Juraj Kubelka
Hi Holger,

I have an impression that it can be solved by using "--no-default-preferences” option: 
./pharo Pharo.image --no-default-preferences

Is it a good solution for you? Or do you need to load some preferences? 

Another option could be implementing an error signal, e.g., CantFindOriginError in the cantFindOriginError method and catch this in the GlobalIdentifier object.

Cheers,
Juraj


El 11-06-2017, a las 11:36, Juraj Kubelka <[hidden email]> escribió:

Hi Holger,


Cheers,
Juraj

El 08-06-2017, a las 17:16, Holger Freyther <[hidden email]> escribió:


On 17. Apr 2017, at 21:30, Juraj Kubelka <[hidden email]> wrote:

Hi Holger,

Hey Juraj!


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

I thought I tested it but somehow it is broken (again)? Looks like FileLocator>>#exists fails instead of answering false? Can you reproduce it?

$ unset HOME
$ pharo ...
Error: Can't find the requested origin
UnixResolver(PlatformResolver)>>cantFindOriginError
[ self cantFindOriginError ] in UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed: in Block: [ self cantFindOriginError ]
UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:
UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:
UnixResolver>>home
[ self home / '.config' ] in UnixResolver>>preferences in Block: [ self home / '.config' ]
UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:
UnixResolver>>preferences
UnixResolver(FileSystemResolver)>>resolve:
SystemResolver(FileSystemResolver)>>unknownOrigin:
SystemResolver(FileSystemResolver)>>resolve:
InteractiveResolver>>unknownOrigin:
[ self unknownOrigin: origin ] in InteractiveResolver>>resolve: in Block: [ self unknownOrigin: origin ]
IdentityDictionary(Dictionary)>>at:ifAbsent:
InteractiveResolver>>resolve:
FileLocator>>resolve
FileLocator(AbstractFileReference)>>exists
GlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>shouldCallPreviousPersistence
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:


Reply | Threaded
Open this post in threaded view
|

Re: Pharo6 server deployment and no home directory

Holger Freyther

> On 12. Jun 2017, at 16:41, Juraj Kubelka <[hidden email]> wrote:
>
> Hi Holger,
>
> I have an impression that it can be solved by using "--no-default-preferences” option:
> ./pharo Pharo.image --no-default-preferences
>
> Is it a good solution for you? Or do you need to load some preferences?

Right, unsetting HOME and then using --no-default-preferences makes the error go away.



> Another option could be implementing an error signal, e.g., CantFindOriginError in the cantFindOriginError method and catch this in the GlobalIdentifier object.

I wonder if "FileLocator home exists" should really throw an exception in case {home} can not be resolved.

a.) Just because it can not be resolved, it might still exist?
b.) If it can not be resolved it doesn't exist from an image point of view?


holger
Reply | Threaded
Open this post in threaded view
|

Re: Pharo6 server deployment and no home directory

Juraj Kubelka

> El 16-06-2017, a las 10:34, Holger Freyther <[hidden email]> escribió:
>
>
>> On 12. Jun 2017, at 16:41, Juraj Kubelka <[hidden email]> wrote:
>>
>> Hi Holger,
>>
>> I have an impression that it can be solved by using "--no-default-preferences” option:
>> ./pharo Pharo.image --no-default-preferences
>>
>> Is it a good solution for you? Or do you need to load some preferences?
>
> Right, unsetting HOME and then using --no-default-preferences makes the error go away.
>
>
>
>> Another option could be implementing an error signal, e.g., CantFindOriginError in the cantFindOriginError method and catch this in the GlobalIdentifier object.
>
> I wonder if "FileLocator home exists" should really throw an exception in case {home} can not be resolved.
>
> a.) Just because it can not be resolved, it might still exist?
> b.) If it can not be resolved it doesn't exist from an image point of view?

I think it is better to throw an exception. Then someone is sure that does not use a code, that needs {home} directory, but cannot.
Maybe there could be a specialized error class for this. Now it uses Error, if I remember well.

Juraj

>
> holger