{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleContainerTools/distroless/issues/153","repository_url":"https://api.github.com/repos/GoogleContainerTools/distroless","labels_url":"https://api.github.com/repos/GoogleContainerTools/distroless/issues/153/labels{/name}","comments_url":"https://api.github.com/repos/GoogleContainerTools/distroless/issues/153/comments","events_url":"https://api.github.com/repos/GoogleContainerTools/distroless/issues/153/events","html_url":"https://github.com/GoogleContainerTools/distroless/issues/153","id":282103492,"node_id":"MDU6SXNzdWUyODIxMDM0OTI=","number":153,"title":"Download packages more robustly","user":{"login":"drigz","id":632207,"node_id":"MDQ6VXNlcjYzMjIwNw==","avatar_url":"https://avatars1.githubusercontent.com/u/632207?v=4","gravatar_id":"","url":"https://api.github.com/users/drigz","html_url":"https://github.com/drigz","followers_url":"https://api.github.com/users/drigz/followers","following_url":"https://api.github.com/users/drigz/following{/other_user}","gists_url":"https://api.github.com/users/drigz/gists{/gist_id}","starred_url":"https://api.github.com/users/drigz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drigz/subscriptions","organizations_url":"https://api.github.com/users/drigz/orgs","repos_url":"https://api.github.com/users/drigz/repos","events_url":"https://api.github.com/users/drigz/events{/privacy}","received_events_url":"https://api.github.com/users/drigz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-12-14T13:38:50Z","updated_at":"2018-08-21T12:47:51Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Bazel's downloader is fairly robust: when you use a 'mirror.bazel.build' URL with `http_archive`, you can be confident it will not error out when fetching. However, as dpkg_parser.py uses urllib2 directly, it doesn't take advantage of this reliability.\r\n\r\nFrom skimming #72, it seems like work is underway to allow fixing a package version, and hosting it in a mirror. It would be good to take advantage of Bazel's downloader as part of this redesign.\r\n\r\nFor example, one error we've seen in CI:\r\n\r\n```\r\nERROR: error loading package 'src/docker': Encountered error while reading extension file 'file/packages.bzl': no such package '@package_bundle//file': dpkg_parser command failed: Traceback (most recent call last):\r\n  File \"/usr/lib/python2.7/runpy.py\", line 162, in _run_module_as_main\r\n    \"__main__\", fname, loader, pkg_name)\r\n  File \"/usr/lib/python2.7/runpy.py\", line 72, in _run_code\r\n    exec code in run_globals\r\n  File \"/home/kbuilder/.cache/bazel/_bazel_kbuilder/external/dpkg_parser/file/dpkg_parser.par/__main__.py\", line 188, in <module>\r\n  File \"/home/kbuilder/.cache/bazel/_bazel_kbuilder/external/dpkg_parser/file/dpkg_parser.par/__main__.py\", line 79, in main\r\n  File \"/home/kbuilder/.cache/bazel/_bazel_kbuilder/external/dpkg_parser/file/dpkg_parser.par/__main__.py\", line 107, in download_dpkg\r\n  File \"/usr/lib/python2.7/socket.py\", line 351, in read\r\n    data = self._sock.recv(rbufsize)\r\n  File \"/usr/lib/python2.7/httplib.py\", line 578, in read\r\n    return self._read_chunked(amt)\r\n  File \"/usr/lib/python2.7/httplib.py\", line 632, in _read_chunked\r\n    raise IncompleteRead(''.join(value))\r\nhttplib.IncompleteRead: IncompleteRead(4096 bytes read)\r\n (/home/kbuilder/.cache/bazel/_bazel_kbuilder/external/dpkg_parser/file/dpkg_parser.par --package-files /home/kbuilder/.cache/bazel/_bazel_kbuilder/external/debian_stretch/file/Packages.json,/home/kbuilder/.cache/bazel/_bazel_kbuilder/external/debian_stretch_backports/file/Packages.json --packages libpython2.7 --workspace-name package_bundle)\r\n```"},"comment":{"url":"https://api.github.com/repos/GoogleContainerTools/distroless/issues/comments/414661643","html_url":"https://github.com/GoogleContainerTools/distroless/issues/153#issuecomment-414661643","issue_url":"https://api.github.com/repos/GoogleContainerTools/distroless/issues/153","id":414661643,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDY2MTY0Mw==","user":{"login":"MarkusTeufelberger","id":950561,"node_id":"MDQ6VXNlcjk1MDU2MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/950561?v=4","gravatar_id":"","url":"https://api.github.com/users/MarkusTeufelberger","html_url":"https://github.com/MarkusTeufelberger","followers_url":"https://api.github.com/users/MarkusTeufelberger/followers","following_url":"https://api.github.com/users/MarkusTeufelberger/following{/other_user}","gists_url":"https://api.github.com/users/MarkusTeufelberger/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkusTeufelberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkusTeufelberger/subscriptions","organizations_url":"https://api.github.com/users/MarkusTeufelberger/orgs","repos_url":"https://api.github.com/users/MarkusTeufelberger/repos","events_url":"https://api.github.com/users/MarkusTeufelberger/events{/privacy}","received_events_url":"https://api.github.com/users/MarkusTeufelberger/received_events","type":"User","site_admin":false},"created_at":"2018-08-21T12:47:51Z","updated_at":"2018-08-21T12:47:51Z","author_association":"CONTRIBUTOR","body":"Yes, those are the scripts that I migrated over there a while ago - still waiting for the final lockfile design/support in Bazel to do a bigger overhaul and (hopefully) write most of it all in native skylark/starlark.\r\n\r\nFeedback is more than welcome, I didn't work on it lately but can catch up and improve if necessary."}}
{"actor":{"display_login":"MarkusTeufelberger"}}