bulky-evening-62934
04/09/2020, 2:14 PM/tmp
to do the job, but I don’t have enough space for /tmp
, which option can point it to another directory ?hundreds-father-404
04/09/2020, 4:16 PM./pants --print-exception-stacktrace
?hundreds-father-404
04/09/2020, 4:21 PM./pants binary
on the BUILD file from yesterday with tensorflow
, or something else?bulky-evening-62934
04/09/2020, 4:23 PMhundreds-father-404
04/09/2020, 4:46 PMpytest
and boto3
. But, it’s very important to us Pants developers that we have a strong story around data science workflows, such as being able to use tensorflow, so we’ll need to figure this out.hundreds-father-404
04/10/2020, 3:52 PMbulky-evening-62934
04/10/2020, 3:59 PMinterpreter_constraints = "CPython>=3.7"
interpreter_search_paths = "<PYENV>"
in pants.toml
,
But it still tries to create a virtual env by py36 (I configure the PYENV_ROOT and there is 3.7.5 installed)hundreds-father-404
04/10/2020, 4:03 PMCPython>=3.7
to the default, rather than overriding the value.
you’ll want to do this to instead override the value:
[python-setup]
interpreter_constraints = ["CPython>=3.7"]
interpreter_search_paths = ["<PYENV>"]
You can run ./pants help-advanced python-setup
for more information on the options, including the expected types.
--
I’m sorry for this confusion. I think this is probably a misfeature. Imo, it would be better if we made you be explicit in adding instead of overriding by doing this:
interpreter_constraints.add = ["CPython>=3.7"]
hundreds-father-404
04/10/2020, 4:19 PMbulky-evening-62934
04/10/2020, 4:21 PM./pants binary XXXX
, but it stucks at creating the venv to make pants workhundreds-father-404
04/10/2020, 4:25 PMit stucks at creating the venv to make pants workOkay, this sounds like the
./pants
script is the issue, rather than this option.
So, there are possibly multiple Python interpreters that Pants will end up using.
The first is the Python interpreter that Pants uses to run itself - this must be Python 3.6+ and will be determined by the ./pants
script. You can override it by setting the env var PYTHON
, e.g. export PYTHON=python3.7
The other is what Pants uses for subprocesses when it does things like runs Pytest. This doesn’t need to be the same interpreter that you use to run Pants itself; it might be, but it doesn’t need to be. For example, Pants supports if you have Python 2 code. Even though Pants needs Python 3.6 to run, it can still run code that is Python 2. This is like how Black and MyPy need Python 3 to run but work on Python 2 code. Those two python-setup
options you’re setting only impact this interpreter selection; they don’t impact what is used by ./pants
.
Here, try setting PYTHON=python3.7
(or the more precise path if you have it, e.g. the output of which python3.7
)hundreds-father-404
04/10/2020, 4:26 PMbut it stucks at creating the venv to make pants workHm, do you have an error message for this, by chance?
bulky-evening-62934
04/10/2020, 4:40 PMpython.h
, so I fix it by installing python3-dev
thanks for your explanation, I will look at the pants script to understand how it uses python 3.6
To make sure that I understand everything correctly, the interpreter_constraints
is not applied to the python version used by pants itself ?bulky-evening-62934
04/10/2020, 5:06 PMbulky-evening-62934
04/10/2020, 5:07 PM/tmp
?hundreds-father-404
04/10/2020, 5:08 PMhundreds-father-404
04/10/2020, 5:10 PMenough-analyst-54434
04/10/2020, 5:14 PM/tmp/process-executionIeivdN/...
, IOW pex is running here in v2 locally and the v2 local sandbox system works in /tmp
by default, so that needs to be moved in @bulky-evening-62934's case. Assuming that's right, I'm looking to see if we have a knob for this....hundreds-father-404
04/10/2020, 5:17 PMenough-analyst-54434
04/10/2020, 5:19 PMenough-analyst-54434
04/10/2020, 5:19 PMenough-analyst-54434
04/10/2020, 5:20 PMenough-analyst-54434
04/10/2020, 5:22 PMhundreds-father-404
04/10/2020, 5:24 PMBy “so much memory” I assume you mean so much disk.Ah, yes, I did mean this. Okay, sounds good. I’ll open an issue and ask Greg if it’d be easy for him to knock out.
hundreds-breakfast-49010
04/10/2020, 6:04 PMTMPDIR
hundreds-breakfast-49010
04/10/2020, 6:04 PMenough-analyst-54434
04/10/2020, 6:05 PMhundreds-breakfast-49010
04/10/2020, 6:05 PMpip-
temp files show up in /tmp stillhundreds-breakfast-49010
04/10/2020, 6:07 PMhundreds-breakfast-49010
04/10/2020, 6:07 PMTMPDIR
and then tell people to use it without making any changes to pex properenough-analyst-54434
04/10/2020, 6:07 PMPIP_...
https://pip.pypa.io/en/stable/user_guide/#environment-variables but Pex runs Pip in isolated mode, so no use I think:
--isolated Run pip in an isolated mode, ignoring environment variables and user configuration.
hundreds-breakfast-49010
04/10/2020, 6:09 PMwheel_dir
is the option pip cares about?enough-analyst-54434
04/10/2020, 6:10 PMhundreds-breakfast-49010
04/10/2020, 6:11 PM./pex_root
, but I"m not sure what dir that option takes to be the .
enough-analyst-54434
04/10/2020, 6:11 PMhundreds-breakfast-49010
04/10/2020, 6:11 PMenough-analyst-54434
04/10/2020, 6:12 PMhundreds-breakfast-49010
04/10/2020, 6:12 PMTMPDIR
varhundreds-breakfast-49010
04/10/2020, 6:12 PMenough-analyst-54434
04/10/2020, 6:12 PMenough-analyst-54434
04/10/2020, 6:13 PMso it's just htese Pip tempdirs that we should expect to see being still written to /tmpYes.
hundreds-breakfast-49010
04/10/2020, 6:14 PMhundreds-breakfast-49010
04/10/2020, 6:14 PMTMPDIR
todayhundreds-breakfast-49010
04/10/2020, 6:14 PMhundreds-father-404
04/10/2020, 6:15 PMTMPDIR
fixes things when you have a spare moment?enough-analyst-54434
04/10/2020, 6:18 PMenough-analyst-54434
04/10/2020, 6:19 PMhundreds-breakfast-49010
04/10/2020, 6:19 PMhundreds-breakfast-49010
04/10/2020, 6:19 PMhundreds-breakfast-49010
04/10/2020, 6:20 PMhundreds-breakfast-49010
04/10/2020, 6:21 PMhundreds-father-404
04/10/2020, 6:22 PMulimit
. That would be good to include in the same sectionbulky-evening-62934
04/10/2020, 6:31 PM--cache-dir /tmp/tmprqaeuwas
bulky-evening-62934
04/10/2020, 6:32 PM/tmp
is because I’m using s3, and its disk is mounted on /mnt
hundreds-breakfast-49010
04/10/2020, 6:34 PM--cache-dir
is getting set?enough-analyst-54434
04/10/2020, 7:05 PM--disable-cache
and use a local (to EPR sandbox), throwaway PEX_ROOT like its base class HermeticPex already does: https://github.com/pantsbuild/pants/blob/55d2d02b8e30a97c8e62f6ddf9b9f57337647354/src/python/pants/backend/python/rules/hermetic_pex.py#L52-L60
Pex 2.1.7, which is in the backtrace here, has sanitized PEX_ROOT handling (https://github.com/pantsbuild/pex/pull/929) so this should work out. I'll send up a PR...enough-analyst-54434
04/10/2020, 7:22 PMbulky-evening-62934
04/14/2020, 10:08 AM1.27.0.dev3
, --cache-dir
now could use TMPDIR, but it still failed because resolved_dists
is still using /tmp
,
/home/ubuntu/.pyenv/versions/3.7.5/bin/python3.7 /mnt/tmp/process-executionhdCFxz/pex_root/pip.pex/49a647f5ed9e81dc8f85560600c53fbb4dfc60f0 --disable-pip-version-check --isolated --no-python-version-warning -q --cache-dir /mnt/tmp/process-executionhdCFxz/pex_root install --no-deps --no-index --only-binary :all: --target /mnt/tmp/process-executionhdCFxz/pex_root/installed_wheels/35830898f97169961ccf9a54a496b28734a1142b/tensorflow-2.1.0-cp37-cp37m-manylinux2010_x86_64.whl.ada6572daa8649f29e04fa85ea710176 --no-compile /tmp/tmp3_fu_pdh/resolved_dists/cp37-cp37m/tensorflow-2.1.0-cp37-cp37m-manylinux2010_x86_64.whl
(see the end of the command above)