Skip to content

Commit fc95b5a

Browse files
committed
use envoy build docker for CI
Signed-off-by: Huabing (Robin) Zhao <[email protected]>
1 parent 86c2fd9 commit fc95b5a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+4233
-104
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.0.0
1+
6.3.2

.github/workflows/build_api.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: build-api
3+
4+
on:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- "main"
9+
- "master"
10+
- "release/v*"
11+
paths-ignore:
12+
- "**/*.md"
13+
- "**/*.png"
14+
pull_request:
15+
branches:
16+
- "main"
17+
- "master"
18+
- "release/v*"
19+
paths-ignore:
20+
- "**/*.md"
21+
- "**/*.png"
22+
23+
jobs:
24+
BuildMetaProtocolBinary:
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 1440 # 12 hours
27+
name: Build API
28+
env:
29+
LOG_DIR: /tmp/test_logs
30+
LOG_PATH: /tmp/test_logs/${{ matrix.protocal }}.log
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
- name: Build
35+
run: |
36+
bash ${GITHUB_WORKSPACE}/ci/ci_api.sh
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: build-metaprotocol
3+
4+
on:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- "main"
9+
- "master"
10+
- "release/v*"
11+
paths-ignore:
12+
- "**/*.md"
13+
- "**/*.png"
14+
pull_request:
15+
branches:
16+
- "main"
17+
- "master"
18+
- "release/v*"
19+
paths-ignore:
20+
- "**/*.md"
21+
- "**/*.png"
22+
23+
jobs:
24+
BuildMetaProtocolBinary:
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 1440 # 12 hours
27+
name: Build MetaProtocolProxy
28+
env:
29+
LOG_DIR: /tmp/test_logs
30+
LOG_PATH: /tmp/test_logs/${{ matrix.protocal }}.log
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
- name: Build
35+
run: |
36+
bash ${GITHUB_WORKSPACE}/ci/ci_dev.sh

.github/workflows/buildci.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,11 @@
1212
## See the License for the specific language governing permissions and
1313
## limitations under the License.
1414

15-
SHELL := /bin/bash
16-
CC := clang-10
17-
CXX := clang++-10
18-
PATH := /home/ubuntu/clang+llvm-10.0.0-linux-gnu/bin:$(PATH)
1915

20-
BAZEL_CONFIG = -s --sandbox_debug --verbose_failures --verbose_explanations --explain=build.log --host_force_python=PY3
21-
BAZEL_CONFIG_DEV = $(BAZEL_CONFIG) --config=libc++
22-
BAZEL_CONFIG_REL = $(BAZEL_CONFIG_DEV) --config=release
2316
BAZEL_TARGETS = envoy
2417

2518
build:
26-
export PATH=$(PATH) CC=$(CC) CXX=$(CXX) && \
27-
bazel build $(BAZEL_CONFIG_DEV) $(BAZEL_TARGETS)
19+
bazel build $(BAZEL_TARGETS)
2820

2921
release:
3022
export PATH=$(PATH) CC=$(CC) CXX=$(CXX) && \

