Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mesheryctl] Add mesheryctl system model #8176

Open
abdullah1308 opened this issue Jul 14, 2023 · 19 comments · Fixed by #8284
Open

[mesheryctl] Add mesheryctl system model #8176

abdullah1308 opened this issue Jul 14, 2023 · 19 comments · Fixed by #8284
Labels
area/models Models, Components, Relationships related changes component/mesheryctl CLI for Meshery issue/willfix This issue will be worked on kind/child One of a number of issues relating to an epic language/go Issues or pull requests that use Golang

Comments

@abdullah1308
Copy link
Contributor

See mesheryctl Command Tracker for current status of commands.

Current Behavior

Desired Behavior

Implementation

  1. Enhance mesheryctl to expose component generator and component updater functionality in binary form and available in new mesheryctl releases.
  2. Use new MeshKit libraries.
  3. Create mesheryctl system model
    1. Create mesheryctl system model list - Use /api/meshmodels/models to retrieve and display list of the names of all registered models, using a single column format with just "model" name.
    2. Create mesheryctl system model view [model-name]
      1. Reusing the logic from mesheryctl perf retrieve and display the contents of the model record matching the [model-name]. If multiple models match the name, display list of matches and ask the user to select one for display.
      2. In a key:value format (one key per line), display all model information, using yaml as the default style of output.
    3. Create mesheryctl system model update - supporting the following parameters:
      Usage:
    mesheryctl system model update --source [path-to-spreadsheet] [--output-dir] [relative path persist assets/icons] 

Example:

$ mesheryctl system model update --source https://docs.google.com/spreadsheets/d/e/2PACX-1vSgOXuiqbhUgtC9oNbJlz9PYpOEaFVoGNUFMIk4NZciFfQv1ewZg8ahdrWHKI79GkKK9TbmnZx8CqIe/pub\?gid\=0\&single\=true\&output\=csv --system meshery-server --output-dir /docs/assets/images/models

Future:
1. Create mesheryctl system model gen - supporting the following parameters:

Acceptance Tests

Mockups


Contributor Resources

@abdullah1308 abdullah1308 added kind/enhancement Improvement in current feature component/mesheryctl CLI for Meshery language/go Issues or pull requests that use Golang area/models Models, Components, Relationships related changes kind/child One of a number of issues relating to an epic and removed kind/enhancement Improvement in current feature labels Jul 14, 2023
@github-actions
Copy link

This issue has been labeled with 'component/mesheryctl'. Note that after making changes you need to update it in the mesheryctl command tracker spreadsheet.


        Be sure to join the community, if you haven't yet and please leave a ⭐ star on the project 😄

@zakisk
Copy link
Contributor

zakisk commented Jul 15, 2023

@abdullah1308 hey I want to go with it.

@zakisk
Copy link
Contributor

zakisk commented Jul 19, 2023

@abdullah1308 /api/meshmodels/models returns all models if version is not specified so do I return all models's name or specify version?

@abdullah1308
Copy link
Contributor Author

abdullah1308 commented Jul 19, 2023

Hey @zakisk means does not filter models by version number. You can perhaps have a flag in this command to filter by version string.

@zakisk
Copy link
Contributor

zakisk commented Jul 20, 2023

@abdullah1308 hi, in mesheryctl system model view [model-name] command if I got 2 Models in reponse e.g Jenkin Operator then I will show a prompt to let user select one of them, since Model.Displayname fields are same, in order to differenciate between them which field from Model do I append to it, at the moment it will prompt as this:

Select a model:
> Jenkin Operator
  Jenkin Operator

what I am considering is to append version to name as this:

Select a model:
> Jenkin Operator, version: 1
  Jenkin Operator, version: 2

tell me how to do it. thank you

@abdullah1308
Copy link
Contributor Author

@zakisk I like the second approach.

@zakisk
Copy link
Contributor

zakisk commented Jul 21, 2023

@leecalcote I've completed implementation of mesheryctl system model view [model-name] command but I'm having an issue here is output in both format:
JSON:

