Commit 051a64d
Saran-386
Fix(workflow): Refactor build/run flow and sandbox isolation
Addresses a critical flaw in the Cortex workflow where "cortex run" was
not leveraging the pre-warmed environment from "cortex build", leading
to redundant setups and hangs.
Key changes include:
- Removed the "cortex init" command, simplifying the workflow.
- Reworked "cortex build" to be authoritative: it now fully prepares
the execution environment, including Python dependencies and model setup,
in a persistent cache.
- Reworked "cortex run" to execute directly from this cached environment,
eliminating ephemeral unpacking and redundant dependency resolution.
- Implemented a graceful fallback for cgroup/namespace isolation:
The runtime now checks for root privileges and conditionally applies
sandbox isolation. In non-root environments, it gracefully proceeds
without cgroup/macvlan isolation to prevent hangs, logging a warning.
This ensures core functionality without requiring elevated privileges for basic execution.
This also fixes deadlocks related to macvlan synchronization when isolation is bypassed.
This ensures a faster, more robust, and predictable execution experience
for Cortex bundles.1 parent 441adf0 commit 051a64d
4 files changed
Lines changed: 147 additions & 263 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | 80 | | |
90 | 81 | | |
91 | 82 | | |
| |||
94 | 85 | | |
95 | 86 | | |
96 | 87 | | |
97 | | - | |
| 88 | + | |
98 | 89 | | |
99 | | - | |
100 | | - | |
| 90 | + | |
| 91 | + | |
101 | 92 | | |
102 | 93 | | |
103 | 94 | | |
| |||
128 | 119 | | |
129 | 120 | | |
130 | 121 | | |
131 | | - | |
| 122 | + | |
132 | 123 | | |
133 | 124 | | |
134 | 125 | | |
135 | 126 | | |
136 | 127 | | |
137 | 128 | | |
138 | 129 | | |
139 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
140 | 134 | | |
141 | 135 | | |
142 | 136 | | |
143 | 137 | | |
144 | 138 | | |
145 | 139 | | |
146 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
147 | 144 | | |
148 | 145 | | |
149 | 146 | | |
| |||
191 | 188 | | |
192 | 189 | | |
193 | 190 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | 191 | | |
205 | 192 | | |
206 | 193 | | |
| |||
0 commit comments