celerity / celerity/slurmactiond

Poll GitHub API instead of using webhooks

Open
#14 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
13
Forks
4
PR merge metrics
No merged PRs in 30d

Description

This project sounds very interesting for the needs of my lab. Unfortunately, opening a port plus having a reverse-proxy running on a machine that submits SLURM jobs is not really an option for me. As an alternative to using a webhook, would it be possible to poll the GitHub API instead?

I dug a little bit, sounds like you [get the worflows of a repository](https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#list-repository-workflows) with:

```
https://api.github.com/repos/USER/NAME/actions/workflows
```

then you [get the latest runs of a workflow](https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository) with:

```
https://api.github.com/repos/USER/NAME/actions/workflows/WORKFLOW_ID/runs
```

filter the queuing runs, then you [get the jobs of a run](https://docs.github.com/en/rest/actions/workflow-jobs?apiVersion=2022-11-28#list-jobs-for-a-workflow-run) with:

```
https://api.github.com/repos/USER/NAME/actions/runs/RUN_ID/jobs
```

filter the self-hosted jobs and you get the expected labels for the runner to spawn.

I'd love to contribute to this, but I'm not familiar with Rust.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.