Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

Commit b9ccd4d

Browse files
authored
Merge pull request #5 from getsentry/antonpirker/use-relay-as-extension
Use relay from sentry release registry as Lambda extension
2 parents f53475f + 9dad94a commit b9ccd4d

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The following are all _required_.
6363

6464
## Testing
6565

66-
If you want to see an example of a zip file this action can create looks like you can manually run the GitHub action "Test Production". This will create a dummy lambda layer (just containing one placeholder file) and the latest [relay](https://github.com/getsentry/relay) based Sentry Lambda Extension. After the GitHub action has run, you can download the generated artifact at the bottom of the summary page of the GitHub action result.
66+
If you want to see what an example of a zip file created by this action looks like you can manually run the GitHub action "Test Production". This will create a dummy lambda layer (just containing one placeholder file) and the latest [relay](https://github.com/getsentry/relay) based Sentry Lambda Extension. After the GitHub action has run, you can download the generated artifact at the bottom of the summary page of the GitHub action result.
6767

6868
## Contributing
6969

action.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,32 @@ runs:
2828
with:
2929
path: ${{ inputs.build_cache_paths }}
3030
key: ${{ inputs.build_cache_key }}
31-
- name: "Download and configure Sentry Lambda extension"
31+
- name: Download latest relay
3232
shell: bash
3333
run: |
34-
echo "Downloading Sentry Lambda extension..."
34+
echo "Downloading relay..."
35+
mkdir -p dist-serverless/relay
36+
curl -0 --silent \
37+
--output dist-serverless/relay/relay \
38+
"$(curl -s https://release-registry.services.sentry.io/apps/relay/latest | jq -r .files.\"relay-Linux-x86_64\".url)"
39+
chmod +x dist-serverless/relay/relay
40+
echo "Done downloading relay."
41+
- name: Configure Lambda extension to start relay
42+
shell: bash
43+
run: |
44+
echo "Creating start script..."
3545
mkdir -p dist-serverless/extensions
36-
curl -0 --silent --output dist-serverless/extensions/sentry-lambda-extension `curl -s https://release-registry.services.sentry.io/apps/sentry-lambda-extension/latest | jq -r .files.\"sentry-lambda-extension\".url`
46+
cat > dist-serverless/extensions/sentry-lambda-extension << EOT
47+
#!/bin/bash
48+
set -euo pipefail
49+
exec /opt/relay/relay run \
50+
--mode=proxy \
51+
--shutdown-timeout=2 \
52+
--upstream-dsn="\$SENTRY_DSN" \
53+
--aws-runtime-api="\$AWS_LAMBDA_RUNTIME_API"
54+
EOT
3755
chmod +x dist-serverless/extensions/sentry-lambda-extension
38-
echo "Done downloading Sentry Lambda extension..."
56+
echo "Done creating start script."
3957
- name: "Setup tmate session"
4058
uses: mxschmitt/action-tmate@v3
4159
if: ${{ inputs.debug_enabled == 'true' }}

0 commit comments

Comments
 (0)