Code Monkey home page Code Monkey logo

Comments (10)

sparshev avatar sparshev commented on August 20, 2024 1

Hi @Gayanvir ,

Yeah, I think it's a major issue. Need to check how to fix it for the parallel execution. Will keep you updated.

Thank you

from mpl.

sparshev avatar sparshev commented on August 20, 2024 1

Hi @Gayanvir ,
I just prepared the fix - it still need to be polished, but looks like working well. The one thing I need to check - is the complicated tests execution.
Could you please check the fix with your pipeline logic?

Thank you

from mpl.

sparshev avatar sparshev commented on August 20, 2024 1

@Gayanvir thank you for testing - I will test it little bit more and merge with master asap.

from mpl.

sparshev avatar sparshev commented on August 20, 2024

Sooo, unfortunately fix will not be simple - MPL need to split the execution context... With configs I think it's simple - CFG will be a full copy of the parent config - here is no issue. But the shared context like activeModules, postStepsErrors, modulePostSteps - will be affected.
I think we can use step id from the pipeline to navigate the right branch. It will help with choosing the right context and will allow to execute any number of parallel threads per pipeline.

from mpl.

Gayanvir avatar Gayanvir commented on August 20, 2024

I am new to MPL and Jenkins. please correct me if I am wrong. What I could notice is activeModules cannot have duplicate modules. Here https://github.com/griddynamics/mpl/blob/master/vars/MPLModule.groovy#L36 it says "Loop protection: There is no way to run currently active module again". So I guess activeModules need to have unique values. This might not well suited for parallel stages. But if we have this restriction, I think we can simply remove a module from activeModule by just removing by its path. Just like
activeModules -= path

instead of
activeModules.pop()

from mpl.

sparshev avatar sparshev commented on August 20, 2024

No, this activeModules also a part of different mechanisms inside MPL to determine the poststeps and so on. I was able to run multiple Test modules from the parallel stages, but I think it's just a luck - and for sure if we will go forth with the complex parallel builds - it will cause a multiple issues.

Infinity loop protection - is here to make sure the module will not call itself again (but it can call the parent one).

from mpl.

sparshev avatar sparshev commented on August 20, 2024

Checking the ways to solve the issue - it seems that the parallel builds in pipeline are still not good for daily use, so be careful: env is shared in the pipeline.
Anyway I think there is another way to pass the build identifier, hopefully I will find it soon.

from mpl.

sparshev avatar sparshev commented on August 20, 2024

Seems I'm moving forward with the next solution:

  1. Adding StepStartNode / StepEndNode guards to the running of the module (additionally I need to identify them somehow)
  2. Using CpsThread.current().head.get().getEnclosingBlocks() determining the current branch of the modules
  3. Following the branch to make sure we using the right MPLManager context.

First step is partially done, now the Pipeline Steps of the build looks much better - now each module in the separated block:
after_guards

from mpl.

sparshev avatar sparshev commented on August 20, 2024

Just improved view of the Pipeline Steps:

  • Hid the rows with checking existence of .jenkins project modules - used Helper.pathExists() instead of the step fileExists().
  • Added LabelAction and ArgumentsAction to store the MPL data in the blocks.
    improved_view

from mpl.

Gayanvir avatar Gayanvir commented on August 20, 2024

Hi @sparshev ,
Sorry for the late reply and I highly appreciate your efforts on this. Our pipeline is not much complex but has parallel builds. I tried your fixes and it is working well. Good job !!!

Thanks

from mpl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.