Skip to content

Conversation

TerryHowe
Copy link
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

Copy link

codecov bot commented Jan 22, 2025

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
Copy link
Contributor

@sabre1041 sabre1041 left a comment

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

@TerryHowe
Copy link
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
Copy link
Contributor

sajayantony commented Feb 12, 2025

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.

@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
Member

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

Copy link

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.

@TerryHowe TerryHowe force-pushed the backup-restore-spec branch from ed103fc to b3504a0 Compare June 12, 2025 13:48
@shizhMSFT shizhMSFT requested a review from Copilot June 17, 2025 04:50
Copilot

This comment was marked as outdated.

TerryHowe and others added 4 commits June 28, 2025 05:27
Co-authored-by: Andrew Block <andy.block@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>
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
Copy link
Contributor

@Copilot Copilot AI left a comment

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 ".".

@TerryHowe TerryHowe force-pushed the backup-restore-spec branch from c63131f to 7b47268 Compare July 3, 2025 01:49
@TerryHowe
Copy link
Member Author

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

@FeynmanZhou
Copy link
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.

Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

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

Copy link
Member

@FeynmanZhou FeynmanZhou left a comment

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
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
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
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
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"
      }
    }
  ]
}

Copy link
Contributor

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

LGTM

@TerryHowe TerryHowe merged commit ce45791 into oras-project:main Jul 3, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants