beabee-communityrm / monorepo

Beabee is platform for community journalism
https://www.beabee.io
GNU Affero General Public License v3.0
1 stars 0 forks source link

feat(task-runner): New task runner package and dashboard #4

Open JumpLink opened 1 month ago

JumpLink commented 1 month ago

Work

New Services in docker-compose.yml

New apps

New packages

New docker images

GitHub

docker-compose.yml

CLI

Task Runner Worker

A simple application that waits for new jobs and processes them. Currently, everything is simply executed in the same process of the Node.js application. Since Node.js can only use one CPU core, this could lead to problems with a large number of jobs. With BullMQ this could also be outsourced to separate processes, but I don't think we need that at the moment.

Task Runner Dashboard

Also a simple application that uses bull-board, so far without much customization, but would be possible. The password protection is currently a fixed user, but the authentication of beabee could perhaps be used here if this is to become public.

Docker Deno and Node.js Image

Our workspace currently requires Node.js and Deno. Unfortunately, I could not get both to run with alpine, so this image is based on debian, but is currently only used for building and not for runtime.

Docker Workspace Image

Because we now have many apps that use the same packages (which themselves also have dependencies among each other), the same packages always had to be built in every image. That's why I introduced the workspace image, which builds everything once and the other images copy out what they need. I have also customized the GitHub Actions so that the deno-node and workspace image are built and published first and the others then use them.

Models

I created the models package because they have to be built with the typescript compiler. esbuild is lightning fast in contrast to the TypeScript compiler, but has no information about the types used. Since TypeORM uses the experimental decorators of TypeScript and not the new ones of the JavaScript standard, the types information is needed for this, which esbuild cannot do. For this reason, we build the models with the typescript compiler. This way, the models in the apps can still be used with esbuild.

Version

Since everything is now always released and deployed together, we should bring all apps and packages to the same version number. beabee-common is currently the only outlier here with version 0.21.0, so I suggest bringing everything to version 0.22.0. Alternatively, we could rename @beabee/beabee-common to @beabee/common (here, common is also the only outlier with the name) and then set everything to version 0.16.0.

Why so many changes?

This was not planned and has the following reasons:

Potential for improvement

JumpLink commented 5 days ago

@wpf500 I still have to fix a few small bugs and update the documentation, but otherwise the PR is ready for review. But let's take another look at it together