[Buildbot-devel] Fwd: Escaping the slave virtualenv
Dustin J. Mitchell
dustin at v.igoro.us
Sat Nov 1 16:38:40 UTC 2014
In general, 'activate' is only useful for interactive use of a
virtualenv. For scripts, I recommend always using the full path
within the virtualenv. In this case, a shorter option than your
replacement is omitting the activate line, and running
./sandbox/bin/buildbot start slave. That will get you the proper
virtualenv for the buildslave code (by virtue of using the python
executable named in sandbox/bin/buildbot's first line) without setting
any environment variables. But what you have will work just fine.
Dustin
On Sat, Nov 1, 2014 at 2:11 AM, Kay Hayen <kay.hayen at gmail.com> wrote:
>
> (sorry for responding only privately. May I suggest to configure the default
> for the list to be otherwise, namely to reply to the list)
>
> Hello Vasily,
>
> you wrote:
>
>> Did you try manually reproducing what you're seeing (with all the
>> environment variables Buildbot so nicely dumps)?
>
> this is on 0.8.9 and indeed, using the PATH is already sufficient to
> reproduce. So this boils down to how to remove the PATH.
>
> I wasn't aware that lauching a virtualenv "python" without any other
> environment variables, already, catches you in that environment.
>
> I am right now starting it like this:
>
> #!/bin/bash
>
> cd /opt/buildbot
> source sandbox/bin/activate
> buildslave start slave
>
> I suppose, there may be a better way, to start it without the activate, that
> is changing the PATH, maybe sandbox/bin/python
>
> I am going to use this instead:
>
> #!/bin/bash
>
> cd /opt/buildbot
> ./sandbox/bin/python ./sandbox/bin/buildslave start slave
>
> It apparently works to start the slave. The script was more or less derived
> from the tutorial then.
>
> It also means, that the script will be unnecessary with systemd. I only kept
> it, because I had no idea how to source "activate" with systemd.
>
> Yours,
> Kay
>
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
>
More information about the devel
mailing list