Re: Regarding two jenkins jobs

2023-08-10 Thread Ashok Reddy
Hi Kris,

Thanks for your help and I will check with my team. I will provide you
clear idea next time.

On Fri, 11 Aug 2023 at 9:31 AM, Kris Stern  wrote:

> Hi Ashok,
>
> According to Björn's suggestion, he is suggesting you *not* to use a
> single Jenkinsfile if you would like to run two jobs on two instances of
> Jenkins on the same server. However, if you are using the two instances on
> the same server to say for example run a frontend and a backend for a web
> app, you can probably achieve this with multiple Docker containers using a
> single Jenkinsfile for a Pipeline by following the suggested instructions
> at
> https://www.jenkins.io/doc/book/pipeline/docker/#using-multiple-containers.
>
>
> However, if you really want more tailored suggestions the community can
> offer, you will need to provide us with more information about your setup,
> as well as what is your use case for. Otherwise we can only guess and throw
> (perhaps not 100% relevant) ideas at you.
>
> Since you are using Jenkins for a work project, I think it may be a good
> idea to ask around to see how this is usually set up at your company from
> someone who has done it before, or from some documentation. This will help
> make sure that you are following. the best practices established at your
> company.
>
> Best,
> Kris
>
> --
> *From:* jenkinsci-users@googlegroups.com 
> on behalf of Ashok Reddy 
> *Sent:* 11 August 2023 08:51
>
> *To:* jenkinsci-users@googlegroups.com 
> *Subject:* Re: Regarding two jenkins jobs
>
> Hi Kris,
>
> Thank for your help but, I am expecting to configure two jenkins instances
> in one jenkinsfile.
>
> As Doneer suggested, it would be good to implement but in my org, they
> have already implemented. Not sure how did they implement
> it.
>
> On Thu, 10 Aug 2023 at 10:30 PM, Kris Stern  wrote:
>
> Hi Ashok,
>
> I am guessing you are looking for the following, but am not sure...
>
> You can try something like the below:
>
> java -DJENKINS_HOME=/path-to-jenkins1 -jar jenkins.war --httpPort=8080
> java -DJENKINS_HOME=/path-to-jenkins2 -jar jenkins.war --httpPort=8081
>
> Something like this, so one instance can be reached at port 8080 and the
> other one at port 8081.
>
> Best,
> Kris
>
> --
> *From:* jenkinsci-users@googlegroups.com 
> on behalf of Ashok Reddy 
> *Sent:* 10 August 2023 22:25
> *To:* jenkinsci-users@googlegroups.com 
> *Subject:* Re: Regarding two jenkins jobs
>
>
> Hi Kris,
>
> Yes , two jenkins instances
> On Thu, 10 Aug 2023 at 9:54 PM, 'Björn Pedersen' via Jenkins Users <
> jenkinsci-users@googlegroups.com> wrote:
>
>
>
> ashok...@gmail.com schrieb am Donnerstag, 10. August 2023 um 03:54:11
> UTC+2:
>
> Hi All,
>
> How to configure jenkinsfile if one job is in one jenkins instance and
> another job is in another jenkins instance?
>
>
> I you really mean 2 jenkins instances (not different agents):
>
> * don't use a single Jenkinsfile, instead configure the jobs (at least on
> one instance) to  use another name (e.g. jenkinsfile.host).
> * or  switch execution based on the HUDSON_URL variable (this gives the
> main jenkins URL), although this most likely will make the jenkinsfile
> quite unreadable.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/7c6eee8d-3526-41cf-a758-f0f32523dd8an%40googlegroups.com
> 
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CAKRLcHhxb4uK2uAwkuUKqPG7N%3DpBzsyHkg3nLEMOFtQxJMZfxQ%40mail.gmail.com
> 
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/OS3P286MB1431FE7694ADADDC290132ADA113A%40OS3P286MB1431.JPNP286.PROD.OUTLOOK.COM
> 
> .
>
> --
> You received this message because you are subscribed to the Google 

Re: Regarding two jenkins jobs

2023-08-10 Thread Kris Stern
Hi Ashok,

