Are we able to run pharo images in a read only environment?

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

Are we able to run pharo images in a read only environment?

Tim Mackinnon
Hi - I am trying to run a pharo image in lambda (as an experiment) - however I get an error from Pharo about not being able to write to the changes file?

As I am just evaluating some code - I’m not really coding, so don’t need a changes file - is there a command line option to not require it?

Also, am I running pharo the most efficient way - I’m using eval on the command line and referencing a class with a class method - but is this the best way?

Thanks,

Tim

"errorMessage": "Command failed: ./pharo Pharo.image eval \"Lambda processJSON: '{\"key3\":\"value3\",\"key2\":\"value2\",\"key1\":\"value1\"}'\"\n'Pharo cannot write to the changes file named /var/task/Pharo.changes.\n\nPlease check that you have write permission for this file.\n\nYou won''t be able to save this image correctly until you fix this.'\n\u001b[31mError: Can't find the requested origin\n\u001b[0mUnixResolver(PlatformResolver)>>cantFindOriginError\n[ self cantFindOriginError ] in UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed: in Block: [ self cantFindOriginError ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:\nUnixResolver>>home\n[ self home / '.config' ] in UnixResolver>>preferences in Block: [ self home / '.config' ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver>>preferences\nUnixResolver(FileSystemResolver)>>resolve:\nSystemResolver(FileSystemResolver)>>unknownOrigin:\nSystemResolver(FileSystemResolver)>>resolve:\nInteractiveResolver>>unknownOrigin:\n[ self unknownOrigin: origin ] in InteractiveResolver>>resolve: in Block: [ self unknownOrigin: origin ]\nIdentityDictionary(Dictionary)>>at:ifAbsent:\nInteractiveResolver>>resolve:\nFileLocator>>resolve\nFileLocator(AbstractFileReference)>>exists\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>shouldCallPreviousPersistence\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:\nGlobalIdentifier>>ensure\nGlobalIdentifier class>>initializeUniqueInstance\nGlobalIdentifier class>>uniqueInstance\nSystemSettingsPersistence class>>resumeSystemSettings\n[ :persistence | persistence resumeSystemSettings ] in PharoCommandLineHandler>>runPreferences in Block: [ :persistence | persistence resumeSystemSettings ...etc...\nBlockClosure>>cull:\nSystemDictionary(Dictionary)>>at:ifPresent:\nSmalltalkImage>>at:ifPresent:\nPharoCommandLineHandler>>runPreferences\nPharoCommandLineHandler>>activate\nPharoCommandLineHandler class(CommandLineHandler class)>>activateWith:\n\u001b[0m",
  "errorType": "Error",
  "stackTrace": [
    "'Pharo cannot write to the changes file named /var/task/Pharo.changes.",
    "",
    "Please check that you have write permission for this file.",
    "",
    "You won''t be able to save this image correctly until you fix this.'",
    "\u001b[31mError: Can't find the requested origin",
    "\u001b[0mUnixResolver(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:",
    "\u001b[0m",
    "ChildProcess.exithandler (child_process.js:204:12)",
    "emitTwo (events.js:106:13)",
    "ChildProcess.emit (events.js:191:7)",
    "maybeClose (internal/child_process.js:886:16)",
    "Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)"
  ]
}

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

Re: Are we able to run pharo images in a read only environment?

Esteban A. Maringolo
Interesting experiment.

It would be good to know how fast does the image boot and start
execution in the context of a service billed at the sub second scale.


Esteban A. Maringolo


2017-06-27 13:05 GMT-03:00 Tim Mackinnon <[hidden email]>:

