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

Make it easier to test multiple endpoints with aya #6202

Merged
merged 2 commits into from
Jun 23, 2020
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
8 changes: 8 additions & 0 deletions examples/are-you-alive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ After you run docker compose, navigate to `http://localhost:9090` to see
Prometheus and `http://localhost:8080/metrics` to see the raw metrics being
exported.

## Test Specific Tablet Types

See [this vitess
documentation](https://vitess.io/docs/user-guides/faq/#how-do-i-choose-between-master-vs-replica-for-queries)
for how to target specific tablet types. In the configuration file you'll want
to, for example, put "@master" or "@replica" on the ends of your connection
strings.

## Push to Registry

If you have push access to the [planetscale public
Expand Down
19 changes: 6 additions & 13 deletions examples/are-you-alive/build/dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
# Use a [multi stage
# build](https://docs.docker.com/develop/develop-images/multistage-build/) to
# build [reflex](https://github.com/cespare/reflex), a tool that will allow us
# to automatically rerun the project when any files change.
FROM golang:1.12.5 AS build
# Build reflex as a static binary (CGO_ENABLED=0) so we can run it in our final
# container.
RUN CGO_ENABLED=0 go get -v github.com/cespare/reflex

FROM golang:1.12.5-alpine AS runtime
COPY --from=build /go/bin/reflex /go/bin/reflex
COPY reflex.conf /
ENTRYPOINT ["/go/bin/reflex", "-c", "/reflex.conf"]
FROM golang:1.14
RUN go get -v github.com/cespare/reflex
COPY reflex.conf /reflex.conf
COPY entrypoint.sh /entrypoint.sh
COPY endpoints.yaml /endpoints.yaml
ENTRYPOINT ["/entrypoint.sh"]
5 changes: 4 additions & 1 deletion examples/are-you-alive/build/dev/reflex.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Get all dependencies when go.mod changes.
-r '(\.mod$)' -s -- go get vitess.io/vitess/examples/are-you-alive/cmd/are-you-alive/...

# Rerun "go run" every time a ".go" file changes.
-r '(\.go$)' -s -- go run vitess.io/vitess/examples/are-you-alive/cmd/are-you-alive --initialize
-r '(\.go$)' -s -- go run vitess.io/vitess/examples/are-you-alive/cmd/are-you-alive --initialize --endpoints_config /endpoints.yaml
3 changes: 2 additions & 1 deletion examples/are-you-alive/build/release/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM golang:1.12.5 AS build
FROM golang:1.14 AS build
COPY . /go/src/vitess.io/vitess/examples/are-you-alive
RUN go get vitess.io/vitess/examples/are-you-alive/cmd/are-you-alive/...
RUN CGO_ENABLED=0 go install vitess.io/vitess/examples/are-you-alive/cmd/are-you-alive

FROM debian:stretch-slim AS runtime
Expand Down
Loading