Skip to content

Commit

Permalink
feat: add actions to build taxi containers
Browse files Browse the repository at this point in the history
  • Loading branch information
vordimous committed Feb 29, 2024
1 parent f89f037 commit 5ac7a9c
Show file tree
Hide file tree
Showing 1,078 changed files with 79,967 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/extras-route-guide-server-build-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Build and Push route-guide-server image

on:
push:
# paths:
# - 'extras-containers/route-guide-server/**/*'
paths:
- 'extras-containers/route-guide-server/**/*'

env:
IMAGE_NAME: extras-route-guide-server
Expand Down Expand Up @@ -34,11 +34,11 @@ jobs:
labels: |
org.opencontainers.image.title=Zilla Demos ${{ env.IMAGE_NAME }}
org.opencontainers.image.description=Supporting container for ${{ env.DOCKERFILE_CONTEXT }}
org.opencontainers.image.url=https://github.com/${{ github.repository }}/tree/main/${{ env.DOCKERFILE_CONTEXT }}
org.opencontainers.image.source=https://github.com/${{ github.repository }}/tree/main/${{ env.DOCKERFILE_CONTEXT }}
annotations: |
manifest:org.opencontainers.image.title=Zilla Demos ${{ env.IMAGE_NAME }}
manifest:org.opencontainers.image.description=Supporting container for ${{ env.DOCKERFILE_CONTEXT }}
manifest:org.opencontainers.image.url=https://github.com/${{ github.repository }}/tree/main/${{ env.DOCKERFILE_CONTEXT }}
manifest:org.opencontainers.image.source=https://github.com/${{ github.repository }}/tree/main/${{ env.DOCKERFILE_CONTEXT }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/extras-taxi-gateway-build-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build and Push taxi-gateway image

on:
push:
paths:
- "extras-containers/taxi/grpc/gateway/**/*"

env:
IMAGE_NAME: extras-taxi-gateway
DOCKERFILE_CONTEXT: extras-containers/taxi/grpc/gateway

jobs:
buildx-push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read

