Giter VIP home page Giter VIP logo

Comments (5)

lasselindqvist avatar lasselindqvist commented on August 11, 2024

Hi. In case of Jenkins, I would recommend using Locable Resources Plugin (https://www.jenkins.io/doc/pipeline/steps/lockable-resources/).
https://stackoverflow.com/questions/56786164/jenkins-resource-locks-get-lock-for-multiple-node-specific-resources/58393432#58393432 also very well shows how you can make the locks node-specific so that it would allow different nodes to run different static analysis builds.

from discuss.

mariometushev avatar mariometushev commented on August 11, 2024

@lasselindqvist Thanks for your quick answer bro.
So if I understand right, this plugin allows you to lock specific amount of RAM memory for some Jenkins job build step.

But I think that the problem is not related to Jenkins, because I just want to make spotbugs task sequential, in other words if at some point in time spotbugs is running for some java module, I want gradle to finish that task before start next spotbugs task for another module.

If I have 8 modules and Jenkins runs 8 parallel gradle tasks, for example:
Module1.compile(requires a little bit of memory and needs some seconds to finish)
Module2.compile(requires a little bit of memory and needs some seconds to finish)
Module3.compile(requires a little bit of memory and needs some seconds to finish)
Module4.compile(requires a little bit of memory and needs some seconds to finish)
Module5.compile(requires a little bit of memory and needs some seconds to finish)
Module6.compile(requires a little bit of memory and needs some seconds to finish)
Module7.compile(requires a little bit of memory and needs some seconds to finish)
Module8.spotbugs(requires 1GB RAM and needs some extra minutes to finish)

Compile gradle tasks will finish faster than spotbugs one, and if gradle start another spotbugs task for some modules, for example:
Module1.spotbugs
Module2.test
Module3.spotbugs
Module4.spotbugs
Module5.spotbugs
Module6.spotbugs
Module7.test
Module8.spotbugs

At that moment the job will need more than 6GB of RAM and I don't have that much.
I don't know if you understand me right :)

I just need to tell gradle: "Hey, don't run spotbugs, because another module is now using that gradle task"

Best regards, Mario :)

from discuss.

lasselindqvist avatar lasselindqvist commented on August 11, 2024

If you just want one spotbugs at a time, the situation is even simpler for you. Just use

lock(label: 'spotbugs') {
    // gradle spotbugs command goes here
}

and it will only allow one single command globally.

from discuss.

mariometushev avatar mariometushev commented on August 11, 2024

@lasselindqvist Thank you man, appreciate your help. Can this plugin be used in Jenkins freestyle job instead of pipeline?

from discuss.

lasselindqvist avatar lasselindqvist commented on August 11, 2024

I would think you can. Best way to find out is to just install the plugin and try using it.

from discuss.

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.