Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2.8 KiB
NP Replica
This project provides a local Chinese web replica of the core NUPACK analysis/input workflow.
Run
docker compose up --build -d
Open http://127.0.0.1:18765.
Reverse Proxy
The service listens on port 18765. You can later reverse proxy np.lihato.icu to this port from your public server.
Endpoints
GET /GET /healthGET /api/examplePOST /api/analyzePOST /api/jobsGET /api/jobs/<job_id>
Persistent Shares
Shared result links are stored in Redis when NP_REDIS_URL is enabled. The compose file maps Redis data to ./runtime/redis and enables AOF/RDB persistence, so shares survive container recreation and service restarts. Back up or migrate ./runtime/redis if you move the deployment.
Notes
-
tubemode supports strand concentrations andSetSpec(max_size=...). -
complexmode supports explicit complex definitions such asA+B. -
Pair matrices are returned as a preview block to keep responses manageable.
-
The Docker image compiles ViennaRNA
RNAplotfromrna/ViennaRNA-2.7.2.tar.gzand embeds SVG structure plots into MFE results. -
Multistrand MFE plots now use a split-strand layout by default when a structure contains
+, withRNAplotretained as the fallback path. -
The web UI now supports Chinese and English switching, browser-side history, result export, and async polling for submitted jobs.
-
Docker now starts three services:
np-replica,np-worker, andredis. -
Async jobs use Redis-backed storage and queueing when
NP_REDIS_URLis configured; otherwise the app falls back to the older in-memory mode. -
The browser-facing API and page behavior stay the same after enabling Redis-backed jobs.
-
Worker concurrency is controlled by
NP_WORKER_CONCURRENCYand defaults to2. -
Per-job native thread usage is capped by
NP_PER_JOB_THREAD_LIMITand defaults to1to prevent a single analysis from monopolizing the machine. -
NP_STRUCTURE_PLOT_MODEsupportsauto(default),split, andrnaplot. -
Static pages are served with ETag-based browser caching; JSON API responses remain uncached.
-
The force-directed structure viewer lazy-loads D3 only when that view is opened, so the initial page load is not blocked by the external CDN.
-
/healthuses Redis queue length plus a running-job set instead of scanning every historical job on each poll.现在
docker-compose.yml面向 64 核 / 64G WSL 服务器的并发策略是:- 最多同时跑 16 个任务
- 每个任务最多用 4 个计算线程
- 后续任务进入队列等待
- 理论上最多占用约 64 个 native 计算线程,避免 16 × 8 这类过度超卖
如果后面你发现机器还会被压满,最直接的调法就是在 docker-compose.yml 里继续压:
- 把 NP_WORKER_CONCURRENCY 改小
- 或保持并发不变,把 NP_PER_JOB_THREAD_LIMIT 改成 2 或 1