According to Björn's suggestion, he is suggesting you not to use a single 
Jenkinsfile if you would like to run two jobs on two instances of Jenkins on 
the same server. However, if you are using the two instances on the same server 
to say for example run a frontend and a backend for a web app, you can probably 
achieve this with multiple Docker containers using a single Jenkinsfile for a 
Pipeline by following the suggested instructions at 
https://www.jenkins.io/doc/book/pipeline/docker/#using-multiple-containers.

However, if you really want more tailored suggestions the community can offer, 
you will need to provide us with more information about your setup, as well as 
what is your use case for. Otherwise we can only guess and throw (perhaps not 
100% relevant) ideas at you.

Since you are using Jenkins for a work project, I think it may be a good idea 
to ask around to see how this is usually set up at your company from someone 
who has done it before, or from some documentation. This will help make sure 
that you are following. the best practices established at your company.

Best,
Kris


From: jenkinsci-users@googlegroups.com  on 
behalf of Ashok Reddy 
Sent: 11 August 2023 08:51
To: jenkinsci-users@googlegroups.com 
Subject: Re: Regarding two jenkins jobs

Hi Kris,

Thank for your help but, I am expecting to configure two jenkins instances in 
one jenkinsfile.

As Doneer suggested, it would be good to implement but in my org, they have 
already implemented. Not sure how did they implement
it.

On Thu, 10 Aug 2023 at 10:30 PM, Kris Stern 
mailto:krisst...@outlook.com>> wrote:
Hi Ashok,

I am guessing you are looking for the following, but am not sure...

You can try something like the below:


java -DJENKINS_HOME=/path-to-jenkins1 -jar jenkins.war --httpPort=8080
java -DJENKINS_HOME=/path-to-jenkins2 -jar jenkins.war --httpPort=8081


Something like this, so one instance can be reached at port 8080 and the other 
one at port 8081.

Best,
Kris


From: jenkinsci-users@googlegroups.com 
mailto:jenkinsci-users@googlegroups.com>> on 
behalf of Ashok Reddy mailto:ashokrd...@gmail.com>>
Sent: 10 August 2023 22:25
To: jenkinsci-users@googlegroups.com 
mailto:jenkinsci-users@googlegroups.com>>
Subject: Re: Regarding two jenkins jobs


Hi Kris,

Yes , two jenkins instances
On Thu, 10 Aug 2023 at 9:54 PM, 'Björn Pedersen' via Jenkins Users 
mailto:jenkinsci-users@googlegroups.com>> 
wrote:


ashok...@gmail.com schrieb am Donnerstag, 10. August 
2023 um 03:54:11 UTC+2:
Hi All,

How to configure jenkinsfile if one job is in one jenkins instance and another 
job is in another jenkins instance?

I you really mean 2 jenkins instances (not different agents):

* don't use a single Jenkinsfile, instead configure the jobs (at least on one 
instance) to  use another name (e.g. jenkinsfile.host).
* or  switch execution based on the HUDSON_URL variable (this gives the main 
jenkins URL), although this most likely will make the jenkinsfile quite 
unreadable.



--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/7c6eee8d-3526-41cf-a758-f0f32523dd8an%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAKRLcHhxb4uK2uAwkuUKqPG7N%3DpBzsyHkg3nLEMOFtQxJMZfxQ%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/OS3P286MB1431FE7694ADADDC290132ADA113A%40OS3P286MB1431.JPNP286.PROD.OUTLOOK.COM.

--
You 

Re: Regarding two jenkins jobs

2023-08-10 Thread Ashok Reddy
Hi Kris,

Thank for your help but, I am expecting to configure two jenkins instances
in one jenkinsfile.

As Doneer suggested, it would be good to implement but in my org, they have
already implemented. Not sure how did they implement
it.

On Thu, 10 Aug 2023 at 10:30 PM, Kris Stern  wrote:

