Self-Hosted Hub¶
Module: sc_neurocore.hub
Primary API: write_hub_bundle(...)
CLI: sc-neurocore hub-init
The self-hosted hub generator writes an offline-first Docker Compose bundle for local SC-NeuroCore Studio and opt-in benchmark execution. It is a bundle generator, not a hosted service and not a remote registry.
Generated Artefacts¶
from sc_neurocore.hub import HubBundleConfig, write_hub_bundle
paths = write_hub_bundle(
"build/hub",
HubBundleConfig(
bind_host="127.0.0.1",
studio_port=8001,
image="sc-neurocore-hub:local",
offline=True,
),
)
The output directory contains:
| Path | Purpose |
|---|---|
docker-compose.yml |
Studio and benchmark-runner services |
.env.example |
Offline/cache/model environment defaults |
hub_manifest.json |
Deterministic service, storage, network, and hardening contract |
model_zoo_index.json |
Built-in plugin, network-config, and pretrained-weight index |
benchmark_plan.json |
Opt-in benchmark-runner contract |
README.md |
Local operator instructions |
cache/ |
Writable local cache mount |
models/ |
Read-only user model mount |
benchmarks/results/ |
Writable benchmark output mount |
Security And Operations Contract¶
The generated Studio service defaults to 127.0.0.1, so it is not exposed
outside the host unless the operator explicitly changes --bind-host.
Offline mode sets SC_NEUROCORE_HUB_OFFLINE=1, HF_HUB_OFFLINE=1, and
TRANSFORMERS_OFFLINE=1; --online clears those generated flags.
Compose hardening in the generated bundle:
| Control | Setting |
|---|---|
| Runtime user | Non-root, inherited from deploy/Dockerfile |
| Root filesystem | read_only: true |
| Writable mounts | Cache, model/result directories as needed, plus /tmp tmpfs |
| Privilege escalation | no-new-privileges:true |
| Image pulling | pull_policy: never |
| Readiness | Studio /api/health healthcheck |
| Benchmarks | Opt-in benchmark profile |
CLI¶
sc-neurocore hub-init --output build/hub --port 8001
docker compose -f build/hub/docker-compose.yml up studio
Optional flags:
| Flag | Default | Meaning |
|---|---|---|
--bind-host |
127.0.0.1 |
Host address used for Studio port publishing |
--port |
8001 |
Studio service port |
--hub-image |
sc-neurocore-hub:local |
Generated Compose image tag |
--online |
unset | Generate online-mode environment flags |
Boundaries¶
The hub bundle does not build or publish container images by itself, does not submit hardware or cloud jobs, and does not claim benchmark results until the operator runs the opt-in benchmark profile. Real availability still depends on the container build and the package being installed with the Studio runtime dependencies.
API¶
sc_neurocore.hub
¶
Self-hosted hub bundle generation.
HubBundleConfig
dataclass
¶
Configuration for a local self-hosted hub bundle.
Source code in src/sc_neurocore/hub/bundle.py
| Python | |
|---|---|
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
build_benchmark_plan(config=None)
¶
Build the benchmark-runner plan included in the hub bundle.
Source code in src/sc_neurocore/hub/bundle.py
| Python | |
|---|---|
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
build_hub_manifest(config=None)
¶
Build a deterministic manifest for a self-hosted hub bundle.
Source code in src/sc_neurocore/hub/bundle.py
| Python | |
|---|---|
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | |
build_model_zoo_index()
¶
Build a deterministic model-zoo index for hub manifests.
Source code in src/sc_neurocore/hub/bundle.py
| Python | |
|---|---|
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |
write_hub_bundle(output_dir, config=None)
¶
Write a local Docker Compose hub bundle and return generated paths.
Source code in src/sc_neurocore/hub/bundle.py
| Python | |
|---|---|
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | |