Skip to content

Commit e554cb0

Browse files
authored
Merge pull request #2745 from ROCm/develop-upstream-mirror
Use mirror sites to pull hermetic packages and create copy_wheel rule to copy artifacts
2 parents f854dd2 + 33a418c commit e554cb0

File tree

7 files changed

+69
-9
lines changed

7 files changed

+69
-9
lines changed

tensorflow/tools/pip_package/BUILD

+7
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,13 @@ genrule(
315315
cmd = "echo '' > $@",
316316
)
317317

318+
319+
sh_binary(
320+
name = "copy_wheel",
321+
srcs = ['copy_wheel.sh'],
322+
data = [":wheel"],
323+
)
324+
318325
py_test(
319326
name = "prebuilt_wheel_import_api_packages_test",
320327
srcs = if_wheel_dependency(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
cp tensorflow/tools/pip_package/wheel_house/*.whl $1

third_party/py/python_init_rules.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def python_init_rules():
77
name = "rules_python",
88
sha256 = "778aaeab3e6cfd56d681c89f5c10d7ad6bf8d2f1a72de9de55b23081b2d31618",
99
strip_prefix = "rules_python-0.34.0",
10-
url = "https://github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
10+
url = "https://mirror.bazel.build/github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
1111
patch_args = ["-p1"],
1212
patches = [Label("//third_party/py:rules_python.patch")],
1313
)

third_party/py/rules_python.patch

+28-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
1+
diff --git a/python/repositories.bzl b/python/repositories.bzl
2+
index d58feef..4ce550d 100644
3+
--- a/python/repositories.bzl
4+
+++ b/python/repositories.bzl
5+
@@ -64,7 +64,10 @@ def py_repositories():
6+
)
7+
http_archive(
8+
name = "rules_cc",
9+
- urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
10+
+ urls = [
11+
+ "https://mirror.bazel.build/github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz",
12+
+ "https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"
13+
+ ],
14+
sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf",
15+
strip_prefix = "rules_cc-0.0.9",
16+
)
117
diff --git a/python/versions.bzl b/python/versions.bzl
2-
index fd385cd1..eb4133f1 100644
18+
index fd385cd..9a52e80 100644
319
--- a/python/versions.bzl
420
+++ b/python/versions.bzl
21+
@@ -20,7 +20,7 @@ MACOS_NAME = "mac os"
22+
LINUX_NAME = "linux"
23+
WINDOWS_NAME = "windows"
24+
25+
-DEFAULT_RELEASE_BASE_URL = "https://github.com/indygreg/python-build-standalone/releases/download"
26+
+DEFAULT_RELEASE_BASE_URL = "https://mirror.bazel.build/github.com/indygreg/python-build-standalone/releases/download"
27+
28+
# When updating the versions and releases, run the following command to get
29+
# the hashes:
530
@@ -484,6 +484,19 @@ TOOL_VERSIONS = {
631
},
732
"strip_prefix": "python",
@@ -20,13 +45,13 @@ index fd385cd1..eb4133f1 100644
2045
+ "strip_prefix": "python",
2146
+ },
2247
}
23-
48+
2449
# buildifier: disable=unsorted-dict-items
2550
@@ -493,6 +506,7 @@ MINOR_MAPPING = {
2651
"3.10": "3.10.14",
2752
"3.11": "3.11.9",
2853
"3.12": "3.12.3",
2954
+ "3.13": "3.13.0",
3055
}
31-
56+
3257
PLATFORMS = {

third_party/xla/third_party/py/python_init_rules.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def python_init_rules():
77
name = "rules_python",
88
sha256 = "778aaeab3e6cfd56d681c89f5c10d7ad6bf8d2f1a72de9de55b23081b2d31618",
99
strip_prefix = "rules_python-0.34.0",
10-
url = "https://github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
10+
url = "https://mirror.bazel.build/github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
1111
patch_args = ["-p1"],
1212
patches = [Label("//third_party/py:rules_python.patch")],
1313
)

third_party/xla/third_party/tsl/third_party/py/python_init_rules.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def python_init_rules():
77
name = "rules_python",
88
sha256 = "778aaeab3e6cfd56d681c89f5c10d7ad6bf8d2f1a72de9de55b23081b2d31618",
99
strip_prefix = "rules_python-0.34.0",
10-
url = "https://github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
10+
url = "https://mirror.bazel.build/github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
1111
patch_args = ["-p1"],
1212
patches = [Label("//third_party/py:rules_python.patch")],
1313
)

third_party/xla/third_party/tsl/third_party/py/rules_python.patch

+28-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
1+
diff --git a/python/repositories.bzl b/python/repositories.bzl
2+
index d58feef..4ce550d 100644
3+
--- a/python/repositories.bzl
4+
+++ b/python/repositories.bzl
5+
@@ -64,7 +64,10 @@ def py_repositories():
6+
)
7+
http_archive(
8+
name = "rules_cc",
9+
- urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
10+
+ urls = [
11+
+ "https://mirror.bazel.build/github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz",
12+
+ "https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"
13+
+ ],
14+
sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf",
15+
strip_prefix = "rules_cc-0.0.9",
16+
)
117
diff --git a/python/versions.bzl b/python/versions.bzl
2-
index fd385cd1..eb4133f1 100644
18+
index fd385cd..9a52e80 100644
319
--- a/python/versions.bzl
420
+++ b/python/versions.bzl
21+
@@ -20,7 +20,7 @@ MACOS_NAME = "mac os"
22+
LINUX_NAME = "linux"
23+
WINDOWS_NAME = "windows"
24+
25+
-DEFAULT_RELEASE_BASE_URL = "https://github.com/indygreg/python-build-standalone/releases/download"
26+
+DEFAULT_RELEASE_BASE_URL = "https://mirror.bazel.build/github.com/indygreg/python-build-standalone/releases/download"
27+
28+
# When updating the versions and releases, run the following command to get
29+
# the hashes:
530
@@ -484,6 +484,19 @@ TOOL_VERSIONS = {
631
},
732
"strip_prefix": "python",
@@ -20,13 +45,13 @@ index fd385cd1..eb4133f1 100644
2045
+ "strip_prefix": "python",
2146
+ },
2247
}
23-
48+
2449
# buildifier: disable=unsorted-dict-items
2550
@@ -493,6 +506,7 @@ MINOR_MAPPING = {
2651
"3.10": "3.10.14",
2752
"3.11": "3.11.9",
2853
"3.12": "3.12.3",
2954
+ "3.13": "3.13.0",
3055
}
31-
56+
3257
PLATFORMS = {

0 commit comments

Comments
 (0)