Side project: Rewriting runner in Rust #3809
Replies: 1 comment 2 replies
-
Hey, Beware GitHub is moving their backend implementation step by step, I did something like this during 2021 in golang https://github.com/ChristopherHX/github-act-runner
I have the same problem, but since my project is from 2021 my vssconnection code is fully working. No, I always need to wait for them to break my runner to test my changes based on the c# client codebase.
In this case I could help you. Using a JIT token is a good idea, so you can skip registering your runner / use my project to generate a jit token that is not ephemeral. The JIT token is a base64 encoded json with an json object containing files that are base64 encoded as well. See here how I unpack that one https://github.com/ChristopherHX/github-act-runner/blob/3a9907019f05ef74f05e8c4e4fa2109ab4ebf809/runnerconfiguration/compat/actions_runner_compat.go#L199 How to parse this manually See here how to get an access token for the runner listener The rest is complex
(You could skip this part and use my runner-worker plugin mechanism, so you just need to implement log and job status reporting) This is not trivial FYI My runner has a I decided to use golang, to not need to implement the whole execution logic from scratch like you are required to do |
Beta Was this translation helpful? Give feedback.
-
Hey,
I am currently in my Rust phase, and I have decided to "rewrite" actions runner to Rust (with the twist that actions will be run in Docker container). However, I got stuck right at the beginning.
I have studied the current implementation and my understanding of runner registration is the following:
use_v2_flow
but my requests have never got this set in responses).I am struggling getting 3. step working. As I said, when getting the tenant token, I got a proper response, but never a flag with
use_v2_flow
set. I tried ignoring it and usingv2_flow
either way (as I could easily read what are the HTTP calls that needed to be executed), but that did not work. I either got 401 or 404 error (IMO both are caused by authentication issues).I could not get anywhere using
v2_flow
so I decided to try and implement theVssConnection
approach. Here I got stuck. I cannot figure out how to createVssConnection
and honestly, I have no idea what it is. I have very little experience with .NET, but still tried to google something out, without success.In the end, I have two questions:
v2_flow
?v2_flow
is not possible, can anyone help me figuring outVssConnection
?P.S. My very simple implementation: https://github.com/revolko/github-docker-runner. I will be happy for any comments.
Beta Was this translation helpful? Give feedback.
All reactions