Page MenuHomePhabricator

[jobs-api] add toolforge jobs shell feature
Closed, DuplicatePublic

Description

toolforge webservice as a shell option. As part of the move to toolforge jobs, we should implement this feature for toolforge jobs.

Questions to anwer:

  • how is this implemented in toolforge webservice?
  • should this allow execing into a running job? how do we do that?

Related Objects

Event Timeline

how is this implemented in toolforge webservice?

https://gitlab.wikimedia.org/repos/cloud/toolforge/tools-webservice/-/blob/ec52ccc70d18d58a7c6460efc18371080dfeb270/toolsws/backends/kubernetes.py#L799-839

should this allow execing into a running job? how do we do that?

The webservice shell command launches a new Pod to attach to rather than giving you a way to attach to an existing Pod. https://wikitech.wikimedia.org/wiki/User:BryanDavis/Kubernetes#Attach_to_a_running_pod describes one way to attach to an existing single container pod. I don't think it would be necessary to make this core toolforge jobs functionality.

From an end user experience point of view, I think the command being toolforge shell rather than toolforge jobs shell would make more sense. Today the current webservice shell naming confuses people because of "webservice" being part of the command UI.

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.