Skip to content

Commit

Permalink
[patch] divide gateway for future architecture
Browse files Browse the repository at this point in the history
Signed-off-by: kpango <[email protected]>
  • Loading branch information
kpango committed Jul 28, 2020
1 parent bff597f commit 01c785d
Show file tree
Hide file tree
Showing 334 changed files with 46,897 additions and 2,358 deletions.
28 changes: 26 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,32 @@ area/filter/ingress:
area/gateway:
- apis/proto/vald/**/*
- apis/grpc/vald/**/*
- cmd/gateway/**/*
- pkg/gateway/**/*
- cmd/gateway/vald/**/*
- pkg/gateway/vald/**/*

area/gateway/lb:
- apis/proto/vald/**/*
- apis/grpc/vald/**/*
- cmd/gateway/lb/**/*
- pkg/gateway/lb/**/*

area/gateway/meta:
- apis/proto/vald/**/*
- apis/grpc/vald/**/*
- cmd/gateway/meta/**/*
- pkg/gateway/meta/**/*

area/gateway/backup:
- apis/proto/vald/**/*
- apis/grpc/vald/**/*
- cmd/gateway/backup/**/*
- pkg/gateway/backup/**/*

area/gateway/filter:
- apis/proto/vald/**/*
- apis/grpc/vald/**/*
- cmd/gateway/filter/**/*
- pkg/gateway/filter/**/*

