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

single file executables #118

Closed
YOU54F opened this issue Aug 10, 2023 · 4 comments
Closed

single file executables #118

YOU54F opened this issue Aug 10, 2023 · 4 comments

Comments

@YOU54F
Copy link
Member

YOU54F commented Aug 10, 2023

Hey hey,

Currently we use traveling-ruby to package up our ruby tools into a zipped folder for distribution.

There are few projects which are designed to also support packaging ruby, but using alternate methods, provide a ruby runtime, but as a single executable, that is unpacked into a temp dir when run.

I've been playing out with a few of them and using the work/knowledge I've gained from traveling-ruby to get them up to date and working to help the Ruby community out, and possibly make things simpler for our users when they are starting.

Also I got annoyed at no docker in non linux CI workflows, and kept hammering PactFlow during integration tests, so a nice self contained broker, you can start up on the command line, without Docker was one of my side aims

Windows

Create self extracting pact executables, with native extensions for windows

MacOS / Linux

rb2exe - this uses traveling-ruby and packages into a single file

@YOU54F
Copy link
Member Author

YOU54F commented Aug 16, 2023

Awwww yeaaaah 🚀 ruby packer packing ruby in alpine. It be a chonkie boi tho

Screenshot 2023-08-16 at 22 57 21

@bethesque
Copy link
Member

These are beautiful, but given we're trying to remove the ruby-standalone and use the rust impl instead, what is our usecase for these different packages?

@YOU54F
Copy link
Member Author

YOU54F commented Aug 17, 2023

Soooo, there are a few reasons why I wandered down this rabbit hole. Given that we are moving (or have moved) away from the Ruby ecosystem as the heart of Pact, it would be nice to have a nice little farewell party for all things Ruby

Pact Broker in a box - For use in testing environments that don't have Docker

  • Ability to spin up a test Pact Broker, without needing to install Ruby/Docker
    • CirrusCI MacOS & GitHub Actions MacOS / Windows runners, don't have access to Docker - and therefore had never ran before
      • For confidence whilst I was implementing the FFI layer into Pact-Python, I wanted to confidence that these examples would work cross-platform.
    • Pact python e2e examples use a Pact Broker
      • We test 6 python versions, across 3 operating systems and two processor types, so we have a large amount of Pacts being published in a short space of time
      • In order to make the e2e tests run in CI, I switched out conditionally to use the self hosted Pact Broker provided by PactFlow but was being rate limited

Gift back to the Ruby Community

  • The Ruby community has never had first class support for producing standalone packages, other than community impls like Ruby-Packer, Traveling-Ruby and Ocra. These have been unmaintained for some time.
  • It's nice to take the learnings from traveling Ruby and apply them to the Ruby packaging eco-system, before I depart into the world of Rust.

Better windows support

  • Currently traveling-ruby doesn't support native gems for Windows
  • Long path issues, issues with paths in spaces (I believe rubyc will be unaffected by these)

Pact in a box - consolidated tooling

Phased replacement of ruby cli tooling

  • I'm unsure if we would like to duplicate or move any of the broker client functionality over to Rust. (the other gems don't make sense, as they already have equivs - mock/stub server & verifier)
    • If we did, it would be nice to have the ability to switch between a rust impl or ruby impl. Maybe a rust bin entry point.

All the cool kids love Alpine

  • Traveling-ruby is built on centos7 and uses glibc, which means Alpine users require gcompat or similar libs in order to use the linux executables.
    • If we could build traveling-ruby against Alpine distros (or Rubyc), then we can provide a musl native ruby experience for Alpine users.

@YOU54F
Copy link
Member Author

YOU54F commented Aug 17, 2023

Also just to add, as an additional aside. The Pact Broker uses a large amount of native gems, of which I hadn't really tested with Traveling-Ruby and it was a big selling point of the packaging system.

It irked me a little bit that that I hadn't been able to cover/test that case, so I decided to ensure that it could build and package native gems, and what better way than to test something that I know and love, our Pact Broker!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants