Comments (10)
@laijs well you mentioned the reason why we don't have the pid. That's because we are providing the shim's pid, and this is the runtime responsibility. We're trying to implement properly what runc
has to offer, but I don't see why we should try to make the gRPC API reflecting runc
API.
The CreateContainer() does not start the container process, and for this reason, we cannot provide a PID in response of this. And there is no reason to try to provide the shim PID through this API, those are different things. The guest PIDs from inside the VM should not be mixed up with the host PID of the shim, this would bring more confusion IMO.
from agent.
from agent.
but runtime exec
is allowed before runtime start
, how do you achieve this? @sboeuf
from agent.
@laijs is it ? This is very weird since you should not be able to exec
a process if the container process itself is not running, right ?
Now, let's say it is acceptable (I really think it's not but anyway), we can still do it by calling into exec
after create
, we don't need the PID of the container for that, we only need the container ID.
@laijs am I missing something here ? I ask because I am trying to understand what you're trying to achieve with this.
from agent.
runc allows this behavior.
We'd better to follow the way that runc calls into libcontainer, unless there is a strong demand with convictive reasons.
from agent.
@sameo @sboeuf The shim should be created after runtime create
returns before runtime start
In this case, the shim will be started without NewProcessResponse, so a special tunnel has to be set up to tell the shim about it. It complicates everything.
CreateContainer() returning NewProcessResponse or runtime generating process ID can solve this problem.
from agent.
@laijs I am sorry but I am gonna repeat myself on this one, why do you need the ID from the agent for this case ?
The shim will be started by runtime create
and you will have the real PID in your hand so that you can fill the pid file properly. Why is that not enough ?
from agent.
The shim will be started by
runtime create
and you will have the real PID in your hand so that you can fill the pid file properly. Why is that not enough ?
But the shim doesn't have the pid of the process inside the vm. so the shim can't issue any API to the agent. Unless we add some much APIs for it, or the shim has to listen on a socket and wait for the runtime start
telling him. I am sorry I didn't add enough detail.
from agent.
@laijs Ah thanks for those details, now I understand it :)
So I agree returning the ID could be an option, but the thing is that we don't have the PID at that moment (I know there is a discussion about having this generated from the agent so we could generate that from any function of the agent).
Another one option would be to consider that a shim started with no process ID (or process ID == 0) means this is the container process and in that case, it would actually provide a PID of 0
or 1
along with the container ID, so that the agent would know what process it should tie to the request.
@sameo @WeiZhang555 WDYT ?
from agent.
I updated the issue title to better match current description in the first comment
from agent.
Related Issues (20)
- action: Improve porting checks
- action: Improve porting checks
- action: Improve porting checks
- github: Remove issue template and use central one
- Race between getDeviceName() and uevent arrival
- Passing PCI device information from host to VM is limited and messy HOT 5
- fail to hotplug device if host memory size large enough HOT 7
- make proto fail using docker 18.06 on arm64
- Kata 2.0.0 doesn't play well with Docker HOT 1
- Mount failed with "rw,stripe=1024" HOT 2
- may be a fd leak? HOT 1
- enable github actions
- hugepage support in Kata
- guest OCI hooks failed to find config.json HOT 1
- backport github actions for stable-1.12
- /dev/pts/N leak HOT 1
- pci bus path changes in qemu/arm64 vm when using acpi
- mount: don't error of virtiofs share is already mounted HOT 1
- running oci hook fail with "wait: no child processes" error sometimes when stop container HOT 1
- Revert 1.13.0-alpha1 version bump, as the release was never tagged.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agent.