typesafegithub / github-workflows-kt

Authoring GitHub Actions workflows in Kotlin. You won't go back to YAML!
https://typesafegithub.github.io/github-workflows-kt/
Apache License 2.0
522 stars 24 forks source link

Host a simple JVM app (YAML to Kotlin converter) to make it easier for people to try things out #571

Closed krzema12 closed 1 year ago

krzema12 commented 1 year ago

Great brainstorming session on kotlinlang#server

What's the issue?

Free hosting question, or lack thereof thanks to the crypto scammers and stuff.

I am working with @Piotr Krzemiński on the #github-workflows-kt open source project,
 that wants to free the world to have to write YAML for their GitHub Actions. We have a YAML to Kotlin converter that works fine locally.
But we are stuck because we would like to host it as a JVM server, and all free hosting plans are gone thanks to all those crypto scammers.
For an open source project it’s annoying to have to pay every month for one little converter like that.
Can you think of a work-around? like having a nice sponsor, gaining startup credits somewhere or something like that

We need something like this web tool, but with Kotlin and YAML instead of YAML and JSON https://www.json2yaml.com/

The current YAML to Kotlin converter needs the user to download the project, and do weird Gradle stuff. https://typesafegithub.github.io/github-workflows-kt/user-guide/script-generator/

Hosting platforms

Fly https://fly.io/ was mentionned by David http4k and praised by Johann as a great hosting platform Free plan is probably enough given how few things we need https://fly.io/docs/about/pricing/

AWS is the obvious elephant in the room. AWS Lambda has a limit of 1 million free request per month which should be enough for one or two months given our meteorit success. But cold start is an issue as noted by David. If we do we should use http4k and GraalVM https://www.http4k.org/guide/tutorials/going_native_with_graal_on_aws_lambda/

Oracle has a free tier but its UX suck so we don't use it, because our time is not free. https://www.oracle.com/de/cloud/free/

Google Cloud Platform : https://cloud.google.com/free Martin has an example to deploy to appengine, advises that their UX sucks. He also says that we you get "only" 256MB of RAM which the JVM will happilly use to store metaspace, which is a real concern, that can also be adressed by http4k because 256Mb is plenty for an http4k app says David.

David and the http4k project use Heroku for $7 a month

DigitalOcean has an Open Source sponsoring plan which gives you 5$/month if your project has 500 stars on GitHub. Shit we have only 319 stars, quick we need to spam people. No seriously we can probably reach out and show we are a serious project.

Pros and cons

I would advise against complex solutions that can become a surprising time sink like Oracle (terrible UX) and AWS as James Richardson says: about how to host a "simple" service. AWS gets surprisingly complex very quickly. IAM + STS, 2FA, Cloudwatch, Pulumi, API GW etc etc.

Other than that, the user doesn't really care which hosting platform we use, but the person doing the work may well do, so I would say that whoever is ready to do the job can choose whatever make sense.

Alternatives to a web tool

Piotr proposed an IDE plugin. David remarked that IntelliJ plugin development is not exactly straightforward.

Björn proposed to have a bootstraping a .main.kts script. Or Piotr's equivalent idea Create a Kotlin CLI to improve overall developer workflow

Adam S propose a GitHub action that would create a PR.

Porting to JavaScript sounds nice but is also probably way much work that it's worth.

Those are clever ideas but I would advise against being too clever here. The basic story of the internet is that nothing beats a web tool for trying out something quickly. We should always keep in mind that not all our potential users are kotlin/Java devs. Everyone who hates to code in YAML is welcome.
Obviously I like that our project use Kotlin, but I would also gladly use the project if it used typescript/python/whatever-sane-language.

Original ticket from @krzema12

Ideas how to proceed:

jmfayard commented 1 year ago

🙏🏻 ありがとう @daviddenton @time4tea @NikkyAI

jmfayard commented 1 year ago

Leonardo Colman from the kotest project aka @LeoColman can host the server. By the way let me use the opportunity the say that I love kotest @NikkyAI would you want/have the bandwidth to put the Yaml 2 Kotlin converter on the web?

NikkyAI commented 1 year ago

I could help out with wrapping it in a dockerfile and a bit of backend stuff.. but I am short on time in general.. so.. unable to dedicate it to another thing

krzema12 commented 1 year ago

A prerequisite: https://github.com/typesafegithub/github-workflows-kt/issues/758 (done).

krzema12 commented 1 year ago

Working on a MVP UI here: https://github.com/typesafegithub/github-workflows-kt/pull/787

krzema12 commented 1 year ago

Current state: the Web app is hosted by @LeoColman here: https://github-workflows-kt.colman.com.br/. The UI is very simple now, to be enhanced.

krzema12 commented 1 year ago

Closing per https://github.com/typesafegithub/github-workflows-kt/issues/844