GsDevKit for Docker

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

GsDevKit for Docker

GLASS mailing list
Hi,

I’m working on getting a kit together to easily setup and run GsDevKit stones on Kubernets and have an issue I need some help with.

To start with I’m simply making a docker image with the entire GsDevKit and a seaside stone installed to make sure it’s all working. I’ll create more usable components once I know I can get it installed :)

Starting with creating the docker image, there’s a slightly weird (but I guess not unexpected considering the environment) error calculating the memory sizes:

[Info] Setting up shared memory
  Total memory available is 7972 MB
  Max shared memory segment size is -16 MB
  Max shared memory allowed is -65536 MB
/opt/GsDevKit_home/bin/utils/installOsPrereqs: line 244: [: 18446744073692774399: integer expression expected
/opt/GsDevKit_home/bin/utils/installOsPrereqs: line 248: [: 18446744073692774399: integer expression expected
[Info] No need to increase max shared memory segment size
/opt/GsDevKit_home/bin/utils/installOsPrereqs: line 260: [: 18446744073692774399: integer expression expected
[Info] No need to increase max shared memory allowed

Regardless, since it’s not updating anything, it’s not really an issue - just thought I’d point it out.

I also noticed:

=================
   GsDevKit script: clone_gs_client_dev -o GsDevKit
              path: /opt/GsDevKit_home/bin/private/clone_gs_client_dev
=================
=================
   GsDevKit script: cloneGitHubProject GsDevKit GsDevKit_gs_client_dev dev
              path: /opt/GsDevKit_home/bin/private/cloneGitHubProject
=================
Cloning into 'dev'...
...finished :: cloneGitHubProject GsDevKit GsDevKit_gs_client_dev dev
>>>>>>
basename: missing operand
Try 'basename --help' for more information.
   Checkout 
>>>>>>
fatal: not a git repository: '/.git'

Haven’t looked into this one yet.

The main thing I encountered was while running:

installServerSeaside -c https -z 8383 gsdevkit342 3.4.2

The error appears just before the tODE server install, while starting netldi:

Restarting stone and netldi
=================
   GsDevKit script: startStone -b -N gsdevkit342
              path: /opt/GsDevKit_home/bin/startStone
=================
/opt/GsDevKit_home/server/stones/gsdevkit342/product/bin/waitstone[Info]: GemStone version '3.4.2'
waitstone[Error]: Network service !#dir:/opt/GsDevKit_home/server/stones/gsdevkit342/logs#log:%N%P.log#server!gsdevkit342 was not found.
Network lookup failure; could not find server 'gsdevkit342' on host '5521dafaa573' because file not found: /opt/gemstone/locks/gsdevkit342..LCK;  service gsdevkit342 not found ; NetLDI service 'gs64ldi' not found on node 'localhost6' port 50377 :


Starting stone: gsdevkit342
--- 09/11/2018 07:51:55.246 UTC ---
stopstone[Info]: GemStone version '3.4.2'
stopstone[Info]: Server 'gsdevkit342' is not running.
startstone[Info]: GemStone version '3.4.2'
startstone[Info]: Starting Stone repository monitor gsdevkit342.
startstone[Info]: GEMSTONE is: '/opt/GsDevKit_home/server/stones/gsdevkit342/product'.
startstone[Info]: GEMSTONE_NRS_ALL is: '#dir:$GEMSTONE_LOGDIR#log:%N%P.log'.
startstone[Info]:  Ignoring  GEMSTONE_NRS_ALL for stone
startstone[Info]:
    GEMSTONE_SYS_CONF=/opt/GsDevKit_home/server/stones/gsdevkit342/extents/system.conf
    GEMSTONE_EXE_CONF=/opt/GsDevKit_home/server/stones/gsdevkit342/gsdevkit342.conf
stoned[Info]: Log file is '/opt/GsDevKit_home/server/stones/gsdevkit342/logs/gsdevkit342.log'.
startstone[Info]: GemStone server gsdevkit342 has been started, process 2327

=================
   GsDevKit script: startNetldi gsdevkit342
              path: /opt/GsDevKit_home/bin/startNetldi
=================
starting netldi gsdevkit342 

MessageNotUnderstood: receiver of "," is nil
UndefinedObject(Object)>>doesNotUnderstand: #,
UnixProcess>>processProxy:forkAndExec:arguments:environment:descriptors: in Block: [ :e | e , nullString ]
Array(SequenceableCollection)>>collect:
UnixProcess>>processProxy:forkAndExec:arguments:environment:descriptors:
ExternalUnixOSProcess>>forkChild
ExternalUnixOSProcess class>>forkAndExec:arguments:environment:descriptors:
UnixProcess>>forkAndExec:arguments:environment:descriptors:
UnixProcess>>forkJob:arguments:environment:descriptors:
GsDevKitStartnetldiCommandLineHandler class(GsDevKitAbstractCommandLineHandler class)>>runShellCommand:args:noError:
GsDevKitStartnetldiCommandLineHandler(GsDevKitAbstractCommandLineHandler)>>runShellCommand:args:
GsDevKitStartnetldiCommandLineHandler>>activate
GsDevKitStartnetldiCommandLineHandler class(CommandLineHandler class)>>activateWith:
PharoCommandLineHandler(BasicCommandLineHandler)>>activateSubCommand: in Block: [ aCommandLinehandler activateWith: commandLine ]
BlockClosure>>on:do:
PharoCommandLineHandler(BasicCommandLineHandler)>>activateSubCommand:
PharoCommandLineHandler(BasicCommandLineHandler)>>handleSubcommand
PharoCommandLineHandler(BasicCommandLineHandler)>>handleArgument:
PharoCommandLineHandler(BasicCommandLineHandler)>>activate in Block: [ self handleArgument: (self arguments ifEmpty: [ ...etc...
BlockClosure>>on:do:
PharoCommandLineHandler(BasicCommandLineHandler)>>activate
PharoCommandLineHandler>>activate
PharoCommandLineHandler class(CommandLineHandler class)>>activateWith:
PharoCommandLineHandler class>>activateWith: in Block: [ super activateWith: aCommandLine ]
WorldState>>runStepMethodsIn:
WorldMorph>>runStepMethods
WorldState>>doOneCycleNowFor:
WorldState>>doOneCycleFor:
WorldMorph>>doOneCycle
MorphicUIManager>>spawnNewProcess in Block: [ ...
BlockClosure>>newProcess in Block: [ ...
Error on or near line 99 :: devKitCommandLine startnetldi gsdevkit342 :: devKitCommandLine startnetldi gsdevkit342
Error on or near line 72 :: startNetldi gsdevkit342 :: startNetldi gsdevkit342
Error on or near line 139 :: startStone -b -N gsdevkit342 :: startStone -b -N gsdevkit342
Error on or near line 169 :: newExtent -s /opt/GsDevKit_home/server/stones/gsdevkit342/product/bin/extent0.seaside.dbf gsdevkit342 :: newExtent -s /opt/GsDevKit_home/server/stones/gsdevkit342/product/bin/extent0.seaside.dbf gsdevkit342
Error on or near line 209 :: createStone gsdevkit342 3.4.2 :: createStone gsdevkit342 3.4.2

Not sure about this one. It looks like startNetldi is being called with the right argument (just one string ‘gsdevkit342’) but maybe Pharo didn’t get it from the command line? Not sure how nil got into the arrayOfStrings that ended up at UnixProcess. Since this is all happening during the creation of a docker image, it makes it even harder to debug. Has anyone seen this error before, or know what could cause it?

I remember problems with netldi and hostnames, could that be the case here? Is there some confusion between “host” and “node” names:

Network lookup failure; could not find server 'gsdevkit342' on host '5521dafaa573' because file not found: /opt/gemstone/locks/gsdevkit342..LCK;  service gsdevkit342 not found ; NetLDI service 'gs64ldi' not found on node 'localhost6' port 50377 :

Any advice would be greatly appreciated.

Thanks.

J

PS. I’m running my own fork of GsDevKit, but I made sure it was up to date. Pretty much the only change for now is in installOSPreReqs to include ubuntu 18.04. I’ve checked this whole process with 16.04 and I get the same error so I’m pretty sure it’s not some weird OS related bug… still, ya never know :)


_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: GsDevKit for Docker

GLASS mailing list
Hi again,

Just some thoughts out loud. Anyone with container and kubernets knowledge please chime in :)

I’m looking at what needs to persist in GsDevKit for any particular user, and it comes down to three directories:

$GS_HOME/shared
$GS_HOME/server
$GS_HOME/sys

The “shared” directory doesn’t really need persistence if we assume that when a new version of GS is released, a new image will be created, and the server will replace the old image with the new one.

The same may be said about “sys” however it’s possible, even likely, that new nodes will be added in tODE to support the production system.

“server” obviously contains the stones and translogs so needs to be persistent. 

Ideally, it would be nice if there was a single directory root for data that needed persistence. Having 2 directories mounted (“server” and “sys") may be an issue since there is a link in “sys/stones” pointing to “server/stones”. I’ll have to confirm if that link works once “server” and “sys” are mounted as separate volumes. I have a feeling it won’t.

I forgot to mention, the current state of this work is at:


On the GsDevKit branch.

So the error from the previous email is easily replicated by checking out that branch then running “make build” in the GsDevKit-Starter-3.4.2 directory.

J

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: GsDevKit for Docker

GLASS mailing list

Hello Jupiter,

Just saw you mail message here and will try to find some time tomorrow to answer your questions ... I'm in Europe post-ESUG vacation days and tomorrow is a travel day, so I will likely have some free time on my hands ... I'm not jet-lagged this year, so my brain is actually functioning at the end of the trip.

Dale


On 09/12/2018 01:22 AM, Jupiter Jones via Glass wrote:
Hi again,

Just some thoughts out loud. Anyone with container and kubernets knowledge please chime in :)

I’m looking at what needs to persist in GsDevKit for any particular user, and it comes down to three directories:

$GS_HOME/shared
$GS_HOME/server
$GS_HOME/sys

The “shared” directory doesn’t really need persistence if we assume that when a new version of GS is released, a new image will be created, and the server will replace the old image with the new one.

The same may be said about “sys” however it’s possible, even likely, that new nodes will be added in tODE to support the production system.

“server” obviously contains the stones and translogs so needs to be persistent. 

Ideally, it would be nice if there was a single directory root for data that needed persistence. Having 2 directories mounted (“server” and “sys") may be an issue since there is a link in “sys/stones” pointing to “server/stones”. I’ll have to confirm if that link works once “server” and “sys” are mounted as separate volumes. I have a feeling it won’t.

I forgot to mention, the current state of this work is at:


On the GsDevKit branch.

So the error from the previous email is easily replicated by checking out that branch then running “make build” in the GsDevKit-Starter-3.4.2 directory.

J


_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass


_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: GsDevKit for Docker

GLASS mailing list
In reply to this post by GLASS mailing list



On 09/11/2018 02:51 PM, Jupiter Jones via Glass wrote:
Hi,

I’m working on getting a kit together to easily setup and run GsDevKit stones on Kubernets and have an issue I need some help with.

To start with I’m simply making a docker image with the entire GsDevKit and a seaside stone installed to make sure it’s all working. I’ll create more usable components once I know I can get it installed :)

Starting with creating the docker image, there’s a slightly weird (but I guess not unexpected considering the environment) error calculating the memory sizes:

[Info] Setting up shared memory
  Total memory available is 7972 MB
  Max shared memory segment size is -16 MB
  Max shared memory allowed is -65536 MB
/opt/GsDevKit_home/bin/utils/installOsPrereqs: line 244: [: 18446744073692774399: integer expression expected
/opt/GsDevKit_home/bin/utils/installOsPrereqs: line 248: [: 18446744073692774399: integer expression expected
[Info] No need to increase max shared memory segment size
/opt/GsDevKit_home/bin/utils/installOsPrereqs: line 260: [: 18446744073692774399: integer expression expected
[Info] No need to increase max shared memory allowed
It looks like you are getting negative numbers for the segment size and max shared memory which doesn't seem right ... these numbers are coming out of the /proc files how does docker deal with shared memory and the like ... it is built into the docker image itself or is it getting the values from the underlying os, or ???

Regardless, since it’s not updating anything, it’s not really an issue - just thought I’d point it out.

I also noticed:

=================
   GsDevKit script: clone_gs_client_dev -o GsDevKit
              path: /opt/GsDevKit_home/bin/private/clone_gs_client_dev
=================
=================
   GsDevKit script: cloneGitHubProject GsDevKit GsDevKit_gs_client_dev dev
              path: /opt/GsDevKit_home/bin/private/cloneGitHubProject
=================
Cloning into 'dev'...
...finished :: cloneGitHubProject GsDevKit GsDevKit_gs_client_dev dev
>>>>>>
basename: missing operand
Try 'basename --help' for more information.
   Checkout 
>>>>>>
fatal: not a git repository: '/.git'
are you getting any script line numbers for this error? I try to list the name of the script as it starts andif there are errors provide a stack of the line number where the error occurs for each of the nested scripts ... this additional information (if it is available) would help me understand which `basename` is causing trouble ... but it would seem that this is a bash error or some sort??

Haven’t looked into this one yet.

The main thing I encountered was while running:

installServerSeaside -c https -z 8383 gsdevkit342 3.4.2

The error appears just before the tODE server install, while starting netldi:

Restarting stone and netldi
=================
   GsDevKit script: startStone -b -N gsdevkit342
              path: /opt/GsDevKit_home/bin/startStone
=================
/opt/GsDevKit_home/server/stones/gsdevkit342/product/bin/waitstone[Info]: GemStone version '3.4.2'
waitstone[Error]: Network service !#dir:/opt/GsDevKit_home/server/stones/gsdevkit342/logs#log:%N%P.log#server!gsdevkit342 was not found.
Network lookup failure; could not find server 'gsdevkit342' on host '5521dafaa573' because file not found: /opt/gemstone/locks/gsdevkit342..LCK;  service gsdevkit342 not found ; NetLDI service 'gs64ldi' not found on node 'localhost6' port 50377 :


Starting stone: gsdevkit342
--- 09/11/2018 07:51:55.246 UTC ---
stopstone[Info]: GemStone version '3.4.2'
stopstone[Info]: Server 'gsdevkit342' is not running.
startstone[Info]: GemStone version '3.4.2'
startstone[Info]: Starting Stone repository monitor gsdevkit342.
startstone[Info]: GEMSTONE is: '/opt/GsDevKit_home/server/stones/gsdevkit342/product'.
startstone[Info]: GEMSTONE_NRS_ALL is: '#dir:$GEMSTONE_LOGDIR#log:%N%P.log'.
startstone[Info]:  Ignoring  GEMSTONE_NRS_ALL for stone
startstone[Info]:
    GEMSTONE_SYS_CONF=/opt/GsDevKit_home/server/stones/gsdevkit342/extents/system.conf
    GEMSTONE_EXE_CONF=/opt/GsDevKit_home/server/stones/gsdevkit342/gsdevkit342.conf
stoned[Info]: Log file is '/opt/GsDevKit_home/server/stones/gsdevkit342/logs/gsdevkit342.log'.
startstone[Info]: GemStone server gsdevkit342 has been started, process 2327

=================
   GsDevKit script: startNetldi gsdevkit342
              path: /opt/GsDevKit_home/bin/startNetldi
=================
starting netldi gsdevkit342 

MessageNotUnderstood: receiver of "," is nil
UndefinedObject(Object)>>doesNotUnderstand: #,
UnixProcess>>processProxy:forkAndExec:arguments:environment:descriptors: in Block: [ :e | e , nullString ]
Array(SequenceableCollection)>>collect:
UnixProcess>>processProxy:forkAndExec:arguments:environment:descriptors:
ExternalUnixOSProcess>>forkChild
ExternalUnixOSProcess class>>forkAndExec:arguments:environment:descriptors:
UnixProcess>>forkAndExec:arguments:environment:descriptors:
UnixProcess>>forkJob:arguments:environment:descriptors:
GsDevKitStartnetldiCommandLineHandler class(GsDevKitAbstractCommandLineHandler class)>>runShellCommand:args:noError:
GsDevKitStartnetldiCommandLineHandler(GsDevKitAbstractCommandLineHandler)>>runShellCommand:args:
GsDevKitStartnetldiCommandLineHandler>>activate
GsDevKitStartnetldiCommandLineHandler class(CommandLineHandler class)>>activateWith:
PharoCommandLineHandler(BasicCommandLineHandler)>>activateSubCommand: in Block: [ aCommandLinehandler activateWith: commandLine ]
BlockClosure>>on:do:
PharoCommandLineHandler(BasicCommandLineHandler)>>activateSubCommand:
PharoCommandLineHandler(BasicCommandLineHandler)>>handleSubcommand
PharoCommandLineHandler(BasicCommandLineHandler)>>handleArgument:
PharoCommandLineHandler(BasicCommandLineHandler)>>activate in Block: [ self handleArgument: (self arguments ifEmpty: [ ...etc...
BlockClosure>>on:do:
PharoCommandLineHandler(BasicCommandLineHandler)>>activate
PharoCommandLineHandler>>activate
PharoCommandLineHandler class(CommandLineHandler class)>>activateWith:
PharoCommandLineHandler class>>activateWith: in Block: [ super activateWith: aCommandLine ]
WorldState>>runStepMethodsIn:
WorldMorph>>runStepMethods
WorldState>>doOneCycleNowFor:
WorldState>>doOneCycleFor:
WorldMorph>>doOneCycle
MorphicUIManager>>spawnNewProcess in Block: [ ...
BlockClosure>>newProcess in Block: [ ...
Error on or near line 99 :: devKitCommandLine startnetldi gsdevkit342 :: devKitCommandLine startnetldi gsdevkit342
Error on or near line 72 :: startNetldi gsdevkit342 :: startNetldi gsdevkit342
Error on or near line 139 :: startStone -b -N gsdevkit342 :: startStone -b -N gsdevkit342
Error on or near line 169 :: newExtent -s /opt/GsDevKit_home/server/stones/gsdevkit342/product/bin/extent0.seaside.dbf gsdevkit342 :: newExtent -s /opt/GsDevKit_home/server/stones/gsdevkit342/product/bin/extent0.seaside.dbf gsdevkit342
Error on or near line 209 :: createStone gsdevkit342 3.4.2 :: createStone gsdevkit342 3.4.2

Not sure about this one. It looks like startNetldi is being called with the right argument (just one string ‘gsdevkit342’) but maybe Pharo didn’t get it from the command line? Not sure how nil got into the arrayOfStrings that ended up at UnixProcess. Since this is all happening during the creation of a docker image, it makes it even harder to debug. Has anyone seen this error before, or know what could cause it?
This looks like an environment variable or two is not set correctly ... the error rings a bell but I'm drawing a blank as to what was causing the problem ... If you go into the startNetldi script (line 72) and add a -D option to the defKitCommandLine call, Pharo will start with the GUI (instead of headless) and if you hit an error you will get a debugger, so you can get more details about about the smalltalk code that is executing ... could it be that the PWD env var is messed up?

Are you running the docker instance inside a MAC ... I know that Macs can get the PWD env var messed up depending upon how you start the processes ...

Dale

I remember problems with netldi and hostnames, could that be the case here? Is there some confusion between “host” and “node” names:

Network lookup failure; could not find server 'gsdevkit342' on host '5521dafaa573' because file not found: /opt/gemstone/locks/gsdevkit342..LCK;  service gsdevkit342 not found ; NetLDI service 'gs64ldi' not found on node 'localhost6' port 50377 :
Are the expected processes (stoned and netldi) running ... you can use topaz to login linked (-l) to see if the stone is healthy , then try without the -l (can uncomment the netldi mumbo jumbo in the .topazini file so you can use topaz as an RPC client ...

Dale

Any advice would be greatly appreciated.

Thanks.

J

PS. I’m running my own fork of GsDevKit, but I made sure it was up to date. Pretty much the only change for now is in installOSPreReqs to include ubuntu 18.04. I’ve checked this whole process with 16.04 and I get the same error so I’m pretty sure it’s not some weird OS related bug… still, ya never know :)



_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass


_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: GsDevKit for Docker

GLASS mailing list
In reply to this post by GLASS mailing list



On 09/11/2018 04:22 PM, Jupiter Jones via Glass wrote:
Hi again,

Just some thoughts out loud. Anyone with container and kubernets knowledge please chime in :)

I’m looking at what needs to persist in GsDevKit for any particular user, and it comes down to three directories:

$GS_HOME/shared
$GS_HOME/server
$GS_HOME/sys

The “shared” directory doesn’t really need persistence if we assume that when a new version of GS is released, a new image will be created, and the server will replace the old image with the new one.

The same may be said about “sys” however it’s possible, even likely, that new nodes will be added in tODE to support the production system.

“server” obviously contains the stones and translogs so needs to be persistent.

Ideally, it would be nice if there was a single directory root for data that needed persistence. Having 2 directories mounted (“server” and “sys") may be an issue since there is a link in “sys/stones” pointing to “server/stones”. I’ll have to confirm if that link works once “server” and “sys” are mounted as separate volumes. I have a feeling it won’t.
I think that only the server dir needs to have persistent (the tranlogs and extents) ...the sys/default and sys/local are both managed by git, so you can use git to save any scripts that need to be saved ...

I forgot to mention, the current state of this work is at:


On the GsDevKit branch.

So the error from the previous email is easily replicated by checking out that branch then running “make build” in the GsDevKit-Starter-3.4.2 directory.
I've about used up my budget for doing experiments today and tomorrow I have some high priority items that need to be addressed ... I'll poke around with docker when I next get a chance ...

Dale

J


_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass


_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: GsDevKit for Docker

GLASS mailing list
In reply to this post by GLASS mailing list
Hi Jupiter,

On Thu, Sep 20, 2018 at 4:22 PM, Dale Henrichs via Glass <[hidden email]> wrote:
This looks like an environment variable or two is not set correctly ... 

After playing with this a bit, it looks like the issue is that the 'USER' environment variable isn't set.  I was able to get passed the pharo error by updating the Dockerfile to include 'ENV USER=$GS_USER' during the 'installServerSeaside' RUN section.

Thanks,
Aaron

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass