OSC plugins#3
Conversation
When an MCP request to OpenStack is received with incorrect arguments we fail to return the error in the `stderr` field so it's always an empty string. This is because argparse ignores the `stderr` argument we pass to the shell itself. With this patch we fix it by ensuring we redirect the whole stderr when running the command.
|
/ok-to-test |
|
I have removed the WIP as I have tried it with openstack-k8s-operators/lightspeed-operator#19 using this image quay.io/geguileo/rhos-mcps |
umago
left a comment
There was a problem hiding this comment.
Few nits, otherwise looks good
We are currently seeing some errors logged multiple times. With this patch we remove the cliff log handlers when running commands removing duplicated errors on the console.
Some LLMs don't understand that available tools are not shell commands, so they send shell commands with pipes. In this patch we try to guard against such explicitly errors by explicitly stating that the tools are not shell.
The `get-crc-creds.sh` script expects the currently selected project to be `openstack`, but that's unlikely to happen if we are doing things on the `openstack-lightspeed` namespace. In this patch we update the script so it explicit sets the namespace on the `oc` commands.
Akrog
left a comment
There was a problem hiding this comment.
I have made requested changes and I've also fixed another problem the container had with the dependencies of our pyproject.toml dependencies, which we want to take from the base image.
|
Error in building the image is likely a Will change the approach ( |
This commit changes our container image because it's currently missing almost all the OSC plugins, unlike the `openstackclient` image. In this patch we ensure the image includes the plugins by: * Adding the plugins to the project dependencies in the `osc-plugin` dependency group. * Changing the source for all our openstack related packages, so instead of using PyPi to install them we use RPMs by using the `openstackclient` container image as the base. * We use the Centos 10 base image of the `openstackclient` container so it has Python 3.12 instead of 3.9 that is in the Centos 9 container (quay.io/podified-antelope-centos9/openstack-openstackclient:current-podified) because the MCP python library has a minimum requirement of Python 3.10. This not only resolves the missing plugins, but also ensures that the packages used are not coming from PyPi, facilitating a more secure downstream release. Available plugins are sent as part of the `openstack-cli` MCP tool description to help LLMs know what is installed, as they may assume only basic commands are available. We also update the allowed commands on read-only mode.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Akrog, umago The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
d0164d6
into
openstack-k8s-operators:main
This commit changes our container image because it's currently missing
almost all the OSC plugins, unlike the
openstackclientimage.In this patch we ensure the image includes the plugins by:
Adding the plugins to the project dependencies in the
osc-plugindependency group.
Changing the source for all our openstack related packages, so instead
of using PyPi to install them we use RPMs by using the
openstackclientcontainer image as the base.We use the Centos 10 base image of the
openstackclientcontainer soit has Python 3.12 instead of 3.9 that is in the Centos 9 container
(quay.io/podified-antelope-centos9/openstack-openstackclient:current-podified)
because the MCP python library has a minimum requirement of Python
3.10.
This not only resolves the missing plugins, but also ensures that the
packages used are not coming from PyPi, facilitating a more
secure downstream release.
Available plugins are sent as part of the
openstack-cliMCP tooldescription to help LLMs know what is installed, as they may assume only
basic commands are available.
We also update the allowed commands on read-only mode.
In adition the PR includes a couple of minor improvements to the MCP tool.