From b2602eaf8912d58d7e8ed220d9dcc2f9cb8e0f46 Mon Sep 17 00:00:00 2001 From: Eric Arellano Date: Thu, 4 Jul 2019 16:57:11 -0700 Subject: [PATCH] Set up pants.remote.ini for remoting Python unit tests (#7990) Per https://github.com/pantsbuild/pants/issues/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.remote.ini | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 pants.remote.ini diff --git a/pants.remote.ini b/pants.remote.ini new file mode 100644 index 00000000000..6da3515f330 --- /dev/null +++ b/pants.remote.ini @@ -0,0 +1,40 @@ +# For goals that you'd like to remote, first install the Google cloud CLI and then log in to an +# an account authorized to run the Pants project (you may need to ask a Pants committer for +# to authorize your account). Then, point to this config file and provide the oauth token like this: +# +# $ ./pants --pants-config-files=pants.remote.ini +# --remote-oauth-bearer-token-path=<(gcloud auth application-default print-access-token | perl -p -e 'chomp if eof') +# --no-v1 --v2 test tests/python/pants_test/util:strutil +# +# Remoting does not work for every goal, so you should not permanently point to this ini file, e.g. +# via an env var; only point to it when you want to remote a specific invocation. + +[DEFAULT] +remote_execution: True +remote_execution_server: remotebuildexecution.googleapis.com +remote_store_server: remotebuildexecution.googleapis.com +# This file might not exist on your machine. If this default fails, run `find /usr -name '*.pem'` +# and override this value via the env var PANTS_REMOTE_CA_CERTS_PATH. +remote_ca_certs_path: /usr/local/etc/openssl/cert.pem +remote_instance_name: projects/pants-remoting-beta/instances/default_instance +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", + ] + + +[python-setup] +interpreter_search_paths: [ + '', + '' + # TODO(#7735): We need to add this entry for remoting to be able to discover a valid + # interpreter, because 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", + ] + + +[python-native-code] +ld_flags: [] +cpp_flags: []