mesheryctl system model view ps-db -o json
{
  "name": "ps-db",
  "version": "0.4.0",
  "displayName": "Percona Server for MySQL",
  "category": {
    "name": "App Definition and Development",
    "metadata": null
  },
  "metadata": {
    "svgColor": "ui/public/static/img/meshmodels/ps-db/color/perconaservermysql-color.svg",
    "svgWhite": "ui/public/static/img/meshmodels/ps-db/white/perconaservermysql-white.svg"
  }
}

YAML:

mesheryctl system model view ps-db -o yaml
id: 00000000-0000-0000-0000-000000000000
name: ps-db
version: 0.4.0
displayname: Percona Server for MySQL
category:
  id: 00000000-0000-0000-0000-000000000000
  name: App Definition and Development
  metadata: {}
modelMetadata:
  svgColor: ui/public/static/img/meshmodels/ps-db/color/perconaservermysql-color.svg
  svgWhite: ui/public/static/img/meshmodels/ps-db/white/perconaservermysql-white.svg

in YAML output id is shown as 000-.. I want to omit this, so do I create an issue in meshkit for this?, I want to ignor ID field for YAML as it is at the moment for json.

@leecalcote
Copy link
Member

@zakisk this is looking good so far. We should have prior art in areas like the perf commands for UUID shortening. In fact, we have an open need for shortening in the new filter list command in which one column displays a shortened UUID and another column shows the full UUID.

In this case, we'll leave it to the client, not the server to shorten the UUID, leaving the server to respond with full length UUIDs.

@zakisk
Copy link
Contributor

zakisk commented Jul 21, 2023

@leecalcote do I shorten UUID using base64 encoding or we've pre-built solution for it?

@abdullah1308
Copy link
Contributor Author

@zakisk Create a PR in meshkit changing the tag you've specified to json:"-" yaml:"-"

@zakisk
Copy link
Contributor

zakisk commented Jul 22, 2023

@abdullah1308 @leecalcote plese share details for system model update and system model gen.

@stale
Copy link

stale bot commented Sep 4, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the issue/stale Issue has not had any activity for an extended period of time label Sep 4, 2023
@Freedisch Freedisch removed the issue/stale Issue has not had any activity for an extended period of time label Sep 4, 2023
@stale
Copy link

stale bot commented Oct 14, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the issue/stale Issue has not had any activity for an extended period of time label Oct 14, 2023
@leecalcote leecalcote added the issue/willfix This issue will be worked on label Oct 24, 2023
Copy link

stale bot commented Nov 4, 2023

This issue is being automatically closed due to inactivity. However, you may choose to reopen this issue.

@stale stale bot closed this as completed Nov 4, 2023
@theBeginner86 theBeginner86 reopened this Jan 25, 2024
@stale stale bot removed the issue/stale Issue has not had any activity for an extended period of time label Jan 25, 2024
@theBeginner86
Copy link
Member

cleaning up assignments

@AHB102
Copy link

AHB102 commented Jan 31, 2024

@theBeginner86 Hi there 👋, I'm looking forward to work on this issue for lfx 2024 term 1, are there any prerequisites/ pre tasks that I should be aware of ?

@Eeshu-Yadav
Copy link

@Yashsharma1911 hello sir,i want to contribute in Expand CLI capabilities for registry management, i have also applies through lfx program of upcoming march session , can u assign it to me

@literalEval
Copy link

literalEval commented Feb 13, 2024

Hey @theBeginner86 @abdullah1308

I am really interested in working on this project for the upcoming LFX term. can you please update the Acceptance Tests, so that we can do the same ? Thanks.

@hanshal101
Copy link

Hey @abdullah1308
I am looking forward to taking part in this project for the upcoming LFX term. I have significant experience building a CLI application. LOL-CLI (A kubectl clone) This is just a sample CLI to get a better understanding of the Go and Kubernetes APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/models Models, Components, Relationships related changes component/mesheryctl CLI for Meshery issue/willfix This issue will be worked on kind/child One of a number of issues relating to an epic language/go Issues or pull requests that use Golang
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants