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

Split current runner into smaller, reusable pieces and allow other job types to be added #111

Closed
19 tasks done
stronk7 opened this issue Oct 2, 2023 · 4 comments
Closed
19 tasks done
Assignees
Labels
enhancement New feature or request

Comments

@stronk7
Copy link
Member

stronk7 commented Oct 2, 2023

We have been discussing about this long time and, while there are tempting ideas about to reimplement this with other tools (say JS, Python, Groovy... whatever), this issue is about to pick the current, monolithic, run.sh script and split it into various pieces, still using shell scripts.

If this is later moved to another tool... many of the concepts exposed here (the paradigm) will still be valid.

The basic idea is to introduce the following "concepts" within the moodle-ci runner:

  • Modules: Small pieces of execution that will do only one thing. Say, install Moodle, install a plugin, instantiate a DB..., launch a specific container, run a phpunit test, prepare the Moodle App... the list is still to decide but that's the basic idea.
  • Job types: That will use the available modules to orchestrate a specific job. Say PHPUnit or Behat (those are the currently supported 2 job types). With more jobs to come (say, post-checks, say CiBoT, anything job needing various modules to perfomr
  • Stages: We may need this probably, so different job types can show different stages (preparation, execution, post-execution...) still to define. Highly tidied with job types, maybe their definition is, in fact, part of them.

And these are some initial requirements:

  • All the above needs to continue working with the moodle-ci-runner as a standalone product (so can be executed from command line, like it's now).
  • Ideally it should be a drop-in replacement for the current monolithic script, so once switched to it, all the current jobs (in Jenkins mainly) using it, should continue working 100% the same (changes can happen later).
  • Covered with some good CI tests (Create some workflow allow to test basic functionality #81).
  • It will continue being highly coupled with the nightlyjobs for easier communication between jenkins and the script.

The initial and general plan to go with this requires:

  • Create a new "split" branch in this repository (where all the changes will happen).
  • Enable that new "split" branch to be used @ Jenkins (aka, making both nightlyjobs and nightlysetup aware of it).
  • Configure existing jobs @ Jenkins to allow it to be used (together with current "stable" and "testing" branches).

A more specific implementation plan to follow is:

  • Create the first-basic working system and put it in the "split" branch.
  • Finalise the "phpunit" job as an example and to be able to run something real.
  • Cover as much as possible with tests.
  • Document the basics of the system (modules, job-types, their apis, mandatory and optional...).
  • Create some new "job" to test the flexibility of the system.
  • N iterations until good enough.
  • Migrate the "behat" job.
  • N iterations until good enough.
  • One more round of tests to cover more and more.
  • Move some real jobs to start using the new runner:
    • One phpunit (on every branch).
    • One behat (on every branch).
    • One DEV.
  • Merge everything to a new, mainbranch that will become the default one for the repo (we'll leave the old masterone available for BC compatibility).
  • Make the new runner the default one (aka, STABLE, removing the SPLIT one that we have been using in the interim).
  • Party!

And this is the very first draft of the project. Sure that it evolves (will be updating this description) along the time. There are many things to split and to support.

Ciao :-)

stronk7 added a commit that referenced this issue Oct 8, 2023
This is the very first version of the new ci runner that
splits jobs into smaller modules, available for jobs to
orchestrate them.

This includes a working version of the phpunit job, to
be used as a reference for the migration of the behat
tests and also to create some new job to experiment
with the flexibility of the system.

Note that this is not production-ready yet, just work
in progress to go trying stuff. Once the system is stable
and tested enough we'll go advancing with the implementation plan.

For more information and updates, this is the issue to follow:

#111
stronk7 added a commit to stronk7/moodle-ci-runner that referenced this issue Oct 9, 2023
This is the very first version of the new ci runner that
splits jobs into smaller modules, available for jobs to
orchestrate them.

This includes a working version of the phpunit job, to
be used as a reference for the migration of the behat
tests and also to create some new job to experiment
with the flexibility of the system.

Note that this is not production-ready yet, just work
in progress to go trying stuff. Once the system is stable
and tested enough we'll go advancing with the implementation plan.

For more information and updates, this is the issue to follow:

moodlehq#111
stronk7 added a commit to stronk7/moodle-ci-runner that referenced this issue Oct 9, 2023
This is the very first version of the new ci runner that
splits jobs into smaller modules, available for jobs to
orchestrate them.

This includes a working version of the phpunit job, to
be used as a reference for the migration of the behat
tests and also to create some new job to experiment
with the flexibility of the system.

Note that this is not production-ready yet, just work
in progress to go trying stuff. Once the system is stable
and tested enough we'll go advancing with the implementation plan.

For more information and updates, this is the issue to follow:

moodlehq#111
stronk7 added a commit to stronk7/moodle-ci-runner that referenced this issue Oct 16, 2023
This is the very first version of the new ci runner that
splits jobs into smaller modules, available for jobs to
orchestrate them.

This includes a working version of the phpunit job, to
be used as a reference for the migration of the behat
tests and also to create some new job to experiment
with the flexibility of the system.

Note that this is not production-ready yet, just work
in progress to go trying stuff. Once the system is stable
and tested enough we'll go advancing with the implementation plan.

For more information and updates, this is the issue to follow:

moodlehq#111
stronk7 added a commit to stronk7/moodle-ci-runner that referenced this issue Oct 17, 2023
This is the very first version of the new ci runner that
splits jobs into smaller modules, available for jobs to
orchestrate them.

This includes a working version of the phpunit job, to
be used as a reference for the migration of the behat
tests and also to create some new job to experiment
with the flexibility of the system.

Note that this is not production-ready yet, just work
in progress to go trying stuff. Once the system is stable
and tested enough we'll go advancing with the implementation plan.

For more information and updates, this is the issue to follow:

moodlehq#111
stronk7 added a commit to stronk7/moodle-ci-runner that referenced this issue Oct 17, 2023
This is the very first version of the new ci runner that
splits jobs into smaller modules, available for jobs to
orchestrate them.

This includes a working version of the phpunit job, to
be used as a reference for the migration of the behat
tests and also to create some new job to experiment
with the flexibility of the system.

Note that this is not production-ready yet, just work
in progress to go trying stuff. Once the system is stable
and tested enough we'll go advancing with the implementation plan.

For more information and updates, this is the issue to follow:

moodlehq#111
stronk7 added a commit to stronk7/moodle-ci-runner that referenced this issue Oct 18, 2023
This is the very first version of the new ci runner that
splits jobs into smaller modules, available for jobs to
orchestrate them.

This includes a working version of the phpunit job, to
be used as a reference for the migration of the behat
tests and also to create some new job to experiment
with the flexibility of the system.

Note that this is not production-ready yet, just work
in progress to go trying stuff. Once the system is stable
and tested enough we'll go advancing with the implementation plan.

For more information and updates, this is the issue to follow:

moodlehq#111
stronk7 added a commit to stronk7/moodle-ci-runner that referenced this issue Oct 18, 2023
This is the very first version of the new ci runner that
splits jobs into smaller modules, available for jobs to
orchestrate them.

This includes a working version of the phpunit job, to
be used as a reference for the migration of the behat
tests and also to create some new job to experiment
with the flexibility of the system.

Note that this is not production-ready yet, just work
in progress to go trying stuff. Once the system is stable
and tested enough we'll go advancing with the implementation plan.

For more information and updates, this is the issue to follow:

moodlehq#111
@stronk7
Copy link
Member Author

stronk7 commented Oct 19, 2023

For the records, as of now, both the PHPUnit (phpunit) and Behat (behat) job types have been implemented and feature parity with current stable jobs has been achieved. So you can start using the "split" branch locally if wanted to (will help to detect problems).

Also, the DEV jobs @ CI are already able to use the "SPLIT" runner instead of the "STABLE" one, for any one keen to experiment (there isn't much difference, they do the same, just in a radically different way).

In some days I'll continue advancing with this mega-issue, have some other impending tasks to work on right now.

Ciao :-)

stronk7 added a commit that referenced this issue Oct 22, 2023
This is the very first version of the new ci runner that
splits jobs into smaller modules, available for jobs to
orchestrate them.

This includes a working version of the phpunit job, to
be used as a reference for the migration of the behat
tests and also to create some new job to experiment
with the flexibility of the system.

Note that this is not production-ready yet, just work
in progress to go trying stuff. Once the system is stable
and tested enough we'll go advancing with the implementation plan.

For more information and updates, this is the issue to follow:

#111
stronk7 added a commit to stronk7/moodle-ci-runner that referenced this issue Oct 22, 2023
This is the very first version of the new ci runner that
splits jobs into smaller modules, available for jobs to
orchestrate them.

This includes a working version of the phpunit job, to
be used as a reference for the migration of the behat
tests and also to create some new job to experiment
with the flexibility of the system.

Note that this is not production-ready yet, just work
in progress to go trying stuff. Once the system is stable
and tested enough we'll go advancing with the implementation plan.

For more information and updates, this is the issue to follow:

moodlehq#111
stronk7 added a commit to stronk7/moodle-ci-runner that referenced this issue Oct 22, 2023
This is the very first version of the new ci runner that
splits jobs into smaller modules, available for jobs to
orchestrate them.

This includes a working version of the phpunit job, to
be used as a reference for the migration of the behat
tests and also to create some new job to experiment
with the flexibility of the system.

Note that this is not production-ready yet, just work
in progress to go trying stuff. Once the system is stable
and tested enough we'll go advancing with the implementation plan.

For more information and updates, this is the issue to follow:

moodlehq#111
stronk7 added a commit to stronk7/moodle-ci-runner that referenced this issue Oct 23, 2023
This is the very first version of the new ci runner that
splits jobs into smaller modules, available for jobs to
orchestrate them.

This includes a working version of the phpunit job, to
be used as a reference for the migration of the behat
tests and also to create some new job to experiment
with the flexibility of the system.

Note that this is not production-ready yet, just work
in progress to go trying stuff. Once the system is stable
and tested enough we'll go advancing with the implementation plan.

For more information and updates, this is the issue to follow:

moodlehq#111
stronk7 added a commit that referenced this issue Oct 27, 2023
This is the very first version of the new ci runner that
splits jobs into smaller modules, available for jobs to
orchestrate them.

This includes a working version of the phpunit job, to
be used as a reference for the migration of the behat
tests and also to create some new job to experiment
with the flexibility of the system.

Note that this is not production-ready yet, just work
in progress to go trying stuff. Once the system is stable
and tested enough we'll go advancing with the implementation plan.

For more information and updates, this is the issue to follow:

#111
stronk7 added a commit to stronk7/moodle-ci-runner that referenced this issue Oct 30, 2023
This is the very first version of the new ci runner that
splits jobs into smaller modules, available for jobs to
orchestrate them.

This includes a working version of the phpunit job, to
be used as a reference for the migration of the behat
tests and also to create some new job to experiment
with the flexibility of the system.

Note that this is not production-ready yet, just work
in progress to go trying stuff. Once the system is stable
and tested enough we'll go advancing with the implementation plan.

For more information and updates, this is the issue to follow:

moodlehq#111
@stronk7
Copy link
Member Author

stronk7 commented Nov 10, 2023

Now we are running a few jobs, both in 39_STABLE and master, plus all the DEV jobs, using the new runner, let's see how it goes (apparently ok till now)...

@stronk7
Copy link
Member Author

stronk7 commented Nov 23, 2023

Ok, today the new runner has taken on the old one and CIs are using it for all the jobs. Also, "main" is now the default branch of this repo, with "master" being deleted in some time (TBD).

I'm going to keep this open, until we complete the transition, it's good issue to share updates (changes, new jobs, whatever...).

Ciao :-)

@stronk7
Copy link
Member Author

stronk7 commented Apr 12, 2024

Closing this as completed. Ciao :-)

@stronk7 stronk7 closed this as completed Apr 12, 2024
@stronk7 stronk7 self-assigned this Apr 12, 2024
@stronk7 stronk7 added the enhancement New feature or request label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant