<div dir="ltr">I'll check out giftwrap. never heard of it. But interesting.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 23, 2016 at 7:50 PM, Xav Paice <span dir="ltr"><<a href="mailto:xavpaice@gmail.com" target="_blank">xavpaice@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Can I suggest that using the tool <a href="https://github.com/openstack/giftwrap" rel="noreferrer" target="_blank">https://github.com/openstack/giftwrap</a><br>
might make live a bunch easier?<br>
<br>
I went down a similar path with building Debs in a venv using<br>
dh_virtualenv, with some good success when I sorted the shebang. I later<br>
found that the debs produced by Giftwrap are not only very easy to build<br>
and test, but also take a bunch less effort to maintain and create new<br>
packages for new things. To run the resulting code, I just symlink the<br>
${venv}/bin/$binary to /usr/local/bin and run the thing using very<br>
similar init scripts to the ones supplied by the distro packages. Works<br>
like a charm, because the shebang in the binary points at the venv, not<br>
the system python.<br>
<br>
I do, however, package the init scripts, sample configs, etc in a<br>
separate .deb, which is really very quick and easy and allows me to<br>
control the bits I want to, and let Giftwrap take care of the OpenStack<br>
code repos.<br>
<div><div class="h5"><br>
<br>
On Thu, 2016-06-23 at 23:40 +0000, Matt Joyce wrote:<br>
> I want the script to dynamically instantiate the venv is call activate<br>
> this at execution time and deactivate when done.<br>
><br>
><br>
><br>
> On June 23, 2016 5:12:07 PM EDT, Doug Hellmann <<a href="mailto:doug@doughellmann.com">doug@doughellmann.com</a>><br>
> wrote:<br>
> Excerpts from Silence Dogood's message of 2016-06-23 15:45:34 -0400:<br>
> I know from conversations that a few folks package their python apps as<br>
> distributable virtualenvs. spotify created dh-virtualenv for this. you<br>
> can do it pretty simply by hand.<br>
><br>
> I built a toolchain for building rpms as distributable virtualenvs and that<br>
> works really well.<br>
><br>
> What I'd like to do is make it so that every app that's built as a<br>
> virtualenv gets setup to automatically execute at call time in their<br>
> virtualenv.<br>
><br>
> I see two options:<br>
><br>
> 1) Dynamically generate a wrapper script during build and put it in the<br>
> RPM. Call the wrapper.<br>
><br>
> 2) Created a dependency global module ( as an rpm ) set it as a<br>
> dependency. And basically it'd be an autoexecuting import that<br>
><br>
> instantiates the virtualenv. it would probably know all it needs to<br>
> because I am building all my packages to an internal standard. Then when<br>
> building the APP rpm all I need to do is inject an import into the import<br>
> chain if it's being built as a virtualenv. Then I have what are<br>
> effectively statically compiled python apps.<br>
><br>
> I like 2. But 1 isn't very bad. Both are a little hokey.<br>
><br>
> Was curious if folks might have a preference, or a better idea.<br>
><br>
> Thanks.<br>
><br>
> Matt<br>
><br>
> I'm not sure what you mean by a "wrapper script". If you run the<br>
> Python console script from within the virtualenv you've packaged,<br>
> you shouldn't need to do anything to "activate" that environment<br>
> separately because it should have the correct shebang line.<br>
><br>
> Are you seeing different behavior?<br>
><br>
> Doug<br>
><br>
><br>
</div></div>> ______________________________________________________________<br>
<span class="">><br>
> OpenStack-operators mailing list<br>
> <a href="mailto:OpenStack-operators@lists.openstack.org">OpenStack-operators@lists.openstack.org</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators</a><br>
><br>
</span>> _______________________________________________<br>
<span class="">> OpenStack-operators mailing list<br>
> <a href="mailto:OpenStack-operators@lists.openstack.org">OpenStack-operators@lists.openstack.org</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators</a><br>
<br>
<br>
<br>
</span>_______________________________________________<br>
<div class="HOEnZb"><div class="h5">OpenStack-operators mailing list<br>
<a href="mailto:OpenStack-operators@lists.openstack.org">OpenStack-operators@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators</a><br>
</div></div></blockquote></div><br></div>