hundreds-father-404
08/25/2022, 4:35 PMsparse-lifeguard-95737
08/25/2022, 4:41 PMsparse-lifeguard-95737
08/25/2022, 4:41 PMsparse-lifeguard-95737
08/25/2022, 4:42 PMwide-midnight-78598
08/25/2022, 4:47 PMsparse-lifeguard-95737
08/25/2022, 4:48 PM./pants <goal>
instead of docker run ….. ./pants <goal>
)sparse-lifeguard-95737
08/25/2022, 4:49 PMsparse-lifeguard-95737
08/25/2022, 4:50 PMfmt
in a container, but I do want to run `test`s and package
of pex_binary
targets in onewide-midnight-78598
08/25/2022, 4:50 PMsparse-lifeguard-95737
08/25/2022, 4:51 PMpackage
of docker_image
targets in an image, the docker-in-docker setup can get messy so I’d probably prefer to run it natively as long as it was possible to do so while still building any linked PEXes inside the imagewide-midnight-78598
08/25/2022, 4:52 PMpackage
and test
have the most obvious value, goal-wise, over lints/formatters/introspection tools being inside containers.bitter-ability-32190
08/25/2022, 5:03 PMcheck
maybe as well? Requires compilers for some backendssparse-lifeguard-95737
08/25/2022, 5:04 PMmypy
- makes me lean towards a per-subsystem option instead of a per-goal option in the idealsparse-lifeguard-95737
08/25/2022, 5:05 PMwitty-crayon-22786
08/25/2022, 5:27 PMtest_in_environment=X
and package_for_environment=Y
fields for tests and packages, respectively).
but it definitely makes sense to think through what it might look like to control the environment of other toolshundreds-father-404
08/25/2022, 6:00 PMbut IMO we’d get most of the value from a single global config to say “execute everything in image X instead of directly on the host”This is specifically what I'm trying to figure out: would it be sufficient to only have a single global toggle that is one environment, or will we need to allow more granularity. That impacts the design I strongly suspect people will want more granularity
proud-dentist-22844
08/25/2022, 6:17 PMpants.toml
or BUILD files is problematic.hundreds-father-404
08/25/2022, 6:20 PMproud-dentist-22844
08/25/2022, 6:23 PMplatform_constraints
(and/or os_constraints
) similar to interpreter_constraints
?proud-dentist-22844
08/25/2022, 6:25 PMhundreds-father-404
08/25/2022, 6:29 PMenvironment
field. The "Environment" will have all the relevant config like [python-bootstrap].search_paths
and env vars. It will also likely say whether to run on localhost vs remote execution vs Docker image. So, I'm thinking that if you say python_test(environment="centos7_docker")
, that implies to run in the Docker container
I'm trying to figure this modeling out today. It's tricky...so many use cases, and ideally we don't make Pants harder to use if you don't need this Docker featureproud-dentist-22844
08/25/2022, 6:30 PMqemu
or other virtualization tech to use virtualized arm64 from an x86_64 host.witty-crayon-22786
08/25/2022, 7:03 PMOof that’s a good point, Jacob. Stu and I also discussed how some environments are not possible to run from your machine: on macOS, I can run on macOS or Linux via Docker. On Linux, I can’t run on macOS (outside of remote execution)yea: there will almost certainly need to be a mechanism for matching the current host “fuzzily” against the configured Environments: for example, if an Environment doesn’t specify a platform, then it applies to all platforms, etc.
witty-crayon-22786
08/25/2022, 7:04 PMwide-midnight-78598
08/25/2022, 7:18 PMI can imagine something similar (config wise) being used to wire upOh how direly I would like this... My mishmash of qemu scripts building arm OSes and packages is ... There's no emoji to describe my painor other virtualization tech to use virtualized arm64 from an x86_64 host.qemu
proud-dentist-22844
08/25/2022, 7:37 PMEnvironment
and env vars?witty-crayon-22786
08/25/2022, 7:39 PMwitty-crayon-22786
08/25/2022, 7:40 PMenv
, when they mean environment variables, I'm not too worried about confusion.witty-crayon-22786
08/25/2022, 7:41 PMhundreds-father-404
08/25/2022, 9:53 PMwitty-crayon-22786
08/25/2022, 9:55 PMhundreds-father-404
08/25/2022, 10:07 PMhundreds-father-404
08/25/2022, 10:33 PMrun_in_container
is not set, then use a local environment: whichever is compatible
• if run_in_container
is set, it needs to be a docker environment
The main idea here is that "local" environments let you set platform-specific config, without forcing all targets to say when to use what. Pants can figure it out
--
if we go with the target approach, we could even have local_environment
and docker_environment
be distinct targetswitty-crayon-22786
08/25/2022, 10:34 PMproud-dentist-22844
08/25/2022, 10:38 PMproud-dentist-22844
08/25/2022, 10:49 PMhundreds-father-404
08/25/2022, 10:51 PMdocker_environment(prefer_local_environment=True)
If you have a local_environment
with compatible_platforms
that match yours, we won't use Dockerproud-dentist-22844
08/25/2022, 10:51 PM