clearcontainers / runtime

OCI (Open Containers Initiative) compatible runtime using Virtual Machines
Apache License 2.0
589 stars 70 forks source link

Find a way to display the agent version #1055

Closed jodh-intel closed 6 years ago

jodh-intel commented 6 years ago

As mentioned https://github.com/clearcontainers/tests/issues/944#issuecomment-371157669, the runtime does not display the agent version, although the output of cc-env suggests it should/tries to:

$ cc-runtime cc-env|grep -A 2 Agent
[Agent]
  Type = "hyperstart"
  Version = "<<unknown>>"

The best strategy would seem to be to bind-mount the image (using losetup+mount) and run cc-agent --version now that https://github.com/clearcontainers/agent/pull/213 has landed.

The question though is where we should run this:

  1. In the runtime

    This would allow the cc-env output to display the correct Agent.Version=.

  2. In cc-collect-data.sh

    If we do this, we need to remove the Agent.Version= from the runtime.

Option (1) seems logical but is a bit... brace yourself for a very technical term... "yucky". That said:

wdyt @sboeuf, @sameo, @grahamwhaley, @mcastelino? Should we take a vote on this? :smile:

sboeuf commented 6 years ago

I'd say option 2 since I don't like that we have to mount the image so that we can find the agent version from cc-runtime. cc-collect-data.sh is a separate script, which might be more appropriate for this specific mounting operation.

jodh-intel commented 6 years ago

Sounds reasonable. I'll update the script...