Page MenuHomePhabricator

[webservice,toolforge-cli] Make `webservice shell` a standalone tool
Open, MediumPublic

Description

Right now webservice has a very handy subcommand webservice shell to launch a pod running a specific image in the Kubernetes cluster. Since the same feature is very useful when working with jobs-framework too, it'd be nice if the command name would not suggest it was a webservice-specific feature.

Related Objects

Event Timeline

dcaro renamed this task from Make `webservice shell` a standalone tool to [webservice,toolforge-cli] Make `webservice shell` a standalone tool.Mar 13 2024, 9:44 AM
dcaro triaged this task as Medium priority.
dcaro moved this task from Backlog to Ready to be worked on on the Toolforge board.

My solution for tool persondata:

in ~/.profile I added the following line:

[ -z "$PERSONDATA_PORT" ] && trap "kubectl delete pods -l 'app.kubernetes.io/component=webservice-interactive'" 0 15

So when I log out all webshells get killed.

However if one need for whatever reason a permanent webshell, this is no solution

We might want to run a continuous job using jobs-api, and then kubectl exec into it instead of using kubectl run directly (so jobs-api handles the creation of the pod and such).

One of the features of webservice shell that I worked pretty hard to establish is that you can create command lines like webservice python3.11 shell -- webservice-python-bootstrap --fresh to start a new Pod with a given runtime container, attach local stdin/stdout to that container, execute a given command within the container, and stop the Pod. The particular example given is running a script that we ship inside of the Python containers that manages the $HOME/www/python/venv virtual environment expected by the Python webservice containers.

We might want to run a continuous job using jobs-api, and then kubectl exec into it instead of using kubectl run directly (so jobs-api handles the creation of the pod and such).

That was the request in https://phabricator.wikimedia.org/T410138, which was closed as a duplicate of this, so I assume that is the direction this is committed to now.