WIP: OSC plugins#3
Open
Akrog wants to merge 5 commits into
Open
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.
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.
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 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 |
Collaborator
|
/ok-to-test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.