Skip to content

Deploy/binary release#58

Merged
surafelfikru merged 107 commits into
devfrom
deploy/binary-release-sequential-test
Jan 29, 2026
Merged

Deploy/binary release#58
surafelfikru merged 107 commits into
devfrom
deploy/binary-release-sequential-test

Conversation

@DagmawiKK

Copy link
Copy Markdown
Collaborator

Description

This pull request introduces significant improvements to the build, packaging, and configuration of the MeTTa-KG project, with a focus on supporting multiple database backends, automating frontend and binary asset integration, and enhancing release workflows. The most important changes are grouped below.

Build and Release Automation:

  • Added .github/workflows/release.yml to automate building, packaging, and releasing using cargo-dist, supporting multi-platform builds and GitHub Releases.
  • Added .github/workflows/mork-upload.yml to build and upload MORK server binaries for release, including artifact staging and publishing to GitHub.

Project Structure and Asset Management:

  • Renamed the main crate from api to metta-kg, updated metadata, added a custom build.rs to automate frontend build (using pnpm) and download the MORK server binary during build, ensuring required assets are present. [1] [2]

Database Backend Support:

  • Refactored Cargo.toml to support both SQLite and PostgreSQL via feature flags, added relevant dependencies, and split migrations into backend-specific directories. [1] [2]
  • Added SQLite migration scripts for table creation (up.sql), teardown (down.sql), and initial data seed (up.sql/down.sql). [1] [2] [3] [4]
  • Updated PostgreSQL migration to fix foreign key and cascading delete for the tokens table.

CLI Improvements:

  • Introduced a new CLI definition in src/cli.rs using clap, allowing configuration of database URLs and service endpoints.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I have read the Contributing Guidelines.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

- Add init_database_url to set DB URL via CLI
- Update establish_connection to use env vars if URL not set
- Ensure proper connection for standalone binary execution
- Add Cli struct using clap::Parser for command-line args
- Support database_url, address, and optional port
- Implement helper database_url() to fallback to env var
- Parse and validate address with fallback to localhost
- Default port to 8000 when not provided
- Merge address and port into Rocket config
- Add startup log for clarity
- Parse CLI arguments using clap
- Initialize database URL for connection setup
- Launch Rocket instance with configured CLI options
- Initialize dotenv for environment variables
- Parse CLI options for configuration
- Initialize database URL before Rocket startup
- Launch Rocket server asynchronously
- Parse CLI for address and port configuration
- Serve static files from ui-dist directory using Rocket FileServer
- Default port set to 3000 for frontend
- Log server address and port on startup
- Include stable mork-server binary under api/mork-bin for distribution
- Exclude from build process since it’s precompiled
- Ensure binary is committed for inclusion in release artifacts
…dling

- Run npm install and npm run build for frontend during cargo build
- Copy compiled dist output into api/ui-dist directory
- Ensure ui-dist is always refreshed for accurate packaging
- Improves automation for unified binary and frontend builds
- Adjust rootNodes and ref props for SpaceGraph component
- Ensure canvasHandle correctly receives and sets elements
- Resolves build errors in frontend Load.tsx file
…aries

- set build.rs for frontend build
- mark package as preferred for cargo-dist
- add packages and dependecies for this binary work
- define workspace members and targets
- configure shell installer and release updater
- add mork-server as extra artifact for distribution
- plan and build local and global artifacts
- handle publishing and GitHub release creation
- cache dist and manage scratch storage for artifacts
- Introduced CLI args with sensible defaults for all service URLs.
- Improves configurability without needing hardcoded endpoints.
…-dist via FileServer

- Extracted IP and port dynamically from mettakg_api_url argument.
- Mounted ui-dist folder to serve frontend assets directly.
…inary architecture

- Deleted api.rs and frontend.rs under src/bin to unify server entrypoint.
- Simplified build structure for easier release and maintenance.
…awned within metta-kg binary

- Removed redundant mork-server artifact from dist-workspace.toml.
- Transitioned to internal binary spawning for release workflow.
- Adjusted Cargo configuration for a single combined binary release.
- Prepared workspace for simplified binary management.
@surafelfikru surafelfikru merged commit 1a1f7a2 into dev Jan 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants