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 "Performers" 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.5)

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.setup()
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.6.tar.gz (13.9 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.6-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for naranhi-0.1.6.tar.gz
Algorithm Hash digest
SHA256 072e9cca70618f29cb0721083d90ebdb51a6bdb37e1933099b5746fbd273eed4
MD5 145b9c3631117028c5742a081ceb6d10
BLAKE2b-256 203c0cea431c23221cf5b9c1a378c82e9abe294f25ca8257c5d6400d97c6b3ca

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for naranhi-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 34b401a6faf90868437ab6704c0a72a4ed74d24def6319d170f926e02a582387
MD5 5d387bba8e5fbd8543f3bf6abfd328a1
BLAKE2b-256 7d0195cde2907edd6fb8a653d02957cdd4ab1f167b6c3ec16fced63efbc5a159

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