-
Notifications
You must be signed in to change notification settings - Fork 35
Cli upgrade examples #268
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
Cli upgrade examples #268
Changes from 9 commits
a261242
b28d80d
a0a78fb
caeaa60
656ace3
0ccdf8c
f228543
2d3a28a
c7f8238
b512c4a
866c928
bfcaad9
4432c30
32c9f16
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,4 +13,9 @@ public/ | |
|
|
||
| # nodejs | ||
| package-lock.json | ||
| node_modules/ | ||
| node_modules/ | ||
|
|
||
| # AI DEV Tools | ||
| *.mcp | ||
| .mcp.json | ||
| .env | ||
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,36 @@ | ||||||
| --- | ||||||
| title: "Deprecation of update" | ||||||
| type: docs | ||||||
| weight: 4 | ||||||
| description: "" | ||||||
| --- | ||||||
|
|
||||||
| ## Motivation | ||||||
|
|
||||||
| The PackageRevision API object was meant to represent only metadata related to a package revision, while the contents of the package revision (i.e. the YAML files) are meant to be exposed via a companion PackageRevisionResources object. However PackageRevision's spec.tasks field contains all changes applied to the contents of the package revision in the form of patches, thus the contents of the package are leaking into the object that supposed to represent only the metadata. This implies that the PackageRevision can quickly grow bigger in size, than the contents of the package it represents. | ||||||
| For more details, see: https://github.com/nephio-project/nephio/issues/892 | ||||||
|
|
||||||
| ## Solution | ||||||
|
|
||||||
| We have introduced a new first task type, called upgrade. When there is a need to update a downstream package revision to a more up to date revision of its upstream package, do not store unnecessarily the diff's between the package revisions. Instead, now we use a 3-way-merge operation, where the old upstream, new upstream and the local revision changes are merged together. The introduced 3 way merge implementation is based on the kyaml's 3-way-merge solution. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| With this approach, we can reduce the task list to only one element, also we can deprecate the Patch/Eval/Update task types, since there will be no need for these. The remaining Init/Edit/Clone/Upgrade task can clearly identify the origin of a PackageRevision. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be no harm to define a "first" task somewhere in the docs. |
||||||
| For more details, see: https://github.com/nephio-project/porch/pull/252 | ||||||
|
|
||||||
| ### Example | ||||||
| porchctl rpkg upgrade repository.package.1 --namespace=porch-demo --revision=2 --workspace=2 | ||||||
| This command upgrades the package `repository.package.1` to the second version (revision=2) of its parent package. | ||||||
| It then creates a new package `repository.package.2` with the workspace name specified in the command (workspace=2). | ||||||
|
|
||||||
| ### Migration guide from `update` to `upgrade` | ||||||
| The `upgrade` command now internally handles the functionality previously provided by: | ||||||
| porchctl rpkg copy --replay-strategy=true | ||||||
| This eliminates the need for users to manually copy a cloned package. Additionally, the `upgrade` command operates on | ||||||
| approved packages. | ||||||
|
|
||||||
| #### Previous workflow: | ||||||
| porchctl rpkg copy repository.package-copy.2 --namespace=porch-demo --workspace=3 --replay-strategy=true | ||||||
| porchctl rpkg update --discover=upstream | ||||||
| porchctl rpkg update porch-test.subpackage-copy.3 --namespace=porch-demo --revision=2 | ||||||
| #### New workflow: | ||||||
| porchctl rpkg upgrade --discover=upstream | ||||||
| porchctl rpkg upgrade porch-test.subpackage-copy.2 --namespace=porch-demo --revision=2 --workspace=3 | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,20 +35,21 @@ The commands for administering repositories are: | |
|
|
||
| The commands for administering package revisions are: | ||
|
|
||
| | Command | Description | | ||
| | ------------------------------ | ------------------------------------------------------------------------------------------------ | | ||
| | `porchctl rpkg approve` | Approve a proposal to publish a package revision. | | ||
| | `porchctl rpkg clone` | Create a clone of an existing package revision. | | ||
| | `porchctl rpkg copy` | Create a new package revision from an existing one. | | ||
| | `porchctl rpkg del` | Delete a package revision. | | ||
| | `porchctl rpkg get` | List package revisions in registered repositories. | | ||
| | `porchctl rpkg init` | Initializes a new package revision in a repository. | | ||
| | `porchctl rpkg propose` | Propose that a package revision should be published. | | ||
| | `porchctl rpkg propose-delete` | Propose deletion of a published package revision. | | ||
| | `porchctl rpkg pull` | Pull the content of the package revision. | | ||
| | `porchctl rpkg push` | Push resources to a package revision. | | ||
| | `porchctl rpkg reject` | Reject a proposal to publish or delete a package revision. | | ||
| | `porchctl rpkg upgrade` | Update a downstream package revision to a more recent revision of its upstream package revision. | | ||
| | Command | Description | | ||
| | ------------------------------ | ------------------------------------------------------------------------------------------------------------------ | | ||
| | `porchctl rpkg approve` | Approve a proposal to publish a package revision. | | ||
| | `porchctl rpkg clone` | Create a clone of an existing package revision. | | ||
| | `porchctl rpkg copy` | Create a new package revision from an existing one. | | ||
| | `porchctl rpkg del` | Delete a package revision. | | ||
| | `porchctl rpkg get` | List package revisions in registered repositories. | | ||
| | `porchctl rpkg init` | Initializes a new package in a repository. | | ||
| | `porchctl rpkg propose` | Propose that a package revision should be published. | | ||
| | `porchctl rpkg propose-delete` | Propose deletion of a published package revision. | | ||
| | `porchctl rpkg pull` | Pull the content of the package revision. | | ||
| | `porchctl rpkg push` | Push resources to a package revision. | | ||
| | `porchctl rpkg reject` | Reject a proposal to publish or delete a package revision. | | ||
| | `porchctl rpkg update` | Deprecated, please use the upgrade functionality instead. See: [Deprecation of update](./deprecation-of-update.md) | | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As |
||
| | `porchctl rpkg upgrade` | Update a downstream package revision to a more recent revision of its upstream package using 3 way merge. | | ||
|
|
||
| ## Using the porchctl CLI | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| module github.com/nephio-project/docs | ||
|
|
||
| go 1.18 | ||
| go 1.24 | ||
|
|
||
| require ( | ||
| github.com/google/docsy v0.10.0 // indirect | ||
| github.com/google/docsy v0.12.0 // indirect | ||
| github.com/google/docsy/dependencies v0.7.2 // indirect | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +0,0 @@ | ||
| github.com/FortAwesome/Font-Awesome v0.0.0-20230327165841-0698449d50f2/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= | ||
| github.com/FortAwesome/Font-Awesome v0.0.0-20240402185447-c0f460dca7f7/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= | ||
| github.com/google/docsy v0.7.1 h1:DUriA7Nr3lJjNi9Ulev1SfiG1sUYmvyDeU4nTp7uDxY= | ||
| github.com/google/docsy v0.7.1/go.mod h1:JCmE+c+izhE0Rvzv3y+AzHhz1KdwlA9Oj5YBMklJcfc= | ||
| github.com/google/docsy v0.10.0 h1:6tMDacPwAyRWNCfvsn/9qGOZDQ8b0aRzjRZvnZPY5dg= | ||
| github.com/google/docsy v0.10.0/go.mod h1:c0nIAqmRTOuJ01F85U/wJPQtc3Zj9N58Kea9bOT2AJc= | ||
| github.com/google/docsy/dependencies v0.7.1/go.mod h1:gihhs5gmgeO+wuoay4FwOzob+jYJVyQbNaQOh788lD4= | ||
| github.com/google/docsy/dependencies v0.7.2 h1:+t5ufoADQAj4XneFphz4A+UU0ICAxmNaRHVWtMYXPSI= | ||
| github.com/google/docsy/dependencies v0.7.2/go.mod h1:gihhs5gmgeO+wuoay4FwOzob+jYJVyQbNaQOh788lD4= | ||
| github.com/twbs/bootstrap v5.2.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= | ||
| github.com/twbs/bootstrap v5.3.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| {{ template "_default/_markup/td-render-heading.html" . }} | ||
| <h{{ .Level }}{{ with .Anchor }} id="{{ . }}"{{ end }}>{{ .Text | safeHTML }}</h{{ .Level }}> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,21 @@ | ||
| { | ||
| "name": "nephio-rpoject-docs", | ||
| "name": "nephio-project-docs", | ||
| "version": "1.0.0", | ||
| "description": "", | ||
| "description": "Documentation website for Nephio - Kubernetes-based cloud-native network automation platform", | ||
| "main": "postcss.config.js", | ||
| "scripts": { | ||
| "build": "hugo --gc --minify", | ||
| "serve": "hugo server -D", | ||
| "lint": "echo \"No linting configured\" && exit 0", | ||
| "test": "echo \"Error: no test specified\" && exit 1" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/nephio-project/docs.git" | ||
| }, | ||
| "keywords": [], | ||
| "keywords": ["nephio", "kubernetes", "documentation", "cloud-native", "network-automation", "5g", "hugo", "docsy"], | ||
| "author": "Gergely Csatari <[email protected]>", | ||
| "license": "APACHE2", | ||
| "license": "CC-BY-4.0", | ||
| "bugs": { | ||
| "url": "https://github.com/nephio-project/docs/issues" | ||
| }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.