Skip to content

Commit

Permalink
infra: remove dependency on org_tensorflow (#5528)
Browse files Browse the repository at this point in the history
* remove dependency on `org_tensorflow` and add necessary dependencies 
* update rules_rust dep to HEAD and upgrade to Rust 1.58.1
* set mininum bazel version to 4.0.0
  • Loading branch information
yatbear committed Feb 3, 2022
1 parent 410cb08 commit 595dd94
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 61 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Expand Up @@ -27,8 +27,8 @@ on:
env:
# Keep this Bazel version in sync with the `versions.check` directive
# in our WORKSPACE file.
BAZEL_VERSION: '3.7.0'
BAZEL_SHA256SUM: 'b7583eec83cc38302997098a40b8c870c37e0ab971a83cb3364c754a178b74ec'
BAZEL_VERSION: '4.0.0'
BAZEL_SHA256SUM: '7bee349a626281fc8b8d04a7a0b0358492712377400ab12533aeb39c2eb2b901'
BUILDTOOLS_VERSION: '3.0.0'
BUILDIFIER_SHA256SUM: 'e92a6793c7134c5431c58fbc34700664f101e5c9b1c1fcd93b97978e8b7f88db'
BUILDOZER_SHA256SUM: '3d58a0b6972e4535718cdd6c12778170ea7382de7c75bc3728f5719437ffb84d'
Expand Down Expand Up @@ -121,11 +121,11 @@ jobs:
matrix:
mode: ['native']
platform: ['ubuntu-18.04', 'macos-10.15']
rust_version: ['1.52.0']
rust_version: ['1.58.1']
include:
- mode: 'universal'
platform: 'ubuntu-18.04'
rust_version: '1.52.0'
rust_version: '1.58.1'
steps:
- uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e
- uses: actions/setup-python@152ba7c4dd6521b8e9c93f72d362ce03bf6c4f20
Expand Down Expand Up @@ -244,7 +244,7 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
rust_version: ['1.52.0']
rust_version: ['1.58.1']
cargo_raze_version: ['0.13.0']
steps:
- uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e
Expand Down
70 changes: 34 additions & 36 deletions WORKSPACE
Expand Up @@ -2,6 +2,22 @@ workspace(name = "org_tensorflow_tensorboard")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "bazel_skylib",
sha256 = "07b4117379dde7ab382345c3b0f5edfc6b7cff6c93756eac63da121e0bbcc5de",
strip_prefix = "bazel-skylib-1.1.1",
urls = [
"http://mirror.tensorflow.org/github.com/bazelbuild/bazel-skylib/archive/1.1.1.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz", # 2021-09-27
],
)

load("@bazel_skylib//lib:versions.bzl", "versions")

# Keep this version in sync with the BAZEL environment variable defined
# in our .github/workflows/ci.yml config.
versions.check(minimum_bazel_version = "4.0.0")

http_archive(
name = "io_bazel_rules_webtesting",
sha256 = "9bb461d5ef08e850025480bab185fd269242d4e533bca75bfb748001ceb343c3",
Expand Down Expand Up @@ -73,35 +89,6 @@ http_archive(
],
)

http_archive(
name = "org_tensorflow",
patches = [
# Patch TF's python_configure.bzl to ensure it reconfigures its python
# toolchain when environment variables like `PATH` and `PYTHONPATH`
# change, to avoid the stale genrule py_binary issue described in:
# https://github.com/tensorflow/tensorboard/issues/4862
"//third_party:tensorflow.patch",
],
# NOTE: when updating this, MAKE SURE to also update the protobuf_js runtime version
# in third_party/workspace.bzl to >= the protobuf/protoc version provided by TF.
sha256 = "2595a5c401521f20a2734c4e5d54120996f8391f00bb62a57267d930bce95350",
strip_prefix = "tensorflow-2.3.0",
urls = [
"http://mirror.tensorflow.org/github.com/tensorflow/tensorflow/archive/v2.3.0.tar.gz", # 2020-07-23
"https://github.com/tensorflow/tensorflow/archive/v2.3.0.tar.gz",
],
)

load("@org_tensorflow//tensorflow:workspace.bzl", "tf_workspace")

tf_workspace()

load("@bazel_skylib//lib:versions.bzl", "versions")

# Keep this version in sync with the BAZEL environment variable defined
# in our .github/workflows/ci.yml config.
versions.check(minimum_bazel_version = "3.7.0")

load("@io_bazel_rules_sass//:package.bzl", "rules_sass_dependencies")

