Open pgierz opened 1 month ago
This is a concerning issue first:
docker run -it questionary_demo:latest run questionary_demo
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
You are trying to shell into an x86 image from arm - I'm surprised it let's you get further than that, period. Try pulling down an image that matches the platform first to get rid of that message.
I thought this was iffy as well (the new Apple ARM chips make life more difficult than it needs to be), so I re-ran my bug on an Ubuntu 20.04. First, on bare-metal:
$ export SCIF_BASE=${HOME}/.local/scif
$ scif install questionary_demo.scif
$ scif apps
questionary_demo
$ scif run questionary_demo
[questionary_demo] executing /bin/bash /home/csys/pgierz/.local/scif/apps/questionary_demo/scif/runscript
... hangs, interactive prompts vanish into nirvana :-( ...
It does accept input. I can see when I Control-C out.
Then, I tried it in a Docker container. Note the warning about mismatched architecture doesn't occur here:
$ docker run -t interactive_scif:latest run questionary_demo
[questionary_demo] executing /bin/bash /scif/apps/questionary_demo/scif/runscript
? What's your first name
A bit better. The prompt is there, input is echoed (however, after several newlines), but the next prompt never shows up.
If that helps already to debug, great. I'll keep looking into it (maybe reproduce it with pure shell), but maybe you have an idea already?
For the second - any difference when you add -i
for "interactive" ?
$ docker run -it interactive_scif:latest run questionary_demo
Whoops, yes, sorry that was a typo in my comment. But for completeness, with interactive leads to:
docker run -it interactive_scif:latest run questionary_demo
? What's your first name
Paul? What's your first name Paul
? What's your secret?
***? What's your secret? ***
The next prompt appears, but input is not echoed as I type, and I only see the response (together with the prompt) after hitting return.
Maybe a thought: How are these messages generated?
pgierz@rz-006962:~$ docker run -it interactive_scif:latest run questionary_demo
[questionary_demo] executing /bin/bash /scif/apps/questionary_demo/scif/runscript
? What's your first name
In my terminal they pop up in pink and seem to come from here: https://github.com/vsoch/scif/blob/555bb059104d070697e495f5c54b6ac6c745a98c/scif/main/commands.py#L68-L75
If I am seeing it correctly, the bot
is this:
https://github.com/vsoch/scif/blob/555bb059104d070697e495f5c54b6ac6c745a98c/scif/logger/message.py#L339-L340
Maybe the colorise is messing up with the ending of the string?
@pgierz try inserting an IPython embed around like 80 (in commands.py) there and walking through the logic. I don't think scif was intended to receive input and that's the issue you are running into. If you have a suggestion for a PR / change I'd be happy to review it!
Hi @vsoch,
thanks for build
scif
, I've been using it recently for some container applications and I wish I discovered this years ago...I'm having some trouble getting interactivity to work correctly. For some reason, it seems like
stderr
is being swallowed? I'm not too sure what the issue is exactly, so I'll try to describe it.Let's say I have a simple Python program which uses some prompts to ask the user for questions. I use the very nice library
questionary
for this:Based upon the hello world example, I have this as a
scif
recipe:and finally this as a Dockerfile:
I initially thought the problem was in how I was using
docker
(or, on our HPC,singularity
), but theENTRYPOINT
that is active (the lower one) works fine. If I use the container entry point asscif
and then doI get:
I can still enter info, but I can't see anything I type.
I thought next: OK, maybe it is the containerised version. The same behaviour happens if I install the questionary demo directly onto a
scif
running on my laptop.Any hints about how to solve this would be really great!!
Cheers, Paul