From 142077d8dacbbb777dc681e9dd2dd97e3725b4b3 Mon Sep 17 00:00:00 2001 From: Runhang Li Date: Sat, 18 Feb 2017 14:52:41 -0800 Subject: [PATCH] Remove special case CentOS build files. --- scripts/centos/BUILD | 491 ------------------------------ scripts/centos/package_release.sh | 91 ------ 2 files changed, 582 deletions(-) delete mode 100644 scripts/centos/BUILD delete mode 100755 scripts/centos/package_release.sh diff --git a/scripts/centos/BUILD b/scripts/centos/BUILD deleted file mode 100644 index b3229e7bd82..00000000000 --- a/scripts/centos/BUILD +++ /dev/null @@ -1,491 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load("/tools/rules/pex_rules", "pex_binary") - -release_version = "unversioned" - -filegroup( - name = "tarpkgs", - srcs = [ - ":heron-api", - ":heron-core", - ":heron-client", - ":heron-tools", - ], -) - -filegroup( - name = "binpkgs", - srcs = [ - ":heron-api-install.sh", - ":heron-client-install.sh", - ":heron-tools-install.sh", - ], -) - -################################################################################ -# Heron core packaging -################################################################################ -genrule( - name = "heron-core", - srcs = [ - ":release.yaml", - ":hexecutor", - ":hshell", - ":hstmgr", - ":htmaster", - ":hpyinstance", - ":hscheduler", - ":hscheduler-aurora", - ":hscheduler-local", - ":hbppacking", - ":hrrpacking", - ":hmetricsmgr", - ":hlfsstatemgr", - ":hzkstatemgr", - ":hinstance", - ], - outs = [ - "heron-core.tar.gz", - ], - cmd = " ".join([ - "export GENDIR=$(GENDIR);", - "export BINDIR=$(BINDIR);", - "$(location package_release.sh) $(location heron-core.tar.gz)", - "--cp $(location release.yaml) heron-core/release.yaml", - "--cp $(location hexecutor) heron-core/bin/heron-executor", - "--cp $(location hshell) heron-core/bin/heron-shell", - "--cp $(location hstmgr) heron-core/bin/heron-stmgr", - "--cp $(location htmaster) heron-core/bin/heron-tmaster", - "--cp $(location hpyinstance) heron-core/bin/heron-python-instance", - "--cp $(location hscheduler) heron-core/lib/scheduler/heron-scheduler.jar", - "--cp $(location hscheduler-aurora) heron-core/lib/scheduler/heron-aurora-scheduler.jar", - "--cp $(location hscheduler-local) heron-core/lib/scheduler/heron-local-scheduler.jar", - "--cp $(location hbppacking) heron-core/lib/packing/heron-binpacking-packing.jar", - "--cp $(location hrrpacking) heron-core/lib/packing/heron-roundrobin-packing.jar", - "--cp $(location hmetricsmgr) heron-core/lib/metricsmgr/heron-metricsmgr.jar", - "--cp $(location hlfsstatemgr) heron-core/lib/statemgr/heron-localfs-statemgr.jar", - "--cp $(location hzkstatemgr) heron-core/lib/statemgr/heron-zookeeper-statemgr.jar", - "--cp $(location hinstance) heron-core/lib/instance/heron-instance.jar", - ]), - heuristic_label_expansion = False, - tags = ["manual"], - tools = ["package_release.sh"], -) - -################################################################################ -# Heron client packaging -################################################################################ -genrule( - name = "heron-client", - srcs = [ - ":release.yaml", - ":heron-core", - ":conf-local-heron-internals", - ":conf-local-metrics-sinks", - ":conf-local-client", - ":conf-local-packing", - ":conf-local-scheduler", - ":conf-local-statemgr", - ":conf-local-uploader", - ":hcli", - ":hexamples", - ":hscheduler", - ":hscheduler-aurora", - ":hscheduler-local", - ":hbppacking", - ":hrrpacking", - ":hlfsstatemgr", - ":hzkstatemgr", - ":huploader-localfs", - ":huploader-null", - ":protobuf-java", - ":slf4j-api-java", - ":slf4j-jdk-java", - ], - outs = [ - "heron-client.tar.gz", - ], - cmd = " ".join([ - "export GENDIR=$(GENDIR);", - "export BINDIR=$(BINDIR);", - "$(location package_release.sh) $(location heron-client.tar.gz)", - "--cp $(location release.yaml) release.yaml", - "--cp $(location hcli) bin/heron", - "--cp $(location conf-local-heron-internals) conf/local/heron_internals.yaml", - "--cp $(location conf-local-metrics-sinks) conf/local/metrics_sinks.yaml", - "--cp $(location conf-local-client) conf/local/client.yaml", - "--cp $(location conf-local-packing) conf/local/packing.yaml", - "--cp $(location conf-local-scheduler) conf/local/scheduler.yaml", - "--cp $(location conf-local-statemgr) conf/local/statemgr.yaml", - "--cp $(location conf-local-uploader) conf/local/uploader.yaml", - "--cp $(location heron-core) dist/heron-core.tar.gz", - "--cp $(location hexamples) examples/heron-examples.jar", - "--cp $(location hscheduler) lib/scheduler/heron-scheduler.jar", - "--cp $(location hscheduler-aurora) lib/scheduler/heron-aurora-scheduler.jar", - "--cp $(location hscheduler-local) lib/scheduler/heron-local-scheduler.jar", - "--cp $(location hbppacking) lib/packing/heron-binpacking-packing.jar", - "--cp $(location hrrpacking) lib/packing/heron-roundrobin-packing.jar", - "--cp $(location hlfsstatemgr) lib/statemgr/heron-localfs-statemgr.jar", - "--cp $(location hzkstatemgr) lib/statemgr/heron-zookeeper-statemgr.jar", - "--cp $(location huploader-localfs) lib/uploader/heron-localfs-uploader.jar", - "--cp $(location huploader-null) lib/uploader/heron-null-uploader.jar", - "--cp $(location protobuf-java) lib/third_party/$$(basename $(location protobuf-java))", - "--cp $(location slf4j-api-java) lib/third_party/$$(basename $(location slf4j-api-java))", - "--cp $(location slf4j-jdk-java) lib/third_party/$$(basename $(location slf4j-jdk-java))", - ]), - heuristic_label_expansion = False, - tags = ["manual"], - tools = ["package_release.sh"], -) - -################################################################################ -# Heron tools packaging -################################################################################ -genrule( - name = "heron-tools", - srcs = [ - ":release.yaml", - ":htracker", - ":hui", - ], - outs = [ - "heron-tools.tar.gz", - ], - cmd = " ".join([ - "export GENDIR=$(GENDIR);", - "export BINDIR=$(BINDIR);", - "$(location package_release.sh) $(location heron-tools.tar.gz)", - "--cp $(location release.yaml) release.yaml", - "--cp $(location htracker) bin/heron-tracker", - "--cp $(location hui) bin/heron-ui", - ]), - heuristic_label_expansion = False, - tags = ["manual"], - tools = ["package_release.sh"], -) - -################################################################################ -# Heron api packaging -################################################################################ -genrule( - name = "heron-api", - srcs = [ - ":release.yaml", - ":hapi", - ":hspi", - ":hstorm", - ], - outs = [ - "heron-api.tar.gz", - ], - cmd = " ".join([ - "export GENDIR=$(GENDIR);", - "export BINDIR=$(BINDIR);", - "$(location package_release.sh) $(location heron-api.tar.gz)", - "--cp $(location release.yaml) release.yaml", - "--cp $(location hapi) heron-api.jar", - "--cp $(location hspi) heron-spi.jar", - "--cp $(location hstorm) heron-storm.jar", - ]), - heuristic_label_expansion = False, - tags = ["manual"], - tools = ["package_release.sh"], -) - -filegroup( - name = "conf-local-heron-internals", - srcs = ["//heron/tools/config/src/yaml:conf-local-heron-internals"], -) - -filegroup( - name = "conf-local-metrics-sinks", - srcs = ["//heron/tools/config/src/yaml:conf-local-metrics-sinks"], -) - -filegroup( - name = "conf-local-client", - srcs = ["//heron/tools/config/src/yaml:conf-local-client"], -) - -filegroup( - name = "conf-local-packing", - srcs = ["//heron/tools/config/src/yaml:conf-local-packing"], -) - -filegroup( - name = "conf-local-scheduler", - srcs = ["//heron/tools/config/src/yaml:conf-local-scheduler"], -) - -filegroup( - name = "conf-local-statemgr", - srcs = ["//heron/tools/config/src/yaml:conf-local-statemgr"], -) - -filegroup( - name = "conf-local-uploader", - srcs = ["//heron/tools/config/src/yaml:conf-local-uploader"], -) - -filegroup( - name = "hexamples", - srcs = ["//heron/examples/src/java:heron-examples"], -) - -filegroup( - name = "htmaster", - srcs = ["//heron/tmaster/src/cpp:heron-tmaster"], -) - -filegroup( - name = "hpyinstance", - srcs = ["//heron/instance/src/python/instance:heron-python-instance"], -) - -filegroup( - name = "hstmgr", - srcs = ["//heron/stmgr/src/cpp:heron-stmgr"], -) - -filegroup( - name = "hinstance", - srcs = ["//heron/instance/src/java:heron-instance"], -) - -filegroup( - name = "hlogging", - srcs = ["//heron/instance/src/java:aurora-logging-properties"], -) - -filegroup( - name = "hscheduler", - srcs = ["//heron/scheduler-core/src/java:heron-scheduler"], -) - -filegroup( - name = "hscheduler-aurora", - srcs = ["//heron/schedulers/src/java:heron-aurora-scheduler"], -) - -filegroup( - name = "hscheduler-local", - srcs = ["//heron/schedulers/src/java:heron-local-scheduler"], -) - -filegroup( - name = "hbppacking", - srcs = ["//heron/packing/src/java:heron-binpacking-packing"], -) - -filegroup( - name = "hrrpacking", - srcs = ["//heron/packing/src/java:heron-roundrobin-packing"], -) - -filegroup( - name = "hmetricsmgr", - srcs = ["//heron/metricsmgr/src/java:heron-metricsmgr"], -) - -filegroup( - name = "hexecutor", - srcs = ["//heron/executor/src/python:heron-executor"], -) - -filegroup( - name = "hshell", - srcs = ["//heron/shell/src/python:heron-shell"], -) - -filegroup( - name = "hcli", - srcs = ["//heron/tools/cli/src/python:heron"], -) - -filegroup( - name = "haurora-job", - srcs = ["//heron/tools/cli/src/python:heron-aurora"], -) - -filegroup( - name = "hinternals-config", - srcs = ["//heron/config:config-internals-yaml"], -) - -filegroup( - name = "hcli2", - srcs = ["//heron/cli2/src/python:heron-cli2"], -) - -filegroup( - name = "hscheduler-config", - srcs = ["//heron/cli2/src/python:scheduler-config"], -) - -filegroup( - name = "haurora-scheduler-config", - srcs = ["//heron/cli2/src/python:aurora-scheduler-config"], -) - -filegroup( - name = "hlocal-scheduler-config", - srcs = ["//heron/cli2/src/python:local-scheduler-config"], -) - -filegroup( - name = "hmesos-scheduler-config", - srcs = ["//heron/cli2/src/python:mesos-scheduler-config"], -) - -filegroup( - name = "hlfsstatemgr", - srcs = ["//heron/statemgrs/src/java:heron-localfs-statemgr"], -) - -filegroup( - name = "hzkstatemgr", - srcs = ["//heron/statemgrs/src/java:heron-zookeeper-statemgr"], -) - -filegroup( - name = "protobuf-java", - srcs = ["@com_google_protobuf_protobuf_java//jar"], -) - -filegroup( - name = "slf4j-api-java", - srcs = ["@org_slf4j_slf4j_api//jar"], -) - -filegroup( - name = "slf4j-jdk-java", - srcs = ["@org_slf4j_slf4j_jdk14//jar"], -) - -filegroup( - name = "hapi", - srcs = ["//heron/api/src/java:heron-api"], -) - -filegroup( - name = "hspi", - srcs = ["//heron/spi/src/java:heron-spi"], -) - -filegroup( - name = "hmetrics-api", - srcs = ["//heron/metricsmgr-api/src/java:metricsmgr-api-java"], -) - -filegroup( - name = "hstorm", - srcs = ["//heron/storm/src/java:heron-storm"], -) - -filegroup( - name = "hviz", - srcs = ["//heron/viz/src/python:heron-viz"], -) - -filegroup( - name = "htracker", - srcs = ["//heron/tools/tracker/src/python:heron-tracker"], -) - -filegroup( - name = "hui", - srcs = ["//heron/tools/ui/src/python:heron-ui"], -) - -filegroup( - name = "huploader-localfs", - srcs = ["//heron/uploaders/src/java:heron-localfs-uploader"], -) - -filegroup( - name = "huploader-null", - srcs = ["//heron/uploaders/src/java:heron-null-uploader"], -) - -genrule( - name = "generate-package-info", - outs = ["release.yaml"], - cmd = "$(location //scripts/packages:package-info-generator) $$(find . -name '*status*.txt') >$@", - stamp = 1, - tools = ["//scripts/packages:package-info-generator"], -) - -genrule( - name = "generate-api-launcher", - srcs = [ - ":release.yaml", - "//scripts/packages:api-template-bin.sh", - "//scripts/packages:bin-common.sh" - ], - outs = ["api_launcher_bin.sh"], - cmd = """ - release_info="$$(cat $(location :release.yaml))" - bin_common="$$(cat $(location //scripts/packages:bin-common.sh))" - template="$$(cat $(location //scripts/packages:api-template-bin.sh))" - echo "$${bin_common}\n\n$${template//%release_info%/$${release_info}}" >$@ - """, -) - -genrule( - name = "generate-client-launcher", - srcs = [ - ":release.yaml", - "//scripts/packages:client-template-bin.sh", - "//scripts/packages:bin-common.sh" - ], - outs = ["client_launcher_bin.sh"], - cmd = """ - release_info="$$(cat $(location :release.yaml))" - bin_common="$$(cat $(location //scripts/packages:bin-common.sh))" - template="$$(cat $(location //scripts/packages:client-template-bin.sh))" - echo "$${bin_common}\n\n$${template//%release_info%/$${release_info}}" >$@ - """, -) - -genrule( - name = "generate-tools-launcher", - srcs = [ - ":release.yaml", - "//scripts/packages:tools-template-bin.sh", - "//scripts/packages:bin-common.sh" - ], - outs = ["tools_launcher_bin.sh"], - cmd = """ - release_info="$$(cat $(location :release.yaml))" - bin_common="$$(cat $(location //scripts/packages:bin-common.sh))" - template="$$(cat $(location //scripts/packages:tools-template-bin.sh))" - echo "$${bin_common}\n\n$${template//%release_info%/$${release_info}}" >$@ - """, -) - -load("/scripts/packages/self_extract_binary", "self_extract_binary") - -self_extract_binary( - name = "heron-api-install.sh", - flatten_resources = [ - ":heron-api", - ], - launcher = ":api_launcher_bin.sh", -) - -self_extract_binary( - name = "heron-client-install.sh", - flatten_resources = [ - ":heron-client", - ], - launcher = ":client_launcher_bin.sh", -) - -self_extract_binary( - name = "heron-tools-install.sh", - flatten_resources = [ - ":heron-tools", - ], - launcher = ":tools_launcher_bin.sh", -) diff --git a/scripts/centos/package_release.sh b/scripts/centos/package_release.sh deleted file mode 100755 index 71ee2d5ac4c..00000000000 --- a/scripts/centos/package_release.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash -e -# Copyright 2015 Google Inc. 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Script to package a release tar and create its associated .md5 checksum. -# -# Usage: package_release.sh [package contents] -# -# In the simplest case, each file given will be placed in the root of the -# resulting archive. The --relpath, --path, and --cp flags change this behavior -# so that file paths can be structured. -# -# --path : Each file is copied to ARCHIVE_ROOT//$(basename file). -# --relpaths : Strip $GENBIR, $BINDIR and then from each -# file's path. The resulting path is used for the file -# inside of the archive. This combines with --path to -# change the root of the resulting file path. -# --cp : Copy the first file to the archive using exactly the -# second path. -# -# Example: -# BINDIR=bazel-bin/ \ -# package_release.sh /tmp/b.tar README.adoc LICENSE \ -# --path some/path/for/docs kythe/docs/kythe-{overview,storage}.txt \ -# --relpaths kythe/docs bazel-bin/kythe/docs/schema/schema.html \ -# --cp CONTRIBUTING.md kythe/docs/how-to-contribute.md -# -# Resulting tree in /tmp/b.tar: -# README.adoc -# LICENSE -# kythe/docs/ -# kythe-overview.txt -# kythe-storage.txt -# schema.html -# how-to-contribute.md - -OUT="$1" -shift - -PBASE="$OUT.dir" -P=$PBASE - -mkdir -p "$PBASE" -trap "rm -rf '$PWD/$OUT.dir'" EXIT ERR INT - -while [[ $# -gt 0 ]]; do - case "$1" in - --relpaths) - RELPATHS=$2 - shift - ;; - --path) - P="$PBASE/$2" - mkdir -p "$P" - shift - ;; - --cp) - mkdir -p "$PBASE/$(dirname "$3")" - cp "$2" "$PBASE/$3" - shift 2 - ;; - *) - if [[ -z "$RELPATHS" ]]; then - cp "$1" "$P"/ - else - rp="${1#$GENDIR/}" - rp="${rp#$BINDIR/}" - rp="$(dirname "${rp#$RELPATHS/}")" - mkdir -p "$P/$rp" - cp "$1" "$P/$rp" - fi - ;; - esac - shift -done - -tar czf "$OUT" -C "$OUT.dir" . - -cd "$(dirname "$OUT")" -# md5sum "$(basename "$OUT")".gz > "$(basename "$OUT").gz.md5"