Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Deprecate hyperstart, CC shim, and CC proxy #1428

Merged
merged 4 commits into from
Apr 13, 2019

Conversation

gabibeyer
Copy link
Contributor

vc: as discussed, the hyperstart agent, clear containers shim, and clear containers proxy are no longer being supported, as of version 2.1. Therefore their components have been removed from the kata-runtime implementation and the kata agent, shim and proxy are used when necessary. The virtc API client is also removed, for it uses these deprecated features heavily, and is no longer in working condition.

Fixes issue #1419

@gabibeyer gabibeyer requested a review from a team as a code owner March 26, 2019 21:32
@gabibeyer gabibeyer force-pushed the slashNburn branch 3 times, most recently from 2d6ac6b to 3d74dfa Compare March 26, 2019 22:28
case ccProxyTableType:
config.ProxyType = vc.CCProxyType
case kataProxyTableType:
if k == kataProxyTableType {
Copy link

Choose a reason for hiding this comment

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

So two things after talking with @gabibeyer, we don't expect more than one proxy definition, so we should check the number of entries provided through the config. Also, we don't expect to support multiple types of proxy, shim or agent, so we should simply have a toml entry this way:

[proxy]
path = "foo"

[shim]
path = "bar"

And to even go one step further, we can remove the agent entry itself since that was a simple placeholder to determine the type of agent.

/cc @jodh-intel @amshinde @egernst

Copy link
Member

Choose a reason for hiding this comment

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

I prefer we keep original ones and don't change it. Modify existing field names can break compatibility and make me anxious, proxy.kata doesn't harm :)

Copy link
Member

Choose a reason for hiding this comment

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

If we do this I think we should maintain backward compatibility here to allow runtime to be used with older toml possibly in /etc/kata-containers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good! I kept the old formatting, then added a 'default' case statement that returns an error is the type passed is not supported.

@sboeuf
Copy link

sboeuf commented Mar 26, 2019

Thanks for the PR @gabibeyer, it looks good! Just need to cleanup the whole configuration since we won't be carrying multiple shim/proxy entries.

@WeiZhang555
Copy link
Member

/test

@allencloud
Copy link

Actually alibaba is still using hyperstart for some legacy kernel support in GuestOS. Could we find another way to still support legacy kernels.

@sboeuf
Copy link

sboeuf commented Mar 27, 2019

@allencloud but I thought hyperstart was not even working anymore with Kata. I might be wrong though, or is it because they maintain a downstream version of Kata?

@teawater
Copy link
Member

Looks still have some people need the code.
Maybe we can do some discussions on this PR.

@sboeuf
Copy link

sboeuf commented Mar 27, 2019

@teawater yes but I want to clarify if the hyperstart agent is used in the context of Kata or not. This PR removes the support from a Kata perspective, which I thought was not even working anymore with this agent.

@bergwolf
Copy link
Member

@allencloud I believe you are referring hyperstart support via runv instead. hyperstart_agent.go in kata containers is missing a lot of interface implementations and I doubt it can even work.

Copy link
Member

@WeiZhang555 WeiZhang555 left a comment

Choose a reason for hiding this comment

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

Most parts LGTM except some comments.

@@ -70,6 +70,7 @@ var (
kataEphemeralDevType = "ephemeral"
ephemeralPath = filepath.Join(kataGuestSandboxDir, kataEphemeralDevType)
grpcMaxDataSize = int64(1024 * 1024)
maxHostnameLen = 64
Copy link
Member

Choose a reason for hiding this comment

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

Why add a new var?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was originally declared in the hyperstart_agent.go, but is needed here too, so I moved it :)

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.

os.RemoveAll(dir)
os.MkdirAll(dir, store.DirMode)
}
os.RemoveAll(testDir)
Copy link
Member

Choose a reason for hiding this comment

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

Why remove defaultSharedDir?

Copy link
Contributor Author

@gabibeyer gabibeyer Mar 27, 2019

Choose a reason for hiding this comment

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

It was declared in the hyperstart_agent.go file, and seems to point to the hyper sandbox location, so I figured it may be irrelevant with the removal of hyperstart: var defaultSharedDir = /run/hyper/shared/sandboxes/", but I'm not entirely sure

Copy link
Member

Choose a reason for hiding this comment

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

The CI passed, so I think you should be right.