rules_sass_dependencies()
Expand All @@ -110,22 +97,33 @@ load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories")

sass_repositories()

# gRPC.
http_archive(
name = "com_github_grpc_grpc",
sha256 = "b2f2620c762427bfeeef96a68c1924319f384e877bc0e084487601e4cc6e434c",
strip_prefix = "grpc-1.42.0",
urls = [
"http://mirror.tensorflow.org/github.com/grpc/grpc/archive/v1.42.0.tar.gz",
"https://github.com/grpc/grpc/archive/v1.42.0.tar.gz", # 2021-11-17
],
)

load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")

grpc_deps()

load("@upb//bazel:repository_defs.bzl", "bazel_version_repository")
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")

bazel_version_repository(name = "bazel_version")
grpc_extra_deps()

http_archive(
name = "rules_rust",
sha256 = "9c7d7fd4378d75232858423d574cff677b16ac9a49cd1a11df545a6e72a315ca",
strip_prefix = "rules_rust-42a674093251fb6a603a2652980c9be28a6fea50",
sha256 = "08109dccfa5bbf674ff4dba82b15d40d85b07436b02e62ab27e0b894f45bb4a3",
strip_prefix = "rules_rust-d5ab4143245af8b33d1947813d411a6cae838409",
urls = [
# Master branch as of 2021-04-14
"http://mirror.tensorflow.org/github.com/bazelbuild/rules_rust/archive/42a674093251fb6a603a2652980c9be28a6fea50.tar.gz",
"https://github.com/bazelbuild/rules_rust/archive/42a674093251fb6a603a2652980c9be28a6fea50.tar.gz",
# Master branch as of 2022-01-31
"http://mirror.tensorflow.org/github.com/bazelbuild/rules_rust/archive/d5ab4143245af8b33d1947813d411a6cae838409.tar.gz",
"https://github.com/bazelbuild/rules_rust/archive/d5ab4143245af8b33d1947813d411a6cae838409.tar.gz",
],
)

Expand Down
6 changes: 3 additions & 3 deletions tensorboard/data/server/BUILD
@@ -1,4 +1,4 @@
load("@rules_rust//rust:rust.bzl", "rust_binary", "rust_doc", "rust_doc_test", "rust_library", "rust_test")
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_doc", "rust_doc_test", "rust_library", "rust_test")

package(default_visibility = ["//tensorboard:internal"])

Expand Down Expand Up @@ -117,13 +117,13 @@ rust_binary(

rust_doc_test(
name = "rustboard_core_doc_test",
dep = ":rustboard_core",
crate = ":rustboard_core",
tags = ["manual"], # https://github.com/bazelbuild/rules_rust/issues/689
)

rust_doc(
name = "rustboard_core_doc",
dep = ":rustboard_core",
crate = ":rustboard_core",
tags = ["manual"], # https://github.com/bazelbuild/rules_rust/issues/689
)

Expand Down
Binary file modified tensorboard/data/server/descriptor.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion tensorboard/data/server/tensorboard.data.pb.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tensorboard/data/server/tensorboard.pb.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tensorboard/data/server/update_protos.py
@@ -1,4 +1,4 @@
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
# Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,7 +28,7 @@
_FILE_DESCRIPTOR_SET = "descriptor.bin"

_RUST_LICENSE = """\
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
/* Copyright 2022 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion third_party/rust.bzl
Expand Up @@ -21,5 +21,5 @@ load("//third_party/rust:crates.bzl", "raze_fetch_remote_crates")

def tensorboard_rust_workspace():
"""TensorBoard Rust dependencies."""
rust_repositories(version = "1.52.0")
rust_repositories(version = "1.58.1")
raze_fetch_remote_crates()
12 changes: 0 additions & 12 deletions third_party/tensorflow.patch

This file was deleted.

6 changes: 6 additions & 0 deletions third_party/workspace.bzl
Expand Up @@ -40,6 +40,12 @@ def tensorboard_workspace(name = ""):
actual = "@org_pythonhosted_six",
)

# Needed by Protobuf.
native.bind(
name = "grpc_python_plugin",
actual = "@com_github_grpc_grpc//src/compiler:grpc_python_plugin",
)

platform_http_file(
name = "org_chromium_chromium", # pinned to Chromium 84.0.4147.0
licenses = ["notice"], # BSD 3-clause (maybe more?)
Expand Down

0 comments on commit 595dd94

Please sign in to comment.