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

Commit

Permalink
Merge pull request #5 from getsentry/antonpirker/use-relay-as-extension
Browse files Browse the repository at this point in the history
Use relay from sentry release registry as Lambda extension
  • Loading branch information
antonpirker committed Jun 21, 2022
2 parents f53475f + 9dad94a commit b9ccd4d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The following are all _required_.

## Testing

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.
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.

## Contributing

Expand Down
26 changes: 22 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,32 @@ runs:
with:
path: ${{ inputs.build_cache_paths }}
key: ${{ inputs.build_cache_key }}
- name: "Download and configure Sentry Lambda extension"
- name: Download latest relay
shell: bash
run: |
echo "Downloading Sentry Lambda extension..."
echo "Downloading relay..."
mkdir -p dist-serverless/relay
curl -0 --silent \
--output dist-serverless/relay/relay \
"$(curl -s https://release-registry.services.sentry.io/apps/relay/latest | jq -r .files.\"relay-Linux-x86_64\".url)"
chmod +x dist-serverless/relay/relay
echo "Done downloading relay."
- name: Configure Lambda extension to start relay
shell: bash
run: |
echo "Creating start script..."
mkdir -p dist-serverless/extensions
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`
cat > dist-serverless/extensions/sentry-lambda-extension << EOT
#!/bin/bash
set -euo pipefail
exec /opt/relay/relay run \
--mode=proxy \
--shutdown-timeout=2 \
--upstream-dsn="\$SENTRY_DSN" \
--aws-runtime-api="\$AWS_LAMBDA_RUNTIME_API"
EOT
chmod +x dist-serverless/extensions/sentry-lambda-extension
echo "Done downloading Sentry Lambda extension..."
echo "Done creating start script."
- name: "Setup tmate session"
uses: mxschmitt/action-tmate@v3
if: ${{ inputs.debug_enabled == 'true' }}
Expand Down

0 comments on commit b9ccd4d

Please sign in to comment.