-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
147 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# This file specifies files that are *not* uploaded to Google Cloud Platform | ||
# using gcloud. It follows the same syntax as .gitignore, with the addition of | ||
# "#!include" directives (which insert the entries of the given .gitignore-style | ||
# file at that point). | ||
# | ||
# For more information, run: | ||
# $ gcloud topic gcloudignore | ||
# | ||
.gcloudignore | ||
# If you would like to upload your .git directory, .gitignore file or files | ||
# from your .gitignore file, remove the corresponding line | ||
# below: | ||
.git | ||
.gitignore | ||
|
||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
# Test binary, build with `go test -c` | ||
*.test | ||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out |
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,30 @@ | ||
# Use the official Golang image to create a build artifact. | ||
# This is based on Debian and sets the GOPATH to /go. | ||
# https://hub.docker.com/_/golang | ||
FROM golang:1.13 as builder | ||
|
||
# Create and change to the app directory. | ||
WORKDIR /app | ||
|
||
# Retrieve application dependencies. | ||
# This allows the container build to reuse cached dependencies. | ||
COPY go.* ./ | ||
RUN go mod download | ||
|
||
# Copy local code to the container image. | ||
COPY . ./ | ||
|
||
# Build the binary. | ||
RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -v -o flamed ./cmd/flamed | ||
|
||
# Use the official Alpine image for a lean production container. | ||
# https://hub.docker.com/_/alpine | ||
# https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds | ||
FROM alpine:3 | ||
RUN apk add --no-cache ca-certificates | ||
|
||
# Copy the binary to the production image from the builder stage. | ||
COPY --from=builder /app/flamed /flamed | ||
|
||
# Run the web service on container startup. | ||
CMD ["/flamed"] |
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 |
---|---|---|
@@ -1,2 +1,35 @@ | ||
# FLAME Reference Implementation | ||
|
||
This directory contains a reference implementation of the FLAME | ||
(Full Lifecycle API Management) API. | ||
|
||
The reference implementation is written in Go. | ||
It stores data using the [Google Cloud Datastore API]() | ||
and can be deployed in a container using [Google Cloud Run](). | ||
|
||
It is implemented as a [gRPC]() service and follows the | ||
Google API Design Guidelines that are published at [aip.dev](https://aip.dev). | ||
|
||
The gRPC service supports gRPC JSON transcoding, which allows a JSON REST API | ||
to be automatically published using a proxy. Configuration files for Envoy are | ||
included. | ||
|
||
The gRPC service is configured to support GAPIC generated API clients | ||
and a Go GAPIC library is generated as part of the build process. | ||
|
||
The build process also creates a command-line interface that is | ||
automatically generated from the API description. | ||
|
||
## Cloud Run | ||
|
||
make build | ||
|
||
make run | ||
|
||
export AUDIENCES=`gcloud beta run services describe flame --platform managed --format="value(status.address.url)"` | ||
|
||
`gcloud auth activate-service-account [email protected] --key-file ~/Downloads/your-project-identifier-e48bd9f1c60a.json` | ||
|
||
export CLI_FLAME_TOKEN=`gcloud auth print-identity-token [email protected] --audiences="$AUDIENCES"` | ||
|
||
export CLI_FLAME_ADDRESS=flame-ozfrf5bp4a-uw.a.run.app:443 |
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