fix(clp-package): Disable Docker interactive mode when running sbin scripts non-interactively (fixes #1566).#1567
Conversation
… scripts non-interactively (fixes y-scope#1566).
WalkthroughThe changes introduce a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (10)
💤 Files with no reviewable changes (1)
🧰 Additional context used🧠 Learnings (8)📓 Common learnings📚 Learning: 2025-10-13T03:32:19.293ZApplied to files:
📚 Learning: 2025-10-20T21:05:30.417ZApplied to files:
📚 Learning: 2025-07-07T17:43:04.349ZApplied to files:
📚 Learning: 2025-07-01T14:52:02.418ZApplied to files:
📚 Learning: 2025-07-01T14:51:19.172ZApplied to files:
📚 Learning: 2025-07-07T17:41:15.655ZApplied to files:
📚 Learning: 2025-07-23T09:54:45.185ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (9)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| stdin_open: true | ||
| tty: true |
There was a problem hiding this comment.
These lines are removed to avoid confusions. No matter what values we set here, they would only affect command like docker compose up but not docker compose run.
Reference:
Here's the source code of docker compose run
https://github.com/docker/compose/blob/c37ede62dbb6485c4d5e297db9134631e9b2095e/cmd/compose/run.go#L88-L89
… scripts non-interactively (fixes y-scope#1566). (y-scope#1567)
Description
Problem
When
sbinscripts were run in the background (e.g.,./sbin/compress.sh ~/samples/hive-24hr &), the Docker container's output (stdout/stderr) was not being forwarded to the terminal. The job would run successfully, but users couldn't see any progress, logs, or errors.This happened because:
docker compose runhasstdin_open: trueandtty: trueenabled by default no matter what value is set (undocumented) indocker-compose.runtime.yaml, not to mention we should have setstdin_open: false.&, the shell is non-interactive and stdin is detachedSolution
stdin_open: trueandtty: truefromdocker-compose.runtime.yaml(they default to false)CLP_COMPOSE_RUN_EXTRA_FLAGSarray in.common-env.shthat detects non-interactive shells using[[ $- != *i* ]]--interactive=falseflag to alldocker compose runcommandssbinscripts to use"${CLP_COMPOSE_RUN_EXTRA_FLAGS[@]}"in their compose commandsChecklist
breaking change.
Validation performed
Observed that:
start-clp.shandstop-clp.sh, no matter when running with or without&.compress.shwas run with&, stdin was detached and therefore i could quickly run anothercompress.shcommand. The outputs of those commands were printed to the console.Summary by CodeRabbit
Release Notes
New Features
Changes