Staple AI
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ![](https://i.imgur.com/Yy3WqUe.png) # Staple AI Platform Deployment Documentation This document is a guide to installing the Staple architecture on premises. This is for the complete Staple platform, including user interface and API interface, with all features and additions. The general deployment is achieved using Helm, which provided direct deployments of Kubernetes containing docker containers of code. Kubernetes is used to ensure a reliable, scalable deployment, while the use of Helm makes for a quicker and cleaner deployment process. This document is **specifically** tailored for AWS deployment, although deployments to other cloud enviroments and private enviroments should be similar. For specific details regardng AWS, these are highlighted as such in this installation guide. The deployment process consists of these major steps: **1. Database provisioning and migration 2. Storage provisitoning 3. Cluster Creation 4. Helm installation 5. DNS provisioning** Deployment should take a single developer 1-2 working days. ## General System Requirements There are three types of system requirements: 1. Databases: MySQL, MongoDB, Postgres 2. Document File Storage 3. Kubernetes Cluster Each is discussed in detail in the proceeding sections. The minimum required hardware for the cluster to handle all Staple services are: * Total of 28 CPU cores * Total of 75 GB memory However, for instances where the Staple system should be processing vast numbers of documents (hundreds of thousands to millions of documents monthly), these requirements will increase. Please contact the Staple team for confirmation of exact requirements in such cases. ## Code Transfer Deployment scripts will be provided to you by Staple as ZIP, and transferred via SFTP as required. # Step 1: Databases The first step to installing the Staple system is setting up the databases. Staple uses multiple databases to store user, model and document data. The database should be provisioned according to your usual methods. Database types are as follows: * MySQL * Version: `8.0.11` * Database name: `staple_dashboard` * MongoDB * Version: `4.2.11` * Database name: `staple_scanning` * PostgresQL * Version: `12.3` * Database name: `staple_creation` For each database, a user must be provided to the Staple deployment with full CREATE/READ/UPDATE/DELETE permissions for that database. Once the database is provisioned, the schema migration will be handled automatically using the migration files we will provide you. These files will take care of setting up the database structure. They will require the following information to run: * Host * Username * Password * Database name * Application version (provided by Staple) These values will also be needed later for the Helm deployment. **If you can not provision these databases please let Staple know.** We can provide containerised databases as part of the deployment if required. For performance reasons thoug, this is not preferred. # Step 2: Document Storage The original files Staple proesses are held in a general file system. The storage requirements for the system vary on the expected number of documents expected to be processed, and for how long the documents should be kept. It is generally advised that once a document has been exported from the Staple system to and ERP, Account system, or other long erm storage system, is is deleted after 3 months. However, the time for which documents must be saved may be defined by the client. Please inform Staple the timeline for which documents must be stored. ### Storage on AWS For AWS, Images and other large files are stored in S3. Staple requires that two AWS components be manually provisioned: #### S3 Bucket: The name of the S3 bucket can be anything, but the contents must follow this structure: ``` BUCKETNAME/ > crawlers/ > documents/ > originals/ > scanning_logs/ > docscan/ > galaxy/ > nebula/ > templates/ ``` The `BUCKETNAME` and AWS `region` it is deployed in will also be needed later for the Helm deployment. #### AWS IAM user Role: The Staple deployment needs access to the S3 bucket provisioned above, so the installation will require an `AWS_IAM_USER_KEY` and a `AWS_IAM_USER_SECRET`. It is recommended that a new AWS user or role is created for this purpose, with permissions restricted to the S3 bucket. ### Alternative Storage Systems **If you wish to use an alternative file storage system, please inform Staple of your requirements as soon as possible.** We are happy to work with you to deliver Staple with a different storage system. The system must have an API with the following functionalities: 1. Create new folder 2. Upload document 3. Retreive document 4. List items in folder Batch upload would be beneficial, but is not necessary. Once we have these API endpoints, Staple will quickly integrate them into your custom build. Staple will require a folder structure similar to that given in the prior section. # Step 3: Deployment of Kuberenetes Cluster ### Kubernetes Requirements Staple runs on Kubernetes. This means that it is responsive to load and resilient to faults. For deployments to AWS, a Kuberenetes cluster can be provisioned through AWS Elastic Kubernetes Service. The minimum cluster requirements are: * Total of 28 CPU cores * Total of 75 GB memory * At least one node type available with 5 CPU cores and 10 GB memory For best results, we recommend enabling a Cluster Autoscaler to automatically provision new nodes on demand. [Here](https://docs.aws.amazon.com/eks/latest/userguide/cluster-autoscaler.html) are the instructions for an AWS EKS cluster. #### Cluster dependencies In order to successfully deploy Staple to the cluster, these client utilities are required: * `kubectl`: version 1.16 or higher * Installation instructions: [here](https://kubernetes.io/docs/tasks/tools/install-kubectl/) * `Helm`: major version 3 * Installation instructions: [here](https://helm.sh/docs/intro/install/) To successfully use these utilities, you will need to connect `kubectl` to the cluster. The exact steps required differ between different Kubernetes providers. Staple can provide clear documentation for connecting to an AWS EKS cluster if required, and is happy to assist with any other requirements. #### Namespace All Staple objects will be created in the same namespace. The name of the namespace is arbitrary, but must be provided to `.namespace.name` at installation or it will default to `staple-RELEASENAME`. The Helm installation will create the namespace itself by default, but this can be done manually for security reasons if necessary. If the namespace is created manually, inform Helm by setting the `.namespace.exists` flag to `true`. # Step 4: Deployment Staple is deployed on Kubernetes via a Helm Chart. Helm is a package manager for Kubernetes that makes the installation process significantly smoother and easier. All you need to do is provide user-specific configuration values, and Helm will manage the rest of the installation. Staple will provide a connection to our container registry and a folder `Staple_Deployment_v1.5/` containing the packaged Chart and a template Config.yaml file. Proceed with deployment by: 1. Updating the template `Values.yaml` with your configuration details. These will be described in greater detail at the time. 2. In your command line, navigate to the provided `Staple_Deployment_v1.5/` folder. 3. Install the chart with `helm install -f Config.yaml staple staple-1.5.0.tgz`. It may take some time for the Chart to completely install. For better understanding of the Helm installation process, see [the official website](https://helm.sh/). #### Networking To guarantee privacy and security, Staple implements `CORS` and `TLS`. Both the User interface and the API interface will require their own URLs to be provisioned. These must be provided at installation. Instructions on DNS resolution are later in this document. # Step 5: DNS Resolution The Staple installation can only be accessed through the URLs provided at install time. DNS resolution must be manually implemented for these to resolve appropriated. To find the target host, ensure you are connected to the correct cluster and run: ``` kubectl get ingress -n <NAMESPACE> ``` Replace `NAMESPACE` with the name of the Staple namespace, which was provided to `.namespace.name` at install time. If none is provided, it will default to `staple-RELEASENAME`. Staple services will soon be available at the given URL. ## Questions Staple provides complete *hand-holding* support for every deployment, as you require. We are also happy to deploy the system on your behalf should you wish, or provide a DevOps professional to assist you if you wish. For any questions or issues, please contact: * Joshua Kettlewell: josh@staple.io * Hebe Hilhorst: hebe@staple.io Staple AI is committed to making the installation process as seemless as possible. All feedback and questions will be immediately actioned up.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully