Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: Cleanups/fixes for docker deps and builds #21962

Merged
merged 1 commit into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
113 changes: 111 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,123 @@ updates:
schedule:
interval: "daily"

- package-ecosystem: "docker"
directory: "/.devcontainer"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/ci"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/.devcontainer"
directory: "/examples/dynamic-config-cp"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/ext_authz"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/ext_authz/auth/http-service"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/ext_authz/auth/grpc-service"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/fault-injection"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/grpc-bridge"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/grpc-bridge/client"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/grpc-bridge/server"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/load-reporting-service"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/local_ratelimit"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/lua"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/mysql"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/redis"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/shared/echo"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/shared/flask"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/shared/postgres"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/skywalking-tracing"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/tls"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/tls-sni"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/tls-inspector"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/websocket"
schedule:
interval: daily

- package-ecosystem: "docker"
directory: "/examples/zipkin-tracing"
schedule:
interval: daily

Expand Down Expand Up @@ -80,4 +190,3 @@ updates:
directory: "/examples/load-reporting-service"
schedule:
interval: daily

6 changes: 3 additions & 3 deletions docs/root/start/sandboxes/jaeger_tracing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ To build this sandbox example, and start the example apps run the following comm
$ docker-compose ps

Name Command State Ports
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
jaeger-tracing_front-envoy_1 /docker-entrypoint.sh /bin ... Up 10000/tcp, 0.0.0.0:8000->8000/tcp, 0.0.0.0:8001->8001/tcp
jaeger-tracing_jaeger_1 /go/bin/all-in-one-linux - ... Up 14250/tcp, 14268/tcp, 0.0.0.0:16686->16686/tcp, 5775/udp, 5778/tcp, 6831/udp, 6832/udp, 0.0.0.0:9411->9411/tcp
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
jaeger-tracing_front-envoy_1 /docker-entrypoint.sh /bin ... Up 10000/tcp, 0.0.0.0:8000->8000/tcp
jaeger-tracing_jaeger_1 /go/bin/all-in-one-linux - ... Up 14250/tcp, 14268/tcp, 0.0.0.0:16686->16686/tcp, 5775/udp, 5778/tcp, 6831/udp, 6832/udp, 9411/tcp
jaeger-tracing_service1_1 /bin/sh -c /usr/local/bin/ ... Up 10000/tcp
jaeger-tracing_service2_1 /bin/sh -c /usr/local/bin/ ... Up 10000/tcp

Expand Down
2 changes: 1 addition & 1 deletion docs/root/start/sandboxes/load_reporting_service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Terminal 2 ::
------------------------------------------------------------------------------------------------------------
load-reporting-service_http_service_1 /bin/sh -c /usr/local/bin/ ... Up 10000/tcp, 0.0.0.0:81->80/tcp
load-reporting-service_http_service_2 /bin/sh -c /usr/local/bin/ ... Up 10000/tcp, 0.0.0.0:80->80/tcp
load-reporting-service_lrs_server_1 go run main.go Up 0.0.0.0:18000->18000/tcp
load-reporting-service_lrs_server_1 go run main.go Up 18000/tcp

Step 2: Start sending stream of HTTP requests
*********************************************
Expand Down
6 changes: 3 additions & 3 deletions docs/root/start/sandboxes/mysql.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ Terminal 1
$ docker-compose ps

Name Command State Ports
------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
mysql_mysql_1 docker-entrypoint.sh mysqld Up 3306/tcp
mysql_proxy_1 /docker-entrypoint.sh /bin Up 10000/tcp, 0.0.0.0:1999->1999/tcp, 0.0.0.0:8001->8001/tcp
mysql_proxy_1 /docker-entrypoint.sh /bin Up 10000/tcp, 1999/tcp, 0.0.0.0:8001->8001/tcp

Step 2: Issue commands using mysql
**********************************
Expand All @@ -49,7 +49,7 @@ Terminal 1

.. code-block:: console

$ docker run --rm -it --network envoymesh mysql:5.7 mysql -h proxy -P 1999 -u root --skip-ssl
$ docker run --rm -it --network mysql_default mysql:5.7 mysql -h proxy -P 1999 -u root --skip-ssl
... snip ...

mysql> CREATE DATABASE test;
Expand Down
4 changes: 2 additions & 2 deletions docs/root/start/sandboxes/postgres.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ Build and start the containers.
$ docker-compose ps

Name Command State Ports
----------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
postgres_postgres_1 docker-entrypoint.sh postgres Up 5432/tcp
postgres_proxy_1 /docker-entrypoint.sh /usr ... Up 10000/tcp, 0.0.0.0:1999->1999/tcp, 0.0.0.0:8001->8001/tcp
postgres_proxy_1 /docker-entrypoint.sh /usr ... Up 10000/tcp, 1999/tcp, 0.0.0.0:8001->8001/tcp

Step 2: Issue commands using psql
*********************************
Expand Down
6 changes: 3 additions & 3 deletions examples/brotli/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ services:
context: .
dockerfile: Dockerfile-brotli
ports:
- "9901:9901"
- "9902:9902"
- "10000:10000"
- "${PORT_PROXY:-10000}:10000"
- "${PORT_STATS0:-9901}:9901"
- "${PORT_STATS1:-9902}:9902"

service:
build:
Expand Down
21 changes: 13 additions & 8 deletions examples/brotli/verify.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
#!/bin/bash -e

