Worker Node Setup¶
A worker can analyze designs on behalf of clients and requires access to a license server and a broker for most tasks.
Prerequisites¶
- General Setup has been completed.
- Auth tokens, SSH keys, or credentials for
git.isis.vanderbilt.edu
- A broker running at
<broker>
. - Access to a corpus:
- Have a results directory set up at
<results-dir>
.- Ensure that it's readable and writable by the worker.
- Optionally have a backend running at
<backend>
. - Optionally have
design_swri.json
files available for testing.- Try using the example store as described here if no other source is available.
Install Dependencies¶
Install utilities like wget and rsync, as well as global python packages needed by creopyson and direct2cad.
- Open an admin powershell to
<repo-root>
. - Install dependencies:
- Close powershell and open a new instance for future commands.
Get License Information¶
Option 1: License Server¶
- Have a license server running at
<license-server.ip>
on port<license-server.port>
.
Option 2: Static Creo License¶
- Open an admin powershell to
<repo-root>
. - Get your mac address (for generating licenses):
- Save the result as
<creo-license.host-id>
. - Get a node-locked license for
<creo-license.host-id>
. - If using a local license, have the license file for the above mac
address downloaded to
<creo-license.file>
.
Install Creo¶
Downloads and installs PTC Creo 5.6.
- Open an admin powershell to
<repo-root>
. - Download and run installer:
- Read instructions in terminal and hit enter when ready.
- Follow installer prompts until done.
Fix some minor usability issues.
- If on Windows Server 2019 you can disable the IE Enhanced Security popups that open whenever Creo starts.
Install Creopyson¶
Creopyson provides a python interface to Creo.
- Prepare to connect to
git.isis.vanderbilt.edu
.- Either: Install auth tokens as in General Setup.
- Or: Install SSH keys for
git.isis.vanderbilt.edu
. - Or: have credentials ready for prompt.
- Open an admin powershell to
<repo-root>
. - Download creopyson repository and install via pip:
- Follow prompts.
Configure Corpus Settings¶
Performing various analysis tasks requires access to either a Corpus DB or a local static corpus. The config file at
<config-dir>/craidl.conf.yaml
specifies which of these use and how the connection is configured.
- Open admin powershell to
<repo-root>
. - (Optional) View currently loaded config file:
Option 1: Using a static corpus.¶
- No changes should be needed to config files.
Option 2: Using a remote corpus DB.¶
- Create or update
<config-dir>/craidl.md
:- Set
use_static_corpus
toFalse
. - Set
server_host
to<corpus-db,host
. - Set
server_port
to<corpus-db.port>
.
- Set
- See the config file guide for more detailed instructions and information.
Further details on using a static or database corpus can be found in this section...
Configure Results Dir¶
The results directory needs to be configured to point at the appropriate directory.
- Open admin powershell to
<repo-root>
. - (Optional) View currently loaded config file:
- Create or update the config at
<config-dir>/d2c_workspace.conf.yaml
:- Set
results_dir
to<results-dir>
.
- Set
- See the config file guide for more detailed instructions and information.
Further details on results storage and local worker node operations are in this page...
Initialize Reference Workspace¶
Each worker needs a pristine copy of the workspace in which designs can be analyzed. This reference workspace will be copied, via rsync for efficiency, whenever the worker performs a new analysis. The results archives are also constructed by gathering all the files which have been changed after an analysis when compared to the reference directory.
- Open admin powershell at
<repo-root>
. - Set up the reference workspace:
- Follow prompts.
For further details on workspace configuration, operation, and running analyses locally see this page...
Test the Worker Node (Optional)¶
Run a simple test task, generating the info files for a design, in order to test the worker node's configuration.
- Have a valid design file (usually
design_swri.json
) at<design-file>
. - Open a shell to
<repo-root>
. - Test generating design info files:
When finished this should place an archive in the
<results-dir>
with the generated info files. - Test generating processing designs:
When finished this should place an archive in the
<results-dir>
with the processed design.
Configure Broker Settings¶
The worker process itself needs to be configured with how to connect to a message broker.
- Open admin powershell to
<repo-root>
. - (Optional) View currently loaded config file:
- Create or update the config at
<config-dir>/broker.conf.yaml
:- Set up the broker:
- If you have a
<broker.url>
:- Set
url
to<broker.url>
.
- Set
- Otherwise:
- Set
host
to<broker.ip>
. - Set
protocol
to"amqp"
if using RabbitMQ or"redis"
if using Redis. - Set
port
to<broker.port>
. - Set
db
to<broker.db>
if you have one.
- Set
- If you have a
- Set up the backend, if available:
- Set
backend.enabled
totrue
- If you have a
<backend.url>
:- Set
broker.url
to<broker.url>
- Set
- Otherwise:
- Set
backend.host
to<backend.ip>
. - Set
backend.port
to<broker.port>
. - Set
backend.db
to<broker.db>
if you have one.
- Set
- Set
- Set up the broker:
- See the config file guide for more detailed instructions and information.
Further details on configuring the worker's backend are here...
Run the Worker¶
In order for the worker node to be able to process tasks a worker must be running, either as a process or a service.
Option 1: Run the Worker Node as a Process¶
You can run the worker node as a process to verify all the above settings function as intended.
- Open admin powershell to
<repo-root>
. - Run the SimpleUAM worker node process:
If the worker node process is running and the broker is correctly configured then the worker is also a valid client. This means that, if there is only one attached worker, you can run a basic round trip test of the system using the instructions for testing the client node.
Option 2: Run the Worker Node as a Service¶
Warning
Running SimpleUAM's worker as a service requires ensuring file system permissions and mounted drives are available with headless accounts. This is out of scope of scope of this guide and generally rather annoying.
Contributions or suggestions to simplify this process would be very appreciated.
Configure the Worker Service¶
The worker node service needs to configured, in particular a user should be provided that can see the mounted drive.
- Open admin powershell to
<repo-root>
. - (Optional) View currently loaded config file:
- Create or modify the config at
<config-dir>/d2c_worker.conf.yaml
:- Set
service.account
to the user you want the service to run as.- The default should be fine if the
LocalSystem
user can read and write to your results directory and the workspaces directory.
- The default should be fine if the
- Set
service.password
to the password of that user. - (Optional) Make the service auto start by setting
service.auto_start
toTrue
- Set
- See the config file guide for more detailed instructions and information.
Other Configuration Notes
- Because services don't run as a frontend user paths to network drives can't use drive letters. Make sure all paths in all config files are in UNC format where applicable.
Further details on configuring the worker as a service are here...
Set up the Worker Node Service¶
We use Non-Sucking Service Manager to manage the worker node service, and that requires some setup.
- Open admin powershell to
<repo-root>
. - Install the SimpleUAM worker service:
Start the Worker Node Service¶
The worker node service can start immediately but we recommend holding off until you've verified configurations while running the node as a process.
- Open admin powershell to
<repo-root>
. - Install the SimpleUAM worker service:
Further details on running the worker as a service are here...
Next Steps¶
View information on corpus use here...
View information on local task processing here...
View information on remote task processing here...