Remote Runner: start manual runner and workers
Start a runner using StompMQ that waits for workers and install it as the default runner:
GtRemoteRunner hasUniqueInstance ifTrue: [ GtRemoteRunner cleanUp ]. GtRrStompMqProcessor defaultHost ifNil: [ GtRrStompMqProcessor defaultHost: 'localhost:', StampConstants defaultPort asString ]. manager := GtRrPluggableManager new. manager serverManager: GtRrMqServerManager new; workerManager: (GtRrWorkerManager new forStompMq; autoRestart: false; changesSync: false; poolSize: 0). remoteRunner := GtRemoteRunnerMq new. remoteRunner managerStartupAndShutdown: manager. remoteRunner startLogging; start.
Start a worker that connects to the specified runner (this will typically be run in a separate image from the runner above):
worker := GtRrWorker serverSocketAddress: GtRrStompMqProcessor defaultHost. worker connectionStrategy: (GtRrMqWorkerConnectionStrategy new). worker attributes at: #changesSync put: false; at: GtRrWorker stompMqQueueNames put: GtRrMqServer stompMqQueueNamesAttribute. worker start.
Start a runner that waits for workers and install it as the default runner:
GtRemoteRunner hasUniqueInstance ifTrue: [ GtRemoteRunner cleanUp ]. remoteRunner := GtRemoteRunner new managerStartupAndShutdown: GtRrManualManagerStartupAndShutdown new; port: 7042; startLogging; start. GtRemoteRunner setUniqueInstance: remoteRunner. remoteRunner.
Start a worker that connects to the specified runner (this will typically be run in a separate image from the runner above):
worker := GtRrWorker serverSocketAddress: 'localhost:7042'. worker attributes at: #changesSync put: false. worker start.
or start one from the command line:
bin/GlamorousToolkit-cli GlamorousToolkit.image clap remoteRunnerWorker --log --serverSocketAddress 7042 --changesSync --detachChangesFromFileSystem --noLepiterReload --noGtImageUpdate
or simulate the command line:
commandLine := GtRrWorker commandLineCommand match: #('remoteRunnerWorker' '--log' '--serverSocketAddress' '7042' ). "Start the worker in a separate process since it will hibernate" [ GtRrWorker processCommandLineArgs: commandLine ] fork.
Connect to a headless runner:
GtRemoteRunner hasUniqueInstance ifTrue: [ GtRemoteRunner cleanUp ]. remoteRunner := GtRemoteRunner headlessOnPort: 7042 codeSync: false. GtRemoteRunner setUniqueInstance: remoteRunner. remoteRunner.
remoteRunner startAnnouncementsNotifier.
Submit a simple job:
task := GtRrScriptTask script: '4+3'. job := GtRemoteRunner default submitJob: task asJob.