export NAME=brotli
export PORT_PROXY="${BROTLI_PORT_PROXY:-10200}"
export PORT_STATS0="${BROTLI_PORT_PROXY:-10201}"
export PORT_STATS1="${BROTLI_PORT_PROXY:-10202}"

# shellcheck source=examples/verify-common.sh
. "$(dirname "${BASH_SOURCE[0]}")/../verify-common.sh"

run_log "Test service: localhost:10000/file.json with compression"
sleep 5

run_log "Test service: localhost:${PORT_PROXY}/file.json with compression"
responds_with_header \
"content-encoding: br" \
https://localhost:10000/file.json \
"https://localhost:${PORT_PROXY}/file.json" \
-ki -H "Accept-Encoding: br"

run_log "Test service: localhost:10000/file.txt without compression"
run_log "Test service: localhost:${PORT_PROXY}/file.txt without compression"
responds_without_header \
"content-encoding: br" \
https://localhost:10000/file.txt \
"https://localhost:${PORT_PROXY}/file.txt" \
-ki -H "Accept-Encoding: br"

run_log "Test service: localhost:9901/stats/prometheus without compression"
run_log "Test service: localhost:${PORT_STATS0}/stats/prometheus without compression"
responds_without_header \
"content-encoding: br" \
http://localhost:9901/stats/prometheus \
"http://localhost:${PORT_STATS0}/stats/prometheus" \
-ki -H "Accept-Encoding: br"

run_log "Test service: localhost:9902/stats/prometheus with compression"
run_log "Test service: localhost:${PORT_STATS1}/stats/prometheus with compression"
responds_with_header \
"content-encoding: br" \
https://localhost:9902/stats/prometheus \
"https://localhost:${PORT_STATS1}/stats/prometheus" \
-ki -H "Accept-Encoding: br"
4 changes: 0 additions & 4 deletions examples/cache/Dockerfile-service

This file was deleted.

8 changes: 3 additions & 5 deletions examples/cache/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ services:
context: .
dockerfile: Dockerfile-frontenvoy
ports:
- "8000:8000"
- "${PORT_PROXY:-8000}:8000"

service1:
build:
context: .
dockerfile: Dockerfile-service
context: ../shared/service
volumes:
- ./responses.yaml:/etc/responses.yaml
- ./service.py:/code/service.py
Expand All @@ -28,8 +27,7 @@ services:

service2:
build:
context: .
dockerfile: Dockerfile-service
context: ../shared/service
volumes:
- ./responses.yaml:/etc/responses.yaml
- ./service.py:/code/service.py
Expand Down
14 changes: 8 additions & 6 deletions examples/cache/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

export NAME=cache

export PORT_PROXY="${CACHE_PORT_PROXY:-10300}"

# shellcheck source=examples/verify-common.sh
. "$(dirname "${BASH_SOURCE[0]}")/../verify-common.sh"

Expand Down Expand Up @@ -51,36 +53,36 @@ check_from_origin() {


run_log "Valid-for-minute: First request should be served by the origin"
response=$(curl -si localhost:8000/service/1/valid-for-minute)
response=$(curl -si "localhost:${PORT_PROXY}/service/1/valid-for-minute")
check_from_origin "$response"

run_log "Snooze for 30 seconds"
sleep 30

run_log "Valid-for-minute: Second request should be served from cache"
response=$(curl -si localhost:8000/service/1/valid-for-minute)
response=$(curl -si "localhost:${PORT_PROXY}/service/1/valid-for-minute")
check_cached "$response"

run_log "Snooze for 31 more seconds"
sleep 31

run_log "Valid-for-minute: More than a minute has passed, this request should get a validated response"
response=$(curl -si localhost:8000/service/1/valid-for-minute)
response=$(curl -si "localhost:${PORT_PROXY}/service/1/valid-for-minute")
check_validated "$response"

run_log "Private: Make 4 requests make sure they are all served by the origin"
for _ in {0..3}; do
response=$(curl -si localhost:8000/service/1/private)
response=$(curl -si "localhost:${PORT_PROXY}/service/1/private")
check_from_origin "$response"
done

run_log "No-cache: First request should be served by the origin"
response=$(curl -si localhost:8000/service/1/no-cache)
response=$(curl -si "localhost:${PORT_PROXY}/service/1/no-cache")
check_from_origin "$response"

run_log "No-cache: Make 4 more requests and make sure they are all validated before being served from cache"
for _ in {0..3}; do
sleep 1
response=$(curl -si localhost:8000/service/1/no-cache)
response=$(curl -si "localhost:${PORT_PROXY}/service/1/no-cache")
check_validated "$response"
done
7 changes: 4 additions & 3 deletions examples/cors/backend/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ services:
context: .
dockerfile: Dockerfile-frontenvoy
ports:
- "8002:8000"
- "8003:8001"
- "${PORT_BACKEND:-8002}:8000"
- "${PORT_STATS:-8003}:8001"

backend-service:
image: flask_service:python-3.10-slim-bullseye
build:
context: ../../shared/service
volumes:
- ./service.py:/code/service.py
5 changes: 3 additions & 2 deletions examples/cors/frontend/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ services:
context: .
dockerfile: Dockerfile-frontenvoy
ports:
- "8000:8000"
- "${PORT_PROXY:-8000}:8000"

frontend-service:
image: flask_service:python-3.10-slim-bullseye
build:
context: ../../shared/service
volumes:
- ./service.py:/code/service.py
- ./index.html:/code/index.html
Loading