-
Notifications
You must be signed in to change notification settings - Fork 12
Description
📚 Context
Today we have a set of yaml files to drive the docker compose execution that spins up a cartesi runtime environment. These multiple files are merged by docker compose based on its own rules. When cartesi run is executed a set of yaml files are specified with multiple -f args to docker compose up. There are some runtime options that change which files are specified, and also some envvar replacement values.
During the CLI build process we need to keep all these files around. This is done by the npm copy-files script, which copy the files to the dist directory, and into the package.
There is a possibility of packaging the CLI as a single binary (which we should create a separate issue for and link here). The easiest way of doing that is to use SEA, Single Execution Application. Nodejs has its own experimental support for SEA, but Bun seems to have a more mature support. In case we use Bun we will need to change the way how these yaml files are handled, as discussed above, even with support for embedded files by Bun.
✔️ Solution
I think the simplest way would be to migrate from the yaml files, which currently account for a total of less than 400 lines of yaml code, to a code based generation of the docker compose configuration.
We would need to create functions that spit yaml configuration, and feed that to docker compose as stdin using -f -.
📈 Subtasks
- code to produce compose configuration
🎯 Definition of Done
- cartesi run working the say but all
yamlfiles removed from repo