{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/36051","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/36051/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/36051/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/36051/events","html_url":"https://github.com/saltstack/salt/issues/36051","id":174921254,"number":36051,"title":"Packaging salt-minion for debian/ubuntu with fewer dependencies","user":{"login":"stephane-martin","id":3155613,"avatar_url":"https://avatars.githubusercontent.com/u/3155613?v=3","gravatar_id":"","url":"https://api.github.com/users/stephane-martin","html_url":"https://github.com/stephane-martin","followers_url":"https://api.github.com/users/stephane-martin/followers","following_url":"https://api.github.com/users/stephane-martin/following{/other_user}","gists_url":"https://api.github.com/users/stephane-martin/gists{/gist_id}","starred_url":"https://api.github.com/users/stephane-martin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephane-martin/subscriptions","organizations_url":"https://api.github.com/users/stephane-martin/orgs","repos_url":"https://api.github.com/users/stephane-martin/repos","events_url":"https://api.github.com/users/stephane-martin/events{/privacy}","received_events_url":"https://api.github.com/users/stephane-martin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Pending%20Discussion","name":"Pending Discussion","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/37","html_url":"https://github.com/saltstack/salt/milestones/Blocked","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/37/labels","id":343741,"number":37,"title":"Blocked","description":"Issues which are blocked in some way, whether they need further discussion, clarification, justification, or are blocked for some other reason.","creator":{"login":"basepi","id":702318,"avatar_url":"https://avatars.githubusercontent.com/u/702318?v=3","gravatar_id":"","url":"https://api.github.com/users/basepi","html_url":"https://github.com/basepi","followers_url":"https://api.github.com/users/basepi/followers","following_url":"https://api.github.com/users/basepi/following{/other_user}","gists_url":"https://api.github.com/users/basepi/gists{/gist_id}","starred_url":"https://api.github.com/users/basepi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basepi/subscriptions","organizations_url":"https://api.github.com/users/basepi/orgs","repos_url":"https://api.github.com/users/basepi/repos","events_url":"https://api.github.com/users/basepi/events{/privacy}","received_events_url":"https://api.github.com/users/basepi/received_events","type":"User","site_admin":false},"open_issues":581,"closed_issues":1019,"state":"open","created_at":"2013-05-28T22:24:12Z","updated_at":"2016-09-15T21:08:16Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-09-03T22:38:22Z","updated_at":"2016-09-15T22:33:14Z","closed_at":null,"body":"Hello,\r\n\r\nthe official deb packages for salt minions currently have dependencies on multiple packages. For example:\r\n- python-jinja2\r\n- python-yaml\r\n- python-pkg-resources\r\n- python-m2crypto\r\n- python-crypto,\r\n- python-msgpack\r\n- python-zmq\r\n\r\nThat's a bit impractical, because every minion must have these packages installed, and because it somewhat pollutes the global python site-packages directory (hell happens if you mix them with pip installs afterwards).\r\n\r\n**dh-virtualenv** (https://github.com/spotify/dh-virtualenv) provides a way to package python apps as self-contained virtualenv.\r\n\r\nI experimented with it and I was able to package the minion. You can find the results here: https://github.com/stephane-martin/salt-debian-packaging/tree/master/dist.\r\n\r\nFor example on jessie: \r\n```\r\ndpkg-deb --info saltbundledminion_2016.3.3-8_amd64.deb\r\n[...]\r\nPre-Depends: dpkg, python, python2.7, python-minimal, python2.7-minimal\r\nDepends: libc6 (>= 2.17), libgcc1 (>= 1:4.1.1), libgmp10, libstdc++6 (>= 4.9), libsystemd0 (>= 214), libyaml-0-2, zlib1g (>= 1:1.2.0), init-system-helpers (>= 1.18~), libssl1.0.0\r\n```\r\n\r\nFor jessie and xenial, the deb package installs a systemd service `saltbundledminion`.\r\nOn trusty, upstart is used instead.\r\n\r\nIf you want to try the packages :\r\n- please note it's an experiment. **No guarantee it works as expected**.\r\n- first uninstall the official minion package\r\n- then install the saltbundledminion package (it won't overwrite your existing config files in `/etc/salt`)\r\n\r\nSome glitches I had to take care about:\r\n- systemd notify only works correctly when the systemd python package is installed in the virtualenv (see my comment at the end of here: https://github.com/saltstack/salt-pack/issues/131)\r\n- salt requires the redis python module to make its own redis module works. So I added it to the virtualenv\r\n- grains like `oscodename` are not complete, if a small package `lsb_release.py'` is not a present. So I added it directly in packaging. See https://github.com/saltstack/salt/issues/35262\r\n- a `python-apt` module is mandatory to perform some tasks with salt apt module. Unfortunately this python-apt module is not available as a pip install. So I added directly in packaging.\r\n- `salt '*' test.version` returns *2016.3.0* instead of *2016.3.3* when you package the salt minion from the salt release tarball instead of a git clone (it seems that salt setup.py does some black magic based on git tags to guess the version of the current salt install...). I patched a bit the install process to get the right version number.\r\n\r\nProbably there are others that I haven't seen yet...\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/247473852","html_url":"https://github.com/saltstack/salt/issues/36051#issuecomment-247473852","issue_url":"https://api.github.com/repos/saltstack/salt/issues/36051","id":247473852,"user":{"login":"dmurphy18","id":9943204,"avatar_url":"https://avatars.githubusercontent.com/u/9943204?v=3","gravatar_id":"","url":"https://api.github.com/users/dmurphy18","html_url":"https://github.com/dmurphy18","followers_url":"https://api.github.com/users/dmurphy18/followers","following_url":"https://api.github.com/users/dmurphy18/following{/other_user}","gists_url":"https://api.github.com/users/dmurphy18/gists{/gist_id}","starred_url":"https://api.github.com/users/dmurphy18/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmurphy18/subscriptions","organizations_url":"https://api.github.com/users/dmurphy18/orgs","repos_url":"https://api.github.com/users/dmurphy18/repos","events_url":"https://api.github.com/users/dmurphy18/events{/privacy}","received_events_url":"https://api.github.com/users/dmurphy18/received_events","type":"User","site_admin":false},"created_at":"2016-09-15T22:33:14Z","updated_at":"2016-09-15T22:33:14Z","body":"@stephane-martin using virtualenv has been looked at for Salt but it has a number of caveats which make it an issue to support in Python 2.7.  However with Python 3 that has changed given the env support and we have considered that using a virtual env might be useful there, but no firm decisions have been made, and full movement to an only Python 3 environment is still some time away, this is Python 2.7 no longer in use. \r\n\r\nAs for dependencies, with more modern OS versions it is not an issue since they are usually already available and it is only on the older OSs that it becomes an issue in supplying recent versions of packages, for example: Ubuntu 12.04."}}
{"actor":{"display_login":"dmurphy18"}}