Skip to content

Commit

Permalink
Issue #4: this takes things about as far as they can go ...
Browse files Browse the repository at this point in the history
tODE comes up and can be used to work with code (haven't done this extensively),
however the project entry and object/filesystem access code is not functional ...
namely $GS_HOME/sys/default/client/tode-scripts/setUpSys does not run correctly ...

I suspect that there is code on the client that is executed during login
that properly initializes the server ... we've got a properly setup
TDSessionDescription, so we've got all the pieces ... just need to glue
them together properly.
  • Loading branch information
dalehenrich committed Jun 5, 2023
1 parent bbc55e5 commit d5a4df9
Show file tree
Hide file tree
Showing 18 changed files with 97 additions and 73 deletions.
16 changes: 15 additions & 1 deletion bin/createStone.solo
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ RwLoadSpecificationV2 {
]
%
method
restart
"startnetldi support"
"start netldi or if already running, restart the netldi"

^ true
%
method
debugLogging
"startnetldi support"
"no debug logging"

^ false
%
method
loadTode: stoneSpec
"not currently functioning GsHostProcess issue? ... ERROR message: /usr/bin/env: ‘bash’: No such file or directory"
| commandLine |
Expand Down Expand Up @@ -153,7 +167,7 @@ doit
(self start or: [ stoneSpec isTodeEnabled ])
ifTrue: [
stoneSpec startStone: self withSuperDoitOptions: false.
stoneSpec startNetldi: self withSuperDoitOptions: false.
stoneSpec startNetldi: self withSuperDoitOptions: true.
false ifTrue: [
stoneSpec isTodeEnabled
ifTrue: [
Expand Down
7 changes: 0 additions & 7 deletions bin/deleteStone.solo
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,6 @@ RwLoadSpecificationV2 {
]
%
method
restart
"startnetldi support"
"start netldi or if already running, restart the netldi"

^ true
%
method
debugLogging
"startnetldi support"
^ false
Expand Down
18 changes: 9 additions & 9 deletions bin/registerTodeSharedDir.solo
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
options
{
SuperDoitRequiredOptionWithRequiredArg long: 'registry'.
SuperDoitRequiredOptionWithRequiredArg long: 'todeSharedDirectory'.
SuperDoitRequiredOptionWithRequiredArg long: 'todeHome'.
SuperDoitOptionalOptionWithNoArg long: 'populate'.
}
%
Usage
-----
USAGE $basename [--help | -h] [--debug | -D] [--debugGem] \
--registry=<registry-name> \
--todeSharedDirectory=<path-to-shared-tode-directory>
--todeHome=<path-to-shared-tode-directory>
[--populate]

DESCRIPTION
Expand All @@ -30,7 +30,7 @@ OPTIONS
dump stack to stdout and wait for topaz to attach using topaz
DEBUGGEM command.
--registry Name of registry that stone is defined in (Required).
--todeSharedDirectory=<path-to-shared-tode-directory>
--todeHome=<path-to-shared-tode-directory>
Path to directory where tODE meta data is to be stored (Required).
--populate If specified, the minimum directory structure required by tODE
will be created.
Expand All @@ -39,9 +39,9 @@ EXAMPLES
$basename --help
$basename -D
$basename --registry=bosch \
--todeSharedDirectory=/home/dhenrich/gemstone/tode_shared
--todeHome=/home/dhenrich/gemstone/tode_home
$basename --registry=bosch --populate \
--todeSharedDirectory=/home/dhenrich/gemstone/tode_shared
--todeHome=/home/dhenrich/gemstone/tode_home
-----
%
specs
Expand All @@ -65,14 +65,14 @@ RwLoadSpecificationV2 {
]
%
doit
| registryClass stonesRegistry todeSharedDir todeSharedDirPath |
| registryClass stonesRegistry todeHomeDir todeHomeDirPath |
self preDoitSpecLoad: [:spec |
spec projectsHome: self dirname asFileReference parent parent].
registryClass := (self globalNamed: 'GDKRegistry').
stonesRegistry := registryClass stonesRegistryNamed: self registry.
todeSharedDir := self todeSharedDirectory asFileReference.
todeSharedDirPath := GsFile serverRealPath: todeSharedDir pathString.
stonesRegistry todeSharedDirectory: todeSharedDirPath populate: self populate.
todeHomeDir := self todeHome asFileReference.
todeHomeDirPath := GsFile serverRealPath: todeHomeDir pathString.
stonesRegistry todeHomeDirectory: todeHomeDirPath populate: self populate.
stonesRegistry export.

%
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ createStoneStructure: stoneSpec
key = #'stats'
ifTrue: [ (stoneRoot / value) ensureCreateDirectory ].
key = #'tode'
ifTrue: [ self createTodeSharedDirectory: stoneSpec ].
ifTrue: [ self createTodeHomeDirectory: stoneSpec ].
key = #'tranlogs'
ifTrue: [
useTranlogDir := '/' , value.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
todeHome
^ self stonesRegistry todeHome

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
accessing
todeHome: todeHomeDirPath
"The tode home is equivalent to the $GS_HOME directory in GsDevKit_home"

(todeHomeDirPath isKindOf: CharacterCollection)
ifFalse: [ self error: 'The todeHome is expected to be a CharacterCollection' ].
todeHome := todeHomeDirPath
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
todeHome
^todeHome
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
accessing
todeHomeDirectory: todeHomePath populate: populate
"The tode shared directory is equivalent to the $GS_HOME/sys/local directory in GsDevKit_home.
The directories created in this method are required for the proper functioning of a tODE client."

| todeHomeDir |
todeHomeDir := todeHomePath asFileReference.
self todeHome: todeHomeDir pathString.
(todeHomeDir exists not or: [ populate ])
ifTrue: [
todeHomeDir ensureCreateDirectory.
(todeHomeDir / 'sys') ensureCreateDirectory.
(todeHomeDir / 'sys' / 'local') ensureCreateDirectory.
(todeHomeDir / 'sys' / 'local' / 'server') ensureCreateDirectory.
(todeHomeDir / 'sys' / 'local' / 'server' / 'gemstone') ensureCreateDirectory.
(todeHomeDir / 'sys' / 'local' / 'server' / 'home') ensureCreateDirectory.
(todeHomeDir / 'sys' / 'local' / 'server' / 'monticello')
ensureCreateDirectory.
(todeHomeDir / 'sys' / 'local' / 'server' / 'projects') ensureCreateDirectory.
(todeHomeDir / 'sys' / 'local' / 'server' / 'stones') ensureCreateDirectory.
(todeHomeDir / 'sys' / 'local' / 'server' / 'templates')
ensureCreateDirectory.
(todeHomeDir / 'sys' / 'local' / 'server' / 'upgrade') ensureCreateDirectory.
(todeHomeDir / 'sys' / 'local' / 'sessions') ensureCreateDirectory.
self class
symbolicLink: todeHomeDir / 'sys' / 'local' / 'server' / 'stones'
linkName: todeHomeDir / 'sys' / 'stones' ]

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"commentStamp" : "",
"instvars" : [
"stones",
"todeSharedDirectory",
"todeHome",
"stonesDirectory",
"sessions",
"productDirectory",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
stone creation
createSessionDescripton: stoneSpec
| sessionDescriptionFile description localHostName |
sessionDescriptionFile := stoneSpec todeSharedDirectory asFileReference
| sessionDescriptionFile description localHostName todeHome |
todeHome := stoneSpec todeHome.
sessionDescriptionFile := stoneSpec todeHome asFileReference / 'sys' / 'local'
/ 'sessions' / stoneSpec stoneName.
localHostName := System hostname.
description := TDSessionDescription new
Expand All @@ -17,5 +18,8 @@ createSessionDescripton: stoneSpec
password: stoneSpec password;
backupDirectory: (stoneSpec rootDir / self backups) pathString;
snapshotDirectory: (stoneSpec rootDir / self snapshots) pathString;
serverGitRoot:
stoneSpec stonesRegistry projectDirectory asFileReference pathString;
serverTodeRoot: todeHome asFileReference pathString;
yourself.
description exportTo: sessionDescriptionFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
stone creation
createTodeHomeDirectory: stoneSpec
stoneSpec todeHome
ifNil: [
GsFile stdout
nextPutAll:
'WARNING: tode home directory is not defined, use registerTodeSharedDirectory.solo to define' ]
ifNotNil: [ :todeHome |
| todeStonesDir |
todeStonesDir := todeHome asFileReference / 'sys' / 'local' / 'server' / 'stones'
/ stoneSpec stoneName.
todeStonesDir ensureCreateDirectory.
self class symbolicLink: todeStonesDir linkName: stoneSpec rootDir / 'tode'.
self createTodeStoneMetadata: todeStonesDir.
self createSessionDescripton: stoneSpec ]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
stone creation
createTodeStoneMetadata: stoneSpec
createTodeStoneMetadata: todeStonesDir
"todeStonesDir - directory where meta data is to be created"
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ stone destruction
destroyStoneStructure: stoneSpec
"clean up the stone-specific tode meta data"

| sharedtodeDir stoneDir sessionsFile |
sharedtodeDir := stoneSpec todeSharedDirectory asFileReference.
stoneDir := sharedtodeDir / 'server' / 'stones' / stoneSpec stoneName.
stoneDir ensureDeleteAll.
sessionsFile := sharedtodeDir / 'sessions' / stoneSpec stoneName.
sessionsFile ensureDelete
| todeHomeDir sessionsFile todeMetaDataDir |
todeHomeDir := stoneSpec todeHome asFileReference.
sessionsFile := todeHomeDir / 'sys' / 'local' / 'sessions'
/ stoneSpec stoneName.
sessionsFile ensureDelete.
todeMetaDataDir := todeHomeDir / 'sys' / 'local' / 'server' / 'stones'
/ stoneSpec stoneName.
todeMetaDataDir ensureDelete

0 comments on commit d5a4df9

Please sign in to comment.