Skip to content

Commit

Permalink
Merge pull request #2745 from ROCm/develop-upstream-mirror
Browse files Browse the repository at this point in the history
Use mirror sites to pull hermetic packages and create copy_wheel rule to copy artifacts
  • Loading branch information
hsharsha authored Nov 6, 2024
2 parents f854dd2 + 33a418c commit e554cb0
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 9 deletions.
7 changes: 7 additions & 0 deletions tensorflow/tools/pip_package/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,13 @@ genrule(
cmd = "echo '' > $@",
)


sh_binary(
name = "copy_wheel",
srcs = ['copy_wheel.sh'],
data = [":wheel"],
)

py_test(
name = "prebuilt_wheel_import_api_packages_test",
srcs = if_wheel_dependency(
Expand Down
3 changes: 3 additions & 0 deletions tensorflow/tools/pip_package/copy_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

cp tensorflow/tools/pip_package/wheel_house/*.whl $1
2 changes: 1 addition & 1 deletion third_party/py/python_init_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def python_init_rules():
name = "rules_python",
sha256 = "778aaeab3e6cfd56d681c89f5c10d7ad6bf8d2f1a72de9de55b23081b2d31618",
strip_prefix = "rules_python-0.34.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
url = "https://mirror.bazel.build/github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
patch_args = ["-p1"],
patches = [Label("//third_party/py:rules_python.patch")],
)
31 changes: 28 additions & 3 deletions third_party/py/rules_python.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
diff --git a/python/repositories.bzl b/python/repositories.bzl
index d58feef..4ce550d 100644
--- a/python/repositories.bzl
+++ b/python/repositories.bzl
@@ -64,7 +64,10 @@ def py_repositories():
)
http_archive(
name = "rules_cc",
- urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
+ urls = [
+ "https://mirror.bazel.build/github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz",
+ "https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"
+ ],
sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf",
strip_prefix = "rules_cc-0.0.9",
)
diff --git a/python/versions.bzl b/python/versions.bzl
index fd385cd1..eb4133f1 100644
index fd385cd..9a52e80 100644
--- a/python/versions.bzl
+++ b/python/versions.bzl
@@ -20,7 +20,7 @@ MACOS_NAME = "mac os"
LINUX_NAME = "linux"
WINDOWS_NAME = "windows"

-DEFAULT_RELEASE_BASE_URL = "https://github.com/indygreg/python-build-standalone/releases/download"
+DEFAULT_RELEASE_BASE_URL = "https://mirror.bazel.build/github.com/indygreg/python-build-standalone/releases/download"

# When updating the versions and releases, run the following command to get
# the hashes:
@@ -484,6 +484,19 @@ TOOL_VERSIONS = {
},
"strip_prefix": "python",
Expand All @@ -20,13 +45,13 @@ index fd385cd1..eb4133f1 100644
+ "strip_prefix": "python",
+ },
}

# buildifier: disable=unsorted-dict-items
@@ -493,6 +506,7 @@ MINOR_MAPPING = {
"3.10": "3.10.14",
"3.11": "3.11.9",
"3.12": "3.12.3",
+ "3.13": "3.13.0",
}

PLATFORMS = {
2 changes: 1 addition & 1 deletion third_party/xla/third_party/py/python_init_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def python_init_rules():
name = "rules_python",
sha256 = "778aaeab3e6cfd56d681c89f5c10d7ad6bf8d2f1a72de9de55b23081b2d31618",
strip_prefix = "rules_python-0.34.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
url = "https://mirror.bazel.build/github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
patch_args = ["-p1"],
patches = [Label("//third_party/py:rules_python.patch")],
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def python_init_rules():
name = "rules_python",
sha256 = "778aaeab3e6cfd56d681c89f5c10d7ad6bf8d2f1a72de9de55b23081b2d31618",
strip_prefix = "rules_python-0.34.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
url = "https://mirror.bazel.build/github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
patch_args = ["-p1"],
patches = [Label("//third_party/py:rules_python.patch")],
)
31 changes: 28 additions & 3 deletions third_party/xla/third_party/tsl/third_party/py/rules_python.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
diff --git a/python/repositories.bzl b/python/repositories.bzl
index d58feef..4ce550d 100644
--- a/python/repositories.bzl
+++ b/python/repositories.bzl
@@ -64,7 +64,10 @@ def py_repositories():
)
http_archive(
name = "rules_cc",
- urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
+ urls = [
+ "https://mirror.bazel.build/github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz",
+ "https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"
+ ],
sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf",
strip_prefix = "rules_cc-0.0.9",
)
diff --git a/python/versions.bzl b/python/versions.bzl
index fd385cd1..eb4133f1 100644
index fd385cd..9a52e80 100644
--- a/python/versions.bzl
+++ b/python/versions.bzl
@@ -20,7 +20,7 @@ MACOS_NAME = "mac os"
LINUX_NAME = "linux"
WINDOWS_NAME = "windows"

-DEFAULT_RELEASE_BASE_URL = "https://github.com/indygreg/python-build-standalone/releases/download"
+DEFAULT_RELEASE_BASE_URL = "https://mirror.bazel.build/github.com/indygreg/python-build-standalone/releases/download"

# When updating the versions and releases, run the following command to get
# the hashes:
@@ -484,6 +484,19 @@ TOOL_VERSIONS = {
},
"strip_prefix": "python",
Expand All @@ -20,13 +45,13 @@ index fd385cd1..eb4133f1 100644
+ "strip_prefix": "python",
+ },
}

# buildifier: disable=unsorted-dict-items
@@ -493,6 +506,7 @@ MINOR_MAPPING = {
"3.10": "3.10.14",
"3.11": "3.11.9",
"3.12": "3.12.3",
+ "3.13": "3.13.0",
}

PLATFORMS = {

0 comments on commit e554cb0

Please sign in to comment.