Thanks to visit codestin.com
Credit goes to github.com

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

Conversation

@iaguis
Copy link
Member

@iaguis iaguis commented Dec 11, 2015

We store the size of the ACI in the database when we write it to the
CAS. We also store the size of the tree store when we render the ACI.
We also populate sizes of existing images after we do the migration to
the new db schema.

When we list images, we print the sum of these two sizes as the size of
the image. This means that if the image is fetched but never ran, it
won't be rendered to the tree store so it will take less space.

If the image is removed (rkt image rm), we also remove the ACIInfo
table associated with it, this means we don't have information about the
tree store size. It will be removed on the next garbage collection if
it's not referenced by any non-GCd pod.

Example:

> sudo rkt image list
ID  NAME    IMPORT TIME LAST USED   SIZE    LATEST
> sudo rkt fetch coreos.com/etcd:v2.0.10
[...]
> sudo rkt image list
ID          NAME            IMPORT TIME LAST USED   SIZE    LATEST
sha512-c03b055d02e5 coreos.com/etcd:v2.0.10 4 seconds ago   4 seconds ago   12MiB   false
> sudo rkt run coreos.com/etcd:v2.0.10
[...]
> sudo rkt image list
ID          NAME                        IMPORT TIME LAST USED   SIZE    LATEST
sha512-c03b055d02e5 coreos.com/etcd:v2.0.10             42 seconds ago  6 seconds ago   25MiB   false
sha512-5a4b9d6c657f coreos.com/rkt/stage1-coreos:0.13.0+git1bdd981  9 seconds ago   8 seconds ago   146MiB  false
> sudo rkt gc --grace-period=0s
Moving pod "eadcafde-fd07-478e-8bec-75ad05832ffe" to garbage
Garbage collecting pod "eadcafde-fd07-478e-8bec-75ad05832ffe"
> sudo rkt image gc
rkt: removed treestore "deps-sha512-24fb14daa5f366abb27d4531f7a73e745624b08091661605a2b2760fbb4765af"
rkt: removed treestore "deps-sha512-c0de11e9d504069810da931c94aece3bcc5430dc20f9a5177044eaef62f93fcc"
> sudo rkt image list
ID          NAME                        IMPORT TIME LAST USED   SIZE    LATEST
sha512-c03b055d02e5 coreos.com/etcd:v2.0.10             2 minutes ago   1 minute ago    12MiB   false
sha512-5a4b9d6c657f coreos.com/rkt/stage1-coreos:0.13.0+git1bdd981  1 minute ago    1 minute ago    73MiB   false

Fixes #1814

@iaguis
Copy link
Member Author

iaguis commented Dec 11, 2015

Oh, I use bufio.(*Reader).Discard which is not included in go1.4. But it looks like we're switching to go1.5 soon, right?

If not, I can work around it.

@iaguis iaguis modified the milestones: v0.14.0, v0.15.0 Dec 11, 2015
@krnowak
Copy link
Collaborator

krnowak commented Dec 11, 2015

@iaguis: Yeah, please work it around. Not sure how soon rkt will become go-1.5-only.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's wait with that for an official switchover.

@iaguis
Copy link
Member Author

iaguis commented Dec 11, 2015

@iaguis: Yeah, please work it around. Not sure how soon rkt will become go-1.5-only.

Done

store/migrate.go Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does ql support DEFAULT clause?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I just tested it.

@krnowak
Copy link
Collaborator

krnowak commented Dec 11, 2015

Ok, I'm done with the review. Tests? :P

We store the size of the ACI in the database when we write it to the
CAS. We also store the size of the tree store when we render the ACI.
We also populate sizes of existing images after we do the migration to
the new db schema.

When we list images, we print the sum of these two sizes as the size of
the image. This means that if the image is fetched but never ran, it
won't be rendered to the tree store so it will take less space.

If the image is removed (`rkt image rm`), we also remove the ACIInfo
table associated with it, this means we don't have information about the
tree store size. It will be removed on the next garbage collection if
it's not referenced by any non-GCd pod.
When calculating directory size.

Also, rearrange the linux/unsupported go files.
@krnowak
Copy link
Collaborator

krnowak commented Dec 14, 2015

Is there something that could use a test? I'm not really sure about it.

Anyway, LFAD, but let's wait for green (I had to restart semaphore build, TestFetch failed as usual).

@iaguis
Copy link
Member Author

iaguis commented Dec 14, 2015

Added a functional test

@krnowak
Copy link
Collaborator

krnowak commented Dec 14, 2015

I made comments in the commit instead of 'all files' view. Meh.

Some nits, but otherwise LFAD. Also restarted the semaphore job, because TestFetch.

@iaguis
Copy link
Member Author

iaguis commented Dec 14, 2015

Addressed your comments. Let's wait for green (again)

iaguis added a commit that referenced this pull request Dec 14, 2015
rkt: add image size to rkt image list
@iaguis iaguis merged commit 9ee8c23 into rkt:master Dec 14, 2015
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.

2 participants