Page MenuHomePhabricator

`mwscript-k8s --attach` seems to terminate IO after a few seconds without input
Closed, ResolvedPublicBUG REPORT

Description

$ mwscript-k8s --comment="bd808 exploring this new system" --attach -- shell.php --wiki=enwiki
⏳ Starting shell.php on Kubernetes...
skipping missing values file matching "/etc/helmfile-defaults/private/main_services/mw-script/eqiad.yaml"
skipping missing values file matching "values-eqiad.yaml"
skipping missing values file matching "/etc/helmfile-defaults/private/main_services/mw-script/eqiad.yaml"
skipping missing values file matching "values-eqiad.yaml"
Release "6blgm1ki" does not exist. Installing it now.
NAME: 6blgm1ki
LAST DEPLOYED: Tue Jul  9 23:15:39 2024
NAMESPACE: mw-script
STATUS: deployed
REVISION: 1
NOTES:


6blgm1ki        mw-script       1               2024-07-09 23:15:39.048323063 +0000 UTC deployed        mediawiki-0.6.36

⏳ Waiting for the container to start...
🚀 Job is running.
📜 Attaching to stdin/stdout:

   RuntimeException  Error waiting for execution loop.

$

Running eval.php instead of shell.php produces very similar results. Basically if you stop to think or read the output of your last command it is likely that the interactive session will terminate.

Event Timeline

I'd recommend using the dedicated REPL for this

sudo mw-debug-repl enwiki does indeed seem to work better. If this is the expected solution for running shell.php or eval.php, maybe it would be useful to have mwscript-k8s tell you "LOL, no" if you ask it to run either REPL script?

As an open question, what is the expected use case for mwscript-k8s --attach if this behavior of closing the input pipe is expected?

Tagging @RLazarus as I haven't really kept up with mwscript development

RLazarus claimed this task.

So, mwscript-k8s is still in medium-early development, some snags still expected and it shouldn't be anyone's primary workflow yet. There'll be wider announcements when it's ready for adoption (Soon TM but Not Yet TM); in the meantime, thanks for giving it a try and feedback is still welcome, just don't panic when it isn't ready to use full-time.

The early exit wasn't intended behavior -- and it actually wasn't input-related either, just a misconfigured liveness probe that should now be resolved.

As for mw-debug-repl vs. mwscript-k8s shell.php -- they both work, slightly differently. mw-debug-repl attaches to an existing mw-debug pod; mwscript-k8s spins up a new pod that goes away when you're done with it. Often those will both suit your needs fine, and you can use either. mw-debug-repl is designed specifically for shell.php and eval.php; mwscript-k8s is designed for maintenance scripts generally, with --attach meant to support scripts like purgeList.php reading from stdin -- so that means it also works fine for shell.php and eval.php.