Welcome to the Compox documentation!
Compox
Compox is a simple Python execution engine for Tescan applications. It’s purpose is to run data processing algorithms written in Python on the server and report the results to the client application such as Tescan 3D Viewer or Picannto.
See the GitHub pages for full python API reference, docs and tutorials!
Installation
Compox can be installed through PyPI:
pip install compox
You can also install the server by cloning this repository and installing it from source.
Note that some additional dependencies, such as MinIO executable for your operating system, will be downloaded on the first run of the server.
Running the server
Once installed into your Python environment, Compox can be run using the compox command. This command is available in the virtual environment
created during the setup process. Run the following command to list the available commands:
compox --help
It’s recommended to start with generating an initial configuration file with compox generate-config. See the configuration options section below.
To see the usage of the generate-config command, you can run:
compox generate-config --help
To run the Compox, use the following command:
compox run --config /path/to/config.yaml
Deploying algorithms
See the relevant section in the documentation for information about target structure of the deployable algorithms. You may also refer to our tutorials that will guide you through the preparation and deployment of selected algorithms.
Once your algorithm is ready, you can use the compox deploy-algorithms command to deploy it to your server.
To see the usage of the deploy-algorithms command, you can run:
compox deploy-algorithms --help
By default, this command reads algorithm definitions from the folder specified
in your configuration file with the deploy_algorithms_from key and deploys
all deployable algorithm subfolders found there.
Examples:
compox deploy-algorithms --config /path/to/config.yaml
Deploy only selected algorithm folders:
compox deploy-algorithms --config /path/to/config.yaml --name foo --name bar
Override the algorithm root folder for a single run:
compox deploy-algorithms --config /path/to/config.yaml --path /path/to/algorithms
Note that the server does not need to be running in order to deploy the algorithms.
Configuration
The server uses pydantic settings for configuration. The options can be either set as runtime arguments, in a yaml file, or using the COMPOX__ environment variables, in corresponding order of precedence.
Ensure all paths and URLs are correctly set before running the application.
Adjust CUDA settings based on hardware capabilities.
Logging paths should be accessible by the application to prevent errors.
Use the
loggingsection to control how much detail is shown in the console versus the log file.See the configuration reference below for detailed configuration options.
Configuration reference
Compox Configuration Reference
Section |
Field |
Default |
Description |
|---|---|---|---|
|
|
The main server port used to make requests. |
|
|
|
Directory for algorithm deployment sources. |
|
|
|
Path to the main log file (supports dynamic prefixes). |
|
|
|
Optional config path override. |
|
|
|
|
Minimum level shown in the interactive console. At |
|
|
|
Minimum level written to the main log file. |
|
|
|
Product display name. |
|
|
|
Tags attached to the server. |
|
|
|
Name of the corporate group. |
|
|
|
Full name of the organization. |
|
|
|
Domain used in server configuration. |
|
|
|
Enables/disables GUI menu for algorithm management. |
|
|
|
Enables/disables systray GUI integration. |
|
|
Path to the installed package resource |
Path to the systray icon (supports dynamic prefixes). |
|
|
|
Device used for model inference ( |
|
|
|
Comma-separated list of visible CUDA GPUs. |
|
|
|
Task executor selection. |
|
|
|
Number of FastAPI background task workers. |
|
|
|
Task executor selection. |
|
|
|
Celery worker name. |
|
|
required |
Broker URL for Celery (e.g. |
|
|
|
Celery result backend. |
|
|
|
Whether to run Celery Flower. |
|
|
|
Optional Flower port override. |
|
|
|
Prefix applied to object store collections (useful for AWS S3). |
|
|
|
Days until stored datasets expire. |
|
|
|
Days until execution data expires. |
|
|
|
Days until training data expires. |
|
|
|
Days until deploy data expires. |
|
|
|
Days until stop-requests expire. |
|
|
generated with |
Generated access key for storage backend. If |
|
|
generated with |
Generated secret key for storage backend. If |
|
|
|
Selected backend provider. |
|
|
|
Whether to start a local MinIO server. |
|
|
|
MinIO service port. |
|
|
|
MinIO admin console port. |
|
|
|
MinIO binary path (OS-specific, supports dynamic prefixes). |
|
|
|
Storage directory used by MinIO (supports dynamic prefixes). |
|
|
|
Optional AWS compatibility region. |
|
|
|
Optional domain override for S3 compatibility. |
|
|
Derived from |
Computed as |
|
|
|
AWS backend selection. |
|
|
|
Optional override for S3 endpoint URL. |
|
|
|
AWS region (e.g. |
|
|
|
Domain used for S3-style URLs. |
|
|
|
Enable SSL on the server. |
|
|
|
SSL key file path (supports dynamic prefixes). |
|
|
|
SSL certificate path (supports dynamic prefixes). |
|
|
|
CORS allowed origins. |
|
|
|
CORS allowed methods. |
|
|
|
CORS allowed headers. |
|
|
|
CORS allow credentials. |
|
|
|
CORS exposed headers. |
|
|
|
CORS preflight max age in seconds. |
Logging configuration
Compox uses separate console and file sinks. This lets you keep the terminal readable while still collecting more detailed logs in the file.
Example:
log_path: "LOG_DEFAULT:compox.log"
logging:
console_level: "INFO"
file_level: "DEBUG"
Recommended modes:
Quiet day-to-day operation:
logging: console_level: "INFO" file_level: "DEBUG"
Full interactive debugging:
logging: console_level: "DEBUG" file_level: "DEBUG"
At INFO console level, Compox suppresses some high-frequency console noise such as polling status requests, file transfer access logs, and routine MinIO subprocess output. These logs still remain available in the file sink. At DEBUG or TRACE, those console logs are shown again.
Some fields in the Compox configuration (such as log_path, icon_path, etc.) support dynamic prefixes that resolve to OS-specific or runtime-specific paths. This allows for portability across platforms (e.g., Windows, Linux) and between development and production environments.
Supported Prefixes
Prefix |
Meaning (Resolved To…) |
|---|---|
|
A platform-dependent log directory: |
- Windows: |
|
- Linux/macOS: |
|
|
A system-wide data directory (Windows only): |
- e.g., |
|
- On Linux/macOS, defaults to |
These are resolved at runtime in the Settings.parse_paths() validator method.
Security Notice
While you can technically communicate with a remotely running Compox instance, the communication is currently not authenticated and done via standard HTTP. Do not expose Compox endpoints to network in case of sensitive code or data. Security improvements are currently work in progress.
Contents:
- User Guide
- How to create an algorithm module
- Example of a dummy algorithm
- Denoising algorithm template
- Segmentation algorithm template
- Registration algorithm template
- Implementing the
train()method in Compox algorithm runners - This guide is for algorithm developers implementing training logic in their Runner classes.
- Tutorials
- Client Workflows
- API Reference