-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Iker Barriocanal <32816711+iker-barriocanal@users.noreply.github.com>
- Loading branch information
1 parent
ee60bc8
commit ff55b0a
Showing
16 changed files
with
636 additions
and
0 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
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,59 @@ | ||
# Relay Pipelines | ||
|
||
Relay is in the process of moving to a set of rendered jsonnet pipelines. | ||
|
||
## Jsonnet | ||
|
||
You can render the jsonnet pipelines by running: | ||
|
||
``` | ||
make gocd | ||
``` | ||
|
||
This will clean, fmt, lint and generate the GoCD pipelines to | ||
`./gocd/generated-pipelines`. | ||
|
||
|
||
The Relay pipelines are using the https://github.com/getsentry/gocd-jsonnet | ||
libraries to generate the pipeline for each region. | ||
|
||
## Files | ||
|
||
Below is a description of the directories in the `gocd/` directory. | ||
|
||
### `gocd/templates/` | ||
|
||
These are a set of jsonnet and libsonnet files which are used | ||
to generate the relay pipelines. This avoids duplication across | ||
our GoCD pipeline files as we deploy to multiple regions. | ||
|
||
The `gocd/templates/relay.jsonnet` file is the entry point for the | ||
relay pipelines. | ||
|
||
`gocd/templates/libs/*.libsonnet` define the pipeline behaviors for | ||
deploy relay and relay-pops. These libraries are used to create a | ||
GoCD pipeline, following the same naming as the | ||
[GoCD yaml pipelines](https://github.com/tomzo/gocd-yaml-config-plugin#readme). | ||
|
||
`gocd/templates/bash/*.sh` are shell scripts that are inlined in the | ||
result pipelines. This seperation means syntax highlighting and | ||
extra tooling works for relay's bash scripts. | ||
|
||
`gocd/templates/jsonnetfile.json` and `gocd/templates/jsonnetfile.lock.json` | ||
are used by [jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler#readme), a package manager for jsonnet. | ||
|
||
You can update jsonnet dependencies by runnning `jb update`. | ||
|
||
### `gocd/generated-pipelines/` | ||
|
||
The current setup of GoCD at sentry is only able to look for | ||
yaml pipelines in a repo, so relay has to commit the generated | ||
pipelines. | ||
|
||
The dev-infra team is working on a GoCD plugin that will accept | ||
the jsonnet directly, removing the need for the generated-pipelines. | ||
|
||
### `gocd/pipelines/` | ||
|
||
These are the original relay pipelines and will be used until we move | ||
to the jsonnet pipelines. |
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,109 @@ | ||
format_version: 10 | ||
pipelines: | ||
deploy-relay-next-monitor: | ||
display_order: 2 | ||
environment_variables: | ||
SENTRY_REGION: monitor | ||
group: relay-next | ||
lock_behavior: unlockWhenFinished | ||
materials: | ||
deploy-relay-next-us-pipeline-complete: | ||
pipeline: deploy-relay-next-us | ||
stage: pipeline-complete | ||
relay_repo: | ||
branch: master | ||
destination: relay | ||
git: git@github.com:getsentry/relay.git | ||
shallow_clone: true | ||
stages: | ||
- checks: | ||
fetch_materials: true | ||
jobs: | ||
checks: | ||
elastic_profile_id: relay | ||
environment_variables: | ||
GITHUB_TOKEN: '{{SECRET:[devinfra-github][token]}}' | ||
tasks: | ||
- script: | | ||
##!/bin/bash | ||
/devinfra/scripts/checks/githubactions/checkruns.py \ | ||
getsentry/relay \ | ||
"${GO_REVISION_RELAY_REPO}" \ | ||
"Integration Tests" \ | ||
"Test (macos-latest)" \ | ||
"Test (windows-latest)" \ | ||
"Test All Features (ubuntu-latest)" \ | ||
"Push GCR Docker Image" | ||
timeout: 1800 | ||
- deploy-production: | ||
fetch_materials: true | ||
jobs: | ||
create_sentry_release: | ||
elastic_profile_id: relay | ||
environment_variables: | ||
SENTRY_AUTH_TOKEN: '{{SECRET:[devinfra-temp][relay_sentry_auth_token]}}' | ||
SENTRY_ORG: sentry | ||
SENTRY_PROJECT: relay | ||
SENTRY_URL: https://sentry.my.sentry.io/ | ||
tasks: | ||
- script: | | ||
##!/bin/bash | ||
./relay/scripts/create-sentry-release "${GO_REVISION_RELAY_REPO}" | ||
timeout: 1200 | ||
deploy: | ||
elastic_profile_id: relay | ||
tasks: | ||
- script: | | ||
##!/bin/bash | ||
eval $(/devinfra/scripts/regions/project_env_vars.py --region="${SENTRY_REGION}") | ||
/devinfra/scripts/k8s/k8stunnel | ||
/devinfra/scripts/k8s/k8s-deploy.py \ | ||
--label-selector="service=relay,deploy_if_production=true" \ | ||
--image="us.gcr.io/sentryio/relay:${GO_REVISION_RELAY_REPO}" \ | ||
--container-name="relay" | ||
timeout: 1200 | ||
- progress-to-pops: | ||
approval: | ||
allow_only_on_success: true | ||
type: manual | ||
jobs: | ||
progress-to-pops: | ||
elastic_profile_id: relay | ||
tasks: | ||
- exec: | ||
command: true | ||
timeout: 1200 | ||
- deploy-pops: | ||
fetch_materials: true | ||
jobs: | ||
deploy-pops-monitor: | ||
elastic_profile_id: relay-pop | ||
environment_variables: | ||
SENTRY_REGION: monitor | ||
tasks: | ||
- script: | | ||
##!/bin/bash | ||
eval $(/devinfra/scripts/regions/project_env_vars.py --region="${SENTRY_REGION}") | ||
/devinfra/scripts/k8s/k8stunnel | ||
/devinfra/scripts/k8s/k8s-deploy.py \ | ||
--label-selector="service=relay-pop" \ | ||
--image="us.gcr.io/sentryio/relay:${GO_REVISION_RELAY_REPO}" \ | ||
--container-name="relay" | ||
timeout: 1200 | ||
- pipeline-complete: | ||
approval: | ||
allow_only_on_success: true | ||
type: success | ||
jobs: | ||
pipeline-complete: | ||
tasks: | ||
- exec: | ||
command: true |
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,173 @@ | ||
format_version: 10 | ||
pipelines: | ||
deploy-relay-next-us: | ||
display_order: 1 | ||
environment_variables: | ||
SENTRY_REGION: us | ||
group: relay-next | ||
lock_behavior: unlockWhenFinished | ||
materials: | ||
deploy-relay-next-pipeline-complete: | ||
pipeline: deploy-relay-next | ||
stage: pipeline-complete | ||
relay_repo: | ||
branch: master | ||
destination: relay | ||
git: git@github.com:getsentry/relay.git | ||
shallow_clone: true | ||
stages: | ||
- checks: | ||
fetch_materials: true | ||
jobs: | ||
checks: | ||
elastic_profile_id: relay | ||
environment_variables: | ||
GITHUB_TOKEN: '{{SECRET:[devinfra-github][token]}}' | ||
tasks: | ||
- script: | | ||
##!/bin/bash | ||
/devinfra/scripts/checks/githubactions/checkruns.py \ | ||
getsentry/relay \ | ||
"${GO_REVISION_RELAY_REPO}" \ | ||
"Integration Tests" \ | ||
"Test (macos-latest)" \ | ||
"Test (windows-latest)" \ | ||
"Test All Features (ubuntu-latest)" \ | ||
"Push GCR Docker Image" | ||
timeout: 1800 | ||
- deploy-production: | ||
fetch_materials: true | ||
jobs: | ||
create_sentry_release: | ||
elastic_profile_id: relay | ||
environment_variables: | ||
SENTRY_AUTH_TOKEN: '{{SECRET:[devinfra-temp][relay_sentry_auth_token]}}' | ||
SENTRY_ORG: sentry | ||
SENTRY_PROJECT: relay | ||
SENTRY_URL: https://sentry.my.sentry.io/ | ||
tasks: | ||
- script: | | ||
##!/bin/bash | ||
./relay/scripts/create-sentry-release "${GO_REVISION_RELAY_REPO}" | ||
timeout: 1200 | ||
deploy: | ||
elastic_profile_id: relay | ||
tasks: | ||
- script: | | ||
##!/bin/bash | ||
eval $(/devinfra/scripts/regions/project_env_vars.py --region="${SENTRY_REGION}") | ||
/devinfra/scripts/k8s/k8stunnel | ||
/devinfra/scripts/k8s/k8s-deploy.py \ | ||
--label-selector="service=relay,deploy_if_production=true" \ | ||
--image="us.gcr.io/sentryio/relay:${GO_REVISION_RELAY_REPO}" \ | ||
--container-name="relay" | ||
timeout: 1200 | ||
- progress-to-pops: | ||
approval: | ||
allow_only_on_success: true | ||
type: manual | ||
jobs: | ||
progress-to-pops: | ||
elastic_profile_id: relay | ||
tasks: | ||
- exec: | ||
command: true | ||
timeout: 1200 | ||
- deploy-pops: | ||
fetch_materials: true | ||
jobs: | ||
create_sentry_release: | ||
elastic_profile_id: relay | ||
environment_variables: | ||
SENTRY_AUTH_TOKEN: '{{SECRET:[devinfra-temp][relay_sentry_auth_token]}}' | ||
SENTRY_ORG: sentry | ||
SENTRY_PROJECT: pop-relay | ||
SENTRY_URL: https://sentry.my.sentry.io/ | ||
tasks: | ||
- script: | | ||
##!/bin/bash | ||
./relay/scripts/create-sentry-release "${GO_REVISION_RELAY_REPO}" | ||
timeout: 1200 | ||
deploy-pops-us-pop-1: | ||
elastic_profile_id: relay-pop | ||
environment_variables: | ||
SENTRY_REGION: us-pop-1 | ||
tasks: | ||
- script: | | ||
##!/bin/bash | ||
eval $(/devinfra/scripts/regions/project_env_vars.py --region="${SENTRY_REGION}") | ||
/devinfra/scripts/k8s/k8stunnel | ||
/devinfra/scripts/k8s/k8s-deploy.py \ | ||
--label-selector="service=relay-pop" \ | ||
--image="us.gcr.io/sentryio/relay:${GO_REVISION_RELAY_REPO}" \ | ||
--container-name="relay" | ||
timeout: 1200 | ||
deploy-pops-us-pop-2: | ||
elastic_profile_id: relay-pop | ||
environment_variables: | ||
SENTRY_REGION: us-pop-2 | ||
tasks: | ||
- script: | | ||
##!/bin/bash | ||
eval $(/devinfra/scripts/regions/project_env_vars.py --region="${SENTRY_REGION}") | ||
/devinfra/scripts/k8s/k8stunnel | ||
/devinfra/scripts/k8s/k8s-deploy.py \ | ||
--label-selector="service=relay-pop" \ | ||
--image="us.gcr.io/sentryio/relay:${GO_REVISION_RELAY_REPO}" \ | ||
--container-name="relay" | ||
timeout: 1200 | ||
deploy-pops-us-pop-3: | ||
elastic_profile_id: relay-pop | ||
environment_variables: | ||
SENTRY_REGION: us-pop-3 | ||
tasks: | ||
- script: | | ||
##!/bin/bash | ||
eval $(/devinfra/scripts/regions/project_env_vars.py --region="${SENTRY_REGION}") | ||
/devinfra/scripts/k8s/k8stunnel | ||
/devinfra/scripts/k8s/k8s-deploy.py \ | ||
--label-selector="service=relay-pop" \ | ||
--image="us.gcr.io/sentryio/relay:${GO_REVISION_RELAY_REPO}" \ | ||
--container-name="relay" | ||
timeout: 1200 | ||
deploy-pops-us-pop-4: | ||
elastic_profile_id: relay-pop | ||
environment_variables: | ||
SENTRY_REGION: us-pop-4 | ||
tasks: | ||
- script: | | ||
##!/bin/bash | ||
eval $(/devinfra/scripts/regions/project_env_vars.py --region="${SENTRY_REGION}") | ||
/devinfra/scripts/k8s/k8stunnel | ||
/devinfra/scripts/k8s/k8s-deploy.py \ | ||
--label-selector="service=relay-pop" \ | ||
--image="us.gcr.io/sentryio/relay:${GO_REVISION_RELAY_REPO}" \ | ||
--container-name="relay" | ||
timeout: 1200 | ||
- pipeline-complete: | ||
approval: | ||
allow_only_on_success: true | ||
type: success | ||
jobs: | ||
pipeline-complete: | ||
tasks: | ||
- exec: | ||
command: true |
Oops, something went wrong.