diff --git a/ci/Dockerfile-envoy-alpine b/ci/Dockerfile-envoy-alpine new file mode 100644 index 0000000000000..82d8287264a39 --- /dev/null +++ b/ci/Dockerfile-envoy-alpine @@ -0,0 +1,3 @@ +FROM frolvlad/alpine-glibc + +ADD build_release_stripped/envoy /usr/local/bin/envoy diff --git a/ci/Dockerfile-envoy-alpine-debug b/ci/Dockerfile-envoy-alpine-debug new file mode 100644 index 0000000000000..7cef9e93f99cb --- /dev/null +++ b/ci/Dockerfile-envoy-alpine-debug @@ -0,0 +1,3 @@ +FROM frolvlad/alpine-glibc + +ADD build_release/envoy /usr/local/bin/envoy diff --git a/ci/Dockerfile-envoy-image b/ci/Dockerfile-envoy-image index bd84854292677..db5618ec4b7cf 100644 --- a/ci/Dockerfile-envoy-image +++ b/ci/Dockerfile-envoy-image @@ -1,7 +1,3 @@ FROM ubuntu:14.04 -ADD build_release/envoy /usr/local/bin/envoy -RUN apt-get update && apt-get install -y \ - build-essential -RUN strip /usr/local/bin/envoy -RUN apt-get purge -y build-essential +ADD build_release_stripped/envoy /usr/local/bin/envoy diff --git a/ci/build_alpine_container/Dockerfile-envoy-alpine b/ci/build_alpine_container/Dockerfile-envoy-alpine deleted file mode 100644 index d9ca3c2cb8710..0000000000000 --- a/ci/build_alpine_container/Dockerfile-envoy-alpine +++ /dev/null @@ -1,5 +0,0 @@ -FROM frolvlad/alpine-glibc - -RUN mkdir -p /usr/local/conf/envoy -COPY ./bin/stripped/envoy /usr/local/bin/envoy -COPY ./bin/configs/google_com_proxy.json /usr/local/conf/envoy/ diff --git a/ci/build_alpine_container/Dockerfile-envoy-alpine-debug b/ci/build_alpine_container/Dockerfile-envoy-alpine-debug deleted file mode 100644 index ea7b348813568..0000000000000 --- a/ci/build_alpine_container/Dockerfile-envoy-alpine-debug +++ /dev/null @@ -1,5 +0,0 @@ -FROM frolvlad/alpine-glibc - -RUN mkdir -p /usr/local/conf/envoy -COPY ./bin/debug/envoy /usr/local/bin/envoy -COPY ./bin/configs/google_com_proxy.json /usr/local/conf/envoy/ diff --git a/ci/build_alpine_container/Makefile b/ci/build_alpine_container/Makefile deleted file mode 100644 index 400a4f664a6f8..0000000000000 --- a/ci/build_alpine_container/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -PHONY: all - -ENVOY_TAG ?= "latest" -ENVOY_BUILD_DIR ?= "/tmp/envoy-docker-build" -ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) - -all: binary container test - -binary: - echo "CWD: ${ROOT_DIR}" - rm -rf ./bin - mkdir -p ./bin/stripped - mkdir -p ./bin/debug - mkdir -p ./bin/configs - docker run -t -i --name build-envoy-alpine-ct -v ${ROOT_DIR}/../../:/source -v $(ENVOY_BUILD_DIR):/build lyft/envoy-build:latest /bin/bash -c \ - "set -x && cd /source && \ - cp /build/envoy/source/exe/envoy /source/ci/build_alpine_container/bin/stripped/ && \ - strip /source/ci/build_alpine_container/bin/stripped/envoy && \ - cp /build/envoy/source/exe/envoy /source/ci/build_alpine_container/bin/debug/ && \ - cp /source/configs/google_com_proxy.json /source/ci/build_alpine_container/bin/configs/" - docker rm -f build-envoy-alpine-ct - # Fail build if a core file gets generated during the build. - if [ -f "../../core" ]; \ - then \ - echo "Core dumped, failing build"; \ - exit 1; \ - fi - -container: - docker build -f ./Dockerfile-envoy-alpine -t lyft/envoy-alpine:${ENVOY_TAG} . - docker build -f ./Dockerfile-envoy-alpine-debug -t lyft/envoy-alpine-debug:${ENVOY_TAG} . - -test: - ./run_alpine_binary_verification.sh debug - ./run_alpine_binary_verification.sh stripped - -clean: - rm -rf ./bin diff --git a/ci/build_alpine_container/run_alpine_binary_verification.sh b/ci/build_alpine_container/run_alpine_binary_verification.sh deleted file mode 100755 index a7a7866ef2071..0000000000000 --- a/ci/build_alpine_container/run_alpine_binary_verification.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash -set -e - -usage() { - echo "Usage: $0 [debug|stripped]" - exit 1 -} - -check_args() { - if [ $# -lt 1 ]; then - usage - fi - - type=$1 - - if [ "$type" != "debug" ] && [ "$type" != "stripped" ]; then - usage - fi -} - -main() { - check_args $* - if [ -z "${ENVOY_TAG}" ]; then - ENVOY_TAG="latest" - fi - - if [ "${type}" == "debug" ]; then - ENVOY_IMAGE=lyft/envoy-alpine-debug:${ENVOY_TAG} - else - ENVOY_IMAGE=lyft/envoy-alpine:${ENVOY_TAG} - fi - TEST_CONTAINER=alpine_envoy_test_ct - - # Spin up a test container for the smoke test. - set +e - docker rm -fv ${TEST_CONTAINER} - set -e - docker run -d --name ${TEST_CONTAINER} ${ENVOY_IMAGE} /usr/local/bin/envoy -c /usr/local/conf/envoy/google_com_proxy.json - output=`docker exec alpine_envoy_test_ct ps aux | grep google_com_proxy` - if [ -z "$output" ]; then - echo "Failed to detect envoy binary to be running!" - exit 1 - fi - echo "Successfully started envoy in container ${TEST_CONTAINER}" - #TODO - add more tests, like a health check. -} - -main $* diff --git a/ci/coverage_publish.sh b/ci/coverage_publish.sh index c1f607476d358..f273d6cd9eec0 100755 --- a/ci/coverage_publish.sh +++ b/ci/coverage_publish.sh @@ -25,9 +25,9 @@ then COVERAGE_DIR="$(dirname "${COVERAGE_FILE}")" S3_LOCATION="lyft-envoy/coverage/report-${BRANCH_NAME}" - aws s3 cp "${COVERAGE_DIR}" "s3://${S3_LOCATION}" --recursive --profile coverage --acl public-read --quiet --sse + pip install awscli --upgrade + aws s3 cp "${COVERAGE_DIR}" "s3://${S3_LOCATION}" --recursive --acl public-read --quiet --sse echo "Coverage report for branch '${BRANCH_NAME}': https://s3.amazonaws.com/${S3_LOCATION}/coverage.html" - else echo "Coverage report will not be uploaded for this build." fi diff --git a/ci/do_ci.sh b/ci/do_ci.sh index a97ca045c6f48..140db233dae2f 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -21,6 +21,9 @@ function bazel_release_binary_build() { echo "Copying release binary for image build..." mkdir -p "${ENVOY_SRCDIR}"/build_release cp -f "${ENVOY_DELIVERY_DIR}"/envoy "${ENVOY_SRCDIR}"/build_release + mkdir -p "${ENVOY_SRCDIR}"/build_release_stripped + cp -f "${ENVOY_DELIVERY_DIR}"/envoy "${ENVOY_SRCDIR}"/build_release_stripped + strip "${ENVOY_SRCDIR}"/build_release_stripped/envoy } function bazel_debug_binary_build() { diff --git a/ci/docker_push.sh b/ci/docker_push.sh index 1f0d0443b18cf..3d0a5e42d6918 100755 --- a/ci/docker_push.sh +++ b/ci/docker_push.sh @@ -28,17 +28,17 @@ then docker build -f ci/Dockerfile-envoy-image -t lyft/envoy:latest . docker login -u "$DOCKERHUB_USERNAME" -p "$DOCKERHUB_PASSWORD" docker push lyft/envoy:latest - docker tag lyft/envoy:latest lyft/envoy:$CIRCLE_SHA1 - docker push lyft/envoy:$CIRCLE_SHA1 - docker rm $(docker ps -a -q) || true - docker rmi $(docker images -a -q) || true + docker tag lyft/envoy:latest lyft/envoy:"$CIRCLE_SHA1" + docker push lyft/envoy:"$CIRCLE_SHA1" - make -C ci/build_alpine_container - docker tag lyft/envoy-alpine:latest lyft/envoy-alpine:$CIRCLE_SHA1 - docker push lyft/envoy-alpine:$CIRCLE_SHA1 + docker build -f ci/Dockerfile-envoy-alpine -t lyft/envoy-alpine:latest . + docker tag lyft/envoy-alpine:latest lyft/envoy-alpine:"$CIRCLE_SHA1" + docker push lyft/envoy-alpine:"$CIRCLE_SHA1" docker push lyft/envoy-alpine:latest - docker tag lyft/envoy-alpine-debug:latest lyft/envoy-alpine-debug:$CIRCLE_SHA1 - docker push lyft/envoy-alpine-debug:$CIRCLE_SHA1 + + docker build -f ci/Dockerfile-envoy-alpine-debug -t lyft/envoy-alpine-debug:latest . + docker tag lyft/envoy-alpine-debug:latest lyft/envoy-alpine-debug:"$CIRCLE_SHA1" + docker push lyft/envoy-alpine-debug:"$CIRCLE_SHA1" docker push lyft/envoy-alpine-debug:latest # This script tests the docker examples.