Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ git_repository(
#
git_repository(
name = "io_bazel_rules_go",
commit = "76c63b5cd0d47c1f2b47ab4953db96c574af1c1d",
commit = "2d9f328a9723baf2d037ba9db28d9d0e30683938", # Apr 6, 2017 (buildifier fix)
remote = "https://github.com/bazelbuild/rules_go.git",
)

Expand Down
178 changes: 178 additions & 0 deletions WORKSPACE~
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# Copyright (C) Extensible Service Proxy Authors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is ~ file. we don't need it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added by accident, just removed it.

# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
################################################################################
#
# A Bazel (http://bazel.io) workspace for the Google Cloud Endpoints runtime.

ISTIO_PROXY = "20e19d217be714ce1440b6dcdeab21cf1c14c2de"

git_repository(
name = "nginx",
commit = "cfce863dbe786e61e0e7a33376906b337da70c19",
remote = "https://nginx.googlesource.com/nginx",
)

load("@nginx//:build.bzl", "nginx_repositories")

nginx_repositories(
bind = True,
nginx = "@nginx//",
)

# Required by gRPC.
bind(
name = "libssl",
actual = "@boringssl//:ssl",
)

git_repository(
name = "istio_proxy_git",
commit = ISTIO_PROXY,
remote = "https://github.com/istio/proxy",
)

load(
"@istio_proxy_git//contrib/endpoints:repositories.bzl",
"grpc_repositories",
"servicecontrol_client_repositories",
)
load(
"@istio_proxy_git//:repositories.bzl",
"protobuf_repositories",
"googletest_repositories",
)

bind(
name = "api_manager",
actual = "@istio_proxy_git//contrib/endpoints/include:api_manager",
)

bind(
name = "api_manager_status_proto",
actual = "@istio_proxy_git//contrib/endpoints/src/api_manager:status_proto",
)

bind(
name = "api_manager_status_proto_genproto",
actual = "@istio_proxy_git//contrib/endpoints/src/api_manager:status_proto_genproto",
)

bind(
name = "api_manager_auth_lib",
actual = "@istio_proxy_git//contrib/endpoints/src/api_manager/auth/lib",
)

bind(
name = "api_manager_utils",
actual = "@istio_proxy_git//contrib/endpoints/src/api_manager/utils",
)

bind(
name = "grpc_transcoding",
actual = "@istio_proxy_git//contrib/endpoints/src/grpc/transcoding",
)

servicecontrol_client_repositories()

protobuf_repositories()

googletest_repositories()

grpc_repositories()

# Workaround for Bazel > 0.4.0 since it needs newer protobuf.bzl from:
# https://github.com/google/protobuf/pull/2246
# Do not use this git_repository for anything else than protobuf.bzl
new_git_repository(
name = "protobuf_bzl",
# Injecting an empty BUILD file to prevent using any build target
build_file_content = "",
commit = "05090726144b6e632c50f47720ff51049bfcbef6",
remote = "https://github.com/google/protobuf.git",
)

git_repository(
name = "gflags_git",
commit = "fe57e5af4db74ab298523f06d2c43aa895ba9f98", # 2016-07-22
remote = "https://github.com/gflags/gflags",
)

bind(
name = "gflags",
actual = "@gflags_git//:gflags",
)

git_repository(
name = "tools",
commit = "1bcac83ed2dc9c5e0be156a4c1801d435667f642",
remote = "https://github.com/cloudendpoints/endpoints-tools",
)

#
# Python rules
#
git_repository(
name = "io_bazel_rules_pex",
commit = "d4af3ca0a015e8b2d2a81a4df1df51bb0fa0bba0",
remote = "https://github.com/benley/bazel_rules_pex.git",
)

load("@io_bazel_rules_pex//pex:pex_rules.bzl", "pex_repositories")

pex_repositories()

#
# Perl rules
#

git_repository(
name = "io_bazel_rules_perl",
commit = "f6211c2db1e54d0a30bc3c3a718f2b5d45f02a22",
remote = "https://github.com/bazelbuild/rules_perl.git",
)

#
# Go rules
#
git_repository(
name = "io_bazel_rules_go",
commit = "76c63b5cd0d47c1f2b47ab4953db96c574af1c1d",
remote = "https://github.com/bazelbuild/rules_go.git",
)

load("@io_bazel_rules_go//go:def.bzl", "go_repositories", "go_repository", "new_go_repository")

go_repositories()

new_git_repository(
name = "github.com_golang_protobuf",
build_file = "third_party/BUILD.golang_protobuf",
commit = "8616e8ee5e20a1704615e6c8d7afcdac06087a67",
remote = "https://github.com/golang/protobuf.git",
)

load("//test/grpc:repositories.bzl", "grpc_go_repositories")

grpc_go_repositories()
2 changes: 1 addition & 1 deletion docker/ingress/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ cp $DEB $ROOT/docker/ingress
cp $ROOT/bazel-bin/test/src/ingress $ROOT/docker/ingress
cp $ROOT/test/src/controller/nginx.tmpl $ROOT/docker/ingress
docker build -t ${IMAGE} $ROOT/docker/ingress || error_exit "Failed to build"
gcloud docker push ${IMAGE} || error_exit "Failed to upload docker image"
gcloud docker -- push ${IMAGE} || error_exit "Failed to upload docker image"
6 changes: 3 additions & 3 deletions script/jenkins-build-docker-slave
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ TOOLS_BUCKET=''
function update_image() {
local image="${1}"
[[ ${FORCE} == true ]] && return 0
${GCLOUD} docker pull "${image}"
${GCLOUD} docker -- pull "${image}"
local image_exists=${?}
[[ ${image_exists} -eq 0 ]] && return 1
return 0
Expand Down Expand Up @@ -75,7 +75,7 @@ if [[ "${BUILD}" == true ]]; then
run retry -n 10 docker build --build-arg TOOLS_BUCKET="${TOOLS_BUCKET}" --no-cache -t ${IMAGE} \
-f "${DOCKER_FILE}" . || error_exit "Could not build ${SLAVE}"
echo "Pushing Docker image: ${IMAGE}"
retry -n 3 ${GCLOUD} docker push "${IMAGE}" \
retry -n 3 ${GCLOUD} docker -- push "${IMAGE}" \
|| error_exit "Failed to push tag ${IMAGE}."
fi
fi
Expand All @@ -86,7 +86,7 @@ if [[ -n "${TAG}" ]]; then
retry -n 3 docker tag "${IMAGE}" ${TAG}

echo "Pushing Docker image: ${TAG}"
retry -n 3 ${GCLOUD} docker push "${TAG}" \
retry -n 3 ${GCLOUD} docker -- push "${TAG}" \
|| error_exit "Failed to push tag ${TAG}."
fi

6 changes: 3 additions & 3 deletions script/linux-build-docker
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ done
[[ -f "${DEB}" ]] || error_exit "Cannot find Debian package ${DEB}"

echo "Checking if docker image ${IMAGE} exists.."
gcloud docker pull "${IMAGE}" \
gcloud docker -- pull "${IMAGE}" \
&& { echo "Image ${IMAGE} already exists; skipping"; exit 0; }

echo "Building Endpoints Runtime docker image."
Expand Down Expand Up @@ -86,14 +86,14 @@ if [[ -n "${CONFIG}" ]]; then

echo "Pushing Custom Docker image: ${IMAGE}"
retry -n 10 -s 10 \
gcloud docker push "${IMAGE}" \
gcloud docker -- push "${IMAGE}" \
|| error_exit "Failed to upload custom Docker image to gcr."
else

echo "Pushing Docker image: ${IMAGE}"

# Try 10 times, shortest wait is 10 seconds, exponential back-off.
retry -n 10 -s 10 \
gcloud docker push "${IMAGE}" \
gcloud docker -- push "${IMAGE}" \
|| error_exit "Failed to upload Docker image to gcr."
fi
2 changes: 1 addition & 1 deletion script/linux-gae-instance
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function download_nginx_logs() {

retry -n 2 -s 10 \
${GCLOUD} compute ssh --project=${PROJECT} --zone=${vm_zone} ${vm_name} \
"sudo tar czf \"${remote_archive}\" /var/log/ ; sudo chmod 777 \"${remote_archive}\"" \
--command="sudo tar czf ${remote_archive} /var/log/; sudo chmod 777 ${remote_archive}" \
|| error_exit "Cannot tar backend VM logs."

retry -n 2 -s 10 \
Expand Down
2 changes: 1 addition & 1 deletion script/release-stable
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function tag_stable_image() {

docker_tag_f "${image}" "${stable}"

retry "${GCLOUD}" docker push "${stable}" \
retry "${GCLOUD}" docker -- push "${stable}" \
|| error_exit "ERROR: failed to push '${stable}'"
}

Expand Down
4 changes: 2 additions & 2 deletions test/bookstore/linux-build-bookstore-docker
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ done
[[ -n "${IMAGE}" ]] || error_exit "Specify required image argument via '-i'"

echo "Checking if docker image ${IMAGE} exists.."
gcloud docker pull "${IMAGE}" \
gcloud docker -- pull "${IMAGE}" \
&& echo "Image ${IMAGE} already exists; skipping" \
&& exit 0

Expand All @@ -54,5 +54,5 @@ retry -n 3 docker build --no-cache -t ${IMAGE} \
echo "Pushing Docker image: ${IMAGE}"
# Try 10 times, shortest wait is 10 seconds, exponential back-off.
retry -n 10 -s 10 \
gcloud docker push "${IMAGE}" \
gcloud docker -- push "${IMAGE}" \
|| error_exit "Failed to upload Docker image to gcr."
2 changes: 1 addition & 1 deletion test/echo/docker-remote/build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ sed "s/\${PROJECT}/${PROJECT}/" ../service.json.temp > ./service.json

${GCLOUD} docker -- build --no-cache -t ${TAG} .
docker tag -f ${TAG} gcr.io/${PROJECT}/${TAG}
${GCLOUD} docker push gcr.io/${PROJECT}/${TAG}
${GCLOUD} docker -- push gcr.io/${PROJECT}/${TAG}

rm service.json

Expand Down
2 changes: 1 addition & 1 deletion test/echo/docker/build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ sed "s/\${PROJECT}/${PROJECT}/" ../service.json.temp > ./service.json

docker build --no-cache -t ${TAG} .
docker tag -f ${TAG} gcr.io/${PROJECT}/${TAG}
${GCLOUD} docker push gcr.io/${PROJECT}/${TAG}
${GCLOUD} docker -- push gcr.io/${PROJECT}/${TAG}

rm service.json

Expand Down
2 changes: 1 addition & 1 deletion test/grpc/Dockerfile.temp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# 2) cp bazel-bin/test/grpc/grpc-test-server test/grpc
# 3) IMAGE=gcr.io/endpointsv2/grpc-test-server:latest
# 4) docker build --no-cache -t "${IMAGE}" test/grpc
# 5) gcloud docker push "${IMAGE}"
# 5) gcloud docker -- push "${IMAGE}"

FROM debian:jessie

Expand Down
4 changes: 2 additions & 2 deletions test/grpc/linux-build-grpc-docker
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ done
[[ -n "${IMAGE}" ]] || error_exit "Specify required image argument via '-i'"

echo "Checking if docker image ${IMAGE} exists.."
gcloud docker pull "${IMAGE}" \
gcloud docker -- pull "${IMAGE}" \
&& { echo "Image ${IMAGE} already exists; skipping"; exit 0; }

BAZEL_TARGET="${ROOT}/bazel-bin/${TEST_SERVER_BIN}"
Expand All @@ -82,5 +82,5 @@ retry -n 3 docker build --no-cache -t "${IMAGE}" \
echo "Pushing Docker image: ${IMAGE}"
# Try 10 times, shortest wait is 10 seconds, exponential back-off.
retry -n 10 -s 10 \
gcloud docker push "${IMAGE}" \
gcloud docker -- push "${IMAGE}" \
|| error_exit "Failed to upload Docker image to gcr."
2 changes: 1 addition & 1 deletion test/transcoding/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# 2) cp bazel-bin/test/transcoding/bookstore-server test/transcoding
# 3) IMAGE=gcr.io/endpointsv2/bookstore-grpc:latest
# 4) docker build --no-cache -t "${IMAGE}" test/transcoding
# 5) gcloud docker push "${IMAGE}"
# 5) gcloud docker -- push "${IMAGE}"

FROM debian:jessie

Expand Down
1 change: 1 addition & 0 deletions third_party/BUILD.golang_protobuf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ go_library(
"proto/lib.go",
"proto/message_set.go",
"proto/pointer_reflect.go",
"proto/pointer_unsafe.go",
"proto/properties.go",
"proto/text.go",
"proto/text_parser.go",
Expand Down