paritytech / command-bot

Apache License 2.0
12 stars 5 forks source link

[EngAut] CommandBot: Create GHA version #113

Open crystalin opened 1 year ago

crystalin commented 1 year ago

Background:

Stakeholders and Goals:

Original request: We've been using the benchbot and are thinking to move to the command-bot, however we don't rely on gitlab for our CI. Our current setup is using Github Action but with self-hosted instances (dedicated to building/testing).

I like the idea of the command-bot allowing commands from different sources (matrix/github/...) but it seems to be quite customized to how parity work (using gitlab, helm,...).

Do you have any plan on making it more generic to allow non-gitlab service ?


GitHub action milestone

## Tasks
- [ ] https://github.com/paritytech/cmd-action/issues/4
- [ ] https://github.com/paritytech/cmd-action/issues/7
- [ ] https://github.com/paritytech/cmd-action/issues/10
- [ ] https://github.com/paritytech/cmd-action/issues/14
- [ ] https://github.com/paritytech/cmd-action/issues/12
- [ ] https://github.com/paritytech/cmd-action/issues/2
- [ ] https://github.com/paritytech/cmd-action/issues/20
- [ ] https://github.com/paritytech/cmd-action/issues/1
- [ ] https://github.com/paritytech/cmd-action/issues/8
- [ ] https://github.com/paritytech/cmd-action/issues/19
- [ ] https://github.com/paritytech/cmd-action/issues/3
- [ ] https://github.com/paritytech/cmd-action/issues/5
- [ ] https://github.com/paritytech/command-bot/issues/274
- [ ] https://github.com/paritytech/cmd-action/issues/22
- [ ] https://github.com/paritytech/cmd-action/issues/23
mutantcornholio commented 1 year ago

Could you elaborate on what currently doesn't work, or how command-bot's way of spawning jobs contradicts your CI configuration?

crystalin commented 1 year ago

I didn't go as far a trying to setup everything yet. The documentation contains many element but it is a bit hard to know how all of the elements are orchestrated overall. But in the setup part it mentions:

Create a repository in GitLab and set up GITLAB_PUSH_NAMESPACE along with GITLAB_ACCESS_TOKEN to run the commands for the GitHub repository (Step 3).

That is why I supposed it required to do so, I'll try to set the bot up and see where I get stuck

crystalin commented 1 year ago

Also, the first line of readme also mention:

command-bot executes arbitrary commands on GitLab CI

mutantcornholio commented 1 year ago

You're going through deployment/development setup. Are you trying to host your own instance?

crystalin commented 1 year ago

Ideally yes, but if you offer a service where we can plug our repo and our CI servers, I'm happy to try it (I don't think that would work in term of security however so we would end up hosting it)

mutantcornholio commented 1 year ago

Okay, I think I've misread the situation. Let us think on it. Currently, it'll basically mean replacing at least half of the code, and that raises a big question on the vision of the project.

mordamax commented 10 months ago

@crystalin Currently, we defer the tasks to run and queue for the CI, in our case Gitlab. We are going to make it less opinionated and instead of creating a Gitlab CI job - create Kubernetes jobs.

What would be a desired infrastructure set up so you could deploy and use it on your side?

crystalin commented 10 months ago

Thank you, I think plugin it with github and using their GHA (self-hosted runner) is preferred but we could probably combine it with our kubernetes cluster too

mordamax commented 6 months ago

Current plan is to move away from gitlab completely, so will be porting the exiting command bot to separate repo, the idea is to set this up as Github action, with decoupled repo for command scripts and interface. https://github.com/paritytech/command-bot-scripts/tree/main/commands This allows to avoid re-deploying/releasing the bot business logic from the commands implementation.

Bullrich commented 3 months ago

I will be taking up this task.

I have created a milestone to track this:

GitHub action milestone

Bullrich commented 3 months ago

The repository cmd-action has been created. The action will be developed there.

I ran two experiments to see if this is feasible, both of them were succesfull:

Bullrich commented 3 months ago

Currently working on paritytech/cmd-action#1.

I'm making the system parse content from the comments and validating it with the commands.

Bullrich commented 3 months ago

Preparing schema handling.

I've been in contact with Oliver, our main stakeholder.

The logic of configuration handling will be similar to review-bot's: Easy to read and hosted in the target repository.

cmd-action will be mainly a tool to "parse" commands and pass it to a github action with a repo script.

Bullrich commented 2 months ago

Currently working on https://github.com/paritytech/cmd-action/issues/7

Configuration files will be moved to be in yaml (can also be toml) so it's easier to read.

I'm preparing this ticket in combination with https://github.com/paritytech/cmd-action/issues/10 so we have a schema validator out of the box

Bullrich commented 2 months ago

Completed the following tasks

Bullrich commented 2 months ago

22-26 of April

Bullrich commented 2 months ago

Currently working on the finishing touches for https://github.com/paritytech/cmd-action/pull/18

This will close:

Bullrich commented 2 months ago

Closed:

Bullrich commented 1 month ago

Completed last week:

Bullrich commented 1 month ago

WIP: #8

Most of the task is done. Only some things remaining:

Bullrich commented 4 weeks ago

Work in progress to migrate the command action to work as a github workflow:

Missing commands

mordamax commented 3 weeks ago

The fellows/runtimes integration is on pause due to couple of reasons

Bullrich commented 3 weeks ago

Finished preparing https://github.com/paritytech/polkadot-sdk/pull/4701

Bullrich commented 3 weeks ago

Completed migration of most commands:

Currently working on adding the last command (sync): https://github.com/paritytech/polkadot-sdk/pull/4818 Blocked by https://github.com/paritytech/ci_cd/issues/995