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

Setup initial infrastructure #8

Open
jooola opened this issue Apr 9, 2022 · 18 comments
Open

Setup initial infrastructure #8

jooola opened this issue Apr 9, 2022 · 18 comments
Labels
funding This is a funding request of some kind proposal This is a project proposal

Comments

@jooola
Copy link
Contributor

jooola commented Apr 9, 2022

Describe the proposal

Context libretime/libretime#1497

I propose to provide a testing infrastructure for the project and a demo to the public. I will try not to elaborate too much on the technical details but they involve how much money goes into it.

In terms of testing I think we only need 2 different distributions, each with the latest system of both Debian and Ubuntu (Bullseye and Focal), this means 2 different devices to pay for. Once we fully support containers, we should only need a single device running different distributions inside containers.

In terms of a demo, having a second Libretime stack installed next to the testing installation should be good enough. I consider the demo a lower priority compared to the testing infrastructure.

Management of these devices should be handled use infrastructure as code, so changes can be reviewed and approved by maintainers. Transmission to future maintainers should also be easier.

These devices could be used for other purposes.

Cost breakdown

This depends on the platform offering these servers:

  • Hetzner
    2 x CX11 3,49€ (no VAT) / month

  • [Add providers if you have a better solution]

I don't know how far we need to pan for the funding of this, if we plan yearly or every 6 month.

Involvement

I help to maintain LibreTime and expect that continuous testing of the deployed services will make the development cycle faster. The demo is intended to bring the project to the public in order to reach more people and grow the community.

@jooola jooola added funding This is a funding request of some kind proposal This is a project proposal labels Apr 9, 2022
@paddatrapper
Copy link
Contributor

I think that is the best price we are going to find. The other plus about Hetzner is that it already has a concept of team ownership

@jooola
Copy link
Contributor Author

jooola commented Apr 11, 2022

In addition they have good tooling around there Cloud provider API, and we could for instance setup those devices using ansible.

@paddatrapper
Copy link
Contributor

We have about $18 a month coming into the collective, with some decent reserves there to tide us over if those drop. Maybe we cover yearly? This is an expense that makes sense and is desperately needed, so uncontroversial. Yearly funding gives us a chance to review as needed

I have requested a virtual card from OpenCollective so that Hetzner charges can be billed directly to the OpenCollective instead of going via one of us.

@jooola
Copy link
Contributor Author

jooola commented Apr 11, 2022

I would also go for locking 1 year of funding, and if the costs are reduced because we move to the docker image stacks then we will have some money from the server we don't need. Which could be reused next year.

What is the VAT rate for LibreTime ? In which country is the organization localised ?

@paddatrapper
Copy link
Contributor

We're backed by the US OpenCollective, which is a 501(c) 6 - https://www.oscollective.org/ https://opencollective.com/opensource#category-ABOUT

No no VAT in the EU, we are effectively US based.

@paddatrapper
Copy link
Contributor

OpenCollective has approved a credit card for paying Hetzner at most $10 a month. How much would it cost to secure a year of use per server? I can request an increase in the card limit, otherwise we can just go with a monthly cost

@jooola
Copy link
Contributor Author

jooola commented Jun 6, 2022

I don't think we can get lower costs by billing yearly. So we would have € 3.49 / mo x 2 = 83.76 per year

I think 10€ per month is good enough, if we reach a limit we will raise it.

@paddatrapper
Copy link
Contributor

Sounds good. Shall I create a Hetzner team or do you want to?

@jooola
Copy link
Contributor Author

jooola commented Jun 6, 2022

Sounds good. Shall I create a Hetzner team or do you want to?

I think we need to create an organization user for the billing process, and invite us both to a shared project. I you want to do it feel free to do it.

@paddatrapper
Copy link
Contributor

Hetzner organisation created and configured

@jooola
Copy link
Contributor Author

jooola commented Dec 7, 2022

This is now waiting on #18

@jooola
Copy link
Contributor Author

jooola commented Mar 22, 2023

Now that we support docker deployment for LibreTime, I would actually prefer to have a single VPS, instead of 2.

This single VPS can also be used for other services, such as a stats.libretime.org service if that is needed, or host a prometheus/loki/grafana stack to monitor the demo.libretime.org service.

We wanted to test the install script as well, but I think we should rather use the vagrant setup to test it, and maybe we can run a full deployment test using a disposable vps and run cypress tests against it.

So I am re targeting this ticket to "Setup basic infra", and make the demo service only a part of it.

@jooola jooola changed the title Setup testing and demo infrastructure Setup initial infrastructure Mar 22, 2023
@jooola
Copy link
Contributor Author

jooola commented Mar 22, 2023

Here is a quick draft of what I would like to do:

  • Attach our ssh public keys to the LibreTime infrastructure team @ hetzner
  • Create a Debian Bullseye VPS @ hetzner
  • Attach some subdomains to that server ip @ gandi
  • Create an ansible playbook to:
    • Setup extra users (CI deploy keys, ...)
    • Setup base packages (postfix, ...)
    • Setup a docker compatible firewall
    • Setup a reverse proxy for our services
    • Setup docker + docker-compose
    • Setup a LibreTime demo instance using a docker-compose spec

@paddatrapper
Copy link
Contributor

Sounds good. I'd like to do the infrastructure management with terraform, just makes recreating things much easier

@jooola
Copy link
Contributor Author

jooola commented Mar 22, 2023

Hmm right, I am happy to automate the server creation as well, but I am unsure if we gain much by having both terrafom and ansible.

I see there are also some ansible collections for both gandi and hetzner:

If we still want to use terraform, it will probably be for learning purposes.

I only scratched the surface of terraform, and I am unsure if all what I plan to do can be done via terraform, so we only use a single tool.

EDIT: I actually read on the web that using both doesn't necessarily make things harder, but can help us to use the best tools for the job.

We could call terraform from ansible https://docs.ansible.com/ansible/latest/collections/community/general/terraform_module.html

@paddatrapper
Copy link
Contributor

paddatrapper commented Mar 23, 2023

They're 2 different tools for 2 different tasks in my mind. Terraform is for creating the infrastructure and ansible is for configuring it (e.g. Installing LibreTime and configuring users). Terraform isn't appropriate for that and is much better suited for doing things like creating the VPS and configuring DNS entries

I also wouldn't call terraform from Ansible. Just have the CI run terraform and then Ansible

@jooola
Copy link
Contributor Author

jooola commented Mar 23, 2023

They're 2 different tools for 2 different tasks in my mind. Terraform is for creating the infrastructure and ansible is for configuring it (e.g. Installing LibreTime and configuring users). Terraform isn't appropriate for that and is much better suited for doing things like creating the VPS and configuring DNS entries

I understand, but ansible seem capable of handling what terraform is doing, so the discussion is whether we still want to use terraform for the server creation.

@paddatrapper
Copy link
Contributor

I didn't realise that Ansible could manage the actual Hetzner and Gandi infrastructure. In that case, using a single tool may be better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
funding This is a funding request of some kind proposal This is a project proposal
Projects
None yet
Development

No branches or pull requests

2 participants