Skip to content

Commit

Permalink
Merge pull request #13 from Rungutan/issues-11
Browse files Browse the repository at this point in the history
Issues 11
  • Loading branch information
mariusmitrofan authored Jan 23, 2021
2 parents c482f9e + f038c4a commit 6da9188
Show file tree
Hide file tree
Showing 4 changed files with 219 additions and 45 deletions.
98 changes: 97 additions & 1 deletion .github/workflows/main-push-docker-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: main

jobs:
main:
sentry-base:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -39,6 +39,30 @@ jobs:
tags: |
rungutancommunity/sentry-base:latest
public.ecr.aws/x7u7j5v7/sentry-base:latest
sentry-relay:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: --debug
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to ECR
uses: docker/login-action@v1
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
- name: Build and push Sentry Relay image
id: docker_build_sentry_relay
uses: docker/build-push-action@v2
Expand All @@ -49,6 +73,30 @@ jobs:
tags: |
rungutancommunity/sentry-relay:latest
public.ecr.aws/x7u7j5v7/sentry-relay:latest
sentry-snuba:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: --debug
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to ECR
uses: docker/login-action@v1
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
- name: Build and push Sentry Snuba image
id: docker_build_sentry_snuba
uses: docker/build-push-action@v2
Expand All @@ -59,6 +107,30 @@ jobs:
tags: |
rungutancommunity/sentry-snuba:latest
public.ecr.aws/x7u7j5v7/sentry-snuba:latest
bassh:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: --debug
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to ECR
uses: docker/login-action@v1
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
- name: Build and push Bash image
id: docker_build_bash
uses: docker/build-push-action@v2
Expand All @@ -69,6 +141,30 @@ jobs:
tags: |
rungutancommunity/bash:latest
public.ecr.aws/x7u7j5v7/bash:latest
clickhouse-client:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: --debug
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to ECR
uses: docker/login-action@v1
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
- name: Build and push ClickHouse Client image
id: docker_build_clickhouse_client
uses: docker/build-push-action@v2
Expand Down
110 changes: 109 additions & 1 deletion .github/workflows/release-push-docker-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- '*'

jobs:
main:
sentry-base:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -43,6 +43,33 @@ jobs:
tags: |
rungutancommunity/sentry-base:${{ steps.get_version.outputs.VERSION }}
public.ecr.aws/x7u7j5v7/sentry-base:${{ steps.get_version.outputs.VERSION }}
sentry-relay:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: --debug
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to ECR
uses: docker/login-action@v1
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
- name: Build and push Sentry Relay image
id: docker_build_sentry_relay
uses: docker/build-push-action@v2
Expand All @@ -53,6 +80,33 @@ jobs:
tags: |
rungutancommunity/sentry-relay:${{ steps.get_version.outputs.VERSION }}
public.ecr.aws/x7u7j5v7/sentry-relay:${{ steps.get_version.outputs.VERSION }}
sentry-snuba:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: --debug
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to ECR
uses: docker/login-action@v1
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
- name: Build and push Sentry Snuba image
id: docker_build_sentry_snuba
uses: docker/build-push-action@v2
Expand All @@ -63,6 +117,33 @@ jobs:
tags: |
rungutancommunity/sentry-snuba:${{ steps.get_version.outputs.VERSION }}
public.ecr.aws/x7u7j5v7/sentry-snuba:${{ steps.get_version.outputs.VERSION }}
bash:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: --debug
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to ECR
uses: docker/login-action@v1
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
- name: Build and push Bash image
id: docker_build_bash
uses: docker/build-push-action@v2
Expand All @@ -73,6 +154,33 @@ jobs:
tags: |
rungutancommunity/bash:${{ steps.get_version.outputs.VERSION }}
public.ecr.aws/x7u7j5v7/bash:${{ steps.get_version.outputs.VERSION }}
clickhouse-client:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: --debug
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to ECR
uses: docker/login-action@v1
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
- name: Build and push ClickHouse Client image
id: docker_build_clickhouse_client
uses: docker/build-push-action@v2
Expand Down
22 changes: 11 additions & 11 deletions cloudformation-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Parameters:
# OpsWorks ClickHouse variables
ClickHouseCookbookUrl:
Type: String
Default: https://github.com/Rungutan/sentry-performance-monitoring/releases/download/1.5.0/clickhouse-1.5.0.tar.gz
Default: https://github.com/Rungutan/sentry-performance-monitoring/releases/download/1.6.0/clickhouse-1.6.0.tar.gz

ClickHouseInstanceType:
Type: String
Expand Down Expand Up @@ -205,28 +205,28 @@ Parameters:

