Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Relay #682

Closed
tillkruss opened this issue Jan 6, 2023 · 8 comments
Closed

Support for Relay #682

tillkruss opened this issue Jan 6, 2023 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@tillkruss
Copy link
Sponsor

Describe the feature

I'm one of the makers of Relay and we're heavy users shivammathur/setup-php ourselves and would love to see Relay support.

Underlying issue

Installing Relay is a little verbose on GitHub Actions, since it requires the msgpack and igbinary extensions and some extra steps.

Describe alternatives

  - name: Setup PHP
    uses: shivammathur/setup-php@v2
    with:
      extensions: msgpack, igbinary

  - name: Install Relay
    run: |
      curl -L "https://builds.r2.relay.so/${{ env.relay }}/relay-${{ env.relay }}-php${{ env.php }}-debian-x86-64.tar.gz" | tar xz
      cd relay-${{ env.relay }}-php${{ env.php }}-debian-x86-64
      sudo cp relay.ini $(php-config --ini-dir)
      sudo cp relay-pkg.so $(php-config --extension-dir)/relay.so
      sudo sed -i "s/00000000-0000-0000-0000-000000000000/$(cat /proc/sys/kernel/random/uuid)/" $(php-config --extension-dir)/relay.so

Additional context

https://relay.so/docs/1.x/installation#github-actions

Are you willing to submit a PR?

Yes, but we don't know where to start. Happy to become sponsors as well 👍

@tillkruss tillkruss added the enhancement New feature or request label Jan 6, 2023
@shivammathur
Copy link
Owner

@tillkruss

Thanks for reaching out.
I will be happy to add support in the next release. Sponsorship is always helpful 👍

@tillkruss
Copy link
Sponsor Author

Excellent, happy to review ✌️

@shivammathur
Copy link
Owner

Added in 52eb86c. It is in develop right now, will be in the next release.

This should work on Linux and macOS once released.

- name: Install PHP
  uses: shivammathur/setup-php@v2
  with:
    php-version: '8.1' # 7.4 to 8.2
    extensions: relay # or specific version like relay-0.4.6 
  env:
    RELAY_KEY: ${{ secrets.RELAY_KEY }}
    RELAY_ENVIRONMENT: development
    RELAY_EVICTION_POLICY: lru
    RELAY_MAX_MEMORY: 256M

@shivammathur shivammathur added the awaiting-release Added/Fixed and tested, awaiting release label Jan 13, 2023
@tillkruss
Copy link
Sponsor Author

Amazing, looks good ❤️‍🔥

@ostrolucky
Copy link

Can we generate random key by default, in case no key was specified? Because if no key is specified, extension produces warnings. And I don't have an idea for a one-liner in RELAY_KEY to do this 🤔

@shivammathur
Copy link
Owner

@ostrolucky

RELAY_KEY env would be for setting the license key.
https://relay.so/docs/1.x/configuration#default-configuration

The random uuid replacement in the extension binary will be done by default

init_relay_binary_id() {
if [ -e "${ext_dir:?}"/relay.so ]; then
grep -aq 00000000 "${ext_dir:?}"/relay.so && \
sudo LC_ALL=C sed -i.bak "s/00000000-0000-0000-0000-000000000000/$(uuidgen)/" "$ext_dir"/relay.so
fi
}

@ostrolucky
Copy link

Ahh all good then, very nice

@shivammathur
Copy link
Owner

Released in 2.24.0

@shivammathur shivammathur removed the awaiting-release Added/Fixed and tested, awaiting release label Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants