-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow running detached app commands and follow logs by container ID #906
base: main
Are you sure you want to change the base?
Conversation
687f08b
to
1cac6e5
Compare
1cac6e5
to
d2edf8d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @aliismayilov,
Sorry for the delay in getting to this! I think we just need some checks for invalid option combinations and we should be good to go!
Also it looks like there are some test failures - |
6a21493
to
a978ed2
Compare
Thanks for looking into this! I've added an incompatibility check. See if it makes sense.
Not anymore! I must've missed them in the avalanche of log lines 😄 |
I just realized that there will be no output from a detached container in the logs. I created a separate issue: #1154 |
this is useful for long running rake tasks or scripts that can be run without having to keep open connection to the server. Example: ``` kamal app exec 'bin/rails db:backfill_task' --detach ```
a978ed2
to
765e441
Compare
5a7fdb7
to
fb1b4bf
Compare
fb1b4bf
to
bc049e7
Compare
@djmb I've updated the pull request with more changes to support logs inspection for detached containers. In short:
I've also updated the pull request description. |
This is useful for long running rake tasks or scripts that can be run without having to keep an open connection to servers.
The command that starts a detached container exits immediately and the output leaves the container ID that can be used for following the logs or investigating them later. To support this, I've also extended the
kamal logs
command with--container-id
option.Example:
To support logs inspection, I've also applied kamal logging config to all newly started
app exec
containers. This resolves #1154.