Skip to content

Worker (server-core-worker) ​

The Worker service executes background tasks — primarily building and distributing Docker containers for analyses. It is purely queue-driven with no database.

Running ​

bash
# Development (from repo root)
npm run server-train-manager

# Docker
docker run -e ... privateaim/hub core-worker

INFO

Unlike other services, the worker has no CLI interface. It starts directly via node dist/index.mjs using dotenv/config.

Dependencies ​

  • Authup — OAuth2 identity provider
  • RabbitMQ — AMQP message bus (receives tasks from Core API)
  • Core API — REST client for status updates
  • Storage API — REST client for file access
  • Docker — local Docker daemon for container execution

Environment Variables ​

Service-Specific ​

VariableDefaultDescription
CORE_URL—Core API base URL (required)
STORAGE_URL—Storage service base URL (required)
RABBITMQ_CONNECTION_STRINGamqp://root:start123@127.0.0.1RabbitMQ connection

Inherited ​

VariableDefaultDescription
NODE_ENVdevelopmentEnvironment
PORT3000Health-check HTTP port
REALMmasterAuthup realm
CLIENT_IDsystemAuthup client ID
CLIENT_SECRETstart123Authup client secret
AUTHUP_URL—Authup URL

Components ​

The worker runs four AMQP task consumers:

ComponentPurpose
Analysis BuilderBuilds Docker images from analysis code
Analysis DistributorPushes images to target registries
Master Image BuilderBuilds base Docker images from GitHub
Master Image SynchronizerSyncs master image catalog

Health Check ​

The worker exposes a minimal HTTP server for health checking:

GET http://localhost:3000/