Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Official API Server - Recipes submodule update #31

Closed
SpecialAro opened this issue May 11, 2022 · 3 comments · Fixed by #33
Closed

Official API Server - Recipes submodule update #31

SpecialAro opened this issue May 11, 2022 · 3 comments · Fixed by #33

Comments

@SpecialAro
Copy link
Member

Problem

The official API Server of Ferdium (https://api.ferdium.org/) is currently running through the docker image provided by https://hub.docker.com/repository/docker/ferdium/ferdium-server.

I've checked the container and the recipes folder is not currently a git repository. Once we upgrade the recipes main branch, the server currently needs to be updated manually by:

  1. locally pulling the new commits on recipes repo
  2. building a new docker image locally (we should get a GH Action for this, I will open a different issue)
  3. pushing the new docker image to the registry docker hub manually (we should get a GH Action for this, I will open different issue)
  4. delete the old docker image on the server
  5. run the new docker image

This process is totally non-sense and automation is very much in need.

Proposed Solution

My proposal is:

  1. To include the "recipes" folder in the .dockerignore file, so that when we build the image the "recipes" folder is not present.
  2. To install git in the container by changing the dockerfile (https://github.com/ferdium/ferdium-server/blob/main/Dockerfile) or the entrypoint.sh (https://github.com/ferdium/ferdium-server/blob/main/docker/entrypoint.sh)
  3. In entrypoint.sh: Git pull the recipes repo locally.
  4. In entrypoint.sh: Define a crontab job to run every "X" minutes (or hours, or maybe once a day) to git fetch and git pull -r the recipes local repo.

Any thoughts on this? Do you agree?

@santhosh-chinnasamy
Copy link
Contributor

@SpecialAro instead of running cron, shall we expose a web-hook/api endpoint which will be triggered by the GH action whenever a new commit happens in main/develop branch of recipes repo and pulls the new commits?

what do you think ?

@vraravam
Copy link
Contributor

What I would caution is:

  1. Based on the git pull happening from within the image, you will have a dependency on git, access rights to pull from the repo
  2. To create the hosted recipes, you will need to run pnpm which brings in node as another dependency
  3. There might be some other node modules (eg targz) that you will need during the pnpm package processing.

@SpecialAro
Copy link
Member Author

@SpecialAro instead of running cron, shall we expose a web-hook/api endpoint which will be triggered by the GH action whenever a new commit happens in main/develop branch of recipes repo and pulls the new commits?

what do you think ?

this is pretty interesting. Been looking into it and can be something to be implemented, not only for the recipes repo but also to the server repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants