Self-hosting Omnidocs Platform (Generic)

Modified on Thu, 3 Dec at 8:47 AM

Self-hosting Omnidocs Platform (Generic)

TABLE OF CONTENTS

Overview

The Omnidocs environment consists of several core services that work together to support the overall functionality:

  • Core Services
  • Create API, Internal API, and Backup API
  • Transformation Service
  • JMES Engine
  • Templating Services
  • Docx, Pptx, Xlsx, Html
  • PDF Output Service
  • PDF Conversion Engine

For storage, the environment uses both Object/Blob Storage and a MongoDB-based database.

Asynchronous document generation and webhooks are optional. They need two more services, PDF Orchestrator and Webhook Orchestrator, and a message queue.

It is also recommended to secure the network boundary using both an Ingress Gateway and an Egress Gateway. This helps protect the system from external threats and simplifies configuration when interacting with external services (e.g., adding firewall exceptions for MongoDB Atlas).

Self-hosting_Omnidocs_Platform_(Generic)-create-arch

Self-hosting_Omnidocs_Platform_(Generic)-create-arch

For example, when deploying on Azure, the setup may include:

  • Application Gateway: Acts as an inbound reverse proxy with Web Application Firewall protection.
  • NAT Gateway: Handles outbound communication through network address translation.

Services

Core Services

Create API

The Create API is the main entry point and orchestrator for the environment. It serves as both the workflow orchestrator, coordinating other services to execute various features (such as generating a document), and as the sole ingress for the system, exposing the complete API surface and WebAssembly clients.

  • Inbound Communication: The only service exposed externally for inbound requests.
  • Service Dependencies: Requires reachability to all other services and dependencies (excluding Backup API). These endpoints are configured using environment variables.
  • Resource Allocation: Due to offloading computational tasks to WebAssembly and templating engines, the service only needs moderate resources to handle typical request loads.

Internal API

The Internal API assists the Create API during specific workflows, such as generating documents and interacting with external data sources. It does not require external inbound access, only outbound communication.

  • Service Dependencies: Requires similar discoverability as the Create API.
  • Resource Allocation: Comparable to Create API, but with lower overall demand.

Backup API

The Backup API is responsible for executing backup and restore operations on the storage components.

  • API Exposure: This service does not expose an API endpoint and does not require discoverability of other services, aside from storage components.
  • Required: Besides backup and restore, the Backup API publishes shared units and deletes units and organizations. Run it in every installation.
  • Resource Allocation: Lightweight, with minimal CPU and memory needs.

Transformation Service

JMES Engine

The JMES Engine processes transformations during the initial phase of a workflow using an extended version of JMESPath.

  • Service Dependencies: No service discoverability required.
  • Resource Allocation: Low CPU usage but requires substantial memory, with a minimum of 3GB RAM and 1 CPU recommended.

Templating Services

The templating engines are used in the next phase of the workflow. Depending on the type of document being generated, either the Docx engine for Word documents, the Pptx engine for PowerPoint presentations, the Xlsx engine for Excel spreadsheets, or the Html engine for HTML documents is used.

  • Service Dependencies: No service discoverability required.
  • Resource Allocation: These services are generally lightweight. Office engines require up to 1GB of memory each, while the HTML engine has minimal memory needs.

PDF Output Service

PDF Engine

The PDF Engine is responsible for converting Office and HTML documents to PDF as the final step of a workflow.

  • Service Dependencies: No service discoverability required.
  • Resource Allocation: CPU-intensive and benefits from having whole number CPU units assigned (e.g., 1 CPU, 2 CPUs) for optimal performance. This ensures efficient resource use, as fractional CPU allocations may not perform adequately. Memory requirements vary based on document complexity.
  • Recommendations: Allocate 1 CPU and at least 2GB of memory per instance. This service scales more efficiently horizontally rather than vertically.
  • Scaling Guidance: If horizontal scaling is limited, consider increasing memory before adding additional CPUs (up to 2 CPUs). Scaling beyond this number results in diminishing returns.

Background Services (optional)

PDF Orchestrator and Webhook Orchestrator

These services process asynchronous generation requests from the message queue and call the webhooks of the calling system. You only need them if you use asynchronous generation or webhooks.

  • Inbound Communication: None.
  • Without them: Normal document generation works. The asynchronous endpoints answer "Async API is disabled (no queues)."

Storage Dependencies

Object Storage

The environment supports several object storage options:

  • Azure Storage: Suitable for deployments in Azure environments.
  • S3-Compatible Storage: Useful for non-Azure or third-party environments (e.g., Ceph or MinIO).
  • MongoDB GridFS: A fallback solution used when no other object storage is available.

Database Storage

The system relies on a MongoDB-compatible database for structured data storage. Supported options include:

  • MongoDB Atlas: A cloud-based managed service.
  • Azure CosmosDB for MongoDB: A managed database service offering compatibility with MongoDB.
  • Self-Managed MongoDB Instance: A manually maintained setup. Run it as a replica set, because Create uses MongoDB transactions.

Message Queue (optional)

Asynchronous generation and webhooks need an AMQP message broker. Supported options are RabbitMQ and Azure Service Bus.

Domain Names and Reverse Proxy

  • One subdomain per organization: Each organization is opened on its own subdomain of your Create address, and Create uses the first part of the host name to find the organization. Your DNS and certificate must cover these subdomains.
  • Keep the host name: The reverse proxy must forward the original host name to the Create API.

Updates

Omnidocs releases a new version of Create every month. We recommend running the latest version, or at most one month behind.

Accessing Container Images

To access the container images required for the Omnidocs environment, please contact your designated technical contact at Omnidocs. They will assist in providing you with an authentication token for our Azure Container Registry, enabling you to pull the necessary images for the various services described in this documentation.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article