{"action":"created","issue":{"url":"https://api.github.com/repos/coreos/rkt/issues/2890","repository_url":"https://api.github.com/repos/coreos/rkt","labels_url":"https://api.github.com/repos/coreos/rkt/issues/2890/labels{/name}","comments_url":"https://api.github.com/repos/coreos/rkt/issues/2890/comments","events_url":"https://api.github.com/repos/coreos/rkt/issues/2890/events","html_url":"https://github.com/coreos/rkt/issues/2890","id":164601839,"number":2890,"title":"`rkt image rm` doesn't remove the rendered image in treestore","user":{"login":"yifan-gu","id":3278588,"avatar_url":"https://avatars.githubusercontent.com/u/3278588?v=3","gravatar_id":"","url":"https://api.github.com/users/yifan-gu","html_url":"https://github.com/yifan-gu","followers_url":"https://api.github.com/users/yifan-gu/followers","following_url":"https://api.github.com/users/yifan-gu/following{/other_user}","gists_url":"https://api.github.com/users/yifan-gu/gists{/gist_id}","starred_url":"https://api.github.com/users/yifan-gu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yifan-gu/subscriptions","organizations_url":"https://api.github.com/users/yifan-gu/orgs","repos_url":"https://api.github.com/users/yifan-gu/repos","events_url":"https://api.github.com/users/yifan-gu/events{/privacy}","received_events_url":"https://api.github.com/users/yifan-gu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/coreos/rkt/labels/component/store","name":"component/store","color":"0052cc"},{"url":"https://api.github.com/repos/coreos/rkt/labels/kind/bug","name":"kind/bug","color":"FF0000"},{"url":"https://api.github.com/repos/coreos/rkt/labels/priority/P1","name":"priority/P1","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/coreos/rkt/milestones/43","html_url":"https://github.com/coreos/rkt/milestones/v1.11.0","labels_url":"https://api.github.com/repos/coreos/rkt/milestones/43/labels","id":1815915,"number":43,"title":"v1.11.0","description":"","creator":{"login":"lucab","id":98086,"avatar_url":"https://avatars.githubusercontent.com/u/98086?v=3","gravatar_id":"","url":"https://api.github.com/users/lucab","html_url":"https://github.com/lucab","followers_url":"https://api.github.com/users/lucab/followers","following_url":"https://api.github.com/users/lucab/following{/other_user}","gists_url":"https://api.github.com/users/lucab/gists{/gist_id}","starred_url":"https://api.github.com/users/lucab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucab/subscriptions","organizations_url":"https://api.github.com/users/lucab/orgs","repos_url":"https://api.github.com/users/lucab/repos","events_url":"https://api.github.com/users/lucab/events{/privacy}","received_events_url":"https://api.github.com/users/lucab/received_events","type":"User","site_admin":false},"open_issues":43,"closed_issues":3,"state":"open","created_at":"2016-06-08T15:21:51Z","updated_at":"2016-07-08T19:39:34Z","due_on":"2016-07-20T22:00:00Z","closed_at":null},"comments":1,"created_at":"2016-07-08T19:39:34Z","updated_at":"2016-07-08T20:36:31Z","closed_at":null,"body":"**Environment**\r\n\r\n```\r\nrkt Version: 1.9.1+git63666dc\r\nappc Version: 0.8.4\r\nGo Version: go1.6.2\r\nGo OS/Arch: linux/amd64\r\nFeatures: +TPM -PROFILE\r\n--\r\nLinux 3.19.0-64-generic x86_64\r\n--\r\nNAME=\"Ubuntu\"\r\nVERSION=\"15.04 (Vivid Vervet)\"\r\nID=ubuntu\r\nID_LIKE=debian\r\nPRETTY_NAME=\"Ubuntu 15.04\"\r\nVERSION_ID=\"15.04\"\r\nHOME_URL=\"http://www.ubuntu.com/\"\r\nSUPPORT_URL=\"http://help.ubuntu.com/\"\r\nBUG_REPORT_URL=\"http://bugs.launchpad.net/ubuntu/\"\r\n--\r\nsystemd 219\r\n+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN\r\n```\r\n\r\n**What did you do?**\r\n\r\n```\r\n$ sudo rkt list\r\nUUID\tAPP\tIMAGE NAME\tSTATE\tCREATED\tSTARTED\tNETWORKS\r\n# empty\r\n\r\n$ sudo rkt image list\r\nID\tNAME\tIMPORT TIME\tLAST USED\tSIZE\tLATEST\r\n# empty\r\n\r\n$ sudo ls /var/lib/rkt/cas/tree\r\n# empty\r\n\r\n$ sudo rkt fetch --insecure-options=image,ondisk docker://busybox\r\nimage: remote fetching from URL \"docker://busybox\"\r\nDownloading sha256:a3ed95caeb0 [===============================]     32 B / 32 B\r\nDownloading sha256:8ddc19f1652 [===============================] 668 KB / 668 KB\r\nsha512-93a6493db935409f38f06420bbc2f6f0\r\n\r\n$ sudo ls /var/lib/rkt/cas/tree\r\ndeps-sha512-689a997937d2dd8a77c43273ab92a77e377f0ec40bb2808ccf62a2fb3084a8f0\r\n\r\n\r\n$ sudo rkt image rm  sha512-93a6493db935409f38f06420bbc2f6f0\r\nsuccessfully removed aci for image: \"sha512-93a6493db935409f38f06420bbc2f6f09cd26e554fd41e6e27df80c13a920fdd\"\r\nrm: 1 image(s) successfully removed\r\n\r\n$ sudo ls /var/lib/rkt/cas/tree\r\ndeps-sha512-689a997937d2dd8a77c43273ab92a77e377f0ec40bb2808ccf62a2fb3084a8f0\r\n\r\n$ sudo rkt image gc\r\ngc: removed treestore \"deps-sha512-689a997937d2dd8a77c43273ab92a77e377f0ec40bb2808ccf62a2fb3084a8f0\"\r\n\r\n$ sudo ls /var/lib/rkt/cas/tree\r\n# empty\r\n```\r\n\r\n**What did you expect to see?**\r\n\r\nAfter `rkt image rm`, the treestore should be removed when no pod is using it.\r\n\r\n**What did you see instead?**\r\n\r\nThe treestore is left there until `rkt image gc`.\r\n"},"comment":{"url":"https://api.github.com/repos/coreos/rkt/issues/comments/231466151","html_url":"https://github.com/coreos/rkt/issues/2890#issuecomment-231466151","issue_url":"https://api.github.com/repos/coreos/rkt/issues/2890","id":231466151,"user":{"login":"sgotti","id":1690273,"avatar_url":"https://avatars.githubusercontent.com/u/1690273?v=3","gravatar_id":"","url":"https://api.github.com/users/sgotti","html_url":"https://github.com/sgotti","followers_url":"https://api.github.com/users/sgotti/followers","following_url":"https://api.github.com/users/sgotti/following{/other_user}","gists_url":"https://api.github.com/users/sgotti/gists{/gist_id}","starred_url":"https://api.github.com/users/sgotti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgotti/subscriptions","organizations_url":"https://api.github.com/users/sgotti/orgs","repos_url":"https://api.github.com/users/sgotti/repos","events_url":"https://api.github.com/users/sgotti/events{/privacy}","received_events_url":"https://api.github.com/users/sgotti/received_events","type":"User","site_admin":false},"created_at":"2016-07-08T20:36:31Z","updated_at":"2016-07-08T20:36:31Z","body":"@yifan-gu Before the explanation I want to preface that I'm writing some notes/issue on a store refactor that cover also this.\r\n\r\nThis is the wanted behavior (with appc) since in the chain fetch -> store -> render , the tree store is a caching layer of a rendered image (render phase). \r\nBut a tree store is not tied 1 to 1 with an ACI since it may have dependencies and since the dependencies are only resolved by discovery (meta or store based discovery) starting from the same ACI, if you update e dependency, you can end up with multiple tree store for the same ACI (for this reason the tree store ID is the sha512 sum of the flattened dependency tree). So the ACI and the tree store are decoupled. \r\n\r\nAdditionally removing an ACI should also remove all the tree stores having it as the top ACI and this will require that you should first check that every related treestore is not referenced by any pod or fail the removal. I thought it was better to decouple this and make the treestore garbage collectable to avoid a lot of unmanageable locking (or adding some pinning) between the store, the tree store and the pods.\r\n\r\nIn my proposal one of the multiple steps will be to also split the two implementation for multiple reasons, for example having per user stores but an unique tree store is it needs chroot capabilities to be rendered.\r\nI also noticed some not very correct changes that, my bad since I hadn't time to review, covered adding tree store size to the ACIInfo table.\r\n\r\nWith oci the tree store can be tied to the manifest digests, so there will be just one tree store per manifest, but it'll also prefer to keep it decoupled since the user should want to GC the ACI store to remove unferenced blobs and avoid the same problems as above.\r\n\r\n"}}
{"actor":{"display_login":"sgotti"}}