> Hi - I am trying to run a pharo image in lambda (as an experiment) - however
> I get an error from Pharo about not being able to write to the changes file?
>
> As I am just evaluating some code - I’m not really coding, so don’t need a
> changes file - is there a command line option to not require it?
>
> Also, am I running pharo the most efficient way - I’m using eval on the
> command line and referencing a class with a class method - but is this the
> best way?
>
> Thanks,
>
> Tim
>
> "errorMessage": "Command failed: ./pharo Pharo.image eval \"Lambda
> processJSON:
> '{\"key3\":\"value3\",\"key2\":\"value2\",\"key1\":\"value1\"}'\"\n'Pharo
> cannot write to the changes file named /var/task/Pharo.changes.\n\nPlease
> check that you have write permission for this file.\n\nYou won''t be able to
> save this image correctly until you fix this.'\n\u001b[31mError: Can't find
> the requested
> origin\n\u001b[0mUnixResolver(PlatformResolver)>>cantFindOriginError\n[ self
> cantFindOriginError ] in
> UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed: in Block: [
> self cantFindOriginError
> ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:\nUnixResolver>>home\n[
> self home / '.config' ] in UnixResolver>>preferences in Block: [ self home /
> '.config'
> ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver>>preferences\nUnixResolver(FileSystemResolver)>>resolve:\nSystemResolver(FileSystemResolver)>>unknownOrigin:\nSystemResolver(FileSystemResolver)>>resolve:\nInteractiveResolver>>unknownOrigin:\n[
> self unknownOrigin: origin ] in InteractiveResolver>>resolve: in Block: [
> self unknownOrigin: origin
> ]\nIdentityDictionary(Dictionary)>>at:ifAbsent:\nInteractiveResolver>>resolve:\nFileLocator>>resolve\nFileLocator(AbstractFileReference)>>exists\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>shouldCallPreviousPersistence\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:\nGlobalIdentifier>>ensure\nGlobalIdentifier
> class>>initializeUniqueInstance\nGlobalIdentifier
> class>>uniqueInstance\nSystemSettingsPersistence
> class>>resumeSystemSettings\n[ :persistence | persistence
> resumeSystemSettings ] in PharoCommandLineHandler>>runPreferences in Block:
> [ :persistence | persistence resumeSystemSettings
> ...etc...\nBlockClosure>>cull:\nSystemDictionary(Dictionary)>>at:ifPresent:\nSmalltalkImage>>at:ifPresent:\nPharoCommandLineHandler>>runPreferences\nPharoCommandLineHandler>>activate\nPharoCommandLineHandler
> class(CommandLineHandler class)>>activateWith:\n\u001b[0m",
>   "errorType": "Error",
>   "stackTrace": [
>     "'Pharo cannot write to the changes file named
> /var/task/Pharo.changes.",
>     "",
>     "Please check that you have write permission for this file.",
>     "",
>     "You won''t be able to save this image correctly until you fix this.'",
>     "\u001b[31mError: Can't find the requested origin",
>     "\u001b[0mUnixResolver(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:",
>     "\u001b[0m",
>     "ChildProcess.exithandler (child_process.js:204:12)",
>     "emitTwo (events.js:106:13)",
>     "ChildProcess.emit (events.js:191:7)",
>     "maybeClose (internal/child_process.js:886:16)",
>     "Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)"
>   ]
> }
>
>

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

Re: Are we able to run pharo images in a read only environment?

Sven Van Caekenberghe-2

> On 27 Jun 2017, at 21:00, Esteban A. Maringolo <[hidden email]> wrote:
>
> Interesting experiment.
>
> It would be good to know how fast does the image boot and start
> execution in the context of a service billed at the sub second scale.

Sadly I have the impression we lost some speed:

~/pharo64$ ./pharo Pharo.image printVersion
[version] 6.0 #60499

~/pharo64$ time ./pharo Pharo.image eval '42 factorial'
1405006117752879898543142606244511569936384000000000

real 0m1.276s
user 0m0.985s
sys 0m0.171s

while before

~/pharo/build$ ../bin/pharo Pharo.image printVersion
[version] 4.0 #40620

$ time ../bin/pharo Pharo.image eval '42 factorial'
1405006117752879898543142606244511569936384000000000

real 0m0.526s
user 0m0.434s
sys 0m0.045s

But it is really hard to find the cause.

That being said, these lambda servers can only work well if they keep instances alive for longer when there is enough traffic.

> Esteban A. Maringolo
>
>
> 2017-06-27 13:05 GMT-03:00 Tim Mackinnon <[hidden email]>:
>> Hi - I am trying to run a pharo image in lambda (as an experiment) - however
>> I get an error from Pharo about not being able to write to the changes file?
>>
>> As I am just evaluating some code - I’m not really coding, so don’t need a
>> changes file - is there a command line option to not require it?
>>
>> Also, am I running pharo the most efficient way - I’m using eval on the
>> command line and referencing a class with a class method - but is this the
>> best way?
>>
>> Thanks,
>>
>> Tim
>>
>> "errorMessage": "Command failed: ./pharo Pharo.image eval \"Lambda
>> processJSON:
>> '{\"key3\":\"value3\",\"key2\":\"value2\",\"key1\":\"value1\"}'\"\n'Pharo
>> cannot write to the changes file named /var/task/Pharo.changes.\n\nPlease
>> check that you have write permission for this file.\n\nYou won''t be able to
>> save this image correctly until you fix this.'\n\u001b[31mError: Can't find
>> the requested
>> origin\n\u001b[0mUnixResolver(PlatformResolver)>>cantFindOriginError\n[ self
>> cantFindOriginError ] in
>> UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed: in Block: [
>> self cantFindOriginError
>> ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:\nUnixResolver>>home\n[
>> self home / '.config' ] in UnixResolver>>preferences in Block: [ self home /
>> '.config'
>> ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver>>preferences\nUnixResolver(FileSystemResolver)>>resolve:\nSystemResolver(FileSystemResolver)>>unknownOrigin:\nSystemResolver(FileSystemResolver)>>resolve:\nInteractiveResolver>>unknownOrigin:\n[
>> self unknownOrigin: origin ] in InteractiveResolver>>resolve: in Block: [
>> self unknownOrigin: origin
>> ]\nIdentityDictionary(Dictionary)>>at:ifAbsent:\nInteractiveResolver>>resolve:\nFileLocator>>resolve\nFileLocator(AbstractFileReference)>>exists\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>shouldCallPreviousPersistence\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:\nGlobalIdentifier>>ensure\nGlobalIdentifier
>> class>>initializeUniqueInstance\nGlobalIdentifier
>> class>>uniqueInstance\nSystemSettingsPersistence
>> class>>resumeSystemSettings\n[ :persistence | persistence
>> resumeSystemSettings ] in PharoCommandLineHandler>>runPreferences in Block:
>> [ :persistence | persistence resumeSystemSettings
>> ...etc...\nBlockClosure>>cull:\nSystemDictionary(Dictionary)>>at:ifPresent:\nSmalltalkImage>>at:ifPresent:\nPharoCommandLineHandler>>runPreferences\nPharoCommandLineHandler>>activate\nPharoCommandLineHandler
>> class(CommandLineHandler class)>>activateWith:\n\u001b[0m",
>>  "errorType": "Error",
>>  "stackTrace": [
>>    "'Pharo cannot write to the changes file named
>> /var/task/Pharo.changes.",
>>    "",
>>    "Please check that you have write permission for this file.",
>>    "",
>>    "You won''t be able to save this image correctly until you fix this.'",
>>    "\u001b[31mError: Can't find the requested origin",
>>    "\u001b[0mUnixResolver(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:",
>>    "\u001b[0m",
>>    "ChildProcess.exithandler (child_process.js:204:12)",
>>    "emitTwo (events.js:106:13)",
>>    "ChildProcess.emit (events.js:191:7)",
>>    "maybeClose (internal/child_process.js:886:16)",
>>    "Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)"
>>  ]
>> }
>>
>>
>


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

Re: Are we able to run pharo images in a read only environment?

Sven Van Caekenberghe-2
In reply to this post by Tim Mackinnon

> On 27 Jun 2017, at 18:05, Tim Mackinnon <[hidden email]> wrote:
>
> Hi - I am trying to run a pharo image in lambda (as an experiment) - however I get an error from Pharo about not being able to write to the changes file?
>
> As I am just evaluating some code - I’m not really coding, so don’t need a changes file - is there a command line option to not require it?

That is really strange, it should just work (it does for me using the zero config scripts).

I would try to use absolute (resolved) paths as much as possible.

> Also, am I running pharo the most efficient way - I’m using eval on the command line and referencing a class with a class method - but is this the best way?

Yes, that is ok.

> Thanks,
>
> Tim
>
> "errorMessage": "Command failed: ./pharo Pharo.image eval \"Lambda processJSON: '{\"key3\":\"value3\",\"key2\":\"value2\",\"key1\":\"value1\"}'\"\n'Pharo cannot write to the changes file named /var/task/Pharo.changes.\n\nPlease check that you have write permission for this file.\n\nYou won''t be able to save this image correctly until you fix this.'\n\u001b[31mError: Can't find the requested origin\n\u001b[0mUnixResolver(PlatformResolver)>>cantFindOriginError\n[ self cantFindOriginError ] in UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed: in Block: [ self cantFindOriginError ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:\nUnixResolver>>home\n[ self home / '.config' ] in UnixResolver>>preferences in Block: [ self home / '.config' ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver>>preferences\nUnixResolver(FileSystemResolver)>>resolve:\nSystemResolver(FileSystemResolver)>>unknownOrigin:\nSystemResolver(FileSystemResolver)>>resolve:\nInteractiveResolver>>unknownOrigin:\n[ self unknownOrigin: origin ] in InteractiveResolver>>resolve: in Block: [ self unknownOrigin: origin ]\nIdentityDictionary(Dictionary)>>at:ifAbsent:\nInteractiveResolver>>resolve:\nFileLocator>>resolve\nFileLocator(AbstractFileReference)>>exists\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>shouldCallPreviousPersistence\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:\nGlobalIdentifier>>ensure\nGlobalIdentifier class>>initializeUniqueInstance\nGlobalIdentifier class>>uniqueInstance\nSystemSettingsPersistence class>>resumeSystemSettings\n[ :persistence | persistence resumeSystemSettings ] in PharoCommandLineHandler>>runPreferences in Block: [ :persistence | persistence resumeSystemSettings ...etc...\nBlockClosure>>cull:\nSystemDictionary(Dictionary)>>at:ifPresent:\nSmalltalkImage>>at:ifPresent:\nPharoCommandLineHandler>>runPreferences\nPharoCommandLineHandler>>activate\nPharoCommandLineHandler class(CommandLineHandler class)>>activateWith:\n\u001b[0m",
>   "errorType": "Error",
>   "stackTrace": [
>     "'Pharo cannot write to the changes file named /var/task/Pharo.changes.",
>     "",
>     "Please check that you have write permission for this file.",
>     "",
>     "You won''t be able to save this image correctly until you fix this.'",
>     "\u001b[31mError: Can't find the requested origin",
>     "\u001b[0mUnixResolver(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:",
>     "\u001b[0m",
>     "ChildProcess.exithandler (child_process.js:204:12)",
>     "emitTwo (events.js:106:13)",
>     "ChildProcess.emit (events.js:191:7)",
>     "maybeClose (internal/child_process.js:886:16)",
>     "Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)"
>   ]
> }
>
>


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

Re: Are we able to run pharo images in a read only environment?

Esteban A. Maringolo
In reply to this post by Sven Van Caekenberghe-2
2017-06-27 16:15 GMT-03:00 Sven Van Caekenberghe <[hidden email]>:
>> On 27 Jun 2017, at 21:00, Esteban A. Maringolo <[hidden email]> wrote:

>> It would be good to know how fast does the image boot and start
>> execution in the context of a service billed at the sub second scale.
>
> Sadly I have the impression we lost some speed:

[SNIP]

> But it is really hard to find the cause.
>
> That being said, these lambda servers can only work well if they keep instances alive for longer when there is enough traffic.

AFAIU the purpose of AWS Lambda is to have "fire and forget" kind of
functions, mainly stateless consumers of single purpose functions,
with "infinite" transparent scalability.

Like for processing ads clicks/impressions, receiving data from lots
of mobile/IoT devices, etc.

Regards,

Esteban A. Maringolo

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

Re: Are we able to run pharo images in a read only environment?

Tim Mackinnon
In reply to this post by Sven Van Caekenberghe-2
Hi Sven, I'm curious how you are running your image.


And am running pharo like the GO example by exec'ing via node js.

My aim was to write an Alexa service in pharo vs nodejs like I have been doing.

I was assuming I can call pharo via the eval option and stringify the Jaon Alexa Paramus and return a result via Stdout... well in theory, and the work to make pharo play better in wider ecosystem.

It should work, and it seems you did make it work... but how?

Like you, I am wondering when I run it on an ec2 instance (non lambda), why it takes so long to load? It feels like it can be faster?

Tim

Sent from my iPhone



Sent from my iPhone
On 27 Jun 2017, at 20:21, Sven Van Caekenberghe <[hidden email]> wrote:


On 27 Jun 2017, at 18:05, Tim Mackinnon <[hidden email]> wrote:

Hi - I am trying to run a pharo image in lambda (as an experiment) - however I get an error from Pharo about not being able to write to the changes file?

As I am just evaluating some code - I’m not really coding, so don’t need a changes file - is there a command line option to not require it?

That is really strange, it should just work (it does for me using the zero config scripts).

I would try to use absolute (resolved) paths as much as possible.

Also, am I running pharo the most efficient way - I’m using eval on the command line and referencing a class with a class method - but is this the best way?

Yes, that is ok.

Thanks,

Tim

"errorMessage": "Command failed: ./pharo Pharo.image eval \"Lambda processJSON: '{\"key3\":\"value3\",\"key2\":\"value2\",\"key1\":\"value1\"}'\"\n'Pharo cannot write to the changes file named /var/task/Pharo.changes.\n\nPlease check that you have write permission for this file.\n\nYou won''t be able to save this image correctly until you fix this.'\n\u001b[31mError: Can't find the requested origin\n\u001b[0mUnixResolver(PlatformResolver)>>cantFindOriginError\n[ self cantFindOriginError ] in UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed: in Block: [ self cantFindOriginError ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:\nUnixResolver>>home\n[ self home / '.config' ] in UnixResolver>>preferences in Block: [ self home / '.config' ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver>>preferences\nUnixResolver(FileSystemResolver)>>resolve:\nSystemResolver(FileSystemResolver)>>unknownOrigin:\nSystemResolver(FileSystemResolver)>>resolve:\nInteractiveResolver>>unknownOrigin:\n[ self unknownOrigin: origin ] in InteractiveResolver>>resolve: in Block: [ self unknownOrigin: origin ]\nIdentityDictionary(Dictionary)>>at:ifAbsent:\nInteractiveResolver>>resolve:\nFileLocator>>resolve\nFileLocator(AbstractFileReference)>>exists\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>shouldCallPreviousPersistence\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:\nGlobalIdentifier>>ensure\nGlobalIdentifier class>>initializeUniqueInstance\nGlobalIdentifier class>>uniqueInstance\nSystemSettingsPersistence class>>resumeSystemSettings\n[ :persistence | persistence resumeSystemSettings ] in PharoCommandLineHandler>>runPreferences in Block: [ :persistence | persistence resumeSystemSettings ...etc...\nBlockClosure>>cull:\nSystemDictionary(Dictionary)>>at:ifPresent:\nSmalltalkImage>>at:ifPresent:\nPharoCommandLineHandler>>runPreferences\nPharoCommandLineHandler>>activate\nPharoCommandLineHandler class(CommandLineHandler class)>>activateWith:\n\u001b[0m",
 "errorType": "Error",
 "stackTrace": [
   "'Pharo cannot write to the changes file named /var/task/Pharo.changes.",
   "",
   "Please check that you have write permission for this file.",
   "",
   "You won''t be able to save this image correctly until you fix this.'",
   "\u001b[31mError: Can't find the requested origin",
   "\u001b[0mUnixResolver(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:",
   "\u001b[0m",
   "ChildProcess.exithandler (child_process.js:204:12)",
   "emitTwo (events.js:106:13)",
   "ChildProcess.emit (events.js:191:7)",
   "maybeClose (internal/child_process.js:886:16)",
   "Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)"
 ]
}




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

Re: Are we able to run pharo images in a read only environment?

Tim Mackinnon
FYI: I managed to get it to work - I still get the message about trying to save the changes file and it not being possible - however my error was not specifying —no-default-preferences  and also  around correctly escaping the command line - the “eval” command is a bit tricky as you need to escape any “ characters as they are badly interpreted.

Thus I had to do the following:

const child = exec('./pharo Pharo.image --no-default-preferences eval "Lambda processJSON: \'' + JSON.stringify(event).replace(/"/g,'\\"') + '\'"', (error) => {
   
}

It looks like a simple lambda execution takes about 2700 to 2900ms

Tim

On 28 Jun 2017, at 01:01, Tim Mackinnon <[hidden email]> wrote:

Hi Sven, I'm curious how you are running your image.


And am running pharo like the GO example by exec'ing via node js.

My aim was to write an Alexa service in pharo vs nodejs like I have been doing.

I was assuming I can call pharo via the eval option and stringify the Jaon Alexa Paramus and return a result via Stdout... well in theory, and the work to make pharo play better in wider ecosystem.

It should work, and it seems you did make it work... but how?

Like you, I am wondering when I run it on an ec2 instance (non lambda), why it takes so long to load? It feels like it can be faster?

Tim

Sent from my iPhone



Sent from my iPhone
On 27 Jun 2017, at 20:21, Sven Van Caekenberghe <[hidden email]> wrote:


On 27 Jun 2017, at 18:05, Tim Mackinnon <[hidden email]> wrote:

Hi - I am trying to run a pharo image in lambda (as an experiment) - however I get an error from Pharo about not being able to write to the changes file?

As I am just evaluating some code - I’m not really coding, so don’t need a changes file - is there a command line option to not require it?

That is really strange, it should just work (it does for me using the zero config scripts).

I would try to use absolute (resolved) paths as much as possible.

Also, am I running pharo the most efficient way - I’m using eval on the command line and referencing a class with a class method - but is this the best way?

Yes, that is ok.

Thanks,

Tim

"errorMessage": "Command failed: ./pharo Pharo.image eval \"Lambda processJSON: '{\"key3\":\"value3\",\"key2\":\"value2\",\"key1\":\"value1\"}'\"\n'Pharo cannot write to the changes file named /var/task/Pharo.changes.\n\nPlease check that you have write permission for this file.\n\nYou won''t be able to save this image correctly until you fix this.'\n\u001b[31mError: Can't find the requested origin\n\u001b[0mUnixResolver(PlatformResolver)>>cantFindOriginError\n[ self cantFindOriginError ] in UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed: in Block: [ self cantFindOriginError ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:\nUnixResolver>>home\n[ self home / '.config' ] in UnixResolver>>preferences in Block: [ self home / '.config' ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver>>preferences\nUnixResolver(FileSystemResolver)>>resolve:\nSystemResolver(FileSystemResolver)>>unknownOrigin:\nSystemResolver(FileSystemResolver)>>resolve:\nInteractiveResolver>>unknownOrigin:\n[ self unknownOrigin: origin ] in InteractiveResolver>>resolve: in Block: [ self unknownOrigin: origin ]\nIdentityDictionary(Dictionary)>>at:ifAbsent:\nInteractiveResolver>>resolve:\nFileLocator>>resolve\nFileLocator(AbstractFileReference)>>exists\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>shouldCallPreviousPersistence\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:\nGlobalIdentifier>>ensure\nGlobalIdentifier class>>initializeUniqueInstance\nGlobalIdentifier class>>uniqueInstance\nSystemSettingsPersistence class>>resumeSystemSettings\n[ :persistence | persistence resumeSystemSettings ] in PharoCommandLineHandler>>runPreferences in Block: [ :persistence | persistence resumeSystemSettings ...etc...\nBlockClosure>>cull:\nSystemDictionary(Dictionary)>>at:ifPresent:\nSmalltalkImage>>at:ifPresent:\nPharoCommandLineHandler>>runPreferences\nPharoCommandLineHandler>>activate\nPharoCommandLineHandler class(CommandLineHandler class)>>activateWith:\n\u001b[0m",
 "errorType": "Error",
 "stackTrace": [
   "'Pharo cannot write to the changes file named /var/task/Pharo.changes.",
   "",
   "Please check that you have write permission for this file.",
   "",
   "You won''t be able to save this image correctly until you fix this.'",
   "\u001b[31mError: Can't find the requested origin",
   "\u001b[0mUnixResolver(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:",
   "\u001b[0m",
   "ChildProcess.exithandler (child_process.js:204:12)",
   "emitTwo (events.js:106:13)",
   "ChildProcess.emit (events.js:191:7)",
   "maybeClose (internal/child_process.js:886:16)",
   "Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)"
 ]
}





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

Re: Are we able to run pharo images in a read only environment?

Esteban A. Maringolo
2017-06-28 8:13 GMT-03:00 Tim Mackinnon <[hidden email]>:

> FYI: I managed to get it to work - I still get the message about trying to
> save the changes file and it not being possible - however my error was not
> specifying —no-default-preferences  and also  around correctly escaping the
> command line - the “eval” command is a bit tricky as you need to escape any
> “ characters as they are badly interpreted.
>
> Thus I had to do the following:
>
> const child = exec('./pharo Pharo.image --no-default-preferences eval
> "Lambda processJSON: \'' + JSON.stringify(event).replace(/"/g,'\\"') +
> '\'"', (error) => {
>
> }
>
> It looks like a simple lambda execution takes about 2700 to 2900ms

I guess it is more affordable to pay for 3 secs than for a whole
minute with 95% idle time.
However it seems to be a lot of time for the case of lambda use cases.


Esteban A. Maringolo

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

Re: Are we able to run pharo images in a read only environment?

JeremieRegnault
In reply to this post by Tim Mackinnon
Tim Mackinnon wrote
FYI: I managed to get it to work - I still get the message about trying to save the changes file and it not being possible - however my error was not specifying —no-default-preferences  and also  around correctly escaping the command line - the “eval” command is a bit tricky as you need to escape any “ characters as they are badly interpreted.
The error about saving the changes file comes from the fact that at startup, Pharo tries to open Pharo.changes in read and write mode, which is impossible if you are in a read-only environment. I am working on deploying Pharo in read-only, and it's one of the main problems that shows up during my tests.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Are we able to run pharo images in a read only environment?

Sven Van Caekenberghe-2

> On 28 Jun 2017, at 13:52, JeremieRegnault <[hidden email]> wrote:
>
> Tim Mackinnon wrote
>> FYI: I managed to get it to work - I still get the message about trying to
>> save the changes file and it not being possible - however my error was not
>> specifying —no-default-preferences  and also  around correctly escaping
>> the command line - the “eval” command is a bit tricky as you need to
>> escape any “ characters as they are badly interpreted.
>
> The error about saving the changes file comes from the fact that at startup,
> Pharo tries to open Pharo.changes in read and write mode, which is
> impossible if you are in a read-only environment. I am working on deploying
> Pharo in read-only, and it's one of the main problems that shows up during
> my tests.

Did you see my hack here: https://pharo.fogbugz.com/f/cases/20126/Running-Without-Changes-and-Sources ?

>
> --
> View this message in context: http://forum.world.st/Are-we-able-to-run-pharo-images-in-a-read-only-environment-tp4952705p4952771.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>


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

Re: Are we able to run pharo images in a read only environment?

Tim Mackinnon
Thanks Sven - I was going to search for that as I recall it being talked about. I will give it a go and report back on results with Lambda.

I’m not sure how sensitive it is to image sizes and trying to open that file - so it will be interesting.

Tim

> On 28 Jun 2017, at 13:15, Sven Van Caekenberghe <[hidden email]> wrote:
>
>
>> On 28 Jun 2017, at 13:52, JeremieRegnault <[hidden email]> wrote:
>>
>> Tim Mackinnon wrote
>>> FYI: I managed to get it to work - I still get the message about trying to
>>> save the changes file and it not being possible - however my error was not
>>> specifying —no-default-preferences  and also  around correctly escaping
>>> the command line - the “eval” command is a bit tricky as you need to
>>> escape any “ characters as they are badly interpreted.
>>
>> The error about saving the changes file comes from the fact that at startup,
>> Pharo tries to open Pharo.changes in read and write mode, which is
>> impossible if you are in a read-only environment. I am working on deploying
>> Pharo in read-only, and it's one of the main problems that shows up during
>> my tests.
>
> Did you see my hack here: https://pharo.fogbugz.com/f/cases/20126/Running-Without-Changes-and-Sources ?
>
>>
>> --
>> View this message in context: http://forum.world.st/Are-we-able-to-run-pharo-images-in-a-read-only-environment-tp4952705p4952771.html
>> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>>
>
>


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

Re: Are we able to run pharo images in a read only environment?

Sven Van Caekenberghe-2
In reply to this post by Sven Van Caekenberghe-2

> On 27 Jun 2017, at 21:15, Sven Van Caekenberghe <[hidden email]> wrote:
>
>
>> On 27 Jun 2017, at 21:00, Esteban A. Maringolo <[hidden email]> wrote:
>>
>> Interesting experiment.
>>
>> It would be good to know how fast does the image boot and start
>> execution in the context of a service billed at the sub second scale.
>
> Sadly I have the impression we lost some speed:
>
> ~/pharo64$ ./pharo Pharo.image printVersion
> [version] 6.0 #60499
>
> ~/pharo64$ time ./pharo Pharo.image eval '42 factorial'
> 1405006117752879898543142606244511569936384000000000
>
> real 0m1.276s
> user 0m0.985s
> sys 0m0.171s
>
> while before
>
> ~/pharo/build$ ../bin/pharo Pharo.image printVersion
> [version] 4.0 #40620
>
> $ time ../bin/pharo Pharo.image eval '42 factorial'
> 1405006117752879898543142606244511569936384000000000
>
> real 0m0.526s
> user 0m0.434s
> sys 0m0.045s
>
> But it is really hard to find the cause.

The good news is that the Pharo 7 minimal core is way faster

$ time ./pharo ~/Downloads/Pharo7.0-core-32bit-b649ac6.image eval "42 factorial"
1405006117752879898543142606244511569936384000000000

real 0m0.262s
user 0m0.132s
sys 0m0.062s

Which is good of course !

> That being said, these lambda servers can only work well if they keep instances alive for longer when there is enough traffic.
>
>> Esteban A. Maringolo
>>
>>
>> 2017-06-27 13:05 GMT-03:00 Tim Mackinnon <[hidden email]>:
>>> Hi - I am trying to run a pharo image in lambda (as an experiment) - however
>>> I get an error from Pharo about not being able to write to the changes file?
>>>
>>> As I am just evaluating some code - I’m not really coding, so don’t need a
>>> changes file - is there a command line option to not require it?
>>>
>>> Also, am I running pharo the most efficient way - I’m using eval on the
>>> command line and referencing a class with a class method - but is this the
>>> best way?
>>>
>>> Thanks,
>>>
>>> Tim
>>>
>>> "errorMessage": "Command failed: ./pharo Pharo.image eval \"Lambda
>>> processJSON:
>>> '{\"key3\":\"value3\",\"key2\":\"value2\",\"key1\":\"value1\"}'\"\n'Pharo
>>> cannot write to the changes file named /var/task/Pharo.changes.\n\nPlease
>>> check that you have write permission for this file.\n\nYou won''t be able to
>>> save this image correctly until you fix this.'\n\u001b[31mError: Can't find
>>> the requested
>>> origin\n\u001b[0mUnixResolver(PlatformResolver)>>cantFindOriginError\n[ self
>>> cantFindOriginError ] in
>>> UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed: in Block: [
>>> self cantFindOriginError
>>> ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:\nUnixResolver>>home\n[
>>> self home / '.config' ] in UnixResolver>>preferences in Block: [ self home /
>>> '.config'
>>> ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver>>preferences\nUnixResolver(FileSystemResolver)>>resolve:\nSystemResolver(FileSystemResolver)>>unknownOrigin:\nSystemResolver(FileSystemResolver)>>resolve:\nInteractiveResolver>>unknownOrigin:\n[
>>> self unknownOrigin: origin ] in InteractiveResolver>>resolve: in Block: [
>>> self unknownOrigin: origin
>>> ]\nIdentityDictionary(Dictionary)>>at:ifAbsent:\nInteractiveResolver>>resolve:\nFileLocator>>resolve\nFileLocator(AbstractFileReference)>>exists\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>shouldCallPreviousPersistence\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:\nGlobalIdentifier>>ensure\nGlobalIdentifier
>>> class>>initializeUniqueInstance\nGlobalIdentifier
>>> class>>uniqueInstance\nSystemSettingsPersistence
>>> class>>resumeSystemSettings\n[ :persistence | persistence
>>> resumeSystemSettings ] in PharoCommandLineHandler>>runPreferences in Block:
>>> [ :persistence | persistence resumeSystemSettings
>>> ...etc...\nBlockClosure>>cull:\nSystemDictionary(Dictionary)>>at:ifPresent:\nSmalltalkImage>>at:ifPresent:\nPharoCommandLineHandler>>runPreferences\nPharoCommandLineHandler>>activate\nPharoCommandLineHandler
>>> class(CommandLineHandler class)>>activateWith:\n\u001b[0m",
>>> "errorType": "Error",
>>> "stackTrace": [
>>>   "'Pharo cannot write to the changes file named
>>> /var/task/Pharo.changes.",
>>>   "",
>>>   "Please check that you have write permission for this file.",
>>>   "",
>>>   "You won''t be able to save this image correctly until you fix this.'",
>>>   "\u001b[31mError: Can't find the requested origin",
>>>   "\u001b[0mUnixResolver(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:",
>>>   "\u001b[0m",
>>>   "ChildProcess.exithandler (child_process.js:204:12)",
>>>   "emitTwo (events.js:106:13)",
>>>   "ChildProcess.emit (events.js:191:7)",
>>>   "maybeClose (internal/child_process.js:886:16)",
>>>   "Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)"
>>> ]
>>> }
>>>
>>>
>>
>


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

Re: Are we able to run pharo images in a read only environment?

Tim Mackinnon
In reply to this post by Tim Mackinnon
Wow that's very promising - how do I get that setup? I also believe for lambda I need 64 bit as you have little control of the base image?

I haven't had a chance to try marshalling results back to Alexa yet - but that's my goal.

Tim

Sent from my iPhone

> On 30 Jun 2017, at 15:43, Sven Van Caekenberghe <[hidden email]> wrote:
>
>
>> On 27 Jun 2017, at 21:15, Sven Van Caekenberghe <[hidden email]> wrote:
>>
>>
>>> On 27 Jun 2017, at 21:00, Esteban A. Maringolo <[hidden email]> wrote:
>>>
>>> Interesting experiment.
>>>
>>> It would be good to know how fast does the image boot and start
>>> execution in the context of a service billed at the sub second scale.
>>
>> Sadly I have the impression we lost some speed:
>>
>> ~/pharo64$ ./pharo Pharo.image printVersion
>> [version] 6.0 #60499
>>
>> ~/pharo64$ time ./pharo Pharo.image eval '42 factorial'
>> 1405006117752879898543142606244511569936384000000000
>>
>> real    0m1.276s
>> user    0m0.985s
>> sys    0m0.171s
>>
>> while before
>>
>> ~/pharo/build$ ../bin/pharo Pharo.image printVersion
>> [version] 4.0 #40620
>>
>> $ time ../bin/pharo Pharo.image eval '42 factorial'
>> 1405006117752879898543142606244511569936384000000000
>>
>> real    0m0.526s
>> user    0m0.434s
>> sys    0m0.045s
>>
>> But it is really hard to find the cause.
>
> The good news is that the Pharo 7 minimal core is way faster
>
> $ time ./pharo ~/Downloads/Pharo7.0-core-32bit-b649ac6.image eval "42 factorial"
> 1405006117752879898543142606244511569936384000000000
>
> real    0m0.262s
> user    0m0.132s
> sys    0m0.062s
>
> Which is good of course !
>
>> That being said, these lambda servers can only work well if they keep instances alive for longer when there is enough traffic.
>>
>>> Esteban A. Maringolo
>>>
>>>
>>> 2017-06-27 13:05 GMT-03:00 Tim Mackinnon <[hidden email]>:
>>>> Hi - I am trying to run a pharo image in lambda (as an experiment) - however
>>>> I get an error from Pharo about not being able to write to the changes file?
>>>>
>>>> As I am just evaluating some code - I’m not really coding, so don’t need a
>>>> changes file - is there a command line option to not require it?
>>>>
>>>> Also, am I running pharo the most efficient way - I’m using eval on the
>>>> command line and referencing a class with a class method - but is this the
>>>> best way?
>>>>
>>>> Thanks,
>>>>
>>>> Tim
>>>>
>>>> "errorMessage": "Command failed: ./pharo Pharo.image eval \"Lambda
>>>> processJSON:
>>>> '{\"key3\":\"value3\",\"key2\":\"value2\",\"key1\":\"value1\"}'\"\n'Pharo
>>>> cannot write to the changes file named /var/task/Pharo.changes.\n\nPlease
>>>> check that you have write permission for this file.\n\nYou won''t be able to
>>>> save this image correctly until you fix this.'\n\u001b[31mError: Can't find
>>>> the requested
>>>> origin\n\u001b[0mUnixResolver(PlatformResolver)>>cantFindOriginError\n[ self
>>>> cantFindOriginError ] in
>>>> UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed: in Block: [
>>>> self cantFindOriginError
>>>> ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:\nUnixResolver>>home\n[
>>>> self home / '.config' ] in UnixResolver>>preferences in Block: [ self home /
>>>> '.config'
>>>> ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver>>preferences\nUnixResolver(FileSystemResolver)>>resolve:\nSystemResolver(FileSystemResolver)>>unknownOrigin:\nSystemResolver(FileSystemResolver)>>resolve:\nInteractiveResolver>>unknownOrigin:\n[
>>>> self unknownOrigin: origin ] in InteractiveResolver>>resolve: in Block: [
>>>> self unknownOrigin: origin
>>>> ]\nIdentityDictionary(Dictionary)>>at:ifAbsent:\nInteractiveResolver>>resolve:\nFileLocator>>resolve\nFileLocator(AbstractFileReference)>>exists\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>shouldCallPreviousPersistence\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:\nGlobalIdentifier>>ensure\nGlobalIdentifier
>>>> class>>initializeUniqueInstance\nGlobalIdentifier
>>>> class>>uniqueInstance\nSystemSettingsPersistence
>>>> class>>resumeSystemSettings\n[ :persistence | persistence
>>>> resumeSystemSettings ] in PharoCommandLineHandler>>runPreferences in Block:
>>>> [ :persistence | persistence resumeSystemSettings
>>>> ...etc...\nBlockClosure>>cull:\nSystemDictionary(Dictionary)>>at:ifPresent:\nSmalltalkImage>>at:ifPresent:\nPharoCommandLineHandler>>runPreferences\nPharoCommandLineHandler>>activate\nPharoCommandLineHandler
>>>> class(CommandLineHandler class)>>activateWith:\n\u001b[0m",
>>>> "errorType": "Error",
>>>> "stackTrace": [
>>>>  "'Pharo cannot write to the changes file named
>>>> /var/task/Pharo.changes.",
>>>>  "",
>>>>  "Please check that you have write permission for this file.",
>>>>  "",
>>>>  "You won''t be able to save this image correctly until you fix this.'",
>>>>  "\u001b[31mError: Can't find the requested origin",
>>>>  "\u001b[0mUnixResolver(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:",
>>>>  "\u001b[0m",
>>>>  "ChildProcess.exithandler (child_process.js:204:12)",
>>>>  "emitTwo (events.js:106:13)",
>>>>  "ChildProcess.emit (events.js:191:7)",
>>>>  "maybeClose (internal/child_process.js:886:16)",
>>>>  "Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)"
>>>> ]
>>>> }
>>>>
>>>>
>>>
>>
>
>

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

Re: Are we able to run pharo images in a read only environment?

Tim Mackinnon
In reply to this post by Sven Van Caekenberghe-2
I went to try this to see how it might perform on AWS Lambda but I’m guessing there isn’t a minimal 64 bit image right? 

Sven - was this a 32bit image from get.pharo.org/70-minimal?

Tim

On 30 Jun 2017, at 14:43, Sven Van Caekenberghe <[hidden email]> wrote:


On 27 Jun 2017, at 21:15, Sven Van Caekenberghe <[hidden email]> wrote:


On 27 Jun 2017, at 21:00, Esteban A. Maringolo <[hidden email]> wrote:

Interesting experiment.

It would be good to know how fast does the image boot and start
execution in the context of a service billed at the sub second scale.

Sadly I have the impression we lost some speed:

~/pharo64$ ./pharo Pharo.image printVersion
[version] 6.0 #60499

~/pharo64$ time ./pharo Pharo.image eval '42 factorial'
1405006117752879898543142606244511569936384000000000

real 0m1.276s
user 0m0.985s
sys 0m0.171s

while before

~/pharo/build$ ../bin/pharo Pharo.image printVersion
[version] 4.0 #40620

$ time ../bin/pharo Pharo.image eval '42 factorial'
1405006117752879898543142606244511569936384000000000

real 0m0.526s
user 0m0.434s
sys 0m0.045s

But it is really hard to find the cause.

The good news is that the Pharo 7 minimal core is way faster

$ time ./pharo ~/Downloads/Pharo7.0-core-32bit-b649ac6.image eval "42 factorial"
1405006117752879898543142606244511569936384000000000

real 0m0.262s
user 0m0.132s
sys 0m0.062s

Which is good of course ! 

That being said, these lambda servers can only work well if they keep instances alive for longer when there is enough traffic.

Esteban A. Maringolo


2017-06-27 13:05 GMT-03:00 Tim Mackinnon <[hidden email]>:
Hi - I am trying to run a pharo image in lambda (as an experiment) - however
I get an error from Pharo about not being able to write to the changes file?

As I am just evaluating some code - I’m not really coding, so don’t need a
changes file - is there a command line option to not require it?

Also, am I running pharo the most efficient way - I’m using eval on the
command line and referencing a class with a class method - but is this the
best way?

Thanks,

Tim

"errorMessage": "Command failed: ./pharo Pharo.image eval \"Lambda
processJSON:
'{\"key3\":\"value3\",\"key2\":\"value2\",\"key1\":\"value1\"}'\"\n'Pharo
cannot write to the changes file named /var/task/Pharo.changes.\n\nPlease
check that you have write permission for this file.\n\nYou won''t be able to
save this image correctly until you fix this.'\n\u001b[31mError: Can't find
the requested
origin\n\u001b[0mUnixResolver(PlatformResolver)>>cantFindOriginError\n[ self
cantFindOriginError ] in
UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed: in Block: [
self cantFindOriginError
]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:\nUnixResolver>>home\n[
self home / '.config' ] in UnixResolver>>preferences in Block: [ self home /
'.config'
]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver>>preferences\nUnixResolver(FileSystemResolver)>>resolve:\nSystemResolver(FileSystemResolver)>>unknownOrigin:\nSystemResolver(FileSystemResolver)>>resolve:\nInteractiveResolver>>unknownOrigin:\n[
self unknownOrigin: origin ] in InteractiveResolver>>resolve: in Block: [
self unknownOrigin: origin
]\nIdentityDictionary(Dictionary)>>at:ifAbsent:\nInteractiveResolver>>resolve:\nFileLocator>>resolve\nFileLocator(AbstractFileReference)>>exists\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>shouldCallPreviousPersistence\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:\nGlobalIdentifier>>ensure\nGlobalIdentifier
class>>initializeUniqueInstance\nGlobalIdentifier
class>>uniqueInstance\nSystemSettingsPersistence
class>>resumeSystemSettings\n[ :persistence | persistence
resumeSystemSettings ] in PharoCommandLineHandler>>runPreferences in Block:
[ :persistence | persistence resumeSystemSettings
...etc...\nBlockClosure>>cull:\nSystemDictionary(Dictionary)>>at:ifPresent:\nSmalltalkImage>>at:ifPresent:\nPharoCommandLineHandler>>runPreferences\nPharoCommandLineHandler>>activate\nPharoCommandLineHandler
class(CommandLineHandler class)>>activateWith:\n\u001b[0m",
"errorType": "Error",
"stackTrace": [
 "'Pharo cannot write to the changes file named
/var/task/Pharo.changes.",
 "",
 "Please check that you have write permission for this file.",
 "",
 "You won''t be able to save this image correctly until you fix this.'",
 "\u001b[31mError: Can't find the requested origin",
 "\u001b[0mUnixResolver(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:",
 "\u001b[0m",
 "ChildProcess.exithandler (child_process.js:204:12)",
 "emitTwo (events.js:106:13)",
 "ChildProcess.emit (events.js:191:7)",
 "maybeClose (internal/child_process.js:886:16)",
 "Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)"
]
}

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

Re: Are we able to run pharo images in a read only environment?

Sven Van Caekenberghe-2

> On 5 Jul 2017, at 16:05, Tim Mackinnon <[hidden email]> wrote:
>
> I went to try this to see how it might perform on AWS Lambda but I’m guessing there isn’t a minimal 64 bit image right?
>
> Sven - was this a 32bit image from get.pharo.org/70-minimal?

It came from a link Pavel sent me for debugging purposes, he is the expert, I don't know if there are both 32 and 64 bit versions (or even if there is much difference, if any).

> Tim
>
>> On 30 Jun 2017, at 14:43, Sven Van Caekenberghe <[hidden email]> wrote:
>>
>>>
>>> On 27 Jun 2017, at 21:15, Sven Van Caekenberghe <[hidden email]> wrote:
>>>
>>>
>>>> On 27 Jun 2017, at 21:00, Esteban A. Maringolo <[hidden email]> wrote:
>>>>
>>>> Interesting experiment.
>>>>
>>>> It would be good to know how fast does the image boot and start
>>>> execution in the context of a service billed at the sub second scale.
>>>
>>> Sadly I have the impression we lost some speed:
>>>
>>> ~/pharo64$ ./pharo Pharo.image printVersion
>>> [version] 6.0 #60499
>>>
>>> ~/pharo64$ time ./pharo Pharo.image eval '42 factorial'
>>> 1405006117752879898543142606244511569936384000000000
>>>
>>> real 0m1.276s
>>> user 0m0.985s
>>> sys 0m0.171s
>>>
>>> while before
>>>
>>> ~/pharo/build$ ../bin/pharo Pharo.image printVersion
>>> [version] 4.0 #40620
>>>
>>> $ time ../bin/pharo Pharo.image eval '42 factorial'
>>> 1405006117752879898543142606244511569936384000000000
>>>
>>> real 0m0.526s
>>> user 0m0.434s
>>> sys 0m0.045s
>>>
>>> But it is really hard to find the cause.
>>
>> The good news is that the Pharo 7 minimal core is way faster
>>
>> $ time ./pharo ~/Downloads/Pharo7.0-core-32bit-b649ac6.image eval "42 factorial"
>> 1405006117752879898543142606244511569936384000000000
>>
>> real 0m0.262s
>> user 0m0.132s
>> sys 0m0.062s
>>
>> Which is good of course !
>>
>>> That being said, these lambda servers can only work well if they keep instances alive for longer when there is enough traffic.
>>>
>>>> Esteban A. Maringolo
>>>>
>>>>
>>>> 2017-06-27 13:05 GMT-03:00 Tim Mackinnon <[hidden email]>:
>>>>> Hi - I am trying to run a pharo image in lambda (as an experiment) - however
>>>>> I get an error from Pharo about not being able to write to the changes file?
>>>>>
>>>>> As I am just evaluating some code - I’m not really coding, so don’t need a
>>>>> changes file - is there a command line option to not require it?
>>>>>
>>>>> Also, am I running pharo the most efficient way - I’m using eval on the
>>>>> command line and referencing a class with a class method - but is this the
>>>>> best way?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Tim
>>>>>
>>>>> "errorMessage": "Command failed: ./pharo Pharo.image eval \"Lambda
>>>>> processJSON:
>>>>> '{\"key3\":\"value3\",\"key2\":\"value2\",\"key1\":\"value1\"}'\"\n'Pharo
>>>>> cannot write to the changes file named /var/task/Pharo.changes.\n\nPlease
>>>>> check that you have write permission for this file.\n\nYou won''t be able to
>>>>> save this image correctly until you fix this.'\n\u001b[31mError: Can't find
>>>>> the requested
>>>>> origin\n\u001b[0mUnixResolver(PlatformResolver)>>cantFindOriginError\n[ self
>>>>> cantFindOriginError ] in
>>>>> UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed: in Block: [
>>>>> self cantFindOriginError
>>>>> ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:\nUnixResolver>>home\n[
>>>>> self home / '.config' ] in UnixResolver>>preferences in Block: [ self home /
>>>>> '.config'
>>>>> ]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver>>preferences\nUnixResolver(FileSystemResolver)>>resolve:\nSystemResolver(FileSystemResolver)>>unknownOrigin:\nSystemResolver(FileSystemResolver)>>resolve:\nInteractiveResolver>>unknownOrigin:\n[
>>>>> self unknownOrigin: origin ] in InteractiveResolver>>resolve: in Block: [
>>>>> self unknownOrigin: origin
>>>>> ]\nIdentityDictionary(Dictionary)>>at:ifAbsent:\nInteractiveResolver>>resolve:\nFileLocator>>resolve\nFileLocator(AbstractFileReference)>>exists\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>shouldCallPreviousPersistence\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:\nGlobalIdentifier>>ensure\nGlobalIdentifier
>>>>> class>>initializeUniqueInstance\nGlobalIdentifier
>>>>> class>>uniqueInstance\nSystemSettingsPersistence
>>>>> class>>resumeSystemSettings\n[ :persistence | persistence
>>>>> resumeSystemSettings ] in PharoCommandLineHandler>>runPreferences in Block:
>>>>> [ :persistence | persistence resumeSystemSettings
>>>>> ...etc...\nBlockClosure>>cull:\nSystemDictionary(Dictionary)>>at:ifPresent:\nSmalltalkImage>>at:ifPresent:\nPharoCommandLineHandler>>runPreferences\nPharoCommandLineHandler>>activate\nPharoCommandLineHandler
>>>>> class(CommandLineHandler class)>>activateWith:\n\u001b[0m",
>>>>> "errorType": "Error",
>>>>> "stackTrace": [
>>>>>  "'Pharo cannot write to the changes file named
>>>>> /var/task/Pharo.changes.",
>>>>>  "",
>>>>>  "Please check that you have write permission for this file.",
>>>>>  "",
>>>>>  "You won''t be able to save this image correctly until you fix this.'",
>>>>>  "\u001b[31mError: Can't find the requested origin",
>>>>>  "\u001b[0mUnixResolver(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:",
>>>>>  "\u001b[0m",
>>>>>  "ChildProcess.exithandler (child_process.js:204:12)",
>>>>>  "emitTwo (events.js:106:13)",
>>>>>  "ChildProcess.emit (events.js:191:7)",
>>>>>  "maybeClose (internal/child_process.js:886:16)",
>>>>>  "Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)"
>>>>> ]
>>>>> }
>


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

Re: Are we able to run pharo images in a read only environment?

Henrik Sperre Johansen
In reply to this post by Sven Van Caekenberghe-2
Sven Van Caekenberghe-2 wrote
> On 27 Jun 2017, at 21:15, Sven Van Caekenberghe <[hidden email]> wrote:
>
>
>> On 27 Jun 2017, at 21:00, Esteban A. Maringolo <[hidden email]> wrote:
>>
>> Interesting experiment.
>>
>> It would be good to know how fast does the image boot and start
>> execution in the context of a service billed at the sub second scale.
>
> Sadly I have the impression we lost some speed:
>
> ~/pharo64$ ./pharo Pharo.image printVersion
> [version] 6.0 #60499
>
> ~/pharo64$ time ./pharo Pharo.image eval '42 factorial'
> 1405006117752879898543142606244511569936384000000000
>
> real 0m1.276s
> user 0m0.985s
> sys 0m0.171s
>
> while before
>
> ~/pharo/build$ ../bin/pharo Pharo.image printVersion
> [version] 4.0 #40620
>
> $ time ../bin/pharo Pharo.image eval '42 factorial'
> 1405006117752879898543142606244511569936384000000000
>
> real 0m0.526s
> user 0m0.434s
> sys 0m0.045s
>
> But it is really hard to find the cause.

The good news is that the Pharo 7 minimal core is way faster

$ time ./pharo ~/Downloads/Pharo7.0-core-32bit-b649ac6.image eval "42 factorial"
1405006117752879898543142606244511569936384000000000

real 0m0.262s
user 0m0.132s
sys 0m0.062s

Which is good of course !
So I guess, most of the additional time is either spent in #startUp methods not present in the minimal image (), or in vm reading the larger sized image?
While doing the same in Pharo4 would probably be a pain, it could be interesting to hack ClassSessionHandler in Pharo7 to log time spent in each, and compare the output difference between minimal/full image...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Are we able to run pharo images in a read only environment?

Sven Van Caekenberghe-2

> On 5 Jul 2017, at 19:03, Henrik Sperre Johansen <[hidden email]> wrote:
>
> Sven Van Caekenberghe-2 wrote
>>> On 27 Jun 2017, at 21:15, Sven Van Caekenberghe &lt;
>
>> sven@
>
>> &gt; wrote:
>>>
>>>
>>>> On 27 Jun 2017, at 21:00, Esteban A. Maringolo &lt;
>
>> emaringolo@
>
>> &gt; wrote:
>>>>
>>>> Interesting experiment.
>>>>
>>>> It would be good to know how fast does the image boot and start
>>>> execution in the context of a service billed at the sub second scale.
>>>
>>> Sadly I have the impression we lost some speed:
>>>
>>> ~/pharo64$ ./pharo Pharo.image printVersion
>>> [version] 6.0 #60499
>>>
>>> ~/pharo64$ time ./pharo Pharo.image eval '42 factorial'
>>> 1405006117752879898543142606244511569936384000000000
>>>
>>> real 0m1.276s
>>> user 0m0.985s
>>> sys 0m0.171s
>>>
>>> while before
>>>
>>> ~/pharo/build$ ../bin/pharo Pharo.image printVersion
>>> [version] 4.0 #40620
>>>
>>> $ time ../bin/pharo Pharo.image eval '42 factorial'
>>> 1405006117752879898543142606244511569936384000000000
>>>
>>> real 0m0.526s
>>> user 0m0.434s
>>> sys 0m0.045s
>>>
>>> But it is really hard to find the cause.
>>
>> The good news is that the Pharo 7 minimal core is way faster
>>
>> $ time ./pharo ~/Downloads/Pharo7.0-core-32bit-b649ac6.image eval "42
>> factorial"
>> 1405006117752879898543142606244511569936384000000000
>>
>> real 0m0.262s
>> user 0m0.132s
>> sys 0m0.062s
>>
>> Which is good of course !
>
> So I guess, most of the additional time is either spent in #startUp methods
> not present in the minimal image (), or in vm reading the larger sized
> image?
> While doing the same in Pharo4 would probably be a pain, it could be
> interesting to hack ClassSessionHandler in Pharo7 to log time spent in each,
> and compare the output difference between minimal/full image...

Yes, there should (optionally) be some log with timing info explaining which startup actions are executed and how long each takes. Maybe the log could just be kept in memory in the image.

> --
> View this message in context: http://forum.world.st/Are-we-able-to-run-pharo-images-in-a-read-only-environment-tp4952705p4953537.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>


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

Re: Are we able to run pharo images in a read only environment?

Pavel Krivanek-3
In reply to this post by Tim Mackinnon
Currently we do not publish 64-bit versions of minimal images however it is easy to convert it:

You need a VMMaker image: 
...and then do:
pharo generator.image eval "Spur32to64BitBootstrap new bootstrapImage: 'Pharo-minimal-60506.image'"

-- Pavel

2017-07-05 16:05 GMT+02:00 Tim Mackinnon <[hidden email]>:
I went to try this to see how it might perform on AWS Lambda but I’m guessing there isn’t a minimal 64 bit image right? 

Sven - was this a 32bit image from get.pharo.org/70-minimal?

Tim

On 30 Jun 2017, at 14:43, Sven Van Caekenberghe <[hidden email]> wrote:


On 27 Jun 2017, at 21:15, Sven Van Caekenberghe <[hidden email]> wrote:


On 27 Jun 2017, at 21:00, Esteban A. Maringolo <[hidden email]> wrote:

Interesting experiment.

It would be good to know how fast does the image boot and start
execution in the context of a service billed at the sub second scale.

Sadly I have the impression we lost some speed:

~/pharo64$ ./pharo Pharo.image printVersion
[version] 6.0 #60499

~/pharo64$ time ./pharo Pharo.image eval '42 factorial'
1405006117752879898543142606244511569936384000000000

real 0m1.276s
user 0m0.985s
sys 0m0.171s

while before

~/pharo/build$ ../bin/pharo Pharo.image printVersion
[version] 4.0 #40620

$ time ../bin/pharo Pharo.image eval '42 factorial'
1405006117752879898543142606244511569936384000000000

real 0m0.526s
user 0m0.434s
sys 0m0.045s

But it is really hard to find the cause.

The good news is that the Pharo 7 minimal core is way faster

$ time ./pharo ~/Downloads/Pharo7.0-core-32bit-b649ac6.image eval "42 factorial"
1405006117752879898543142606244511569936384000000000

real 0m0.262s
user 0m0.132s
sys 0m0.062s

Which is good of course ! 

That being said, these lambda servers can only work well if they keep instances alive for longer when there is enough traffic.

Esteban A. Maringolo


2017-06-27 13:05 GMT-03:00 Tim Mackinnon <[hidden email]>:
Hi - I am trying to run a pharo image in lambda (as an experiment) - however
I get an error from Pharo about not being able to write to the changes file?

As I am just evaluating some code - I’m not really coding, so don’t need a
changes file - is there a command line option to not require it?

Also, am I running pharo the most efficient way - I’m using eval on the
command line and referencing a class with a class method - but is this the
best way?

Thanks,

Tim

"errorMessage": "Command failed: ./pharo Pharo.image eval \"Lambda
processJSON:
'{\"key3\":\"value3\",\"key2\":\"value2\",\"key1\":\"value1\"}'\"\n'Pharo
cannot write to the changes file named /var/task/Pharo.changes.\n\nPlease
check that you have write permission for this file.\n\nYou won''t be able to
save this image correctly until you fix this.'\n\u001b[31mError: Can't find
the requested
origin\n\u001b[0mUnixResolver(PlatformResolver)>>cantFindOriginError\n[ self
cantFindOriginError ] in
UnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed: in Block: [
self cantFindOriginError
]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:\nUnixResolver>>home\n[
self home / '.config' ] in UnixResolver>>preferences in Block: [ self home /
'.config'
]\nUnixResolver(PlatformResolver)>>directoryFromEnvVariableNamed:or:\nUnixResolver>>preferences\nUnixResolver(FileSystemResolver)>>resolve:\nSystemResolver(FileSystemResolver)>>unknownOrigin:\nSystemResolver(FileSystemResolver)>>resolve:\nInteractiveResolver>>unknownOrigin:\n[
self unknownOrigin: origin ] in InteractiveResolver>>resolve: in Block: [
self unknownOrigin: origin
]\nIdentityDictionary(Dictionary)>>at:ifAbsent:\nInteractiveResolver>>resolve:\nFileLocator>>resolve\nFileLocator(AbstractFileReference)>>exists\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>shouldCallPreviousPersistence\nGlobalIdentifierStonPersistence(GlobalIdentifierPersistence)>>ensure:\nGlobalIdentifier>>ensure\nGlobalIdentifier
class>>initializeUniqueInstance\nGlobalIdentifier
class>>uniqueInstance\nSystemSettingsPersistence
class>>resumeSystemSettings\n[ :persistence | persistence
resumeSystemSettings ] in PharoCommandLineHandler>>runPreferences in Block:
[ :persistence | persistence resumeSystemSettings
...etc...\nBlockClosure>>cull:\nSystemDictionary(Dictionary)>>at:ifPresent:\nSmalltalkImage>>at:ifPresent:\nPharoCommandLineHandler>>runPreferences\nPharoCommandLineHandler>>activate\nPharoCommandLineHandler
class(CommandLineHandler class)>>activateWith:\n\u001b[0m",
"errorType": "Error",
"stackTrace": [
 "'Pharo cannot write to the changes file named
/var/task/Pharo.changes.",
 "",
 "Please check that you have write permission for this file.",
 "",
 "You won''t be able to save this image correctly until you fix this.'",
 "\u001b[31mError: Can't find the requested origin",
 "\u001b[0mUnixResolver(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:",
 "\u001b[0m",
 "ChildProcess.exithandler (child_process.js:204:12)",
 "emitTwo (events.js:106:13)",
 "ChildProcess.emit (events.js:191:7)",
 "maybeClose (internal/child_process.js:886:16)",
 "Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)"
]
}


Loading...