SentryImage:
Type: String
Default: public.ecr.aws/x7u7j5v7/sentry-base:1.5.0
Description: Public ECR = public.ecr.aws/x7u7j5v7/sentry-base:1.5.0 <AND> Docker HUB = rungutancommunity/sentry-base:1.5.0
Default: public.ecr.aws/x7u7j5v7/sentry-base:1.6.0
Description: Public ECR = public.ecr.aws/x7u7j5v7/sentry-base:1.6.0 <AND> Docker HUB = rungutancommunity/sentry-base:1.6.0

SnubaImage:
Type: String
Default: public.ecr.aws/x7u7j5v7/sentry-snuba:1.5.0
Description: Public ECR = public.ecr.aws/x7u7j5v7/sentry-snuba:1.5.0 <AND> Docker HUB = rungutancommunity/sentry-snuba:1.5.0
Default: public.ecr.aws/x7u7j5v7/sentry-snuba:1.6.0
Description: Public ECR = public.ecr.aws/x7u7j5v7/sentry-snuba:1.6.0 <AND> Docker HUB = rungutancommunity/sentry-snuba:1.6.0

RelayImage:
Type: String
Default: public.ecr.aws/x7u7j5v7/sentry-relay:1.5.0
Description: Public ECR = public.ecr.aws/x7u7j5v7/sentry-relay:1.5.0 <AND> Docker HUB = rungutancommunity/sentry-relay:1.5.0
Default: public.ecr.aws/x7u7j5v7/sentry-relay:1.6.0
Description: Public ECR = public.ecr.aws/x7u7j5v7/sentry-relay:1.6.0 <AND> Docker HUB = rungutancommunity/sentry-relay:1.6.0

BashImage:
Type: String
Default: public.ecr.aws/x7u7j5v7/bash:1.5.0
Description: Public ECR = public.ecr.aws/x7u7j5v7/bash:1.5.0 <AND> Docker HUB = rungutancommunity/bash:1.5.0
Default: public.ecr.aws/x7u7j5v7/bash:1.6.0
Description: Public ECR = public.ecr.aws/x7u7j5v7/bash:1.6.0 <AND> Docker HUB = rungutancommunity/bash:1.6.0

ClickHouseImage:
Type: String
Default: public.ecr.aws/x7u7j5v7/clickhouse-client:1.5.0
Description: Public ECR = public.ecr.aws/x7u7j5v7/clickhouse-client:1.5.0 <AND> Docker HUB = rungutancommunity/clickhouse-client:1.5.0
Default: public.ecr.aws/x7u7j5v7/clickhouse-client:1.6.0
Description: Public ECR = public.ecr.aws/x7u7j5v7/clickhouse-client:1.6.0 <AND> Docker HUB = rungutancommunity/clickhouse-client:1.6.0

MinCountSnubaApi:
Type: String
Expand Down
34 changes: 2 additions & 32 deletions docker/relay/docker-alt-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,13 @@ fi
mkdir -p /work/.relay/ && chown -R relay:relay /work
(cp ${CONFIG_FILE_PATH} /work/.relay/config.yml) || true

# Sleep for the specified number of seconds before starting.
# For example, can be helpful to synchronize container startup in Kubernetes environment.
if [[ -n "${RELAY_DELAY_STARTUP_SECONDS:-}" ]]; then
echo "Sleeping for ${RELAY_DELAY_STARTUP_SECONDS}s..."
sleep "${RELAY_DELAY_STARTUP_SECONDS}"
fi

# Make sure that a specified URL (e.g. the upstream or a proxy sidecar) is reachable before starting.
# Only 200 response is accepted as success.
if [[ -n "${RELAY_PRESTART_ENDPOINT:-}" ]]; then
max_retry="${RELAY_PRESTART_MAX_RETRIES:-120}"
curl_timeout="${RELAY_PRESTART_REQUEST_TIMEOUT:-1}"
for attempt in $(seq 0 "${max_retry}"); do
if [[ "${attempt}" == "${max_retry}" ]]; then
echo "The prestart endpoint has not returned 200 after ${max_retry} attempts, exiting!"
exit 1
fi
status=$(curl --max-time "${curl_timeout}" --show-error --silent \
--output /dev/null --write-out "%{http_code}" \
-H 'Connection: close' \
"${RELAY_PRESTART_ENDPOINT}" \
|| true)
if [[ "${status}" == "200" ]]; then
break
fi
echo "Waiting for a 200 response from ${RELAY_PRESTART_ENDPOINT}, got ${status}"
sleep 1
done
fi

# For compatibility with older images
if [ "$1" == "bash" ]; then
set -- bash "${@:2}"
set -- bash
elif [ "$(id -u)" == "0" ]; then
set -- gosu relay /bin/relay "$@"
else
set -- /bin/relay "$@"
fi

exec "$@"
exec "$@"

0 comments on commit 6da9188

Please sign in to comment.