prisma-engines icon indicating copy to clipboard operation
prisma-engines copied to clipboard

Custom engine compilation and upload to S3

Open applicazza opened this issue 2 years ago • 3 comments

Is there any step by step guide how to compile and release (i.e. upload to custom s3 bucket) modified version of prisms engines? I am maintaining a fork of prisma-engines for my organization that doesn’t drop rows that have 0000-00-00 00:00:00 in datetime columns and would like to automate the process.

applicazza avatar Jul 28 '23 06:07 applicazza

Our process is unfortunately in a closed source Rust project (engineer) that is run in our Buildkite CI at the moment.

It's nothing fancy really, but because of historical security concerns we can not open source it - and you would also definitely want to do it this way as it is hard to maintain and evolve. We have on our list to move this so something more accessible for ages, but never get to it because the existing setup works ok-ish.

This screenshot shows all the builds we currently create and then upload to S3: image These jobs all run on specific Docker images like prismagraphql/build:rhel-libssl1.0.x so they have the correct stuff available to include in the build.

Do you have to build for all operating systems and combinations or does your org only use Prisma in a specific environment? That would bring down the complexity a lot.

janpio avatar Jul 28 '23 08:07 janpio

Our process is unfortunately in a closed source Rust project (engineer) that is run in our Buildkite CI at the moment.

It's nothing fancy really, but because of historical security concerns we can not open source it - and you would also definitely want to do it this way as it is hard to maintain and evolve. We have on our list to move this so something more accessible for ages, but never get to it because the existing setup works ok-ish.

This screenshot shows all the builds we currently create and then upload to S3: image These jobs all run on specific Docker images like prismagraphql/build:rhel-libssl1.0.x so they have the correct stuff available to include in the build.

Do you have to build for all operating systems and combinations or does your org only use Prisma in a specific environment? That would bring down the complexity a lot.

Hey, thanks for blazing fast answer.

We use apple intel, apple silicon and Linux musl and work with MySQL and MongoDB

applicazza avatar Jul 28 '23 11:07 applicazza

As far as I could figure out, these are the underlying build images and command that are being run there:

  • Linux Musl: Uses the image prismagraphql/build:alpine-libssl{openssl_version} (version can be 1.1 or 3.0), and then a pretty standard cargo build command probably
  • Apple Intel and Apple Silicon actually start a GH Actions workflow and then download the result: https://github.com/prisma/prisma-engines/blob/main/.github/workflows/build-apple-intel.yml + https://github.com/prisma/prisma-engines/blob/main/.github/workflows/build-apple-silicon.yml You can see the runs at https://github.com/prisma/prisma-engines/actions/workflows/build-apple-intel.yml and https://github.com/prisma/prisma-engines/actions/workflows/build-apple-silicon.yml

That might be enough for you to put this into a GH Actions workflow that you can easily run on push, tag or release in your fork.

janpio avatar Jul 28 '23 11:07 janpio