oras icon indicating copy to clipboard operation
oras copied to clipboard

Command to push a blob to a remote registry

Open qweeah opened this issue 3 years ago • 1 comments

The proposed commands is:

Usage:
  oras blob push REG/REPO@DIGEST PATH [flags]

Flags:
  --ca-file string               server certificate authority file for the remote registry
  -d, --debug                    debug mode
  -h, --help                     help for pushing a blob
      --insecure                 allow connections to SSL registry without certs
  -p, --password string          registry password or identity token
      --password-stdin           read password or identity token from stdin
      --plain-http               allow insecure connections to registry without SSL check
  -u, --username string          registry username
  -v, --verbose                  verbose output
  -o, --output string            save the fetched blob to

Related to #459

qweeah avatar Aug 03 '22 03:08 qweeah

please assign this to me

lizMSFT avatar Aug 09 '22 03:08 lizMSFT

Current UX: oras blob push localhost:5000/0817hello artifact.txt

image image

cc @shizhMSFT @yizha1 @FeynmanZhou

lizMSFT avatar Aug 23 '22 03:08 lizMSFT

One minor comment:

  • Push a blob to a remote registry

Some questions:

  • Can we change the mediaType for the blob?
  • What is the supported maximum size of a blob? What will happen if the blob size exceeds the maximum value?
  • Can we cancel pushing a blob? What will happen if I ctrl+c while pushing a large blob?

yizha1 avatar Aug 24 '22 04:08 yizha1

Hi @yizha1,

  • Push a blob to a remote registry

Thanks for pointing out, I will change the command message to Push a blob to a remote registry 👌

Can we change the mediaType for the blob?

I'd say no. The blob only has one mediaType application/octet-stream, ref: https://docs.docker.com/registry/spec/api/#initiate-blob-upload

What is the supported maximum size of a blob? What will happen if the blob size exceeds the maximum value?

Currently we do not have a maximum limit on the size of a blob from our ORAS side. But a registry should have some limit on the maximum blob size that it can accept. So if the blob size exceeds the maximum value, the error will be returned from registry side.

Can we cancel pushing a blob? What will happen if I ctrl+c while pushing a large blob?

Yes, we can cancel pushing a blob by using ctrl+c. If the push operation has not been completely finished yet, then the process will be stopped.

lizMSFT avatar Aug 24 '22 12:08 lizMSFT

The overall UX of oras push looks intuitive to me. Would it be more exact to update <name> to <registry>? image

FeynmanZhou avatar Aug 24 '22 15:08 FeynmanZhou

I think it would be helpful to output the full descriptor to a file. without that how is the user planning to use this ? /cc @shizhMSFT

We can however merge #489 but not close this issue if we want to enhance the output of open an another issue. But either way I think we need to be able to describe the use case here /cc @FeynmanZhou @yizha1

sajayantony avatar Aug 24 '22 16:08 sajayantony

@qweeah We need to unify the UX across all command sets like oras manifest and oras blob as they all do CRUD. Let's discuss it.

shizhMSFT avatar Aug 25 '22 02:08 shizhMSFT

The overall UX of oras push looks intuitive to me. Would it be more exact to update <name> to <registry>?

That's a good idea! But I notice we are now only using registry in login and logout commands, and name for others (such as oras push). We might need to unify the UX across all commands first. image

lizMSFT avatar Aug 25 '22 03:08 lizMSFT

UX design (08/26/2022)

# stdout human readable messages 
oras blob push <name> <path>
# stdout json descriptor
oras blob push <name> <path> --descriptor 
# stdout prettified json descriptor
oras blob push <name> <path> --descriptor --pretty
# read from stdin, then push to <name> registry. stdout human readable messages 
# return error if --password-stdin flag is used at the same time
oras blob push <name> - 

image help doc image

lizMSFT avatar Aug 26 '22 14:08 lizMSFT