area/manager/backup:
- apis/proto/manager/backup/**/*
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/dockers-gateway-backup-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# name: 'Build docker image: gateway-backup'
on:
push:
branches:
- master
tags:
- '*.*.*'
- 'v*.*.*'
- '*.*.*-*'
- 'v*.*.*-*'
paths:
- 'internal/**'
- '!internal/db/**'
- '!internal/k8s/**'
- 'apis/grpc/**'
- 'pkg/gateway/backup/**'
- 'cmd/gateway/backup/**'
- 'dockers/base/Dockerfile'
- 'dockers/gateway/backup/Dockerfile'
- 'versions/GO_VERSION'
pull_request:
paths:
- 'internal/**'
- '!internal/db/**'
- '!internal/k8s/**'
- 'apis/grpc/**'
- 'pkg/gateway/backup/**'
- 'cmd/gateway/backup/**'
- 'dockers/base/Dockerfile'
- 'dockers/gateway/backup/Dockerfile'
- 'versions/GO_VERSION'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 10
- name: Build the Docker image
run: |
echo 'Build docker image'
make docker/build/gateway-backup
- name: login to DockerHub
run: |
echo 'Login to DockerHub'
echo ${DOCKERHUB_PASS} | docker login --username ${DOCKERHUB_USER} --password-stdin
env:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_PASS }}
- name: push to DockerHub (master)
if: github.ref == 'refs/heads/master'
run: |
echo 'Push to DockerHub (master)'
imagename=`make docker/name/gateway-backup`
docker tag ${imagename} ${imagename}:nightly
docker push ${imagename}:nightly
- name: push to DockerHub (pull request)
if: github.event_name == 'pull_request'
run: |
echo 'Push to DockerHub (pull request)'
imagename=`make docker/name/gateway-backup`
pr_num=`cat $GITHUB_EVENT_PATH | jq -r ".number"`
docker tag ${imagename} ${imagename}:pr-${pr_num}
docker push ${imagename}:pr-${pr_num}
- name: push to DockerHub (tags)
if: startsWith( github.ref, 'refs/tags/')
run: |
echo 'Push to DockerHub (tags)'
imagename=`make docker/name/gateway-backup`
docker push ${imagename}:latest
tag_name=`echo $GITHUB_REF | sed -e 's:^refs/tags/::'`
docker tag ${imagename} ${imagename}:${tag_name}
docker push ${imagename}:${tag_name}
docker tag ${imagename} ${imagename}:nightly
docker push ${imagename}:nightly
slack:
name: Slack notification
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || startsWith( github.ref, 'refs/tags/')
steps:
- uses: technote-space/workflow-conclusion-action@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: 8398a7/action-slack@v2
with:
author_name: backup-gateway image build
status: ${{ env.WORKFLOW_CONCLUSION }}
only_mention_fail: channel
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_WEBHOOK_URL }}
93 changes: 93 additions & 0 deletions .github/workflows/dockers-gateway-filter-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: 'Build docker image: gateway-filter'
on:
push:
branches:
- master
tags:
- '*.*.*'
- 'v*.*.*'
- '*.*.*-*'
- 'v*.*.*-*'
paths:
- 'internal/**'
- '!internal/db/**'
- '!internal/k8s/**'
- 'apis/grpc/**'
- 'pkg/gateway/filter/**'
- 'cmd/gateway/filter/**'
- 'dockers/base/Dockerfile'
- 'dockers/gateway/filter/Dockerfile'
- 'versions/GO_VERSION'
pull_request:
paths:
- 'internal/**'
- '!internal/db/**'
- '!internal/k8s/**'
- 'apis/grpc/**'
- 'pkg/gateway/filter/**'
- 'cmd/gateway/filter/**'
- 'dockers/base/Dockerfile'
- 'dockers/gateway/filter/Dockerfile'
- 'versions/GO_VERSION'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 10
- name: Build the Docker image
run: |
echo 'Build docker image'
make docker/build/gateway-filter
- name: login to DockerHub
run: |
echo 'Login to DockerHub'
echo ${DOCKERHUB_PASS} | docker login --username ${DOCKERHUB_USER} --password-stdin
env:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_PASS }}
- name: push to DockerHub (master)
if: github.ref == 'refs/heads/master'
run: |
echo 'Push to DockerHub (master)'
imagename=`make docker/name/gateway-filter`
docker tag ${imagename} ${imagename}:nightly
docker push ${imagename}:nightly
- name: push to DockerHub (pull request)
if: github.event_name == 'pull_request'
run: |
echo 'Push to DockerHub (pull request)'
imagename=`make docker/name/gateway-filter`
pr_num=`cat $GITHUB_EVENT_PATH | jq -r ".number"`
docker tag ${imagename} ${imagename}:pr-${pr_num}
docker push ${imagename}:pr-${pr_num}
- name: push to DockerHub (tags)
if: startsWith( github.ref, 'refs/tags/')
run: |
echo 'Push to DockerHub (tags)'
imagename=`make docker/name/gateway-filter`
docker push ${imagename}:latest
tag_name=`echo $GITHUB_REF | sed -e 's:^refs/tags/::'`
docker tag ${imagename} ${imagename}:${tag_name}
docker push ${imagename}:${tag_name}
docker tag ${imagename} ${imagename}:nightly
docker push ${imagename}:nightly
slack:
name: Slack notification
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || startsWith( github.ref, 'refs/tags/')
steps:
- uses: technote-space/workflow-conclusion-action@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: 8398a7/action-slack@v2
with:
author_name: filter-gateway image build
status: ${{ env.WORKFLOW_CONCLUSION }}
only_mention_fail: channel
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_WEBHOOK_URL }}
93 changes: 93 additions & 0 deletions .github/workflows/dockers-gateway-lb-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: 'Build docker image: gateway-lb'
on:
push:
branches:
- master
tags:
- '*.*.*'
- 'v*.*.*'
- '*.*.*-*'
- 'v*.*.*-*'
paths:
- 'internal/**'
- '!internal/db/**'
- '!internal/k8s/**'
- 'apis/grpc/**'
- 'pkg/gateway/lb/**'
- 'cmd/gateway/lb/**'
- 'dockers/base/Dockerfile'
- 'dockers/gateway/lb/Dockerfile'
- 'versions/GO_VERSION'
pull_request:
paths:
- 'internal/**'
- '!internal/db/**'
- '!internal/k8s/**'
- 'apis/grpc/**'
- 'pkg/gateway/lb/**'
- 'cmd/gateway/lb/**'
- 'dockers/base/Dockerfile'
- 'dockers/gateway/lb/Dockerfile'
- 'versions/GO_VERSION'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 10
- name: Build the Docker image
run: |
echo 'Build docker image'
make docker/build/gateway-lb
- name: login to DockerHub
run: |
echo 'Login to DockerHub'
echo ${DOCKERHUB_PASS} | docker login --username ${DOCKERHUB_USER} --password-stdin
env:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_PASS }}
- name: push to DockerHub (master)
if: github.ref == 'refs/heads/master'
run: |
echo 'Push to DockerHub (master)'
imagename=`make docker/name/gateway-lb`
docker tag ${imagename} ${imagename}:nightly
docker push ${imagename}:nightly
- name: push to DockerHub (pull request)
if: github.event_name == 'pull_request'
run: |
echo 'Push to DockerHub (pull request)'
imagename=`make docker/name/gateway-lb`
pr_num=`cat $GITHUB_EVENT_PATH | jq -r ".number"`
docker tag ${imagename} ${imagename}:pr-${pr_num}
docker push ${imagename}:pr-${pr_num}
- name: push to DockerHub (tags)
if: startsWith( github.ref, 'refs/tags/')
run: |
echo 'Push to DockerHub (tags)'
imagename=`make docker/name/gateway-lb`
docker push ${imagename}:latest
tag_name=`echo $GITHUB_REF | sed -e 's:^refs/tags/::'`
docker tag ${imagename} ${imagename}:${tag_name}
docker push ${imagename}:${tag_name}
docker tag ${imagename} ${imagename}:nightly
docker push ${imagename}:nightly
slack:
name: Slack notification
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || startsWith( github.ref, 'refs/tags/')
steps:
- uses: technote-space/workflow-conclusion-action@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: 8398a7/action-slack@v2
with:
author_name: lb-gateway image build
status: ${{ env.WORKFLOW_CONCLUSION }}
only_mention_fail: channel
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_WEBHOOK_URL }}
Loading

0 comments on commit 01c785d

Please sign in to comment.