forked from deephaven/deephaven-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update grpc-proxy. Partial deephaven#516. (deephaven#595)
- Loading branch information
1 parent
ae95f1d
commit 4a8d44c
Showing
10 changed files
with
101 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
# Simple dockerfile for the improbable-eng grpc to grpc-web/websocket proxy | ||
FROM docker.io/library/alpine:3.13 | ||
|
||
# in theory we can use scratch, but we need the sh -c syntax to include envs vars, or hardcode the backend addr | ||
FROM alpine | ||
COPY contents/ . | ||
|
||
ADD https://github.com/improbable-eng/grpc-web/releases/download/v0.13.0/grpcwebproxy-v0.13.0-linux-x86_64.zip /grpcwebproxy.zip | ||
ENV GRPCWEBPROXY_VERSION=v0.13.0 | ||
|
||
# Note(deephaven-core#599): Consider moving grpcwebproxy DL into gradle | ||
RUN set -eux; \ | ||
unzip /grpcwebproxy.zip; \ | ||
mv dist/grpcwebproxy* /grpcwebproxy | ||
apk add --no-cache tini; \ | ||
wget -q "https://github.com/improbable-eng/grpc-web/releases/download/${GRPCWEBPROXY_VERSION}/grpcwebproxy-${GRPCWEBPROXY_VERSION}-linux-x86_64.zip"; \ | ||
sha256sum -c checksums.txt; \ | ||
unzip -d /app "grpcwebproxy-${GRPCWEBPROXY_VERSION}-linux-x86_64.zip"; \ | ||
rm "grpcwebproxy-${GRPCWEBPROXY_VERSION}-linux-x86_64.zip"; \ | ||
mv "/app/dist/grpcwebproxy-${GRPCWEBPROXY_VERSION}-linux-x86_64" /app/dist/grpcwebproxy | ||
|
||
EXPOSE 8080 8443 | ||
|
||
ENV BACKEND_ADDR="" | ||
ENTRYPOINT ["/sbin/tini", "--", "/docker-entrypoint.sh"] | ||
|
||
ENTRYPOINT /grpcwebproxy --run_tls_server=false --backend_addr=$BACKEND_ADDR --backend_tls=false --allow_all_origins --use_websockets --backend_max_call_recv_msg_size=104857600 | ||
LABEL org.opencontainers.image.vendor="Deephaven Data Labs" \ | ||
org.opencontainers.image.title="Deephaven gRPC web proxy" \ | ||
org.opencontainers.image.description="Deephaven gRPC web proxy, for the improbable-eng grpc to grpc-web/websocket proxy" \ | ||
org.opencontainers.image.source="https://github.com/deephaven/deephaven-core" \ | ||
org.opencontainers.image.licenses="Apache-2.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# grpc-proxy | ||
|
||
grpc-proxy is a proxy that exposes a gRPC service via websockets, allowing for the gRPC service to | ||
be consumed from browsers. | ||
|
||
## Configuration | ||
|
||
The environment variable `BACKEND_ADDR` must be set to the gRPC service to be proxied. | ||
See [Dockerfile](Dockerfile) for more details. | ||
|
||
## Build | ||
|
||
To build: `./gradlew grpc-proxy:buildDocker` | ||
|
||
## Notes | ||
|
||
The implementation uses the [grpc-web](https://github.com/improbable-eng/grpc-web) | ||
grpc -> grpc-web+websocket proxy from improbably-eng. It is currently [alpha-quality](https://github.com/improbable-eng/grpc-web#status). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage | ||
|
||
plugins { | ||
id 'com.bmuschko.docker-remote-api' | ||
} | ||
|
||
task prepareDocker(type: Sync) { | ||
from 'Dockerfile' | ||
from ('contents') { | ||
into 'contents' | ||
} | ||
// TODO(deephaven-core#518): Add license and notice to docker images | ||
into 'build/docker' | ||
} | ||
|
||
task buildDocker(type: DockerBuildImage) { | ||
dependsOn prepareDocker | ||
images.add('deephaven/grpc-proxy') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3a327a0625e818c5a7d0a62c4ffc7016a79d5c068ef72d18b6a144f3163ae663 grpcwebproxy-v0.13.0-linux-x86_64.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -o nounset | ||
|
||
exec /app/dist/grpcwebproxy \ | ||
--run_tls_server=false \ | ||
--backend_addr="${BACKEND_ADDR}" \ | ||
--backend_tls=false \ | ||
--allow_all_origins \ | ||
--use_websockets \ | ||
--backend_max_call_recv_msg_size=104857600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters