Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up pants.remote.ini for remoting Python unit tests #7990

Merged

Conversation

Eric-Arellano
Copy link
Contributor

@Eric-Arellano Eric-Arellano commented Jul 1, 2019

Per #7649, we are working to remote unit tests in CI.

This implements step #2, which allows us to run unit tests locally (several, but not all tests). Here, we set up pants.remote.ini so that users only must point to it and provide the authentication token.

pants.ini Outdated
# TODO(#7735): We need to add this entry for remoting to be able to discover a valid
# interpreter, because <PATH> will refer to the host PATH and not the remote value. This value
# was found by inspecting the docker image for remoting.
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/python3.6/bin:/usr/local/go/bin",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not comment this out because it should not cause failures, at least in most instances. If any of these entries do not exist on the machine, then Pex / Pants will just try the other entries in <PEXRC> and <PATH> (which is the host PATH).

By leaving it in, it's one less thing that users have to change to run remoting.

I see why we might want to comment it out by default, though, and am happy to do so if you think it's worth it.

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, we should either resolve the platform issue, or (if this is really a good default) submit it as the default to pex.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or (if this is really a good default) submit it as the default to pex.

What do you mean?

we should either resolve the platform issue

I'd prefer we don't let the platform issue block this PR, because we seem to still be at least a few days away from a good solution. Agreed that it will be great to remove this hack asap.

pants.ini Outdated
remote_execution_extra_platform_properties: [
# This allows network requests, e.g. to resolve dependencies with Pex.
"dockerNetwork=standard",
"container-image=docker://marketplace.gcr.io/google/rbe-ubuntu16-04@sha256:da0f21c71abce3bbb92c3a0c44c3737f007a82b60f8bd2930abc55fe64fc2729",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stu and I discussed instead using our custom Centos7 image. For now, we'll stick with this because it's Ubuntu 16 so closer to what we have in CI. It's possible that we will need to revisit this sometime soon.

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use whatever is closest to our travis environment probably... the Centos6/7 would primarily be relevant to wheel building, but our unit tests successfully run PEX resolves directly in the travis environment currently, and it would probably reduce complexity a bit to not change the platform we're running unit/integration tests on right now.

@Eric-Arellano
Copy link
Contributor Author

Blocked by #7991.

@illicitonion
Copy link
Contributor

Works for me, as long as @stuhood's concerns are addressed :)

Eric-Arellano added a commit that referenced this pull request Jul 3, 2019
### Problem
We want to allow users to permanently configure all remoting options in their `pants.ini`, without that config triggering Pants always using remoting. Tangibly, we are trying to land #7990 to setup our own usage and can't get green CI because Pants is trying to remote things it shouldn't.

Instead, users should be able to turn on remoting at the per-invocation level, just like we have `--enable-pantsd`. 

### Solution
Introduce `--[no-]remote-execution`. For now, this defaults to `False` as this is an alpha feature and it does not work without other remoting config.

### Result
Users can have all their remoting config setup and still be able to entirely run locally. Also now more explicit when you are and are not remoting.
@Eric-Arellano
Copy link
Contributor Author

This is now ready for review.

pants.ini Outdated Show resolved Hide resolved
@Eric-Arellano Eric-Arellano changed the title Set up pants.ini for remoting Python unit tests Set up pants.remote.ini for remoting Python unit tests Jul 4, 2019
Eric-Arellano added a commit that referenced this pull request Jul 4, 2019
#7991 added the flag `--[no-]remote-exeuction` to toggle on and off remote behavior. There, out of error, it was only used to toggle the remote execution runner, not also the remote store.

This is causing #7990 to continue to fail.
@Eric-Arellano Eric-Arellano merged commit b2602ea into pantsbuild:master Jul 4, 2019
@Eric-Arellano Eric-Arellano deleted the remoting-local-unit-tests branch July 4, 2019 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants