Skip to content

docs: backup and restore specification#1610

Merged
TerryHowe merged 16 commits into
oras-project:mainfrom
TerryHowe:backup-restore-spec
Jul 3, 2025
Merged

docs: backup and restore specification#1610
TerryHowe merged 16 commits into
oras-project:mainfrom
TerryHowe:backup-restore-spec

Conversation

@TerryHowe

Copy link
Copy Markdown
Member

What this PR does / why we need it:

Specification for the way the oras backup and oras restore commands will work.

Which issue(s) this PR fixes:

Partial: #1366

@codecov

codecov Bot commented Jan 22, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.32%. Comparing base (571b155) to head (bc04267).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1610      +/-   ##
==========================================
+ Coverage   85.29%   85.32%   +0.03%     
==========================================
  Files         133      133              
  Lines        5882     5882              
==========================================
+ Hits         5017     5019       +2     
+ Misses        616      614       -2     
  Partials      249      249              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TerryHowe TerryHowe force-pushed the backup-restore-spec branch from a67cd77 to 7e33f88 Compare January 23, 2025 14:50

@sabre1041 sabre1041 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature is somewhat confusing. I understand the motivation, but it does not accurately reflect backup/restore. A possible suggestion is to use dump/publish instead

Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
@TerryHowe

Copy link
Copy Markdown
Member Author

This feature is somewhat confusing. I understand the motivation, but it does not accurately reflect backup/restore. A possible suggestion is to use dump/publish instead

If you think of it reading and writing tgz files, I think backup/restore works pretty well.

Names are hard, the equivalent docker command would be save/load.

@sajayantony

sajayantony commented Feb 12, 2025

Copy link
Copy Markdown
Contributor

This reduces the number of commands to create a tar archive (single of multiple) which is awesome.
I was really hoping we just enhanced pull/push to support creating the archive without other commands but am not opposed to this.
Either way really helpful.

For e.g.

oras pull --archive myarchieve.tar.gz  registry.k8s.io/kube-apiserver-arm64:v1.31.0 registry.k8s.io/kube-controller-manager-arm64:v1.31.0

oras push --archive myarchieve.tar.gz  localhost:15000/my-mirror

This might complicate the commands, but contextually might makes more sense.

Comment thread docs/proposals/backup-restore.md Outdated
@TerryHowe TerryHowe force-pushed the backup-restore-spec branch 3 times, most recently from 99093f6 to cc044df Compare April 2, 2025 13:58
@FeynmanZhou

Copy link
Copy Markdown
Member

@TerryHowe Thank you for revising it. Will review this proposal doc again.

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 30 days.

Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
@TerryHowe TerryHowe force-pushed the backup-restore-spec branch from ed103fc to b3504a0 Compare June 12, 2025 13:48
Comment thread docs/proposals/backup-restore.md
Comment thread docs/proposals/backup-restore.md
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md
Comment thread docs/proposals/backup-restore.md
Comment thread docs/proposals/backup-restore.md
@shizhMSFT shizhMSFT requested a review from Copilot June 17, 2025 04:50

This comment was marked as outdated.

Signed-off-by: Terry Howe <terrylhowe@gmail.com>
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
@TerryHowe TerryHowe force-pushed the backup-restore-spec branch from b3504a0 to e1ba0c9 Compare June 28, 2025 11:28
TerryHowe and others added 7 commits June 28, 2025 05:28
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
Co-authored-by: Feynman Zhou <feynmanzhou@microsoft.com>
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
@shizhMSFT shizhMSFT requested a review from Copilot July 2, 2025 08:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a comprehensive specification for new oras backup and oras restore commands, detailing user scenarios, command syntax, flags, and expected behaviors.

  • Introduces a proposal document outlining motivations and real-world scenarios
  • Defines oras backup and oras restore commands with full flag reference
  • Describes CLI UX examples for multi-repo, air-gapped, and repository-level workflows
Comments suppressed due to low confidence (2)

docs/proposals/backup-restore.md:172

  • Remove the stray 'oras' after 'Disable progress bars.'.
* `--no-tty`: Disable progress bars.oras

docs/proposals/backup-restore.md:192

  • The note refers to --output but should mention --input for the restore command.
> Note: If the flag `--output` is not specified, the default input directory is set to the current directory ".".

Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
Comment thread docs/proposals/backup-restore.md Outdated
@TerryHowe TerryHowe force-pushed the backup-restore-spec branch from c63131f to 7b47268 Compare July 3, 2025 01:49
@TerryHowe

Copy link
Copy Markdown
Member Author

I reverted this to the last good commit. There were too many issues with those other updates.

@FeynmanZhou

Copy link
Copy Markdown
Member

I reverted this to the last good commit. There were too many issues with those other updates.

Just discussed with @TerryHowe about this PR. The consensus is that we will merge this PR then I will go ahead to open a follow up PR to enrich the spec.

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as the initial attempt of oras backup/restore

@FeynmanZhou FeynmanZhou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @TerryHowe . LGTM with merging this PR as an initial version. I will open a follow up PR to enrich the doc.

@sabre1041

Copy link
Copy Markdown
Contributor

@TerryHowe this looks good. One final question. What happens when you attempt to back up the same repository with two separate versions? Since there is the potential to have overlapping concerns/files (like the index.json file)

@FeynmanZhou

Copy link
Copy Markdown
Member

@TerryHowe this looks good. One final question. What happens when you attempt to back up the same repository with two separate versions? Since there is the potential to have overlapping concerns/files (like the index.json file)

@sabre1041 Would you mind clarifying "two separate versions" in the context of backup a repo?

@FeynmanZhou

Copy link
Copy Markdown
Member

@sabre1041 BTW, if overall looks good as the initial version, you may also want to approve this PR as you requested changes previously.

@TerryHowe

Copy link
Copy Markdown
Member Author

@TerryHowe this looks good. One final question. What happens when you attempt to back up the same repository with two separate versions? Since there is the potential to have overlapping concerns/files (like the index.json file)

With OCI file layout it just adds another manifest in one blob directory:

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.index.v1+json",
  "manifests": [
    {
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "digest": "sha256:74a8050ec347821b7884ab635f3e7883b5c570388ed8087ffd01fd9fe1cb39c6",
      "size": 3024,
      "annotations": {
        "org.opencontainers.image.ref.name": "registry.k8s.io/kube-apiserver-arm64:v1.31.0"
      }
    },
    {
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "digest": "sha256:9ff42b586c0a57f3fc4a0689afe6db4d8f92f7f79bef3b47b2c75ab112e17de7",
      "size": 3024,
      "annotations": {
        "org.opencontainers.image.ref.name": "registry.k8s.io/kube-apiserver-arm64:v1.32.0"
      }
    }
  ]
}

@sabre1041 sabre1041 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

7 participants