-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Summarize your change Create a service to expose a REST endpoint for the grpc interface. The motivation behind having a REST endpoint is to create a web version of cuegui (coming soon). ## How does it work See the [module README](https://github.com/AcademySoftwareFoundation/OpenCue/blob/1f3229599a58af64aa9c7feda7657f8fece9c97d/rest_gateway/README.md) for a full documentation. --------- Signed-off-by: Diego Tavares <[email protected]> Co-authored-by: Zachary Fong <[email protected]> Co-authored-by: Ramon Figueiredo <[email protected]>
- Loading branch information
1 parent
a2ffd1e
commit 2c0a97e
Showing
26 changed files
with
666 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ venv*/ | |
.coverage | ||
coverage.xml | ||
htmlcov/ | ||
rest_gateway/*.tar\.gz | ||
/.env | ||
.envrc | ||
.vscode | ||
|
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 +1 @@ | ||
1.0 | ||
1.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
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 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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.env |
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,54 @@ | ||
FROM centos7.6-go1.21:latest AS build | ||
|
||
RUN yum install -y \ | ||
git \ | ||
protobuf3-compiler \ | ||
&& yum clean all | ||
WORKDIR /app | ||
ENV PATH=$PATH:/root/go/bin:/opt/protobuf3/usr/bin/ | ||
|
||
# Copy all of the staged files (protos plus go source) | ||
COPY ./proto /app/proto | ||
COPY ./rest_gateway/opencue_gateway /app/opencue_gateway | ||
# COPY ./lib /app/lib | ||
|
||
|
||
WORKDIR /app/opencue_gateway | ||
RUN go mod init opencue_gateway && go mod tidy | ||
|
||
RUN go install \ | ||
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \ | ||
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \ | ||
github.com/golang-jwt/jwt/v5 \ | ||
google.golang.org/protobuf/cmd/protoc-gen-go \ | ||
google.golang.org/grpc/cmd/protoc-gen-go-grpc | ||
|
||
# Generate go grpc code | ||
RUN mkdir -p gen/go && \ | ||
protoc -I ../proto/ \ | ||
--go_out ./gen/go/ \ | ||
--go_opt paths=source_relative \ | ||
--go-grpc_out ./gen/go/ \ | ||
--go-grpc_opt paths=source_relative \ | ||
../proto/*.proto | ||
|
||
# Generate grpc-gateway handlers | ||
RUN protoc -I ../proto/ --grpc-gateway_out ./gen/go \ | ||
--grpc-gateway_opt paths=source_relative \ | ||
--grpc-gateway_opt generate_unbound_methods=true \ | ||
../proto/*.proto | ||
|
||
# Uncomment this to run go tests | ||
# RUN go test -v | ||
|
||
# Build project | ||
RUN go build -o grpc_gateway main.go | ||
|
||
FROM centos-7.6.1810:latest | ||
COPY --from=build /app/opencue_gateway/grpc_gateway /app/ | ||
|
||
# Ensure logs folder is created and has correct permissions | ||
RUN mkdir -p /logs && chmod 755 /logs | ||
|
||
EXPOSE 8448 | ||
ENTRYPOINT ["/app/grpc_gateway"] |
Oops, something went wrong.