Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EngAut] CommandBot: Create GHA version #113

Closed
11 tasks done
crystalin opened this issue Sep 30, 2022 · 27 comments
Closed
11 tasks done

[EngAut] CommandBot: Create GHA version #113

crystalin opened this issue Sep 30, 2022 · 27 comments
Assignees
Labels
action GitHub action related

Comments

@crystalin
Copy link

crystalin commented Sep 30, 2022

Background:

  • current command bot is fully dependent on GitLab, because it was designed to manage tasks queue via GitLab CI pipelines.
  • if any parachain team would want to re-use this bot for their benchmarks and other tasks - the GHA+self-hosted runner is much simpler to set up than deploying a runtime NodeJS app with DB + self-hosted runners

Stakeholders and Goals:

  • [Parity Internal]: unblock gitlab deprecation, as current implementation is locked-in for GitLab
  • [Ecosystem] setup and run benchmarks easier

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

  1. action
    Bullrich
  2. action
    Bullrich
  3. action
    Bullrich
  4. action
    Bullrich
  5. action
    Bullrich
  6. action
    Bullrich
  7. action
    Bullrich
  8. action
    Bullrich
  9. action
    Bullrich
@mutantcornholio
Copy link
Contributor

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

@crystalin
Copy link
Author

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
Copy link
Author

Also, the first line of readme also mention:

command-bot executes arbitrary commands on GitLab CI

@mutantcornholio
Copy link
Contributor

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

@crystalin
Copy link
Author

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
Copy link
Contributor

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 mordamax self-assigned this Apr 5, 2023
@mordamax mordamax changed the title Support for non-gitlab system ? [EngAut] Support for non-gitlab system Jun 5, 2023
@mordamax mordamax mentioned this issue Jun 1, 2023
8 tasks
@mordamax
Copy link
Contributor

@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
Copy link
Author

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 mordamax changed the title [EngAut] Support for non-gitlab system [EngAut] CommandBot: Create GHA version Dec 14, 2023
@mordamax
Copy link
Contributor

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 Bullrich self-assigned this Mar 15, 2024
@mordamax mordamax removed their assignment Mar 15, 2024
@Bullrich Bullrich added the action GitHub action related label Mar 18, 2024
@Bullrich
Copy link
Contributor

Bullrich commented Mar 18, 2024

I will be taking up this task.

I have created a milestone to track this:

GitHub action milestone

@Bullrich
Copy link
Contributor

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
Copy link
Contributor

Currently working on paritytech/cmd-action#1.

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

@Bullrich
Copy link
Contributor

Bullrich commented Apr 8, 2024

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
Copy link
Contributor

Currently working on paritytech/cmd-action#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 paritytech/cmd-action#10 so we have a schema validator out of the box

@Bullrich
Copy link
Contributor

@Bullrich
Copy link
Contributor

Bullrich commented May 6, 2024

@Bullrich
Copy link
Contributor

@Bullrich
Copy link
Contributor

WIP: #8

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

  • Update the JSON schema
  • Add more test with failing cases
  • Update the generated documentation

@Bullrich
Copy link
Contributor

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

Missing commands

  • bench-all
  • bench-overhead
  • bench
  • fmt
  • sample
  • sync
  • update-ui

@mordamax
Copy link
Contributor

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

  • upgrade to polkadot-sdk to v1.13 which supports omni-bencher is not stable yet and blocking
  • switched for now to parity.io rework

@Bullrich
Copy link
Contributor

Finished preparing paritytech/polkadot-sdk#4701

@Bullrich
Copy link
Contributor

Completed migration of most commands:

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

@rzadp
Copy link
Contributor

rzadp commented Jul 11, 2024

Note: I added a task to the list to:

  • Add a small action that reacts to bot xyz commands and sends a link to the forum post.

Bullrich added a commit to paritytech-stg/polkadot-sdk that referenced this issue Jul 11, 2024
Bullrich added a commit to paritytech-stg/polkadot-sdk that referenced this issue Jul 11, 2024
Bullrich added a commit to paritytech-stg/polkadot-sdk that referenced this issue Jul 11, 2024
Bullrich added a commit to paritytech-stg/polkadot-sdk that referenced this issue Jul 11, 2024
Bullrich added a commit to paritytech-stg/polkadot-sdk that referenced this issue Jul 11, 2024
@Bullrich
Copy link
Contributor

Note: I added a task to the list to:

  • Add a small action that reacts to bot xyz commands and sends a link to the forum post.

paritytech/polkadot-sdk#5000 should provide the fix for this.

github-merge-queue bot pushed a commit to paritytech/polkadot-sdk that referenced this issue Jul 11, 2024
Fixed the mentioned issue:
paritytech/command-bot#113 (comment)

Now it will properly comment when the old bot gets triggered.
TomaszWaszczyk pushed a commit to TomaszWaszczyk/polkadot-sdk that referenced this issue Jul 13, 2024
Fixed the mentioned issue:
paritytech/command-bot#113 (comment)

Now it will properly comment when the old bot gets triggered.
TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this issue Aug 2, 2024
Fixed the mentioned issue:
paritytech/command-bot#113 (comment)

Now it will properly comment when the old bot gets triggered.
@mordamax
Copy link
Contributor

mordamax commented Sep 2, 2024

Closing this as done in V1 and V2 versions ->

@crystalin we've gone with simple python script (could be short bash too, like Astar does)
we didn't go with too complex generic (or runtime) solution as it's simple and could be adjusted per project needs

@mordamax mordamax closed this as completed Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action GitHub action related
Projects
Status: Done
Development

When branches are created from issues, their pull requests are automatically linked.

5 participants