BouncerWorker - 3drepo/3drepobouncer GitHub Wiki

About Bouncer Worker

Bouncer worker is a NodeJS client that handles communications between 3drepo.io and 3drepobouncer. It connects to a queue via ampq protocol, parses the incoming messages and operates on them accordingly.

Bouncer worker can import models, process drawings, and create federations - however this last function is being decommissioned and will no longer be used after the next release.

Getting Started

Prerequisites

  • NodeJs v22
  • 3drepobouncerClient - compiled & with dynamically linked dependencies on the PATH

Installation

  • yarn install

Usage

To run Bouncer Worker with default settings:

yarn run-worker

This will run bouncer worker, listening to all configured queues, specied in the default config location (./config.json)

Use --config to specify the path to your configuration file

yarn run-worker --config prod_config.json

--queue [job|model|drawing] will only listen to the specified queue

yarn run-worker --queue model

--exitAfter <number> will process the specified amount of tasks on the queue and exit the process. note: --queue must be specified in this mode.

yarn run-worker --queue model --exitAfter 10

Run with --help to see the list of available options

yarn run-worker --help

Configurations

Bouncer worker takes in a JSON file with the following parameters.

{
	"timeoutMS":, //Number of ms to spend on a task before timing out (default: 3hours)
	"logging": {
		"taskLogDir": //Path to where the individual task logs should go for each tasks. If not set will default to default: rabbitmq.sharedDir 
		"workerLogPath": //Where bouncer worker will write it log. If it is not specified, it will not log to file.
	},
	"rabbitmq":{
		"host" : //URL to rabbitmq server
		"worker_queue": //name of the worker queue
		"callback_queue": //name of the callback queue
		"model_queue": //name of the model queue
		"drawing_queue": //name of the drawing queue
		"task_prefetch": //Number of tasks to process simultaneously on the worker queue (default: 4)
		"model_prefetch": //Number of tasks to process simultaneously on the model queue (default: 1)
		"drawing_prefetch": //Number of tasks to process simultaneously on the drawing queue (default: 1)
		"sharedDir": //Path to the sharedSpace being referenced by the queue
	},
	"bouncer":{
		"path" : //path to 3drepobouncerClient
		"envars":  { } //additional envars to set whilst running 3drepobouncerClient, e.g. REPO_RVT_TEXTURES
	},
	"db": {
		"dbhost": //hostname of mongo database
		"dbport": //port of mongo database
		"username": //authentication username
		"password": //authentication password
	},
	"fs": {
		"path" : //path to fileshare
		"level": //number of levels to split
	},
	"defaultStorage": "db",
	"elastic": { } //Elastic credentials for tracking events; this whole section can be omitted when running locally
	"processMonitoring" : {
		"enabled" : false, // When true, monitors any spawned processes
		"memoryIntervalMS" : 10 // How often to sample spawned processes
	},
	"repoLicense": //license string for license check (only required on builds that are license enforced)
}
⚠️ **GitHub.com Fallback** ⚠️