crate-workbench / cratedb-toolkit

CrateDB Toolkit.
https://cratedb-toolkit.readthedocs.io/
GNU Affero General Public License v3.0
5 stars 3 forks source link

Build self-contained native binaries #160

Open amotl opened 1 month ago

amotl commented 1 month ago

About

We might think about using traditional PyInstaller to build self-contained native binaries? Alternatively, let's try Briefcase, or PyApp?

ctk.exe, anyone?

References

amotl commented 2 weeks ago

Introduction

We discussed matters of how to derive subsets of functionality in CrateDB Toolkit into dedicated release artefacts, which not necessarily need to follow the development iterations and release cadence of Toolkit.

Most prominently, this use case appeared with GH-88 and GH-153. We are sharing our thoughts here, about our first approach to that topic on behalf of monorepo paradigms.

Proposal

This is our first proposal, based on preliminary discussions around needs, requirements, and their possible benefits or pitfalls.

Driver

Publisher

In order to detach from the regular cadence and relevant build processes, we proposed to:

amotl commented 2 weeks ago

Hi there,

I appreciate the idea of using setuptools extra labels for slicing the distribution on behalf of defining a subset of dependencies. I think it is absolutely the right choice to use that mechanism for that very purpose.

On the other hand, as discussed, PyInstaller apparently expects an output name for the binary executable. This one, I strongly believe, goes orthogonal to the dependency selection process, and should be conveyed to the "driver" on behalf of a separate variable.

In order to wrap it together, I would be fine if the "driver" synthesizes it from a single unique label/tag, by e.g. mapping it from cfr => cratedb-cfr-{version}.exe, or such.

Just sharing my humble thoughts on this matter, maybe possible to consider, otherwise please »go ahead« ;].

With kind regards, Andreas.

amotl commented 2 weeks ago

Status Report

It looks like GHCR is not suitable to host and distribute standalone artefacts of arbitrary nature. The means of what GHCR provides, is being a registry and provider for OCI images, which, for example in case of Homebrew, are apparently being unwrapped by the brew installer program, in order to derive its "bottles" packages out of them again.

-- https://github.blog/2021-06-21-github-packages-container-registry-generally-available/

In that spirit, it is not suitable for our use case, and we need to find a different solution. Maybe JFrog, maybe just slap it onto our HTTP server, like we are doing it with the cratedb-prometheus-adapter, and also others like the standalone version of crash? https://build.opensuse.org/ could also be an option, but it might be too much focused on building and matters of Linux, to be an adequate generic solution for distributing binaries of arbitrary nature.

We will continue on this topic next week, and will also be happy about any suggestions, when applicable.