> Hi Ashok,
>
> I am guessing you are looking for the following, but am not sure...
>
> You can try something like the below:
>
> java -DJENKINS_HOME=/path-to-jenkins1 -jar jenkins.war --httpPort=8080
> java -DJENKINS_HOME=/path-to-jenkins2 -jar jenkins.war --httpPort=8081
>
> Something like this, so one instance can be reached at port 8080 and the
> other one at port 8081.
>
> Best,
> Kris
>
> --
> *From:* jenkinsci-users@googlegroups.com 
> on behalf of Ashok Reddy 
> *Sent:* 10 August 2023 22:25
> *To:* jenkinsci-users@googlegroups.com 
> *Subject:* Re: Regarding two jenkins jobs
>
>
> Hi Kris,
>
> Yes , two jenkins instances
> On Thu, 10 Aug 2023 at 9:54 PM, 'Björn Pedersen' via Jenkins Users <
> jenkinsci-users@googlegroups.com> wrote:
>
>
>
> ashok...@gmail.com schrieb am Donnerstag, 10. August 2023 um 03:54:11
> UTC+2:
>
> Hi All,
>
> How to configure jenkinsfile if one job is in one jenkins instance and
> another job is in another jenkins instance?
>
>
> I you really mean 2 jenkins instances (not different agents):
>
> * don't use a single Jenkinsfile, instead configure the jobs (at least on
> one instance) to  use another name (e.g. jenkinsfile.host).
> * or  switch execution based on the HUDSON_URL variable (this gives the
> main jenkins URL), although this most likely will make the jenkinsfile
> quite unreadable.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/7c6eee8d-3526-41cf-a758-f0f32523dd8an%40googlegroups.com
> 
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CAKRLcHhxb4uK2uAwkuUKqPG7N%3DpBzsyHkg3nLEMOFtQxJMZfxQ%40mail.gmail.com
> 
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/OS3P286MB1431FE7694ADADDC290132ADA113A%40OS3P286MB1431.JPNP286.PROD.OUTLOOK.COM
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAKRLcHhVuoe4aV8%3Dj4O25q%2BEpdvUeaYtvfWN2VMvaSGQJn5h0Q%40mail.gmail.com.


Re: Jenkins Python Job

2023-08-10 Thread Mark Waite


On Thursday, August 10, 2023 at 9:45:48 AM UTC-6 Mari wrote:

Hi All,

I have a job running on Jenkins server, which builds python script. The 
script has to display a bar chart as final output.
The build agent I am using on Jenkins appears to have python installed. I 
confirmed this by adding a build step as python3 —version and the result 
was: Python 3.6.8.

Why then do I have this error showing. Do I need to install a plugin? 

Kind regards 
Mari





Traceback (most recent call last)
File "newjenkins.py", line 7, in 
import matplotlib.pyplot as plt
File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 97, in 

_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/usr/lib64/python2.7/site-packages/matplotlib/backends/__init__.py", 
line 25, in pylab_setup
globals(),locals(),[backend_name])
File 
"/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_gtkagg.py", 
line 10, in 
from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, 
FigureCAnvasGTK, \
File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_gtk.py", 
line 13, in 
import gtk, gdk = gtk.gdk
File "/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py", line 64, 
in 
_init()
File "/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py", line 52, 
in _init
_gtk.init_check()
RuntimeError: could not open display


That output indicates that the program is choosing to run Python 2 packages 
(like gtk) with Python 3.  You probably need Python 3 packages to run with 
Python 3.6.8. 

Installing a plugin won't help.  Python 2 reached end of life in 2020, per 
https://www.python.org/doc/sunset-python-2/

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/74a3b800-028f-47ce-b915-086046be13ecn%40googlegroups.com.


Jenkins Python Job

2023-08-10 Thread Mahryama issifu
Hi All,

I have a job running on Jenkins server, which builds python script. The script 
has to display a bar chart as final output.
The build agent I am using on Jenkins appears to have python installed. I 
confirmed this by adding a build step as python3 —version and the result was: 
Python 3.6.8.

Why then do I have this error showing. Do I need to install a plugin? 

Kind regards 
Mari





Traceback (most recent call last)
File "newjenkins.py", line 7, in 
import matplotlib.pyplot as plt
File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 97, in 

  _backend_mod, new_figure_manager, draw_if_interactive, _show = 
pylab_setup()
File "/usr/lib64/python2.7/site-packages/matplotlib/backends/__init__.py", 
line 25, in pylab_setup
  globals(),locals(),[backend_name])
File 
"/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_gtkagg.py", 
line 10, in 
  from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, 
