-
Notifications
You must be signed in to change notification settings - Fork 252
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
Add timeout to opm registry serve #370
Add timeout to opm registry serve #370
Conversation
Hi @Jobava. Thanks for your PR. I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign @ecordell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Just a small change request.
@kevinrizza @ecordell PTAL. |
/ok-to-test |
Is the timeout command not available to you on the target system? It's part of coreutils. |
Not from the context of an index container, which has just scratch, the go binaries and a sqlite db. Our use case requires us pulling the index images and we have no fancy shell features. |
Per @gallettilance's request, I also added a test for CLI parameters. First I considered doing a unit test for the cobra invocations, but that got a bit complicated. Instead I'm just doing an invocation of the opm binary with the parameters from the context of a container. I found a |
/retest |
I'm having a hard time understanding the use case for this switch.
|
That being said, there's nothing wrong with this code, I just want to make sure we're solving the problem the right way. |
Our project requires us to collect this data and serve it from Pyxis. The data will be ultimately used by Catalog or others for display purposes. As to why we want to serve it from pyxis and not just let Catalog collect it... that's because index data uses container registries for storage and pulling a whole index image is pretty expensive [1]. So we have to load every single index container, extract the operator metadata and store it. Having a timeout here just makes our job a bit easier (i.e. we can load data from kubernetes Jobs). We are pulling all the data and storing it (metadata, CSV, CRD etc), but are exposing just some of it to Catalog for now (like capabilities, ALM examples etc). [1] - ~ 500 MiB of data (the docker image size) for 50KiB of actual index metadata (in uncompressed yaml form) |
If |
Add new flag --timeout-seconds to `opm registry serve` which allows specifying that the server should be shut down after a number of seconds. The server is gracefully shut down.
After talking to @kevinrizza , I removed the short version of the flag. We agreed that eventually opm will have a function to export data as json and after that our tooling will switch to using that. After such time we can also remove the --timeout-seconds flag. /retest |
Is this good for merging? |
Aside from that one comment, I think this is fine to merge. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Jobava, kevinrizza The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi again. Can we get an idea of when this can be merged? |
/lgtm |
/retest Please review the full test history for this PR and help us cut down flakes. |
6 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
@kevinrizza I see the test has failed, but can't tell why it is failing |
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
This relates to our project to serve operator metadata via pyxis:
CLOUDWF-1739
Description of the change:
Add new flag
--timeout-seconds/-s
toopm registry serve
which allows specifying that the server should be shut down
after a number of seconds.
The server is gracefully shut down.
Motivation for the change:
We are extracting information from the iib container and normally need this container up for a very short time
(1 min or less). Having a daemon complicates our setup (i.e. we'd need to handle server start/stop manually).
Reviewer Checklist
/docs
Some manual testing done: