{"action":"created","issue":{"url":"https://api.github.com/repos/openshift/origin/issues/8195","repository_url":"https://api.github.com/repos/openshift/origin","labels_url":"https://api.github.com/repos/openshift/origin/issues/8195/labels{/name}","comments_url":"https://api.github.com/repos/openshift/origin/issues/8195/comments","events_url":"https://api.github.com/repos/openshift/origin/issues/8195/events","html_url":"https://github.com/openshift/origin/pull/8195","id":142707986,"number":8195,"title":"Refactor of image resource quota evaluators","user":{"login":"miminar","id":1478803,"avatar_url":"https://avatars.githubusercontent.com/u/1478803?v=3","gravatar_id":"","url":"https://api.github.com/users/miminar","html_url":"https://github.com/miminar","followers_url":"https://api.github.com/users/miminar/followers","following_url":"https://api.github.com/users/miminar/following{/other_user}","gists_url":"https://api.github.com/users/miminar/gists{/gist_id}","starred_url":"https://api.github.com/users/miminar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miminar/subscriptions","organizations_url":"https://api.github.com/users/miminar/orgs","repos_url":"https://api.github.com/users/miminar/repos","events_url":"https://api.github.com/users/miminar/events{/privacy}","received_events_url":"https://api.github.com/users/miminar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":27,"created_at":"2016-03-22T16:44:40Z","updated_at":"2016-04-08T17:16:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/8195","html_url":"https://github.com/openshift/origin/pull/8195","diff_url":"https://github.com/openshift/origin/pull/8195.diff","patch_url":"https://github.com/openshift/origin/pull/8195.patch"},"body":"- Made image processing more readable.\r\n- Reduced number of queries to etcd.\r\n- Caching images in an expiring cache. The cache is shared within a registry\r\n  instance.\r\n- Ditched global variables.\r\n- Caching registry addresses in a lru cache. The cache is shared within a registry instance.\r\n- Using helpers to parse and create names of ImageStreamImages and ImageStreamTags.\r\n- Instantiate structs with a field names.\r\n- Added limit range admission checks limitting maximum image size.\r\n- Improved error reporting of failed builds.\r\n\r\n## TODO:\r\n\r\n- [ ] ~~share imagestream cache between all the admission plugins and resource controllers~~\r\n  - would require too big a change to the core\r\n- [x] `openshift.io/imagestreamimages` is a renamed `openshift.io/images` with almost the same semantics\r\n  - the difference is that all unique images tagged in a project are counted\r\n  - iow. no distinction is done between internally and externally managed images\r\n    - the purpose is a reduction of a number of queries to etcd\r\n- [x] `openshift.io/image-size` is a renamed `openshift.io/imagesize` with the same semantics\r\n  - this time, however, the admission is done only on `ImageStreamMapping` objects; we don't mind tagging such a pushed object to other image streams\r\n- [x] `openshift.io/imagestreamtags` is a new addition to quota resources\r\n  - it sets a limit on number of unique references (either internal or external) to images in the project\r\n  - specified by setting resource quota object\r\n- [x] The admission checks shall be done on `{CREATE} of ImageStreamImport`\r\n  - *Importing a repository has a max limit that is passed into the ISI registry from config - we'll need to pass that same max limit into the evaluator and treat an ISI as a +MAX. importing tags can be +N tags* \r\n- [x] relax precision on usage counting\r\n  - in the registry, cache quota and limit objecs in an expiring cache with at least 2 minute TTL\r\n  - this will highly reduce number of queries to etcd store during a push\r\n  - on the other hand, it will allow an abuser to push few images over the quota, but few images over the limit isn't such a big problem\r\n- [x] don't resolve `ImageStreamTags` and `DockerImage` references\r\n  - treat them automatically as +1 in `openshift.io/imagestreamimages` and `openshift.io/imagestreamtags`\r\n- [x] cache quota and limit range object in the registry during blob upload\r\n- [x] allow to disable quota enforcement in the registry\r\n  - add a flage to disable quote enforcement to the `oadm registry`\r\n  - pass env variable `OPENSHIFT_ENFORCE_QUOTA` to the registry\r\n  - by default, enforce quota in new deployment configs and don't enforce for the old ones\r\n- [x] fix extended tests\r\n"},"comment":{"url":"https://api.github.com/repos/openshift/origin/issues/comments/207522303","html_url":"https://github.com/openshift/origin/pull/8195#issuecomment-207522303","issue_url":"https://api.github.com/repos/openshift/origin/issues/8195","id":207522303,"user":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"created_at":"2016-04-08T17:16:40Z","updated_at":"2016-04-08T17:16:40Z","body":"[test]\n\nOn Fri, Apr 8, 2016 at 1:12 PM, OpenShift Bot <notifications@github.com>\nwrote:\n\n> continuous-integration/openshift-jenkins/test NOTFOUND (\n> https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/2839/)\n> (Extended Tests: core(openshift image quota admission), core(image\n> limit|image resource)), core(openshift image))\n>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly or view it on GitHub\n> <https://github.com/openshift/origin/pull/8195#issuecomment-207520862>\n>\n"}}