Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

rkt: show created/started times in rkt list/status #2030

Merged
merged 4 commits into from Jan 26, 2016

Conversation

iaguis
Copy link
Member

@iaguis iaguis commented Jan 25, 2016

To get the pod creation time we use the modification time in
/var/lib/rkt/pods/*/<UUID>/pod. It's written when the pod is prepared
and doesn't change afterwards.

To get the pod start time we use the modification time in
/var/lib/rkt/pods/*/<UUID>/ppid. It's written when the pod actually
starts and doesn't change afterwards.

Partially addresses #1789

err error
)
if p.isRunning() || p.afterRun() {
t, err = p.getModTime("ppid")
Copy link
Member

Choose a reason for hiding this comment

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

At the moment, stage1 implementations have the choice to write either the "ppid" or the "pid. Then, stage0's getContainerPID1() is able to read either file: it tries "pid" and if it does not work, fall back on "ppid".

The two files are documented in the Stage 1 ACI implementor's guide.

To be consistent, getStartTime() should check "pid" too, although it is not very useful since it is not written in the current implementation...

Copy link
Member Author

Choose a reason for hiding this comment

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

Alright

@alban
Copy link
Member

alban commented Jan 25, 2016

@iaguis iaguis force-pushed the iaguis/list-creation-start-times branch from 97cc07f to f013858 Compare January 25, 2016 16:39

created, err := p.getCreationTime()
if err != nil {
errors = append(errors, fmt.Errorf("unable to get creation time for pod %q: %v", uuid, err))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Moar work for @chris' structured error work.

@krnowak
Copy link
Collaborator

krnowak commented Jan 26, 2016

I'm a bit uneasy about the functional test - it might fail under a load.

Otherwise LFAD.

@iaguis
Copy link
Member Author

iaguis commented Jan 26, 2016

I'm a bit uneasy about the functional test - it might fail under a load.

What do you mean? Why do you think it might fail?


#### New features and UX changes

- Add pod creation and start times to `rkt list` and `rkt status` ([#2030](https://github.com/coreos/rkt/pull/2030)).
Copy link
Member

Choose a reason for hiding this comment

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

Add a link to list.md as well?

@krnowak
Copy link
Collaborator

krnowak commented Jan 26, 2016

You are basically running rkt and getting a timestamp. If machine is under the load, then the time between the two might be longer than the delta we tolerate.

Is is probably just my paranoia and is highly unlikely, because a second is a lot of time. If it start failing in semaphore we can always make the delta larger.

iaguis and others added 4 commits January 26, 2016 14:24
To get the pod creation time we use the modification time in
`/var/lib/rkt/pods/*/<UUID>/pod`. It's written when the pod is prepared
and doesn't change afterwards.

To get the pod start time we use the modification time in
`/var/lib/rkt/pods/*/<UUID>/ppid`. It's written when the pod actually
starts and doesn't change afterwards.
@iaguis iaguis force-pushed the iaguis/list-creation-start-times branch from cd13cf4 to 0b034d6 Compare January 26, 2016 13:28
@iaguis
Copy link
Member Author

iaguis commented Jan 26, 2016

Updated.

Let's revisit if we have problems with the tests.

iaguis added a commit that referenced this pull request Jan 26, 2016
rkt: show created/started times in rkt list/status
@iaguis iaguis merged commit 646746d into rkt:master Jan 26, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants