Skip to content
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

adding support for plugins #238

Merged
merged 1 commit into from
Jan 6, 2025
Merged

adding support for plugins #238

merged 1 commit into from
Jan 6, 2025

Conversation

alshabib
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Dec 19, 2024

Pull Request Test Coverage Report for Build 12640406476

Details

  • 0 of 587 (0.0%) changed or added relevant lines in 2 files are covered.
  • 9 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.04%) to 1.101%

Changes Missing Coverage Covered Lines Changed/Added Lines %
containerz/containerz_grpc.pb.go 0 104 0.0%
containerz/containerz.pb.go 0 483 0.0%
Files with Coverage Reduction New Missed Lines %
containerz/containerz_grpc.pb.go 1 0.0%
containerz/containerz.pb.go 8 0.0%
Totals Coverage Status
Change from base Build 12636953794: -0.04%
Covered Lines: 166
Relevant Lines: 15071

💛 - Coveralls


// StartPlugin starts the specified plugin identified by the name field
// of the request. It should be started using the instance_name of the
// request. If the plugin file named `name.tar` does not exist, this
Copy link
Contributor

Choose a reason for hiding this comment

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

I presume the plugin needs to be a packaged OCI image right? Does this necessarily mean it must be name.tar?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes - fair point. Basically we need to make sure that the file uploaded during deploy is referenceable when PluginStart is called. So there is no need to mandate an extension.

// of the request. It should be started using the instance_name of the
// request. If the plugin file named `name.tar` does not exist, this
// should return an error.
rpc StartPlugin(StartPluginRequest) returns (StartPluginResponse) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Given we have separate plugin-specific commands for start/stop/list -- did you consider having a different one for Deploy to make the API consistent? (Not sure of the pros/cons.)

Is there a link to how volume plugins look for podman? Best I could find is containers/podman#23762.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AFAIK Docker plugins can be used in podman so podman plugins are the same as docker plugins.

I thought about a separate Deploy API but it seems like a lot of duplication since Deploy already uploads a file as we need.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds reasonable to me -- I was forgetting that Deploy didn't actually start the container, so this seems reasonable to me.

containerz/containerz.proto Outdated Show resolved Hide resolved
// of the request. It should be started using the instance_name of the
// request. If the plugin file named `name.tar` does not exist, this
// should return an error.
rpc StartPlugin(StartPluginRequest) returns (StartPluginResponse) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds reasonable to me -- I was forgetting that Deploy didn't actually start the container, so this seems reasonable to me.

@@ -144,6 +162,9 @@ message ImageTransfer {
// Optional. Instructs the target to fetch the image from a remote location.
// The above name and tag must be applied to the container once downloaded.
common.RemoteDownload remote_download = 4;

// Indicates that the file to be transferred is a plugin.
bool is_plugin = 5;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be within a oneof or alternatively an enum? It seems like we might have some other types that are mutually exclusive that might be transferred via Deploy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's not clear to me - I don't think there are other common types images. Technically, this only tells the server not to attempt to load the received image so perhaps it should be no_load instead of is_plugin

@alshabib alshabib merged commit 99332e1 into openconfig:main Jan 6, 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
Development

Successfully merging this pull request may close these issues.

3 participants