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

Remove cache file support #50

Closed
wants to merge 4 commits into from
Closed

Conversation

jukkar
Copy link
Collaborator

@jukkar jukkar commented May 24, 2023

As we can get the full state of the pod and container from runtime, no need to cache the data.
Containerd already has support for this. For cri-o, one needs a version that has commit f59c1f72a837c2235010813b8f361bb57c8c551b ("sandbox: Handle PodLinuxOverhead and PodLinuxResources CRI fields") in it.

@jukkar jukkar requested a review from klihub May 24, 2023 10:31
pkg/resmgr/cache/cache.go Outdated Show resolved Hide resolved
pkg/resmgr/flags.go Outdated Show resolved Hide resolved
klihub
klihub previously requested changes May 24, 2023
Copy link
Collaborator

@klihub klihub left a comment

Choose a reason for hiding this comment

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

LGTM. I have a few nitpicks and a locking-related comment.

@klihub klihub self-requested a review May 24, 2023 13:39
Copy link
Collaborator

@klihub klihub left a comment

Choose a reason for hiding this comment

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

Looks go to me now (although looks like some go reformatting is needed). Maybe we'll need to sit on this for a while, at least until the first CRI-O release is done with the merged related fixes.

And maybe we'll need to add a version check to pkg/resmgr/nri.go:Configure() to give an error (and maybe refuse to start up) if the runtime+version indicates a cri-o without the fixes.

@klihub klihub dismissed their stale review May 24, 2023 13:46

Review commits addressed.

@jukkar
Copy link
Collaborator Author

jukkar commented May 25, 2023

Fixed the format error. We can address the cri-o version check later after the cri-o release.

@jukkar
Copy link
Collaborator Author

jukkar commented May 26, 2023

Removed the cache rm task from todo file.

No need to save / restore cache state as all the state should
come from runtime via Synchronize message so no need to cache
the data even if we restart the nri plugin.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The e2e tests want to validate things after the test and for that,
they need access to the cache state. So now that the cache file is
removed, the cache state needs to be fetched directly from NRI
plugin via a HTTP request.
Default address used by e2e tests is http://localhost:8891/cache-state
The cache fetching is disabled by default and only enabled for
e2e tests.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
As there is no longer a cache file, the test is no longer
valid and can be removed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
No one uses the mutex in cache object so it can be removed.
Can be reintroduced if fine grained locking is needed there.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
@jukkar
Copy link
Collaborator Author

jukkar commented Jun 19, 2023

Rebased to main. Changed option name used by e2e test to --enable-test-apis to sync it with the e2e testing option introduced in #60

@klihub
Copy link
Collaborator

klihub commented Nov 18, 2023

We'll revisit this later. Closing for now.

@klihub klihub closed this Nov 18, 2023
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.

None yet

2 participants