Skip to content

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:
    • Either: Via a corpus DB at <corpus-db>.
    • Or: A static corpus installed as described here.
  • 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:
    pdm run setup-win install.worker-deps
    
  • 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):
    pdm run setup-win mac-address
    
  • 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:
    pdm run setup-win worker.creo
    
  • 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.
    pdm run setup-win worker.disable-ieesc
    

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:
    pdm run setup-win worker.creopyson
    
  • 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:
    pdm run suam-config print --config=craidl -r
    

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 to False.
    • Set server_host to <corpus-db,host.
    • Set server_port to <corpus-db.port>.
  • 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:
    pdm run suam-config print --config=d2c_workspace -r
    
  • Create or update the config at <config-dir>/d2c_workspace.conf.yaml:
    • Set results_dir to <results-dir>.
  • 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:
    pdm run d2c-workspace setup.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:
    pdm run d2c-workspace tasks.gen-info-files --input=<design-file>
    
    When finished this should place an archive in the <results-dir> with the generated info files.
  • Test generating processing designs:
    pdm run d2c-workspace tasks.process-design --input=<design-file>
    
    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:
    pdm run suam-config print --config=broker -r
    
  • 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>.
      • 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 up the backend, if available:
      • Set backend.enabled to true
      • If you have a <backend.url>:
        • Set broker.url to <broker.url>
      • Otherwise:
        • Set backend.host to <backend.ip>.
        • Set backend.port to <broker.port>.
        • Set backend.db to <broker.db> if you have one.
  • 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:
    pdm run suam-worker run
    

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:
    pdm run suam-config print --config=d2c_worker -r
    
  • 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.
    • Set service.password to the password of that user.
    • (Optional) Make the service auto start by setting service.auto_start to True
  • 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:
    pdm run suam-worker service.install
    

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:
    pdm run suam-worker service.start
    

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...