[Pulp-list] [Pulp-dev] Pulp3 CLI Proof of Concept

Dennis Kliban dkliban at redhat.com
Mon Jun 18 21:45:48 UTC 2018


Please try out the POC and send all feedback about the implementation or
any additional use cases before July 2nd.

There are a lot of details on the issue[0] in pulp.plan.io.

[0] https://pulp.plan.io/issues/3756


On Mon, Jun 11, 2018 at 1:20 PM, Bihan Zhang <bizhang at redhat.com> wrote:

> After gathering some initial user stories[0] and feedback from Pulp
> users[1], the Pulp CLI mini-team[2] has been exploring implementation
> options. In doing so, we've spent a few days creating a prototype that we'd
> like the Pulp community to review and test. This proof of concept is
> available at the following repository:
>
> https://github.com/werwty/pulpcli-POC/
>
> This PoC provides an autogenerated set of commands for each endpoint
> available by the REST API schema. Having an autogenerated CLI means it
> automatically supports all plugins and provides complete feature parity
> with our REST API.
>
> Another highlight of the PoC's design is that it's easy to extend. One of
> the feedback items we got from pulp users is that they use scripts to
> automate their usage of the CLI, while other teams like RHUI have their own
> CLI. With this PoC design, users will be able to write their own custom
> commands and functionality in Python. This will also allow us (the Pulp
> team) to provide more complex commands and workflows in the future too.
>
>
> Installation/Usage
> ==============
>
> To see information about how to install and use the PoC CLI, check out the
> README:
>
> https://github.com/werwty/pulpcli-POC/#installation
>
>
> Features
> =======
>
> - Auto-generated CLI commands with one command for each API endpoint
> - Support for plugins
> - Pagination support
> - Lookup via resource UUIDs or names
> - Help screens
> - Task polling
> - Autocompletion for commands and arguments
> - Extensibility
>   - Support in the future to create our own complex commands/workflows
>   - Users/plugin writers can create their own commands and ship their own
> cli plugins
>
>
> Implementation
> ===========
>
> We first began by exploring pre-existing solutions like openapi-cli-client
> and coreapi-cli. The former, openapli-cli-client, was unmaintained and
> didn't seem to work with our API. The coreapi-cli package seemed promising
> but we found it hard to extend and it lacked some of the features we wanted
> to support in our initial set of user stories (e.g. pagination, task
> polling, etc). We realized that it was a rather small codebase that merely
> integrated the coreapi python package[3] with the cli package, click[4].
>
> So next we began investigating writing our own CLI using coreapi and
> click. Doing so was easy and it only required a few lines of code. We were
> then able to add on more features like task polling with little effort. We
> also explored using an alternative to click called argparse[5] but found it
> very hard to work with.
>
>
> Next Steps
> ========
>
> We first want to get feedback on this PoC. If we decide to move forward
> with it, there are a few things we'd like to do to prepare this CLI for an
> MVP:
>
> - Provide docs for how to extend the CLI and write custom commands
> - Better error handling
> - Fix resource lookup for master/detail routes
> - Progress reporting when polling tasks
> - Support for file uploads
> - Authentication and configuration
> - Format of responses
> - Swich out coreapi for openapi
>
> All CLI-related tasks will be tracked through this redmine Epic:
> https://pulp.plan.io/issues/3756
>
> Before we proceed though, we'd like to get feedback. So please review and
> test out our PoC. Let us know if you have any comments and suggestions.
>
> [0] https://www.redhat.com/archives/pulp-dev/2018-May/msg00004.html
> [1] https://www.redhat.com/archives/pulp-list/2018-May/msg00007.html
> [2] asmacdo, bizhang, daviddavis, dawalker, and dkliban
> [3] https://github.com/core-api/python-client
> [4] http://click.pocoo.org/5/
> [5] https://docs.python.org/3/library/argparse.html
>
>
> _______________________________________________
> Pulp-dev mailing list
> Pulp-dev at redhat.com
> https://www.redhat.com/mailman/listinfo/pulp-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pulp-list/attachments/20180618/960d8c9c/attachment.htm>


More information about the Pulp-list mailing list