Piotr Krzemiński
03/23/2024, 8:17 AM@file:Import
) that makes working with these even more painful.
An alternative idea, in some ways similar what @Vampire you proposed some time ago: have a separate Maven package for each action, but I'd like to host the packages in a way that allows me to generate the bindings on the server side, once the user requests them. A bit like https://jitpack.io/, but specialized to cover just the action bindings. The expected UX would be like:
// foobar.main.kts
/// ...
@file:Repository("<https://bindings.typesafegithub.io|https://bindings.typesafegithub.io>")
@file:DependsOn("actions:checkout:v4")
// ... more dependencies like:
@file:DependsOn("action-owner:action-name:action-version")
import actions.Checkout
// ...
uses(action = Checkout(...))
// ...
The user would have to create no extra files like _used_actions.yaml
, no extra workflows like generate-action-bindings.main.kts
and call it either locally or in GitHub workflows. If done right, dependency updating bots like Renovate would work as well, since the maven-metadata.xml
would be generated according to what versions a given action publishes. For this to work kinda like JitPack, we'd have to have our own live endpoint that can react on appropriate GET requests, and generate the bindings on the fly.
I'm also thinking about a variation of this idea, to not have to worry about paying for a server, just to start with something: host the pre-built packages somewhere on GitHub. If someone needs a binding for an action that is not yet supported, they would create a GitHub issue in a well-defined place and format that would later be picked up by a GitHub workflow, and it would generate and commit desired bindings. A separate workflow would periodically regenerate the bindings to catch manifest changes. Here's a little working PoC where I manually built the package and committed it to GitHub here, and show below how to consume it:
#!/usr/bin/env kotlin
// If another repo than Maven Central is specified, we need to specify Maven Central explicitly.
@file:Repository("<https://repo1.maven.org/maven2|https://repo1.maven.org/maven2>")
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:1.12.0")
// Dependency on a repo which contains Maven packages with bindings for various action.
@file:Repository("<https://raw.githubusercontent.com/typesafegithub/github-workflows-kt/poc-host-precompiled-bindings/bindings/|https://raw.githubusercontent.com/typesafegithub/github-workflows-kt/poc-host-precompiled-bindings/bindings/>")
@file:DependsOn("actions:checkout:v4")
import actions.Checkout
Checkout(
fetchDepth = Checkout.FetchDepth.Value(10),
)
Let me know your thoughts! Any risks you see etc.Piotr Krzemiński
03/23/2024, 8:18 AMVampire
03/23/2024, 11:39 AMPiotr Krzemiński
03/23/2024, 1:31 PMLeoColman
03/23/2024, 6:47 PMPiotr Krzemiński
03/23/2024, 10:08 PMVampire
03/23/2024, 11:27 PMAny thoughts here?I think where you might host it is very relevant. You might not have everything available everywhere. Generating the POM should be pretty trivial. You do not need all the fields set you need for Maven Central, and you do not need any dependencies. So the POM is practically just containing the artifacts coordinates, so any simple string-to-file will do.
Piotr Krzemiński
03/24/2024, 4:15 PMPiotr Krzemiński
03/25/2024, 9:42 AM@file:Repository("<http://localhost:8080/binding/>")
success baby
@LeoColman is your offer still up? 🙂 if I productize such bindings server and wrap it in a Docker image, would you be able to host it until we find a better place, just to give folks an opportunity to play with it?LeoColman
03/25/2024, 10:05 PMLeoColman
03/25/2024, 10:05 PMPiotr Krzemiński
03/26/2024, 8:26 AMPiotr Krzemiński
03/26/2024, 12:42 PMLeoColman
03/26/2024, 1:59 PMIntel Xeon D-1531 6c/12t 2.20-2.70GHz 1 x 16GB Micron DDR4 UDIMM 2133MHz ECC VLP 1 x 480GB SSD Intel S3510 300Mbit/s Unmetered
. It's a dedicated machine permanently up. We can allocate docker volumes to store data without any problems. On it I only have a Portainer to host multiple apps, most from LeoColman/MyStack
2. I think from the host itself no, not possible. Maybe CPU/Network data, but that would be from multiple apps. We can add metrics to the service and expose them, co-hosting with docker-compose some solution to grab the metrics.
3. Absolutely. I have Watchtower updating containers using latest
, pulling from DockerHub. It runs once every 24h, but we can make it shorter or even plug to some Portainer Webhook if that's possibleLeoColman
03/26/2024, 2:00 PMversion: "3.8"
services:
github-workflows-kts:
image: krzema12/github-workflows-kt-script-generator-server:0.41.0
networks:
- reverse_proxy
labels:
caddy: github-workflows-kt.colman.com.br
caddy.reverse_proxy: "{{upstreams 8080}}"
networks:
reverse_proxy:
external: true
LeoColman
03/26/2024, 2:01 PMPiotr Krzemiński
03/26/2024, 2:33 PMPiotr Krzemiński
03/26/2024, 2:34 PMLeoColman
03/26/2024, 2:49 PMPiotr Krzemiński
03/26/2024, 2:49 PMPiotr Krzemiński
03/26/2024, 8:11 PMLeoColman
03/26/2024, 8:46 PMVampire
03/27/2024, 1:35 AM@Vampire regarding SourceForge hosting, can you share a reference? is it this one?Yes
I'm a bit hesitant to go with GCP/AWS free tier because there's no 100% bulletproof way of ensuring that I won't exceed the free tier 😄If it exceeds the free tier, it should just stop serving content, it should not auto-upgrade. The credit card information is just used to ensure you are an individual, not a robot and that you do not create multiple free accounts. But you will not have to pay unless you manually activate it as far as I know.
I just don't have to hook my credit card there just yet. I'd very much prefer a solution where I pay $X up front for a box + domainWell, you can of course do that, those options were just to get a free starter. You can anytime rent some VPS from Strato, or Hetzner, or any other VPS provider, or a root server if VPS is not powerfull enough anymore.
Vampire
03/27/2024, 3:56 AMVampire
03/27/2024, 3:58 AM<?
$result = `JAVA_HOME=/home/user-web/vampire0/jdk-21.0.2+13/ /home/user-web/vampire0/kotlinc/bin/kotlin -version`;
echo"
<HTML>
<HEAD>
<TITLE>Execute Script :-D</TITLE>
</HEAD>
<BODY>
";
echo"
result: \"$result\"<BR>
";
echo"
</BODY>
</HTML>
";
?>
you get this result: https://vampire0.users.sourceforge.net/kotlin-version.phpVampire
03/27/2024, 4:00 AMPiotr Krzemiński
03/27/2024, 7:26 AMVampire
03/27/2024, 8:55 AMVampire
03/27/2024, 8:55 AMPiotr Krzemiński
03/27/2024, 9:28 AMVampire
03/27/2024, 9:44 AMPiotr Krzemiński
03/28/2024, 10:32 PMPiotr Krzemiński
03/28/2024, 10:33 PM<http://github-workflows-kt-bindings.colman.com.br|github-workflows-kt-bindings.colman.com.br>
fits nicelyLeoColman
03/29/2024, 12:40 AMLeoColman
03/29/2024, 12:40 AMLeoColman
03/29/2024, 12:41 AMin theory shouldn't work with your Intel serverDocker Magic probably solves that
Piotr Krzemiński
03/29/2024, 7:13 AMlatest
, pulling from DockerHub. It runs once every 24h, but we can make it shorter
could you set it to e.g. 1 hour? or if you have a webhook that I can call to refresh the image, would be cool as well, although I can live with scheduled updates. I've already pushed a new version of the image that fixes a crucial problemLeoColman
03/29/2024, 2:55 PMLeoColman
03/29/2024, 3:06 PMLeoColman
03/29/2024, 3:06 PMLeoColman
03/29/2024, 3:08 PMPiotr Krzemiński
03/29/2024, 5:47 PMVampire
03/29/2024, 8:28 PMI'm allergic to PHPSF project web also supports Perl, Python, Tcl, and Shell scritps for CGI. But actually, the SF project web is unsuitable for this. I have suppressed the fact, that the generator needs to get the types and so on. Due to past abuse any outbound connection from project web is forbidden, even e-mail sending does not work directly anymore.
Piotr Krzemiński
03/30/2024, 10:48 PM