[GH-ISSUE #185] One command install for Finmars Community Edition with optional demo data #98

Open
opened 2026-03-03 11:58:51 +03:00 by kerem · 1 comment
Owner

Originally created by @falendary on GitHub (Feb 23, 2026).
Original GitHub issue: https://github.com/finmars-platform/finmars-core/issues/185

Originally assigned to: @HenkKalkwater on GitHub.

Summary

Speed up Community Edition installation by replacing migrations + post-setup with prebuilt, versioned Postgres dumps matched to the platform semantic version

Installer supports two flows

  • Default
    curl -fsSL https://finmars.com/install.sh | bash
    Restores base-vX.Y.Z.dump

  • With demo data
    curl -fsSL https://finmars.com/install.sh?demo_data=true | bash
    Restores base-demo-data-vX.Y.Z.dump

Motivation

Current install can take up to ~10 minutes largely due to running 200+ migrations and manual setup
Target is ≤ 60 seconds to a usable login

Dumps design

Part 1 Base dump

Filename
base-vX.Y.Z.dump

Contains

  • all migrations applied up to version X.Y.Z
  • no demo data
  • no marketplace preinstalls
  • minimal required baseline to boot and log in after post-restore credential and tenant updates

After restore the installer updates

  • admin username and password
  • space_code
  • realm_code
  • any other environment specific settings required for login and routing

Part 2 Demo-ready dump

Filename
base-demo-data-vX.Y.Z.dump

Contains

  • all migrations applied up to version X.Y.Z
  • PMS Core preinstalled and configured
  • demo data imported
  • platform ready to explore immediately

After restore the installer updates

  • admin username and password
  • space_code
  • realm_code
    No extra marketplace or demo steps required because they are already inside the dump

Installer behavior

Version selection

Installer determines X.Y.Z from the installed platform version
Then downloads the matching dump

  • default path uses base-vX.Y.Z.dump
  • demo_data=true uses base-demo-data-vX.Y.Z.dump

Integrity and safety

  • downloads over HTTPS only
  • verifies checksum, eg sha256
  • is idempotent, rerun should not break existing install
  • clear failure modes when dump for a version is missing, with a message that tells which version it looked for
  • Dumps can be placed in Finmars public S3 bucket as well and install.sh bash script

Optional knobs

  • recreate_db=true drop and recreate DB automatically
  • admin_user and admin_password for non interactive install
  • space_code and realm_code as params too, so it can be fully scripted

Acceptance criteria

Performance

  • base path completes in ≤ 60 seconds on a typical dev laptop with Docker already running
  • demo path completes in ≤ 60 seconds or as close as realistically possible, with a documented target

Correctness

After install completes

Base

  • services are up
  • user can log in
  • tenant settings (space_code, realm_code) reflect inputs
  • no demo data present

Demo

  • services are up
  • user can log in
  • PMS Core is installed and enabled
  • demo entities are present and visible in UI

Reliability

  • rerunning installer does not corrupt DB
  • dump download is verified by checksum
  • installer prints actionable logs and exits nonzero on failure

Security

  • no secrets embedded in public dumps
  • default admin password is user supplied or generated and printed once
  • no secrets echoed beyond what is necessary

Implementation tasks

Dump build pipeline

  • Define procedure to generate dumps for each release version

    • base-vX.Y.Z.dump after migrations only
    • base-demo-data-vX.Y.Z.dump after PMS Core install + demo import
  • Upload to public S3 bucket with versioned naming

  • Generate and publish checksum files

    • base-vX.Y.Z.dump.sha256
    • base-demo-data-vX.Y.Z.dump.sha256
  • Add CI job that restores each dump and runs smoke checks

    • health endpoints respond
    • login works
    • demo presence checks for demo dump

Installer script

  • Parse query params and optional overrides
  • Detect version X.Y.Z
  • Choose correct dump name
  • Download + verify checksum
  • Restore into Postgres
  • Apply post-restore updates for admin credentials and codes
  • Print final access info

Post restore update logic

  • Implement as SQL scripts or management command
  • Ensure correct password hashing
  • Ensure changes are minimal and deterministic

Definition of done

  • both install commands work end to end
  • install time targets are met
  • docs updated to recommend the one command install
Originally created by @falendary on GitHub (Feb 23, 2026). Original GitHub issue: https://github.com/finmars-platform/finmars-core/issues/185 Originally assigned to: @HenkKalkwater on GitHub. ## Summary Speed up Community Edition installation by **replacing migrations + post-setup** with **prebuilt, versioned Postgres dumps** matched to the platform semantic version Installer supports two flows * Default `curl -fsSL https://finmars.com/install.sh | bash` Restores `base-vX.Y.Z.dump` * With demo data `curl -fsSL https://finmars.com/install.sh?demo_data=true | bash` Restores `base-demo-data-vX.Y.Z.dump` ## Motivation Current install can take up to ~10 minutes largely due to running 200+ migrations and manual setup Target is **≤ 60 seconds** to a usable login ## Dumps design ### Part 1 Base dump **Filename** `base-vX.Y.Z.dump` **Contains** * all migrations applied up to version `X.Y.Z` * no demo data * no marketplace preinstalls * minimal required baseline to boot and log in after post-restore credential and tenant updates **After restore the installer updates** * admin username and password * `space_code` * `realm_code` * any other environment specific settings required for login and routing ### Part 2 Demo-ready dump **Filename** `base-demo-data-vX.Y.Z.dump` **Contains** * all migrations applied up to version `X.Y.Z` * PMS Core preinstalled and configured * demo data imported * platform ready to explore immediately **After restore the installer updates** * admin username and password * `space_code` * `realm_code` No extra marketplace or demo steps required because they are already inside the dump ## Installer behavior ### Version selection Installer determines `X.Y.Z` from the installed platform version Then downloads the matching dump * default path uses `base-vX.Y.Z.dump` * `demo_data=true` uses `base-demo-data-vX.Y.Z.dump` ### Integrity and safety * downloads over HTTPS only * verifies checksum, eg `sha256` * is idempotent, rerun should not break existing install * clear failure modes when dump for a version is missing, with a message that tells which version it looked for * Dumps can be placed in Finmars public S3 bucket as well and install.sh bash script ### Optional knobs * `recreate_db=true` drop and recreate DB automatically * `admin_user` and `admin_password` for non interactive install * `space_code` and `realm_code` as params too, so it can be fully scripted ## Acceptance criteria ### Performance * base path completes in **≤ 60 seconds** on a typical dev laptop with Docker already running * demo path completes in **≤ 60 seconds** or as close as realistically possible, with a documented target ### Correctness After install completes Base * services are up * user can log in * tenant settings (`space_code`, `realm_code`) reflect inputs * no demo data present Demo * services are up * user can log in * PMS Core is installed and enabled * demo entities are present and visible in UI ### Reliability * rerunning installer does not corrupt DB * dump download is verified by checksum * installer prints actionable logs and exits nonzero on failure ### Security * no secrets embedded in public dumps * default admin password is user supplied or generated and printed once * no secrets echoed beyond what is necessary ## Implementation tasks ### Dump build pipeline * Define procedure to generate dumps for each release version * `base-vX.Y.Z.dump` after migrations only * `base-demo-data-vX.Y.Z.dump` after PMS Core install + demo import * Upload to public S3 bucket with versioned naming * Generate and publish checksum files * `base-vX.Y.Z.dump.sha256` * `base-demo-data-vX.Y.Z.dump.sha256` * Add CI job that restores each dump and runs smoke checks * health endpoints respond * login works * demo presence checks for demo dump ### Installer script * Parse query params and optional overrides * Detect version `X.Y.Z` * Choose correct dump name * Download + verify checksum * Restore into Postgres * Apply post-restore updates for admin credentials and codes * Print final access info ### Post restore update logic * Implement as SQL scripts or management command * Ensure correct password hashing * Ensure changes are minimal and deterministic ## Definition of done * both install commands work end to end * install time targets are met * docs updated to recommend the one command install
Author
Owner

@falendary commented on GitHub (Feb 23, 2026):

@paktusov please assist @HenkKalkwater with bash script, s3 bucket and other any requests

<!-- gh-comment-id:3944287062 --> @falendary commented on GitHub (Feb 23, 2026): @paktusov please assist @HenkKalkwater with bash script, s3 bucket and other any requests
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/finmars-core#98
No description provided.