FigureCAnvasGTK, \
File 
"/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_gtk.py", line 
13, in 
  import gtk, gdk = gtk.gdk
File "/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py", line 64, 
in 
  _init()
File "/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py", line 52, 
in _init
_gtk.init_check()
RuntimeError: could not open display

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/C172989F-137A-459F-9697-1AF213A08142%40gmail.com.


Re: Regarding two jenkins jobs

2023-08-10 Thread Kris Stern
Hi Ashok,

I am guessing you are looking for the following, but am not sure...

You can try something like the below:


java -DJENKINS_HOME=/path-to-jenkins1 -jar jenkins.war --httpPort=8080
java -DJENKINS_HOME=/path-to-jenkins2 -jar jenkins.war --httpPort=8081


Something like this, so one instance can be reached at port 8080 and the other 
one at port 8081.

Best,
Kris


From: jenkinsci-users@googlegroups.com  on 
behalf of Ashok Reddy 
Sent: 10 August 2023 22:25
To: jenkinsci-users@googlegroups.com 
Subject: Re: Regarding two jenkins jobs


Hi Kris,

Yes , two jenkins instances
On Thu, 10 Aug 2023 at 9:54 PM, 'Björn Pedersen' via Jenkins Users 
mailto:jenkinsci-users@googlegroups.com>> 
wrote:


ashok...@gmail.com schrieb am Donnerstag, 10. August 
2023 um 03:54:11 UTC+2:
Hi All,

How to configure jenkinsfile if one job is in one jenkins instance and another 
job is in another jenkins instance?

I you really mean 2 jenkins instances (not different agents):

* don't use a single Jenkinsfile, instead configure the jobs (at least on one 
instance) to  use another name (e.g. jenkinsfile.host).
* or  switch execution based on the HUDSON_URL variable (this gives the main 
jenkins URL), although this most likely will make the jenkinsfile quite 
unreadable.



--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/7c6eee8d-3526-41cf-a758-f0f32523dd8an%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAKRLcHhxb4uK2uAwkuUKqPG7N%3DpBzsyHkg3nLEMOFtQxJMZfxQ%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/OS3P286MB1431FE7694ADADDC290132ADA113A%40OS3P286MB1431.JPNP286.PROD.OUTLOOK.COM.


Re: Regarding two jenkins jobs

2023-08-10 Thread Ashok Reddy
Hi Kris,

Yes , two jenkins instances
On Thu, 10 Aug 2023 at 9:54 PM, 'Björn Pedersen' via Jenkins Users <
jenkinsci-users@googlegroups.com> wrote:

>
>
> ashok...@gmail.com schrieb am Donnerstag, 10. August 2023 um 03:54:11
> UTC+2:
>
> Hi All,
>
> How to configure jenkinsfile if one job is in one jenkins instance and
> another job is in another jenkins instance?
>
>
> I you really mean 2 jenkins instances (not different agents):
>
> * don't use a single Jenkinsfile, instead configure the jobs (at least on
> one instance) to  use another name (e.g. jenkinsfile.host).
> * or  switch execution based on the HUDSON_URL variable (this gives the
> main jenkins URL), although this most likely will make the jenkinsfile
> quite unreadable.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/7c6eee8d-3526-41cf-a758-f0f32523dd8an%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAKRLcHhxb4uK2uAwkuUKqPG7N%3DpBzsyHkg3nLEMOFtQxJMZfxQ%40mail.gmail.com.


Re: Regarding two jenkins jobs

2023-08-10 Thread 'Björn Pedersen' via Jenkins Users


ashok...@gmail.com schrieb am Donnerstag, 10. August 2023 um 03:54:11 UTC+2:

Hi All, 

How to configure jenkinsfile if one job is in one jenkins instance and 
another job is in another jenkins instance?


I you really mean 2 jenkins instances (not different agents):

* don't use a single Jenkinsfile, instead configure the jobs (at least on 
one instance) to  use another name (e.g. jenkinsfile.host). 
* or  switch execution based on the HUDSON_URL variable (this gives the 
main jenkins URL), although this most likely will make the jenkinsfile 
quite unreadable.


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/7c6eee8d-3526-41cf-a758-f0f32523dd8an%40googlegroups.com.