Pulp
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Help
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Pulp 3 CLI Planning ## MVP User stories ### User * As a CLI user, can see status of Pulp * As a CLI user, I can provide a configuration with my authentication credentials and server address * As a CLI user, I can reference resources by name or pulp_href. * As a CLI user, I can see details of a task * As a CLI user, I can cancel a running or waiting task * As a CLI user, I am guaranteed that the CLI will wait on tasks to complete * As a CLI user, server responses shown to me are parsed to human readable form * As a CLI user, I can chunk upload artifacts into Pulp * As a CLI user, I have docs on how to install, setup, and use the Pulp CLI #### pulp_file (autogenerated) * As a CLI user, I can CRUD file repositories * As a CLI user, I can CRUD file remotes * As a CLI user, I can CRUD file publications * As a CLI user, I can CRUD file distributions * As a CLI user, I can CRUD file content * As a CLI user, I can create a file repository version by specifying a file repository and a file remote * As a CLI user, I can create a file repository version by adding/removing content * As a CLI user, I can create a file publication from a file repository or repository version * As a CLI user, I can create a file distribution for a file publication * As a CLI user, I can sync and publish a file repository in one command. ### Plugin writer * As a plugin writer, I can ship custom CLI commands that are discovered by a Python entry point * As a plugin writer, I am guaranteed that all API endpoints for a plugin are automatically available by the CLI parsing the openAPI schema * As a plugin writer, I can use the plugin template to get a basic code structure for my CLI package * As a plugin writer, I can use the plugin template to generate CI/CD for testing and releasing my CLI package * As a plugin writer, I have docs on how to setup and create CLI commands ## Technical discussion * CLI framework? * click * https://click.palletsprojects.com/ * Popular, well known, and stable. Uses functions and decotorators * typer * https://github.com/tiangolo/typer * Wrapper around click that uses type hints * fire * https://github.com/google/python-fire * Newer. Uses functions or classes. Lots of magic/implicitness. * cliff * https://docs.openstack.org/cliff/latest/ * Also newer. Uses classes. Might be too tied to openstack? * Will CLI be generated statically or dynamically? * statically definition: The code is already written, and the code is shipped with the application * dynamically definition: commands are generated at runtime * statically generated pro * simple * easier to troubleshoot * statically generated con * require plugins to release and ship another python package * dynamically generated pro * server-side features automatically become client features * always a complete CLI matching the server-side API * dynamically generated con * more complicated * We'll have to DIY it, there isn't a project out there that does it * How will plugin writers/developers update the CLI when there is an API change? * Example: new option or new API endpoint * How will plugin writers/developers override options (ie rename or remove them)? * Will the CLI interact directly with pulp or use the bindings? * Would there be an opportunity to open source our tooling for generating Python CLIs from OpenAPI schemas? * Versioning? For example, what if a cli is talking to two Pulp servers with different versions * Use virtualenvs and each plugin cli package requires a particular server version * CLI fetches version info from Pulp server and installs the needed CLI package versions in a virtualenv ### Design #### Bindings We imagine that the CLI will use the bindings to communicate with the Pulp server. #### Versioning For example, what if a cli is talking to two Pulp servers with different versions * Use virtualenvs and each plugin cli package requires a particular server version * CLI fetches version info from Pulp server and installs the needed CLI package versions in a virtualenv #### Static vs Dynamic ##### Purely static - Plugin writers use a template tool to generate commands and options from an API schema - Tooling can be re-run to sync code when the API changes - Plugin writers can override these commands/options in their code - Plugins can also add extra commands ##### Hybrid - Plugin writers use a template tool to generate commands from an API schema - Pulp-CLI maps these commands to endpoints and fills in options at runtime - Plugin writers can override these options in their code - Plugins can also add extra commands - Tooling can be re-run to sync code when the API changes ## Prototype ### Goals - Includes a set of commands (2-3+) - A template to generate these commands ### Technologies - Uses click - Use bindings - Don't worry about installing bindings into virtualenvs for now ### Command Design - Use only pulp_hrefs for now (don't worry about name resolution) - Use functions or classes? - click uses functions so that would be a natural choice - maybe can still use class `__call__` or map methods to functions? - Command formats? - pulp-cli file repository create ... - pulp-cli repository file create ... - pulp-cli file file repository create ... - pulp-cli repository file file create ... - pulp-cli file repository create --type=file ... - pulp-cli file repository --type=file create ... * my preference, because 'file' could be a default value here - pulp-cli rpm content packages list - pulp-cli rpm content advisories list #### Output format - In which format should the cli present its result? - Tabular - python repr - json - yaml - Is this configurable? #### Commands to Implement - Status - File repository CRUD ### Generating Commands - Use openapi generator and give it templates to generate commands - Add these templates into pulp-openapi-generator - Will map openapi endpoints to commands with bindings ### Pulp ansible modules https://github.com/pulp/squeezer - Think about sharing ideas about user stories and behaviours - Look at sharing backend bindings code between ansible modules and CLI ## Notes from 4-AUG User stories: https://pulp.plan.io/versions/93 Matthias' POC: https://github.com/mdellweg/pulp-cli * Autogeneration from openapiv3 looks like it will be harder/less appropriate than we like * Generation questions * autogen docs are aimed at programmatic interface * CLI needs to be human-consumable * pulp2 CLI - no generation, all explicitly programmed * got out of sync/incomplete * can we attach code to generated endpoints/bindings? * eg, squeezer work * group cmds into logical structure * some parts of the REST API we may not *want* to expose (eg, upload/create-content-unit/add-to-repo as 'one stop shop') * we should always use chunked-upload * squeezer discussion * list of paths from openapi * every operation has an id * squeezer knows operations by-id * compat-lib matches provided params-to-REST-api * do we match CLI-version vs pulp-version? * prob leave for later release * use bindings? ditch bindings and use squeezer? * ditch pros * not have to worry about as many dependencies * implies introspect schema directly * how do bindings talk to server? aiohttp? can be defined * want plugin access be as lightweight as possible * reduce friction for plugin writer * squeezer - inherit a class for basic CRUD * openapiv3-python-pkg experimentation * functions vs inheritance - click vs squeezer * FTE estimate discussion * 1.5 for 3 months? * POC necessary (we'll prob throw the first one away) * by pulpcon? * OR, brainstorm at pulpcon, POC by end of Sept * who can work on this and when? * meet 30 min next week * agenda: more design thoughts, and maybe person-commitments * how hard is it to implement ansible-module? * for rpm maybe? * dkliban may find time (maybe by next week?) * Action Items: * ddavis to schedule mtg for next week post-3.6-release * dkliban to try and find time to build out some rpm-support via ansible ## Notes from 26-AUG Meeting ### Action Items * ddavis to pull together existing feedback from various communities into a doc, linked to from this doc * Matthias to work on POC (remove binding-deps, etc) * group to reconvene before PulpCON (2-SEP) ## Notes from 2-SEP meeting * ddavis got feedback from RHUI, support * doc is [here](https://docs.google.com/document/d/1LOShhGWexyuxTI_jzLAQV42p1snEIxjNdDHBYiLpnEA/edit#) - link is internal due to some of the topics discussed, apologies * rhui * task * find specific RPM in specific repo-versions * manage batches of tasks * repo-details * orphan-cleanup * list-orphans * always intended to exist, not implemented * repo-management - list repo-sync-states, for example * filter task by repo? * filter by locked-resources <- better * remove specfic nevras from custom repos * current list-of-hrefs, but CLI needs to be more user-friendly * human-readable access vs href * matthias' CLI already has a PC of href-to-readable * list parameters? what about wildcards? (not for first cut, to be sure) * searching for content * support * task management * lots of existing kbase with pulp-admin commands * can we get a list of such articles from support? * would help prioritize what cmds are actually in use * repo-download/verify would be good (ie, expose 'repair') * what about capsules? * still won't be able to help w/dynaflow tasks? * to-dos * CRDL for task-management * ddavis starting on this already * list tasks by blocked resources - useful, does the REST API even let us do this yet? * pulp orphan delete * dkliban to schedule time w/mdellweg to get started on CLI * repository work * should be moved to pulp-org * do we need to rename it? ###### tags: `CLI`

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully