Skip to main content

Node-centric Async Runtime for Atomic Networked Hierarchical Infrastructure

Project description

Naranhi

Side-by-Side Orchestration

Naranhi (Korean for "Side-by-Side") is a lightweight, declarative framework designed to bridge the gap between local development and massive 2,500+ subject cluster execution. By maintaining a strict boundary between Infrastructure and Science, Naranhi ensures your pipelines are dataset-agnostic, reproducible, and "cluster-aware" without being "cluster-dependent."

🏛️ The Orchestral Philosophy

1. The Score (sinfonia.yaml)

The declarative blueprint defining sensitive information, tasks, and communication channels.

  • Decoupled metadata: Keep processing parameters via pipeline_metadata seprate from execution logic.
  • Integrated Communication: Built-in Slack notifications via communication to monitor swarms in real-time.

2. The Maestro (Conductor)

A sequential, signal-based controller that manages "Wave Barriers".

  • The Great Freeze: Automatically clones and anchors your configuration to every analysis session for perfect provenance.
  • Wave Synchronization: Ensures all parallel "Soloists" in a wave finish successfully before proceeding to the next movement.

3. The Performer (src/task/*.py)

Pure, CLI-ready Python scripts. Using the TaskContext manager or Performer, your science logic remains clean while Naranhi handles the heavy lifting:

  • Atomic Logging: Flat-file logging (O(1) I/O) optimized for high-performance filesystems.
  • Automatic Signaling: Transparently emits task.finish or task.fatal signals to the MNaestro.
  • Error Propagation: Immediate Slack alerts if a soloist fails in the middle of a swarm.

🚀 Quick Start(0.1.4)

1. Define your Score (config/the.yaml)

pipeline_metadata:
  name: "ANALYSIS"

communication:
  slack_webhook: "https://hooks.slack.com/..."

analysis_metadata:
  paths:
    root: "/data/project/the_project"

tasks:
  - id: "00"
    name: "load_data"
    script: "the.py"
    wave: 1

2. Write your Soloist (src/tasks/the.py)

option 1. using @nrh.Performer

import naranhi as nrh
@nrh.Performer()
def main(logger, config, log_dir):
    ...

option 2. using with nrh.TaskContext() as (logger, config, log_dir): statement

import naranhi as nrh

def main():
    # The TaskContext handles logging, signals, and Slack automatically
    with nrh.TaskContext() as (logger, config, log_dir):
        logger.info("Performing Science...")
        # Your neuroimaging logic here
        
if __name__ == "__main__":
    main()

3. Conduct the Symphony

import naranhi as nrh

# Initialize the Maestro with your score
Maestro = nrh.Conductor("config/the.yaml")
Maestro.seup()
Maestro.play()

🛠️ Installation

uv pip install naranhi

⚖️ License

Copyright (c) 2026 JiHoon Kim. All rights reserved. Proprietary and confidential.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

naranhi-0.1.4.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

naranhi-0.1.4-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file naranhi-0.1.4.tar.gz.

File metadata

  • Download URL: naranhi-0.1.4.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.15

File hashes

Hashes for naranhi-0.1.4.tar.gz
Algorithm Hash digest
SHA256 15a110429dd5b05c35f89e64b32845d83641d7312b5dd3063722faad89d7cedd
MD5 e838cd1999deff98a8724fafabc595c1
BLAKE2b-256 260135ba2e3dd65fc2711ec7eef0468fceb4bf733317724ba5e0f83a5bfc1ebf

See more details on using hashes here.

File details

Details for the file naranhi-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: naranhi-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.15

File hashes

Hashes for naranhi-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d6da7ae5d7488448bd7aad7f96f5f2be72956b4a59b98913fa4fe8e035e92b05
MD5 1dd42acc1d2f7776d9b83dae2eabf045
BLAKE2b-256 93b63ebc43ba6e91c7f87f331e09e97911e1176e607118662ac0dbddecd465f1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page