ci/Dockerfile-envoy

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
ARG BUILD_OS=ubuntu
2+
ARG BUILD_TAG=20.04
3+
ARG ENVOY_VRP_BASE_IMAGE=envoy-base
4+
5+
6+
FROM scratch AS binary
7+
COPY ci/docker-entrypoint.sh /
8+
ADD configs/envoyproxy_io_proxy.yaml /etc/envoy/envoy.yaml
9+
# See https://github.com/docker/buildx/issues/510 for why this _must_ be this way
10+
ARG TARGETPLATFORM
11+
ENV TARGETPLATFORM="${TARGETPLATFORM:-linux/amd64}"
12+
ADD "${TARGETPLATFORM}/release.tar.zst" /usr/local/bin/
13+
14+
15+
# STAGE: envoy-base
16+
FROM ${BUILD_OS}:${BUILD_TAG} AS envoy-base
17+
ENV DEBIAN_FRONTEND=noninteractive
18+
EXPOSE 10000
19+
CMD ["envoy", "-c", "/etc/envoy/envoy.yaml"]
20+
RUN mkdir -p /etc/envoy \
21+
&& adduser --group --system envoy
22+
ENTRYPOINT ["/docker-entrypoint.sh"]
23+
# NB: Adding this here means that following steps, for example updating the system packages, are run
24+
# when the version file changes. This should mean that a release version will always update.
25+
# In PRs this will just use cached layers unless either this file changes or the version has changed.
26+
ADD VERSION.txt /etc/envoy
27+
RUN --mount=type=tmpfs,target=/var/cache/apt \
28+
--mount=type=tmpfs,target=/var/lib/apt/lists \
29+
apt-get -qq update \
30+
&& apt-get -qq upgrade -y \
31+
&& apt-get -qq install --no-install-recommends -y ca-certificates \
32+
&& apt-get -qq autoremove -y
33+
34+
35+
# STAGE: envoy
36+
FROM envoy-base AS envoy
37+
COPY --from=binary --chown=0:0 --chmod=644 \
38+
/etc/envoy/envoy.yaml /etc/envoy/envoy.yaml
39+
COPY --from=binary --chown=0:0 --chmod=755 \
40+
/docker-entrypoint.sh /
41+
COPY --from=binary --chown=0:0 --chmod=755 \
42+
/usr/local/bin/utils/su-exec /usr/local/bin/
43+
ARG ENVOY_BINARY=envoy
44+
ARG ENVOY_BINARY_PREFIX=
45+
COPY --from=binary --chown=0:0 --chmod=755 \
46+
"/usr/local/bin/${ENVOY_BINARY_PREFIX}${ENVOY_BINARY}" /usr/local/bin/envoy
47+
COPY --from=binary --chown=0:0 --chmod=755 \
48+
/usr/local/bin/${ENVOY_BINARY_PREFIX}${ENVOY_BINARY}\.* /usr/local/bin/
49+
50+
51+
# STAGE: envoy-tools
52+
FROM envoy AS envoy-tools
53+
# See https://github.com/docker/buildx/issues/510 for why this _must_ be this way
54+
ARG TARGETPLATFORM
55+
ENV TARGETPLATFORM="${TARGETPLATFORM:-linux/amd64}"
56+
COPY --chown=0:0 --chmod=755 \
57+
"${TARGETPLATFORM}/schema_validator_tool" /usr/local/bin/schema_validator_tool
58+
59+
60+
# STAGE: envoy-distroless
61+
# gcr.io/distroless/base-nossl-debian11:nonroot
62+
FROM gcr.io/distroless/base-nossl-debian11:nonroot@sha256:f10e1fbf558c630a4b74a987e6c754d45bf59f9ddcefce090f6b111925996767 AS envoy-distroless
63+
EXPOSE 10000
64+
ENTRYPOINT ["/usr/local/bin/envoy"]
65+
CMD ["-c", "/etc/envoy/envoy.yaml"]
66+
COPY --from=binary --chown=0:0 --chmod=644 \
67+
/etc/envoy/envoy.yaml /etc/envoy/envoy.yaml
68+
COPY --from=binary --chown=0:0 --chmod=755 \
69+
/usr/local/bin/envoy /usr/local/bin/
70+
71+
72+
# STAGE: envoy-google-vrp-base
73+
FROM ${ENVOY_VRP_BASE_IMAGE} AS envoy-google-vrp-base
74+
EXPOSE 10000
75+
EXPOSE 10001
76+
CMD ["supervisord", "-c", "/etc/supervisor.conf"]
77+
ENTRYPOINT []
78+
ADD --chown=0:0 --chmod=644 \
79+
configs/google-vrp/*.yaml /etc/envoy/
80+
ADD --chown=0:0 --chmod=755 \
81+
configs/google-vrp/launch_envoy.sh /usr/local/bin/launch_envoy.sh
82+
ADD --chown=0:0 --chmod=644 \
83+
test/config/integration/certs/serverkey.pem /etc/envoy/certs/serverkey.pem
84+
ADD --chown=0:0 --chmod=644 \
85+
test/config/integration/certs/servercert.pem /etc/envoy/certs/servercert.pem
86+
RUN --mount=type=tmpfs,target=/var/cache/apt \
87+
--mount=type=tmpfs,target=/var/lib/apt/lists \
88+
apt-get -qq update \
89+
&& apt-get -qq upgrade -y \
90+
&& apt-get -qq install -y libc++1 supervisor gdb strace tshark \
91+
&& apt-get autoremove -y \
92+
&& chmod 777 /var/log/supervisor
93+
ADD --chown=0:0 --chmod=755 configs/google-vrp/supervisor.conf /etc/supervisor.conf
94+
95+
96+
# STAGE: envoy-google-vrp
97+
FROM envoy-google-vrp-base as envoy-google-vrp
98+
COPY --from=binary --chown=0:0 --chmod=755 \
99+
/usr/local/bin/envoy /usr/local/bin/envoy
100+
101+
102+
# STAGE: envoy-google-vrp-custom
103+
FROM envoy-google-vrp-base as envoy-google-vrp-custom
104+
ARG ENVOY_CTX_BINARY_PATH
105+
ADD "${ENVOY_CTX_BINARY_PATH}" /usr/local/bin/envoy
106+
107+
108+
# Make envoy image as last stage so it is built by default
109+
FROM envoy

ci/Dockerfile-envoy-windows

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
ARG BUILD_OS=mcr.microsoft.com/windows/servercore
2+
ARG BUILD_TAG=ltsc2019
3+
4+
FROM $BUILD_OS:$BUILD_TAG
5+
6+
USER ContainerAdministrator
7+
RUN net accounts /MaxPWAge:unlimited
8+
RUN net user /add "EnvoyUser" /expires:never
9+
RUN net localgroup "Network Configuration Operators" "EnvoyUser" /add
10+
11+
RUN mkdir "C:\\Program\ Files\\envoy"
12+
RUN setx /M path "%path%;c:\Program Files\envoy"
13+
ADD ["windows/amd64/envoy.exe", "C:/Program Files/envoy/"]
14+
15+
RUN mkdir "C:\\ProgramData\\envoy"
16+
ADD ["configs/envoyproxy_io_proxy.yaml", "C:/ProgramData/envoy/envoy.yaml"]
17+
18+
EXPOSE 10000
19+
20+
COPY ci/docker-entrypoint.bat C:/
21+
ENTRYPOINT ["C:/docker-entrypoint.bat"]
22+
CMD ["envoy.exe", "-c", "C:\\ProgramData\\envoy\\envoy.yaml"]

0 commit comments

Comments
 (0)