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
Let commands in %startscript section ouput to terminal when starting an instance #2506
Comments
Please could you describe in detail exactly what behaviour you would expect? Specifically:
Due to the way instances are implemented, it is not necessarily trivial to implement a Because you can simply |
Thank you for your reply. As for your concerns:
I agree that
But a good news is that the interference is not that common. What users want to see (or expect to see) is usually a banner of the software (like name and version), confirmation message that the service is started successfully or failed, as well as some important configuration information like port being listened. Such a message are stdout and is output to terminal only at the beginning of the service. Likewise, if the service exits, there could be some stdout message showing that the service exits successfully, as well as possibly what resources are released. Both these cases will not interfere with terminal. What you are concerning about is the output of service in the middle of other work running on terminal. But if there are any such messages, it is highly likely these messages are errors which should be displayed in stderr, not in terminal (aka stdout) to cause any interference. Of course, there could still be stdout messages in the middle from a service, like a web server which reports requests it receives. But again, that's the behavior of the command when it's running normally in Linux (not in container). The user should expect that interference and hence no complaints. For cases like this, I usually leave the terminal open and open a new terminal to do other jobs. Or, if the user really wanna disable output, s/he can remove the I think forwarding messages destined to stdout to both stdout and a file is not hard. It is an average exercise of Unix programming, cf. e.g., "Advanced Programming in the Unix Environment", Third Edition. By W. Richard Stevens and Stephen A. Rago, Addison Wesley. 2013. |
Thanks for the detail.
Our expectation of how Singularity is used is that Note that you can do a I can see your point for some cases, but I don't think it's necessarily the most common expectation for an instance. For those who might read this and are also familiar with Docker, instances are like starting a docker container without We can leave this issue open to see if it attracts support from others, or if anyone is interested in contributing the code change to implement the feature.
Agreed ...
Unfortunately it's not as easy dealing with stdout / stderr of containers as simple processes. The container has to start in the background, completely detached from the terminal, with some kind of attachment to the log files, that will be maintained at all times. Then, the We actually have some code that does pieces of this flow for the OCI-mode (but not the native runtime / instances) e.g. here: https://github.com/sylabs/singularity/blob/main/internal/pkg/runtime/launcher/oci/oci_attach_linux.go For instances, we currently just replace the Stdout / Stderr file descriptors with file descriptors for log files. There is no persistent process redirecting output through a buffer, nor a socket that we can attach to - so it's actually a considerable amount of work needed to implement this. https://github.com/sylabs/singularity/blob/main/internal/pkg/instance/instance_linux.go#L271 |
I'd close it. |
Is your feature request related to a problem? Please describe.
Ticket #2501
Describe the solution you'd like
I believe most of users want to see the output message of the running command in terminal real-time. So please let the commands in %startscript section output to the terminal, at least give users an option like --no-redirect to see the message in terminal when starting an instance.
Again, please don't close my ticket in such a hurry. Please let other people listen to me. I just want to ask Singularity to work the way a normal user would expect. That you think unreasonable does not mean it is really unreasonable.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: