Skip to content

Conversation

kaovilai
Copy link
Member

@kaovilai kaovilai commented Jun 14, 2022

OADP-363

Implementation
openshift/openshift-velero-plugin#145
#743

linked lucidchart
plugin-registry

Rich markdown with working in-line image can be viewed at https://github.com/kaovilai/oadp-operator/blob/velero-plugin-registry-designdoc/docs/design/plugin-registry.md

Simplified diagram of changes.
Plugin Registry Imagestream Backup Workflow - Page 1 (2)

@kaovilai kaovilai changed the title plugin-registry design OADP-363 plugin-registry design Jun 14, 2022
@kaovilai kaovilai changed the title OADP-363 plugin-registry design OADP-363 plugin-registry design, registry deployment removal Jun 14, 2022
@kaovilai kaovilai changed the title OADP-363 plugin-registry design, registry deployment removal OADP-363 plugin-registry design, registry deployment removal proposal Jun 14, 2022

### Implementation Details/Notes/Constraints [optional]

The logs relating to registry will be mixed into velero pod logs
Copy link
Member

Choose a reason for hiding this comment

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

How noisy are these logs? Is this something we can control with the debug flag?

Copy link
Contributor

Choose a reason for hiding this comment

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

You can get logs per container:

oc logs <pod-name> -c <conatiner_name>

Copy link
Member Author

Choose a reason for hiding this comment

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

@sseago these logs will be mixed into velero container. Logs only occur when registry is accessed. When no backup is happening, it will be silent.

Copy link
Member Author

Choose a reason for hiding this comment

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

The registry sidecar container idea was thrown out.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes I believe you can control with debug flag.. but currently left as default. Could be reading from velero/dpa loglevel flag or other annotations.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@dymurray dymurray left a comment

Choose a reason for hiding this comment

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

Please include information about the image data being stored in the backup storage.

Today, we stand up a registry deployment that backs data up to a directory in an s3 store. It's not currently scoped under any BSL description. What is our plan with this workflow as we consume it via a library?

@kaovilai
Copy link
Member Author

Copy link
Member

@shubham-pampattiwar shubham-pampattiwar left a comment

Choose a reason for hiding this comment

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

+1 Great approach Thank you @kaovilai. Added some comments. Also, it would be really great if you could help me understand more and address the following:

  • A high-level component diagram, +1 on the current lucid chart, but could just add a component diagram without the implementation details, or just explain the involved components/functions like Whats is registry App, Transport, serveHTTP method etc. I believe this will be really helpful in understanding the approach flow. (A brief description about each would also do without a diagram)
  • Are the requests made via udistribution secure ?
  • How does the image get transported ? I understand there is a working PoC, but lets say we have an app image foo that we want to transport to s3 , how would the new approach go about it?


## Open Questions [optional]

Do we want registry logs to be included in velero backup and/or restore logs?

Choose a reason for hiding this comment

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

I would love to have the registry logs, +1 from my side.

Choose a reason for hiding this comment

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

Additionally, lets not call them registry logs, these are technically plugin logs, right ?

Copy link
Member

Choose a reason for hiding this comment

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

No I think there are 2 things we are talking about here.

  1. the plugin logs that records the process of backing up and restoring images.
  2. The registry library doing the actual push/pull of the images.

I think 1. should be in the backup/restore for sure. 2. feels overly verbose

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. Plugin logs. However the logs generated from registry will not be in backup logs in object storage since the velero backup logger isn't being passed to the ServeHTTP method.

Copy link
Member Author

Choose a reason for hiding this comment

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

We do want them but I believe that per current implementation it is not possible.

Copy link
Member Author

Choose a reason for hiding this comment

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

On the positive side, this means that we can leave log level as debug for the registry component without additional configuration flags.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah let's leave it as a potential future enhancement. Kinda opens the door for some other mechanism within velero plugins to pass logs back


## Summary

removes a listening HTTP server and connect [openshift-velero-plugin](https://github.com/openshift/openshift-velero-plugin/) directly with the [distribution/distribution](https://github.com/distribution/distribution) code to serve requests from [container/image/copy](https://github.com/containers/image/tree/main/copy) method as needed. A "library" to help achieve this is [kaovilai/udistribution](https://github.com/kaovilai/udistribution) which may be moved to konveyor org.

Choose a reason for hiding this comment

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

So basically. Current workflow is,
Velero gRPC req -> Plugin server -> Plugin HTTP req to registry server -> then storage driver makes the using object storage client.
And now,
Velero gRPC req -> Plugin server -> Plugin uses udistribution lib to make direct object storage calls.
Did I understand this correctly ?


### Non-Goals

Creating another custom resource and a controller to replace usage of [distribution/distribution](https://github.com/distribution/distribution).

Choose a reason for hiding this comment

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

I think this falls in the category of Alternatives considered rather than a non-goal.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks.

Creating another custom resource and a controller to replace usage of [distribution/distribution](https://github.com/distribution/distribution).

## Proposal

Copy link
Member

Choose a reason for hiding this comment

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

More from a high level this proposal is to

Redesign the image backup/restore workflow to instead consume a library directly from within the plugin rather than standing up a transient registry deployment.


### Implementation Details/Notes/Constraints [optional]

First, a udistribution client are to be initialized using [`udistribution.NewTransportFromNewConfig()`](https://github.com/kaovilai/udistribution/blob/2b5e16ac1f8efa0bbcdc513ae7103d4f56f3befa/pkg/image/udistribution/docker_transport.go#L50) function.
Copy link
Member

Choose a reason for hiding this comment

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

Just a suggestion, a short paragraph that summarizes what udistribution is would be helpful.

Copy link
Member

Choose a reason for hiding this comment

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

I see its more explained in line 88, but in this section stay away from in depth code references just give a high level description of the library

Copy link
Member Author

Choose a reason for hiding this comment

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

Had to reread section description in https://github.com/konveyor/enhancements/blob/master/guidelines/enhancement_template.md
Will move this to design detail and summary here.

Copy link
Member

@savitharaghunathan savitharaghunathan left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 7, 2022
@dymurray dymurray merged commit 515fbb3 into openshift:master Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants