unoverse 0.1.114 → 0.1.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/operator/docker-compose.yml +12 -0
- package/operator/lib/start.sh +28 -1
- package/package.json +1 -1
|
@@ -169,6 +169,12 @@ services:
|
|
|
169
169
|
# containers connect to the container IP); the loopback-only port mappings above and
|
|
170
170
|
# the Docker network are the boundary here.
|
|
171
171
|
- UNOVERSE_INTERNAL_BIND=0.0.0.0
|
|
172
|
+
# THE FLAG TRAVELS WITH THE ISSUER. .env could say AUTH_ENABLED=false and no
|
|
173
|
+
# container ever saw it: compose forwarded the issuer and audience and not the flag,
|
|
174
|
+
# so the server defaulted to enabled — correctly — and refused to boot on a local
|
|
175
|
+
# universe with no OIDC. The developer's own setting was invisible to the thing it
|
|
176
|
+
# configures.
|
|
177
|
+
- AUTH_ENABLED=${AUTH_ENABLED:-}
|
|
172
178
|
- AUTH_ISSUER=${AUTH_ISSUER:-}
|
|
173
179
|
- AUTH_AUDIENCE=${AUTH_AUDIENCE:-}
|
|
174
180
|
# WHERE THE MARKETPLACE IS. The catalogue this universe can install from, served as
|
|
@@ -277,6 +283,12 @@ services:
|
|
|
277
283
|
- REDIS_PASSWORD=${REDIS_PASSWORD:-}
|
|
278
284
|
- REDIS_TLS=${REDIS_TLS:-}
|
|
279
285
|
- REDIS_NAMESPACE=${REDIS_NAMESPACE:-}
|
|
286
|
+
# THE FLAG TRAVELS WITH THE ISSUER. .env could say AUTH_ENABLED=false and no
|
|
287
|
+
# container ever saw it: compose forwarded the issuer and audience and not the flag,
|
|
288
|
+
# so the server defaulted to enabled — correctly — and refused to boot on a local
|
|
289
|
+
# universe with no OIDC. The developer's own setting was invisible to the thing it
|
|
290
|
+
# configures.
|
|
291
|
+
- AUTH_ENABLED=${AUTH_ENABLED:-}
|
|
280
292
|
- AUTH_ISSUER=${AUTH_ISSUER:-}
|
|
281
293
|
- AUTH_AUDIENCE=${AUTH_AUDIENCE:-}
|
|
282
294
|
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
|
package/operator/lib/start.sh
CHANGED
|
@@ -151,10 +151,19 @@ cmd_start() {
|
|
|
151
151
|
local running=0
|
|
152
152
|
local total=0
|
|
153
153
|
i=0
|
|
154
|
+
# A RESTARTING CONTAINER IS NOT A RUNNING ONE. `--filter status=running` counts a container
|
|
155
|
+
# that is crash-looping, because between crashes it genuinely is running — so `start`
|
|
156
|
+
# announced "All 5 services running" while unoverse and memory were dying on boot every few
|
|
157
|
+
# seconds, and the developer went looking at their browser instead of the logs.
|
|
158
|
+
#
|
|
159
|
+
# Counting restarts as failures also means the loop keeps waiting instead of breaking early
|
|
160
|
+
# on a lie, which gives a slow-but-healthy boot the time it needs.
|
|
161
|
+
local restarting=0
|
|
154
162
|
while [ $attempts -lt 15 ]; do
|
|
155
163
|
running=$(docker compose -f "$ROOT/docker-compose.yml" ps --format "{{.Name}}" --filter "status=running" 2>/dev/null | wc -l | tr -d ' ')
|
|
164
|
+
restarting=$(docker compose -f "$ROOT/docker-compose.yml" ps -a --format "{{.Status}}" 2>/dev/null | grep -ci "restarting" | tr -d ' ')
|
|
156
165
|
total=$(docker compose -f "$ROOT/docker-compose.yml" ps --format "{{.Name}}" 2>/dev/null | wc -l | tr -d ' ')
|
|
157
|
-
if [ "$running" -eq "$total" ] && [ "$total" -gt 0 ]; then
|
|
166
|
+
if [ "$running" -eq "$total" ] && [ "$total" -gt 0 ] && [ "$restarting" -eq 0 ]; then
|
|
158
167
|
break
|
|
159
168
|
fi
|
|
160
169
|
local c="${spin:i%${#spin}:1}"
|
|
@@ -165,6 +174,24 @@ cmd_start() {
|
|
|
165
174
|
done
|
|
166
175
|
|
|
167
176
|
echo ""
|
|
177
|
+
# NAME WHAT IS CRASHING, AND WHY. A restart loop is the one failure whose cause is always
|
|
178
|
+
# in the logs and never on screen, so print the last line of each one rather than leaving
|
|
179
|
+
# the developer to find `docker compose logs` themselves.
|
|
180
|
+
if [ "${restarting:-0}" -gt 0 ]; then
|
|
181
|
+
printf "\r ${RED}✗${NC} $restarting service(s) crashing on boot \n"
|
|
182
|
+
echo ""
|
|
183
|
+
docker compose -f "$ROOT/docker-compose.yml" ps -a --format "{{.Name}}\t{{.Status}}" 2>/dev/null \
|
|
184
|
+
| grep -i restarting | awk -F'\t' '{print $1}' | while read -r svc; do
|
|
185
|
+
local_reason=$(docker compose -f "$ROOT/docker-compose.yml" logs --tail=40 "${svc##*-}" 2>/dev/null \
|
|
186
|
+
| grep -iE "^.*(Error|error:)" | tail -1 | sed -E 's/^[^|]*\| *//')
|
|
187
|
+
echo -e " ${RED}•${NC} ${BOLD}$svc${NC}"
|
|
188
|
+
[ -n "$local_reason" ] && echo -e " ${DIM}${local_reason}${NC}"
|
|
189
|
+
done
|
|
190
|
+
echo ""
|
|
191
|
+
info "Full output: ${BOLD}unoverse logs <service>${NC}"
|
|
192
|
+
echo ""
|
|
193
|
+
return 1
|
|
194
|
+
fi
|
|
168
195
|
if [ "$running" -eq "$total" ] && [ "$total" -gt 0 ]; then
|
|
169
196
|
printf "\r ${GREEN}✓${NC} ${DIM}Health checks passed${NC} \n"
|
|
170
197
|
echo ""
|
package/package.json
CHANGED