cachewerk / relay

The next-generation caching layer for PHP powered by Redis.
https://relay.so
MIT License
191 stars 10 forks source link

Universal install script #26

Open tillkruss opened 1 year ago

tillkruss commented 1 year ago

Having an interactive and non-interactive install script would be useful.

  1. The script must use sh and not bash for portability
  2. The script must accept arguments to run without interaction, see last step
  3. Each step needs validation checks: Was the command completed or not?
  4. Use one-liner to download and execute a. curl -sL https://sentry.io/get-cli/ | sh
  5. Check if we have builds for the system it's executed on a. For manual reference see: https://relay.so/builds b. Check OS as well as architecture c. Abort if os/arch isn't supported and show system information blob, prompt user to open a PR on this repo
  6. Next, find all php binaries a. Loop over PATHs and find binaries that contain *php* in the name b. Test if binary is a php executable using --version?
  7. Show user a list of found executables a. Show path + version + if that version is supported (7.4 — 8.2) b. Let user pick a binary to install Relay to
  8. Detect "ini dir" of php binary
  9. Detect "extension dir" of php binary a. php -i | grep '^extension_dir'
  10. Check for needed PHP extensions (json, msgpack, igbinary) using php -m a. Abort if any of them are missing and prompt user to install the ones that are missing
  11. Check system dependencies a. zstd, lz4 and openssl b. These libs are named differently on each system, we'll need checks for: Debian-based, CentOS-based, macOS-based and AlpineLinux-based systems c. If not found prompt user to install the package and abort
  12. Download correct binary to mktemp
  13. Inject UUID
  14. Move relay.so and relay.ini to ext/ini dirs
  15. Verify installation was completed: php --ri relay and UUID matches
  16. Show confirmation message that Relay was installed
  17. Print instructions how to call script without user interaction for what they just chose
tillkruss commented 1 year ago

We now have an outline here: https://relay.so/docs/1.x/installation#manual-installation

zaherg commented 1 year ago

@tillkruss openssl 1.1 specifically is need it right?, newer version of openssl is not supported correct? (this apply for all versions except the one for ubuntu/debian)

I am asking because alpine:3.17 shipped with openssl 3.0.7-r0

tillkruss commented 1 year ago

Aha, we might need to add builds for that then. Let's do Alpine 3.16 and older for now.

zaherg commented 1 year ago

I have found the following:

  1. centos 8 will install openssl 1.1 by default.
  2. centos 7 will install openssl 1.0 by default.
  3. amazonlinux 2 will install openssl 1.0 by default.
  4. rockylinux 8 will install openssl 1.1 by default.
  5. rockylinux 9 will install openssl 3.0 by default.

So any other distro with openssl 3 (like rockylinux 9) will get an error message that we need openssl 1.1