steps:
- uses: actions/checkout@v4
with:
sparse-checkout-cone-mode: false
sparse-checkout: ${{ env.DOCKERFILE_CONTEXT }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=ref,event=branch
type=sha
labels: |
org.opencontainers.image.title=Zilla Demos ${{ env.IMAGE_NAME }}
org.opencontainers.image.description=Supporting container for ${{ env.DOCKERFILE_CONTEXT }}
org.opencontainers.image.source=https://github.com/${{ github.repository }}/tree/main/${{ env.DOCKERFILE_CONTEXT }}
annotations: |
manifest:org.opencontainers.image.title=Zilla Demos ${{ env.IMAGE_NAME }}
manifest:org.opencontainers.image.description=Supporting container for ${{ env.DOCKERFILE_CONTEXT }}
manifest:org.opencontainers.image.source=https://github.com/${{ github.repository }}/tree/main/${{ env.DOCKERFILE_CONTEXT }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ env.DOCKERFILE_CONTEXT }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
61 changes: 61 additions & 0 deletions .github/workflows/extras-taxi-map-ui-build-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build and Push taxi-map-ui image

on:
push:
paths:
- "extras-containers/taxi/map-ui/**/*"

env:
IMAGE_NAME: extras-taxi-map-ui
DOCKERFILE_CONTEXT: extras-containers/taxi/map-ui

jobs:
buildx-push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read

steps:
- uses: actions/checkout@v4
with:
sparse-checkout-cone-mode: false
sparse-checkout: ${{ env.DOCKERFILE_CONTEXT }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=ref,event=branch
type=sha
labels: |
org.opencontainers.image.title=Zilla Demos ${{ env.IMAGE_NAME }}
org.opencontainers.image.description=Supporting container for ${{ env.DOCKERFILE_CONTEXT }}
org.opencontainers.image.source=https://github.com/${{ github.repository }}/tree/main/${{ env.DOCKERFILE_CONTEXT }}
annotations: |
manifest:org.opencontainers.image.title=Zilla Demos ${{ env.IMAGE_NAME }}
manifest:org.opencontainers.image.description=Supporting container for ${{ env.DOCKERFILE_CONTEXT }}
manifest:org.opencontainers.image.source=https://github.com/${{ github.repository }}/tree/main/${{ env.DOCKERFILE_CONTEXT }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ env.DOCKERFILE_CONTEXT }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
61 changes: 61 additions & 0 deletions .github/workflows/extras-taxi-service-build-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build and Push taxi-service image

on:
push:
paths:
- "extras-containers/taxi/grpc/service/**/*"

env:
IMAGE_NAME: extras-taxi-service
DOCKERFILE_CONTEXT: extras-containers/taxi/grpc/service

jobs:
buildx-push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read

steps:
- uses: actions/checkout@v4
with:
sparse-checkout-cone-mode: false
sparse-checkout: ${{ env.DOCKERFILE_CONTEXT }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=ref,event=branch
type=sha
labels: |
org.opencontainers.image.title=Zilla Demos ${{ env.IMAGE_NAME }}
org.opencontainers.image.description=Supporting container for ${{ env.DOCKERFILE_CONTEXT }}
org.opencontainers.image.source=https://github.com/${{ github.repository }}/tree/main/${{ env.DOCKERFILE_CONTEXT }}
annotations: |
manifest:org.opencontainers.image.title=Zilla Demos ${{ env.IMAGE_NAME }}
manifest:org.opencontainers.image.description=Supporting container for ${{ env.DOCKERFILE_CONTEXT }}
manifest:org.opencontainers.image.source=https://github.com/${{ github.repository }}/tree/main/${{ env.DOCKERFILE_CONTEXT }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ env.DOCKERFILE_CONTEXT }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 2 additions & 2 deletions extras-containers/route-guide-server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ module route_guide/server
go 1.19

require (
github.com/golang/protobuf v1.5.3
google.golang.org/grpc v1.56.3
google.golang.org/grpc/examples v0.0.0-20230705174746-11feb0a9afd8
google.golang.org/protobuf v1.30.0
)

require (
github.com/golang/protobuf v1.5.3 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
google.golang.org/protobuf v1.30.0 // indirect
)
2 changes: 1 addition & 1 deletion extras-containers/route-guide-server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/examples/data"

"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"

pb "google.golang.org/grpc/examples/route_guide/routeguide"
"google.golang.org/grpc/reflection"
Expand Down
27 changes: 27 additions & 0 deletions extras-containers/taxi/grpc/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: v1
plugins:
- plugin: buf.build/protocolbuffers/go:v1.31.0
out: gateway/taxiroute
opt:
- paths=source_relative
- plugin: buf.build/grpc/go:v1.3.0
out: gateway/taxiroute
opt:
- paths=source_relative
- plugin: buf.build/grpc-ecosystem/gateway:v2.16.2
out: gateway/taxiroute
opt:
- paths=source_relative
- generate_unbound_methods=true
- plugin: buf.build/grpc-ecosystem/openapiv2:v2.16.2
out: gateway/taxiroute/openapiv2
opt:
- generate_unbound_methods=true
- plugin: buf.build/protocolbuffers/go:v1.31.0
out: service/taxiroute
opt:
- paths=source_relative
- plugin: buf.build/grpc/go:v1.3.0
out: service/taxiroute
opt:
- paths=source_relative
13 changes: 13 additions & 0 deletions extras-containers/taxi/grpc/buf.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Generated by buf. DO NOT EDIT.
version: v1
deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 28151c0d0a1641bf938a7672c500e01d
digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de
- remote: buf.build
owner: grpc-ecosystem
repository: grpc-gateway
commit: f460f71081c14a80b66cc72526e0b322
digest: shake256:122def85e91fc3ef4ab351680060b8f70e9d09a7ae6d1412aeb2bddfeee5c4d3fc8819da33fef56192cec0a817ac0c3e6d49bb2acf02eb5c9e9131739a60ddfc
8 changes: 8 additions & 0 deletions extras-containers/taxi/grpc/buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: v1
name: buf.build/aklivity/taxi-demo
deps:
- buf.build/googleapis/googleapis
- buf.build/grpc-ecosystem/grpc-gateway
lint:
use:
- DEFAULT
9 changes: 9 additions & 0 deletions extras-containers/taxi/grpc/gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM golang:1.21-alpine AS build
WORKDIR /src
COPY . .
RUN go build -o /bin/gateway ./main.go

FROM alpine
COPY --from=build /bin/gateway /usr/bin/gateway
EXPOSE 8085
CMD ["gateway", "-logtostderr=true"]
22 changes: 22 additions & 0 deletions extras-containers/taxi/grpc/gateway/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module github.com/aklivity/zilla-demos/taxi/grpc/gateway

go 1.21.0

require (
github.com/caitlinelfring/go-env-default v1.1.0
github.com/golang/glog v1.1.2
github.com/grpc-ecosystem/grpc-gateway/v2 v2.17.1
github.com/rs/cors v1.10.0
google.golang.org/grpc v1.57.1
google.golang.org/protobuf v1.31.0
)

require (
github.com/golang/protobuf v1.5.3 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
)
33 changes: 33 additions & 0 deletions extras-containers/taxi/grpc/gateway/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
github.com/caitlinelfring/go-env-default v1.1.0 h1:bhDfXmUolvcIGfQCX8qevQX8wxC54NGz0aimoUnhvDM=
github.com/caitlinelfring/go-env-default v1.1.0/go.mod h1:tESXPr8zFPP/cRy3cwxrHBmjJIf2A1x/o4C9CET2rEk=
github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo=
github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.17.1 h1:LSsiG61v9IzzxMkqEr6nrix4miJI62xlRjwT7BYD2SM=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.17.1/go.mod h1:Hbb13e3/WtqQ8U5hLGkek9gJvBLasHuPFI0UEGfnQ10=
github.com/rs/cors v1.10.0 h1:62NOS1h+r8p1mW6FM0FSB0exioXLhd/sh15KpjWBZ+8=
github.com/rs/cors v1.10.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d h1:VBu5YqKPv6XiJ199exd8Br+Aetz+o08F+PLMnwJQHAY=
google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4=
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d h1:DoPTO70H+bcDXcd39vOqb2viZxgqeBeSGtZ55yZU4/Q=
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M=
google.golang.org/grpc v1.57.1 h1:upNTNqv0ES+2ZOOqACwVtS3Il8M12/+Hz41RCPzAjQg=
google.golang.org/grpc v1.57.1/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
Loading

0 comments on commit 5ac7a9c

Please sign in to comment.