Roll out remote config for Python 3.7 on Windows RBE
PiperOrigin-RevId: 296949118 Change-Id: I9881ad0c76cc1095955e643096143ecc206fccf6
This commit is contained in:
parent
50e990e20c
commit
e9c7aa7f1a
4
.bazelrc
4
.bazelrc
@ -406,9 +406,7 @@ build:rbe_win --define=override_eigen_strong_inline=true
|
||||
build:rbe_win --jobs=500
|
||||
|
||||
build:rbe_win_py37 --config=rbe
|
||||
build:rbe_win_py37 --repo_env=PYTHON_BIN_PATH=C:\\Python37\\python.exe
|
||||
build:rbe_win_py37 --repo_env=PYTHON_LIB_PATH=C:\\Python37\\lib\\site-packages
|
||||
build:rbe_win_py37 --repo_env=TF_PYTHON_CONFIG_REPO=@org_tensorflow//third_party/toolchains/preconfig/win_1803/py37
|
||||
build:rbe_win_py37 --repo_env=TF_PYTHON_CONFIG_REPO="@windows_py37_config_python"
|
||||
build:rbe_win_py37 --python_path=C:\\Python37\\python.exe
|
||||
|
||||
build:rbe_win_py38 --config=rbe
|
||||
|
7
third_party/remote_config/BUILD.tpl
vendored
7
third_party/remote_config/BUILD.tpl
vendored
@ -2,10 +2,7 @@ platform(
|
||||
name = "platform",
|
||||
constraint_values = [
|
||||
"@bazel_tools//platforms:x86_64",
|
||||
"@bazel_tools//platforms:linux",
|
||||
"@bazel_tools//platforms:%{platform}",
|
||||
],
|
||||
exec_properties = {
|
||||
"container-image": "%{container_image}",
|
||||
"Pool": "default",
|
||||
},
|
||||
exec_properties = %{exec_properties},
|
||||
)
|
||||
|
6
third_party/remote_config/common.bzl
vendored
6
third_party/remote_config/common.bzl
vendored
@ -24,7 +24,7 @@ def which(repository_ctx, program_name):
|
||||
if is_windows(repository_ctx):
|
||||
if not program_name.endswith(".exe"):
|
||||
program_name = program_name + ".exe"
|
||||
result = execute(repository_ctx, ["where.exe", program_name])
|
||||
result = execute(repository_ctx, ["C:\\Windows\\System32\\where.exe", program_name])
|
||||
else:
|
||||
result = execute(repository_ctx, ["which", program_name])
|
||||
return result.stdout.rstrip()
|
||||
@ -90,7 +90,7 @@ def read_dir(repository_ctx, src_dir):
|
||||
src_dir = src_dir.replace("/", "\\")
|
||||
find_result = execute(
|
||||
repository_ctx,
|
||||
["cmd.exe", "/c", "dir", src_dir, "/b", "/s", "/a-d"],
|
||||
["C:\\Windows\\System32\\cmd.exe", "/c", "dir", src_dir, "/b", "/s", "/a-d"],
|
||||
empty_stdout_fine = True,
|
||||
)
|
||||
|
||||
@ -121,7 +121,7 @@ def get_environ(repository_ctx, name, default_value = None):
|
||||
if is_windows(repository_ctx):
|
||||
result = execute(
|
||||
repository_ctx,
|
||||
["cmd.exe", "/c", "echo", "%" + name + "%"],
|
||||
["C:\\Windows\\System32\\cmd.exe", "/c", "echo", "%" + name + "%"],
|
||||
empty_stdout_fine = True,
|
||||
)
|
||||
else:
|
||||
|
@ -1,17 +1,27 @@
|
||||
"""Repository rule to create a platform for a docker image to be used with RBE."""
|
||||
|
||||
def _remote_platform_configure_impl(repository_ctx):
|
||||
platform = repository_ctx.attr.platform
|
||||
exec_properties = repository_ctx.attr.platform_exec_properties
|
||||
|
||||
serialized_exec_properties = "{"
|
||||
for k, v in exec_properties.items():
|
||||
serialized_exec_properties += "\"%s\" : \"%s\"," % (k, v)
|
||||
serialized_exec_properties += "}"
|
||||
|
||||
repository_ctx.template(
|
||||
"BUILD",
|
||||
Label("@org_tensorflow//third_party/remote_config:BUILD.tpl"),
|
||||
{
|
||||
"%{container_image}": repository_ctx.attr.container_image,
|
||||
"%{platform}": platform,
|
||||
"%{exec_properties}": serialized_exec_properties,
|
||||
},
|
||||
)
|
||||
|
||||
remote_platform_configure = repository_rule(
|
||||
implementation = _remote_platform_configure_impl,
|
||||
attrs = {
|
||||
"container_image": attr.string(mandatory = True),
|
||||
"platform_exec_properties": attr.string_dict(mandatory = True),
|
||||
"platform": attr.string(default = "linux", values = ["linux", "windows"]),
|
||||
},
|
||||
)
|
||||
|
@ -10,4 +10,5 @@ container_digests = {
|
||||
"cuda10.0-cudnn7-ubuntu16.04-manylinux2010": "sha256:5812d9d0ef0a3276fc5faaf4cd01f3d6e03d635893a6e2d2e04f6f01d626c432",
|
||||
"cuda10.1-cudnn7-ubuntu16.04-manylinux2010": "sha256:23db3de806535c9d26170567ba55cf653e503057345a0e9c129124c08ea118a3",
|
||||
"rocm-ubuntu16.04": "sha256:e645447dd6127325f3e97b8bf23424f637a8579d963b34fcc6772cf7cfaa0ebe",
|
||||
"windows-1803": "sha256:f109576c7c0c8a1783ff22b666e8923b52dbbe7933f69a1c7a7275202c304a12",
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
"""Configurations of RBE builds used with remote config."""
|
||||
|
||||
load("//third_party/toolchains/remote_config:rbe_config.bzl", "tensorflow_rbe_config")
|
||||
load("//third_party/toolchains/remote_config:rbe_config.bzl", "tensorflow_rbe_config", "tensorflow_rbe_win_config")
|
||||
|
||||
def initialize_rbe_configs():
|
||||
tensorflow_rbe_config(
|
||||
@ -29,3 +29,8 @@ def initialize_rbe_configs():
|
||||
python_version = "3",
|
||||
rocm_version = "2.5", # Any version will do.
|
||||
)
|
||||
|
||||
tensorflow_rbe_win_config(
|
||||
name = "windows_py37",
|
||||
python_bin_path = "C:/Python37/python.exe",
|
||||
)
|
||||
|
@ -23,4 +23,9 @@ containers = {
|
||||
"repository": "tensorflow-testing/nosla-rocm-ubuntu16.04",
|
||||
"digest": container_digests["rocm-ubuntu16.04"],
|
||||
},
|
||||
"windows-1803": {
|
||||
"registry": "gcr.io",
|
||||
"repository": "tensorflow-testing/tf-win-rbe",
|
||||
"digest": container_digests["windows-1803"],
|
||||
},
|
||||
}
|
||||
|
@ -61,7 +61,8 @@ def _tensorflow_rbe_config(name, compiler, python_version, os, rocm_version = No
|
||||
|
||||
remote_platform_configure(
|
||||
name = "%s_config_platform" % name,
|
||||
container_image = container_image,
|
||||
platform = "linux",
|
||||
platform_exec_properties = exec_properties,
|
||||
)
|
||||
|
||||
remote_python_configure(
|
||||
@ -104,7 +105,8 @@ def _tensorflow_rbe_config(name, compiler, python_version, os, rocm_version = No
|
||||
|
||||
remote_platform_configure(
|
||||
name = "%s_config_platform" % name,
|
||||
container_image = container_image,
|
||||
platform = "linux",
|
||||
platform_exec_properties = exec_properties,
|
||||
)
|
||||
|
||||
remote_python_configure(
|
||||
@ -133,4 +135,28 @@ def _tensorflow_rbe_config(name, compiler, python_version, os, rocm_version = No
|
||||
else:
|
||||
fail("Neither cuda_version, rocm_version nor python_version specified.")
|
||||
|
||||
def _tensorflow_rbe_win_config(name, python_bin_path, container_name = "windows-1803"):
|
||||
container_image = _container_image_uri(container_name)
|
||||
exec_properties = {
|
||||
"container-image": container_image,
|
||||
"OSFamily": "Windows",
|
||||
}
|
||||
|
||||
env = {
|
||||
"PYTHON_BIN_PATH": python_bin_path,
|
||||
}
|
||||
|
||||
remote_platform_configure(
|
||||
name = "%s_config_platform" % name,
|
||||
platform = "windows",
|
||||
platform_exec_properties = exec_properties,
|
||||
)
|
||||
|
||||
remote_python_configure(
|
||||
name = "%s_config_python" % name,
|
||||
environ = env,
|
||||
exec_properties = exec_properties,
|
||||
)
|
||||
|
||||
tensorflow_rbe_config = _tensorflow_rbe_config
|
||||
tensorflow_rbe_win_config = _tensorflow_rbe_win_config
|
||||
|
Loading…
Reference in New Issue
Block a user