FactoryFactory

OnPremise Installation Guide

This guide provides an overview of installing and setting up the ManufactAI Factory application. Following these installation guidelines is important for ensuring a properly functioning system.

System Architecture

ManufactAI Factory consists of two main components:

  1. Factory API - The backend service responsible for data processing, business logic, and database operations. This component is developed in Python and communicates with the database and storage system.

  2. Factory UI - The frontend application that provides the user interface. This component is developed in React and offers an intuitive, responsive interface for accessing all Factory features.

These components work closely together and require additional supporting services to function properly.

Prerequisites

Before installing ManufactAI Factory, ensure your environment meets the following requirements:

Supporting Services

  • Database: MongoDB (version 7.0 or higher)

    • The database stores all configurations, user accounts, and metadata
    • MongoDB should be configured with replication for production environments
  • Storage: S3-compatible object storage

    • Used for storing user files, analysis reports, and other files
    • Can be AWS S3, MinIO, or any other S3-compatible service
    • Requires appropriate bucket permissions and access credentials
  • Email Service: SMTP server for sending notifications and account management emails

    • Used for user registration, password resets, and system notifications
    • Can be a corporate mail server or a third-party service like SendGrid or Mailgun
  • Network: Proper DNS configuration and routing for your chosen domain

    • The domain should point to your Factory installation
    • TLS/SSL encryption is strongly recommended for all production deployments

System Requirements

The hardware requirements for ManufactAI Factory vary depending on the number of users, amount of data, and expected load. The following minimum specifications are recommended:

  • CPU: Minimum 2-4 cores to get started, though more cores are recommended for production environments with multiple users
  • Memory: Minimum 4-8GB RAM, with higher amounts recommended for production environments
  • Storage: A minimum of 100GB SSD storage is recommended for the application and database
  • Network: The system must be accessible from the locations where users will be training models and working with the application. Ensure reliable network connectivity with sufficient bandwidth (at least 100 Mbps recommended)

These requirements should be adjusted based on monitoring system performance during actual usage. For larger deployments or heavy workloads, consider scaling up resources accordingly.

Installation Overview

The installation process for ManufactAI Factory involves these general steps:

  1. Prepare Infrastructure

    • Set up MongoDB database with appropriate users and authentication
    • Configure S3-compatible storage with buckets and access policies
    • Prepare SMTP service with proper authentication
    • Configure DNS for your chosen domain with appropriate records
  2. Deploy Factory Components

    • Deploy Factory API component using container technology
    • Deploy Factory UI component using container technology
    • Configure environment variables for both components

    Both components are available as Docker containers from the ManufactAI container registry:

    • ghcr.io/manufactai/factory-prod/factory_api
    • ghcr.io/manufactai/factory-prod/factory_ui
  3. Configure Network Routing

    • Set up routing so that:
      • /api/* paths go to the Factory API
      • All other paths go to the Factory UI
    • Configure TLS/SSL termination
    • Set up appropriate caching and request limits

Configuration Essentials

ManufactAI Factory requires proper configuration to function correctly. The most critical configuration elements include:

Database Configuration

Factory requires a MongoDB database with version 7.0 or higher. The MongoDB connection is configured in the Factory API component using the DB_URI environment variable.

Storage Configuration

Factory stores files and data in an S3-compatible storage service. The following must be configured:

  • S3 endpoint URL (AWS endpoint or your custom S3 service)
  • Access key and secret key with appropriate permissions
  • Bucket name
  • Region (if using AWS S3)
  • Path prefix (optional)
  • Expiration settings for temporary URLs

All S3 settings are configured through environment variables in the Factory API component.

API and UI Communication

The Factory UI needs to know how to communicate with the Factory API:

  • The UI must be accessible at the root path of your domain
  • The API must be accessible at the /api path of the same domain
  • The UI is configured to communicate with the API based on the current domain

Authentication

Factory supports email-based authentication and optional Single Sign-On (SSO):

  • SMTP configuration is required for email-based user management
  • SSO can be configured with Keycloak, Google, or other OpenID Connect providers
  • Multi-factor authentication can be enabled through SSO providers

Detailed authentication configuration is covered in the Authentication Guide.

Deployment Methods

ManufactAI Factory is designed for container-based deployment using Docker. This approach provides consistency, scalability, and easier maintenance. The containers can be orchestrated using various tools:

  • Docker Compose for simpler deployments
  • Kubernetes for enterprise-grade orchestration
  • Amazon ECS/EKS for AWS environments
  • Azure AKS for Microsoft Azure environments

Each container can be scaled independently based on the needs of your organization, with the Factory API typically requiring more resources for data processing operations.

Environment Preparation

Before deploying Factory, prepare your environment:

  1. Network Setup:

    • Configure your firewalls to allow necessary traffic
    • Set up a load balancer if using multiple instances
    • Configure DNS entries for your domain
  2. Database Preparation:

    • Deploy MongoDB 7.0+ with appropriate security settings
    • Create a dedicated database user for Factory
    • Configure backups and monitoring
  3. Storage Preparation:

    • Set up your S3-compatible storage
    • Create a dedicated bucket for Factory
    • Configure appropriate access policies
  4. Security Considerations:

    • Use TLS/SSL for all communications
    • Implement network segmentation
    • Follow the principle of least privilege for all accounts

Troubleshooting

Common installation issues and their solutions:

API Connection Issues

  • Verify that the API container is running
  • Check the API logs for error messages
  • Ensure networking is configured correctly between UI and API
  • Verify that the /api path is correctly routed to the Factory API
  • Check for any firewall or network policy restrictions

Database Connection Problems

  • Verify the MongoDB connection string format
  • Ensure MongoDB is running and accessible from the Factory API
  • Check MongoDB authentication credentials
  • Verify MongoDB version compatibility

Storage Issues

  • Verify S3 access credentials
  • Ensure the S3 bucket exists and is accessible
  • Check permissions on the S3 bucket
  • Verify network connectivity between Factory API and S3 storage
  • Test S3 access using the AWS CLI or another S3 client