Newly created jenkins jobs not running on Jenkins - jenkins

I am creating new jobs for my selenium python scripts. My old jobs are running fine, but my newly created jobs do not run . I tried copying and pasting the configurations from my old jobs to the new one , but still new jobs won't run.

can you provide more information? what is the configuration? what do you see in the log?
did you check the labels for the nodes? you might be running on a restricted node or on master or the master doesn't allow jobs to be executed for example ...

Found the solution , there was a memory issue with the AWS machine on which jenkins is deployed

Related

Add multiple nodes to Jenkins master

I have around 100 linux servers that need to be added to a Jenkins master. The situation here is I need to add them by Copy Existing Node and the Jenkins master should not be shutdown/restart.
I don't want to do it manually for a hundred times. Is there any automation way to handle such request. Thank you in advance.
You could script this (self-automate). The Jenkins agent configuration files are located in the nodes subdirectory in the Jenkins home directory. You'd create a sub-directory for each node and inside that put a config.xml file for that nodes configuration. I recommend that you shutdown your Jenkins server while doing this, we've observed Jenkins deleting things when doing this while it is running. Use an existing agent's config.xml file for a template. Assuming all of your servers are configured the same, you need only update the name and host tags, which can be automated using sed.
Update with zero-downtime:
CloudBees has a support article for creating a node using the Rest API. If you'd prefer to use the Jenkins CLI, here's an example shell script. Neither of these approaches will require restarting Jenkins.

Communicate between Jenkins server without setting up master slave relation

I would like to set up jenkins server that would run test scripts based on successful build deployments on other Jenkins servers. for example, if the QA jenkins server is named JQA1OnMachine1 and i have three others that are named
J2OnMachine2, J3OnMachine3, J4OnMachine4 (different jenkins server on different boxes) can the JQA1OnMachine1 (QA jenkis) poll the others at regular interval to see if a build was deployed successfully? if so can anyone tell me how?
Jenkins master slave along with Jenkins Pipeline Plugin would be one of the better ways to implement this however, since you don't want to use that approach you can explore PSTools to remotely capture processes or files on different server.
Your builds may update a file on the build server post completion of the build and your QA machine can run script with PSTools to monitor and trigger the QA testing based on the file content

How to run Jobs in a Multibranch Project sequential instead of parallel

I have configured a multibranch-pipeline project in Jenkins. This project run integration test on all my feature branches (git). For each job in the pipeline project it creates an instance of my webapp (start tomcat and other dependencies). Because of port binding issues this result in many broken jobs.
Can I throttle the builds in the multibranch-pipeline project, so that the jobs for each feature branch run sequentially instead of parallel?
Or if there any more elegant solution?
Edit:
Situation and problem:
I want to have a multibranch pipeline project in Jenkins (because I have many feature branches in git)
The jobs which are created from the multibranch pipeline (for each feature branch in git), run in parallel
Polling scm is at midnight (commits on x branches are new, so the related jobs started at midnight)
every job started one instance of my webapp (and other dependencies) which bind to some ports
The problem is, that there can start many of these jobs at midnight. Every job will try to start an instance of my webapp. The first job can start the webapp without any problem. The second job cannot start the webapp because the ports are already taken from the first instance.
I don't want to configure a new port binding for each feature branch in my git repository. I need a solution to throttle the builds in the multibranch pipeline, so that only on "feature" can run concurrently.
From what I've read in other answers the disableConcurrentBuilds command only prevents multiple builds on the same branch.
If you want only one build running at a time, period, go to your Nodes/Build Executor configuration for the specific VM that your app is running on, drop the number of executors to 1 and configure the node labels so that only jobs from your multibranch pipeline can run on that VM.
My project has strict memory, licensing and storage constraints, so with this setup, all the jobs on the master and feature branches start, but only one can run at a time until the executor becomes available.
The most elegant solution would be to make your Integration Tests to be able to run concurrently.
One solution would be to use an embedded tomcat with a dynamic port. In that way each job instance would run in tomcat with different ports.
This is also a better solution than relying on an external server.
If this is too much work, you can always use the following code in your "jenkinsfile" pipeline:
node {
// This limits build concurrency to 1 per branch
properties([disableConcurrentBuilds()])
// continue your pipeline ...
}
The solution comes from this SO answer.

docker plugin not running parallel builds

I am using docker plugin in jenkins to do our maven builds. We have about 100 builds and we want to run them in parallel using this plugin. Issue is that if all the 100 builds have same label and this label is used in the "template" portion of the plugin, it only runs one build at a time no matter how much instance capacity or container cap we set to. Is there any was that we can run more then one build without assigning different labels to diff jobs and then creating diff templates with those labels?
Ok, somewhat older question, but just fyi: This should really work with current versions. I've running jenkins and docker plugin and it builds even maven jobs in parallel. For detailed analysis, the jenkins log files tells what is happening with the container instantiation.

Jenkins(Hudson): How to setup a mirror CI instance, which builds alternatively

I am looking for ways to setup alternate instances of CI using Jenkins such that, one instance is always available for testing while the other is refreshing with latest changes.
Currently I have only one instance and there's a considerable downtime while it re-builds. Has anyone tried to setup an alternating CI ?
Thanks,
Have you tried making your main build call a test build that is set to run on a different slave? You can have jobs tied to slave machines by going to the job config and checking the "Restrict where this project can be run" box. It will ask you for the name of the slave to tie it to.
Solved this by having two different master and slave combination and a custom shell script which alternates between these two setups. Coudn't find any other alternatives, but this works for me.

Resources