Create HTTP web service which generates Recipes Catalogue dynamically #604

Open
opened 2024-04-02 09:04:00 +00:00 by basebuilder · 3 comments
Member

I mentioned to @decentral1se last week the idea of generating the recipes-catalogue-json in a new fashion which is dynamically via a minimal HTTP server which could be found at recipes.coopcloud.tech/api or such.

If I understand correctly, the current flow revolves around manually running abra catalogue generate and committing that to the repo and pushing it. My proposal, I think, would allow that to just happen automagically whenever a new recipe version is published.

This would benefit from migration to coopcloud.tech/recipes organization detailed in #569 and possibly relate to #599 and also benefit #603

I mentioned to @decentral1se last week the idea of generating the `recipes-catalogue-json` in a new fashion which is *dynamically* via a minimal HTTP server which could be found at `recipes.coopcloud.tech/api` or such. If I understand correctly, the current flow revolves around manually running `abra catalogue generate` and committing that to the repo and pushing it. My proposal, I think, would allow that to *just happen automagically* whenever a new recipe version is published. This would benefit from migration to `coopcloud.tech/recipes` organization detailed in #569 and possibly relate to #599 and also benefit #603
basebuilder added the
proposal
recipes.coopcloud.tech
labels 2024-04-02 09:04:00 +00:00
Owner

Thanks for opening! Under "Operator Collaboration / General Version Improvement" on #583 and in the last fedi meeting (notes: https://docs.coopcloud.tech/federation/minutes/2024-03-29/) we touched on a few ways that we could remove the need for the catalogue repository requirement on the abra side. But we didn't have an answer for how to still provide pre-computed data for catalogue web UI. This /api could deffo sort this. And I'm curious on the overlap between ideas of @p4u1 and your ideas @basebuilder. Hopefully to be discussed at the next fedi meeting 🎉

Thanks for opening! Under "Operator Collaboration / General Version Improvement" on https://git.coopcloud.tech/coop-cloud/organising/issues/583 and in the last fedi meeting (notes: https://docs.coopcloud.tech/federation/minutes/2024-03-29/) we touched on a few ways that we could remove the need for the catalogue repository requirement on the `abra` side. But we didn't have an answer for how to still provide pre-computed data for catalogue web UI. This `/api` could deffo sort this. And I'm curious on the overlap between ideas of @p4u1 and your ideas @basebuilder. Hopefully to be discussed at the next fedi meeting 🎉
Owner

If I understand correctly, the current flow revolves around manually running abra catalogue generate and committing that to the repo and pushing it. My proposal, I think, would allow that to just happen automagically whenever a new recipe version is published.

It's already automatic for some (many? most?) recipes.

  1. abra recipe sync wordpress / abra recipe release wordpress → generates and pushes a git tag
  2. Drone notices the new tag (because of this config) and triggers a build of auto-recipes-catalogue-json
  3. auto-recipes-catalogue-json rebuilds the catalogue and makes a commit to recipes-catalogue-json
  4. Drone notices new commit (config) and auto-deploys new recipe version to https://recipes.coopcloud.tech/recipes.json

There's also a daily Drone job which runs auto-recipes-catalogue-json which will pick up recipes which don't have the drone/downstream step (either ones created not using abra recipe new / the repo template, or older recipes which didn't have that step added afterwards).

> If I understand correctly, the current flow revolves around manually running `abra catalogue generate` and committing that to the repo and pushing it. My proposal, I think, would allow that to just happen automagically whenever a new recipe version is published. It's already automatic for some (many? most?) recipes. 1. `abra recipe sync wordpress` / `abra recipe release wordpress` → generates and pushes a git tag 2. Drone notices the new tag ([because of this config](https://git.coopcloud.tech/coop-cloud/wordpress/src/branch/main/.drone.yml#L28-L40)) and triggers [a build of `auto-recipes-catalogue-json`](https://build.coopcloud.tech/coop-cloud/auto-recipes-catalogue-json) 3. `auto-recipes-catalogue-json` rebuilds the catalogue and makes a commit to [`recipes-catalogue-json`](https://git.coopcloud.tech/coop-cloud/recipes-catalogue-json) 4. Drone notices new commit ([config](https://git.coopcloud.tech/coop-cloud/recipes-catalogue-json/src/branch/main/.drone.yml#L5-L12)) and auto-deploys new recipe version to https://recipes.coopcloud.tech/recipes.json There's also a daily Drone job which runs `auto-recipes-catalogue-json` which will pick up recipes which don't have the `drone/downstream` step (either ones created not using `abra recipe new` / the repo template, or older recipes which didn't have that step added afterwards).
Owner

The main issues I see with the current set-up are:

  1. It's not documented
  2. It means that setting up a new recipe catalogue, for #139, would currently require configuring up a lot of CD.

Copying the above comment into the TODO on Maintainer Handbook could be a start towards addressing (1).

For (2), I think it would be interesting to understand more about the use-cases for 3rd-party recipe catalogues, and maybe make some more progress on the recipe-generation code itself first (i.e. how could we make abra catalogue generate work if .abra/recipes contains recipes which aren't in git.coopcloud.tech/coop-cloud).

The main issues I see with the current set-up are: 1. It's not documented 2. It means that setting up a new recipe catalogue, for #139, would currently require configuring up a lot of CD. Copying the above comment into [the TODO on Maintainer Handbook](https://docs.coopcloud.tech/maintainers/handbook/#how-does-automatic-catalogue-regeneration-work) could be a start towards addressing (1). For (2), I think it would be interesting to understand more about the use-cases for 3rd-party recipe catalogues, and maybe make some more progress on the recipe-generation code itself first (i.e. how could we make `abra catalogue generate` work if `.abra/recipes` contains recipes which aren't in git.coopcloud.tech/coop-cloud).
basebuilder added this to the Project Gitea Re-organisation milestone 2024-04-15 07:09:00 +00:00
Sign in to join this conversation.
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/organising#604
No description provided.