case ccProxyTableType:
config.ProxyType = vc.CCProxyType
case kataProxyTableType:
if k == kataProxyTableType {
Copy link
Member

Choose a reason for hiding this comment

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

I prefer we keep original ones and don't change it. Modify existing field names can break compatibility and make me anxious, proxy.kata doesn't harm :)

@WeiZhang555
Copy link
Member

WeiZhang555 commented Mar 27, 2019

@allencloud I believe you are referring hyperstart support via runv instead. hyperstart_agent.go in kata containers is missing a lot of interface implementations and I doubt it can even work.

If it's runv+hyperstart, then I think it's safe to remove from kata. Or we need more discussion about our deprecated features.

bindUnmountAllRootfs(ctx, defaultSharedDir, pImpl)
// TODO: defaultSharedDir is a hyper var = /run/hyper/shared/sandboxes
// do we need to unmount sandboxes and containers?
bindUnmountAllRootfs(ctx, testDir, pImpl)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@WeiZhang555 your comment reminded me I needed ask about this, thank you!
Two test cases were calling bindUnmountAllRootfs with the defaultSharedDir as an argument, however neither test had anything to do with hyperstart (since defaultSharedDir = /run/hyper/shared/sandboxes/). I wasn't sure what to do about that situation; whether to bindUnmount the KataHostSharedDir, testDir, or some other variable instead.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure either, I think it should be kataHostSharedDir, but I wonder if this is really necessary, maybe bindUnmountAllRootfs can be removed.

@gabibeyer
Copy link
Contributor Author

/test

virtcontainers/api_test.go Outdated Show resolved Hide resolved
case ccProxyTableType:
config.ProxyType = vc.CCProxyType
case kataProxyTableType:
if k == kataProxyTableType {
Copy link
Member

Choose a reason for hiding this comment

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

If we do this I think we should maintain backward compatibility here to allow runtime to be used with older toml possibly in /etc/kata-containers.

virtcontainers/kata_shim_test.go Outdated Show resolved Hide resolved
@WeiZhang555
Copy link
Member

/test

@jcvenegas
Copy link
Member

@gabibeyer ping this PR require rebase

@gabibeyer gabibeyer force-pushed the slashNburn branch 2 times, most recently from 1b9b2d2 to c611cab Compare April 10, 2019 20:36
@gabibeyer
Copy link
Contributor Author

/test

@gabibeyer
Copy link
Contributor Author

/test

gabibeyer and others added 4 commits April 12, 2019 10:48
The hyperstart agent has not been supported in kata since 2.1,
so remove it as a component to kata. Mentioned in issue kata-containers#1113.

Fixes: kata-containers#1419

Signed-off-by: Gabi Beyer <gabrielle.n.beyer@intel.com>
previously used as a small api client for virtcontainers, virtc
no longer needed.

Fixes kata-containers#1419

Signed-off-by: Gabi Beyer <gabrielle.n.beyer@intel.com>
Clear Containers proxy and shim are no longer supported. This
was mentioned in issue kata-containers#1113. Their functionalities are thus
removed from the runtime.

Fixes kata-containers#1419

Signed-off-by: Gabi Beyer <gabrielle.n.beyer@intel.com>
The kata shim tests make use of an ioctl function, so instead
of having a custom one within that file, use the ioctl
function in utils/utils_linux

Fixes kata-containers#1419

Signed-off-by: Gabi Beyer <Gabrielle.n.beyer@intel.com>
@gabibeyer
Copy link
Contributor Author

/test

Copy link
Member

@WeiZhang555 WeiZhang555 left a comment

Choose a reason for hiding this comment

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

LGTM.
Thanks! Only one small nit .

if _, _, errno := unix.Syscall(unix.SYS_IOCTL, fd, request, data); errno != 0 {
//uintptr(request)
//uintptr(unsafe.Pointer(&arg1)),
//); errno != 0 {
Copy link
Member

Choose a reason for hiding this comment

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

need to clean unnecessary codes.

@WeiZhang555
Copy link
Member

I'll merge this. You can file another PR to clean unnecessary comments, it doesn't influence functions so I think it's OK

@WeiZhang555 WeiZhang555 merged commit fae022d into kata-containers:master Apr 13, 2019
@gabibeyer
Copy link
Contributor Author

Yay! Thank you @WeiZhang555

@gabibeyer gabibeyer deleted the slashNburn branch April 14, 2019 03:33
@egernst egernst mentioned this pull request Apr 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants