Jenkins and HA

2017-12-04 Thread Walter Heestermans
Hi,

How can setup HA with Jenkins OpenSource? I have now one master running and 
two agents, can I just add a second master and put an LB in front of it. 
The Jenkins home of my current master is on shared file system.

Regards
walter

-- 
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/b5b3b249-8ad8-4cb2-9282-706b707a373e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build Docker Image from a Dockerized Jenkins

2017-12-04 Thread Jacob Larsen
Here is a list of the options I know, but one important aspect to this 
is if you use pipeline or not in your builds as that affects your choices:


Docker Custom Build Environment Plugin. This will use an existing 
executor to launch a container with the build. The images used need not 
be aware of Jenkins or dependencies. When I looked at it, it seemed 
abandoned, but it looks like someone is trying to pick it up again. It 
will probably take some time before it is up to date with new docker and 
Jenkins features. E.g. last I checked, pipeline was not supported. Also, 
it only works from physical Jenkins nodes.


Docker Slaves Plugin. This will provision slave containers on the fly 
from a single Docker host. Images need not be aware of Jenkins or 
dependencies. Limit on containers launched did not work for pipeline 
jobs last I checked. Also, this only works on a single Docker host.


Docker Pipeline Plugin https://plugins.jenkins.io/docker-workflow. I 
just learned about this one from the previous message, but looking at 
the adoption rate, this must be the mainstream option. Odds are this 
would be your best bet to start, provided you are using pipeline.


Using a build wrapper like SCUBA: 
https://github.com/JonathonReinhart/scuba in a shell step. This has the 
benefit of enabling manual/development builds to use the same steps as 
the automated Jenkins builds. For that particular wrapper, it does not 
support running from inside a container and creating sibling containers. 
I am considering a PR for that, but I think there are other wrappers 
that might support something like this.


There are plugins that dynamically provision slaves from images and run 
builds on those. The common drawback for these would be that the images 
themselves must support running a jenkins Slave, e.g. have a Java 
runtime of a certain version installed.


/Jacob


On 2017-12-04 17:37, Jeeva Chelladhurai wrote:
I would like to run my builds inside docker, so that I can manage 
different run times like node, python, go thru docker images.


- Jeeva

On Mon, Dec 4, 2017 at 5:51 PM, nicolas de loof 
> wrote:


(another) plugin of mines.
Same design as docker-pipeline's "docker.inside"

Can you please describe your use-case so we give better advise ?

if you just want to "build Docker images" as your initial message
told, then just run "docker build" within your job, what else ?

2017-12-04 13:15 GMT+01:00 Jeeva Chelladhurai >:

Any  thoughts on

https://wiki.jenkins.io/display/JENKINS/CloudBees+Docker+Custom+Build+Environment+Plugin



On Mon, Dec 4, 2017 at 12:04 PM, Jeeva Chelladhurai
> wrote:



I have not tried this, so, cannot vouch for this.
Please be cautious about the approach presented in
this blog.

http://niels.nu/blog/2017/continuous-blog-delivery-p2.html

: you might be interested in Docker-in-Docker.


Thanks for the suggestion.. Docker-in-Docker is been
discouraged here is good read on it

https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/



- Jeeva




-- 
Jeeva K S Chelladhurai


-- 
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/CAK5CbZVSDwjOAUe_uB_u89GRufSrbk2MyeUzSHz9w88K6af0QA%40mail.gmail.com

.

For more options, visit https://groups.google.com/d/optout
.


-- 
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/CANMVJznKg%3DXKpeaT62PVkmEvLh4kruCyc1HV%2BQGFNtnjLhX%3DLQ%40mail.gmail.com


Re: Build Docker Image from a Dockerized Jenkins

2017-12-04 Thread nicolas de loof
ok, so for this purpose you can rely on docker-plugin to create agents
on-demand from configured docker images, or docker-slaves-plugin if you
want this configured directly within your jobs, and docker-pipeline
"inside" if you prefer Jenkinsfiles to setup CI/CD in jenkins.

2017-12-04 17:37 GMT+01:00 Jeeva Chelladhurai :

> I would like to run my builds inside docker, so that I can manage
> different run times like node, python, go thru docker images.
>
> - Jeeva
>
> On Mon, Dec 4, 2017 at 5:51 PM, nicolas de loof 
> wrote:
>
>> (another) plugin of mines.
>> Same design as docker-pipeline's "docker.inside"
>>
>> Can you please describe your use-case so we give better advise ?
>>
>> if you just want to "build Docker images" as your initial message told,
>> then just run "docker build" within your job, what else ?
>>
>> 2017-12-04 13:15 GMT+01:00 Jeeva Chelladhurai :
>>
>>> Any  thoughts on https://wiki.jenkins.io/displa
>>> y/JENKINS/CloudBees+Docker+Custom+Build+Environment+Plugin
>>>
>>> On Mon, Dec 4, 2017 at 12:04 PM, Jeeva Chelladhurai 
>>> wrote:
>>>


> I have not tried this, so, cannot vouch for this. Please be cautious
> about the approach presented in this blog.
>
> http://niels.nu/blog/2017/continuous-blog-delivery-p2.html : you
> might be interested in Docker-in-Docker.
>
>
> Thanks for the suggestion.. Docker-in-Docker is been discouraged here
 is good read on it https://jpetazzo.github.io/
 2015/09/03/do-not-use-docker-in-docker-for-ci/

 - Jeeva

>>>
>>>
>>>
>>> --
>>> Jeeva K S Chelladhurai
>>>
>>> --
>>> 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/ms
>>> gid/jenkinsci-users/CAK5CbZVSDwjOAUe_uB_u89GRufSrbk2MyeUzSHz
>>> 9w88K6af0QA%40mail.gmail.com
>>> 
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> 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/ms
>> gid/jenkinsci-users/CANMVJznKg%3DXKpeaT62PVkmEvLh4kruCyc1HV%
>> 2BQGFNtnjLhX%3DLQ%40mail.gmail.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Jeeva K S Chelladhurai
>
> --
> 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/CAK5CbZVoig-s%3DvfVi5SEcrLVjBwZ5-0danHP-X54_
> CogRT9n0Q%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CANMVJznagKiHR4qPv6%2BCBJ-N%3DJ6Q%3Dj6ZDspYtWLGEnNDcP-bSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: HowTo set pipeline step description

2017-12-04 Thread Victor Martinez
As far as I know you don't need to do anything since the pipeline does it 
automatically:

For instance, the below pipeline will be shown as the attached screenshot

node('docker') {
sh 'docker --version'
sh 'docker info'
}











Is that what you meant? 

Cheers 

-- 
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/f2bd4fda-c68e-4ebc-8ba6-cfed991f7b88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Env Inject failure "Couldn't find the right download for WINDOWS and i386 combination"

2017-12-04 Thread Steve K
Oh Yeah!

Thanks @Daniel Beck & @Devin Nusbaum (sorry for referring to you as "David" 
in my previous post).
For the JDK configuration, I just had to de-select  "Install Automatically".
I don't think we use the JDK anywhere, but, if someone comes screaming to 
me "Hey, where's my JDK", I'll deal with it at that time.
But now, I'm a happy guy.  

Thanks again!

-- 
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/7dee52c5-9055-4d02-8e4e-ff21dee6f3ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


HowTo set pipeline step description

2017-12-04 Thread Gil Shinar
I have seen the following ticket [1] and all of it's duplicate tickets but 
haven't found any documentation on how to actually add the description to a 
pipeline step so it'll show what really happened and not just "shell 
script".
Can someone please assist?

[1] https://issues.jenkins-ci.org/browse/JENKINS-37324

-- 
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/b5fdea5e-28c1-4a70-9fc6-677da8944578%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Scenario for Jenkins Pipeline

2017-12-04 Thread addie k
Hey Group,

I am new to Jenkins. We are creating a CI/CD pipeline and I had some basic 
questions. Following is my scenario:


   1. Node project is cloned from Git repo and built.
   2. The test cases are run and unit test code coverage report is generated
   3. The artifacts are then to be used by SonarQube analysis task.
   4. With all the above steps successful, the built artifact will be 
   pushed to cloud foundry.
   5. The artifacts here are basically the contents of the workspace 
   directory - they are not zipped or anything. The total size is approx 200 
   MB.

My questions are:


   1. Will it be a good idea that task#1 and task#2 be a part of the same 
   Jenkins project? I tried isolating them into two separate projects but 
   since task#2 uses the artifacts in task#1, I find the copy-artifact between 
   the two workspaces to be time-consuming.
   2. Task #3 uses the artifacts produced in Task #2 and Task #1. If I 
   isolate Task#3 in a separate Jenkins project, I am facing the same problem 
   of artifacts being copied and taking time. 
   3. I tried using the Jenkins "Pipeline" project. But I am confused - the 
   tasks will use their workspace individually and create artifacts in their 
   own job directories, so how will the pipeline bring them together? Is this 
   even a good candidate for the pipeline? 

Sorry about this, as I am new to this, I have these questions. If you can 
help me understand this here, I will really appreciate! I will be happy to 
provide more information in case I am not clear anywhere.

Thanks,
addie

-- 
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/bc141fb0-c99f-4322-a171-a9d5322d25e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Env Inject failure "Couldn't find the right download for WINDOWS and i386 combination"

2017-12-04 Thread Daniel Beck

> On 4. Dec 2017, at 17:53, Steve K  wrote:
> 
> We're not using a JDK tool in our builds.
> 
> This has become a huge pain.  I can see from your link that Oracle is 
> probably to blame, but I don't see where I can change Jenkins' mind about 
> what JDK to look for.
> 
> Thanks again.

There's likely a single JDK configured in Manage Jenkins » Global Tool 
Configuration with an auto-installer that downloads from Oracle (the label 
might still say java.sun.com).

If so, your options are:
- Remove the tool.
- Remove the auto-installer for the JDK that downloads it from the Oracle site.
- Add a second tool version, which makes the per-job option explicit. Any jobs 
relying on the existing one set up automatically will fail until you explicitly 
configure one.
- Override the path to the JDK on the agent your builds are failing on, this 
should override the unavailable auto installer.

-- 
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/714B2AB3-02A6-4993-8B8B-DE0270B95CBF%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: Translation between declaritive pipleline and groovy pipeline

2017-12-04 Thread jerome
You need to wrap your groovy code into a try/catch/finally block and check 
the current build result ( I also give you some hint when things are not 
yet filled)
try
{
}
catch(any)
{
  println('Error occurred during build:');
  println(any.toString());
  println('Marking build as FAILURE because of this');
  currentBuild.result = 'FAILURE'
  throw any //rethrow exception to prevent the build from proceeding
}
finally
{
  if(!currentBuild.result)
  {
currentBuild.result = 'SUCCESS'
println("Current build result is undefined, setting it as 
${currentBuild.result}")
  }
  // send email
  emailext body: 'my email body', subject: 'email subject', to: 
't...@test.dev', replyTo: 't...@test.dev', mimeType: 'text/html';
}


-- 
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/dfdf3042-8b26-4f83-b43f-a17b8142a4a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Translation between declaritive pipleline and groovy pipeline

2017-12-04 Thread Peter Berghold
Kool! Thanks!

I suspected as much but now I full understand what's going on.

On Mon, Dec 4, 2017 at 1:15 AM Ramanathan Muthaiah 
wrote:

> What would be the equivalent of this:
>>
>> post {
>> always {
>> echo 'One way or another, I have finished'
>> deleteDir() /* clean up our workspace */
>> }
>> success {
>> echo 'I succeeeded!'
>> }
>> unstable {
>> echo 'I am unstable :/'
>> }
>> failure {
>> echo 'I failed :('
>> }
>> changed {
>> echo 'Things were different before...'
>> }
>> }
>> }
>>
>> in a Groovy pipleline?
>>
>> I'm looking at using "something" to notify by email if a build fails
>>
>>
> Groovy code presented in this Cloudbees' article is about mail
> notifications (also, slack and hipchat) -- but you may want to extend it to
> suit your needs.
>
> https://www.cloudbees.com/blog/sending-notifications-pipeline
>
> /Ram
>
> --
> 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/da5927cf-2fc5-4c46-9734-8db06b87be7a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAArvnv3%2ByXh54RAG8pr3yspRUMXzmV6vAsADjuDn0gC__t-93w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Env Inject failure "Couldn't find the right download for WINDOWS and i386 combination"

2017-12-04 Thread Steve K
Thanks @David Nusbaum
Here's a trace from a test job that does nothing more than execute a `date 
/t` on the slave:

Building remotely on ROCDVMSDK2x  
(SLAVE FTP_CLIENT) in workspace C:\Jenkins\workspace\z_date
Installing JDK jdk-9.0.1-oth-JPR
FATAL: Unable to produce a script filehudson.AbortException 
: Couldn't 
find the right download for WINDOWS and i386 combination
at hudson.tools.JDKInstaller.locate(JDKInstaller.java:443) 

at hudson.tools.JDKInstaller.performInstallation(JDKInstaller.java:138) 

at 
hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:72) 

at 
hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109)
 

at 
hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206) 

at hudson.model.JDK.forNode(JDK.java:144) 

at 
hudson.model.AbstractProject.getEnvironment(AbstractProject.java:358) 

at hudson.model.Run.getEnvironment(Run.java:2264) 

at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:921) 

at 
com.lookout.jenkins.EnvironmentScript.generateEnvironment(EnvironmentScript.java:147)
 

at 
com.lookout.jenkins.EnvironmentScript.setUp(EnvironmentScript.java:119) 

at hudson.model.Build$BuildExecution.doRun(Build.java:157) 

at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) 

at hudson.model.Run.execute(Run.java:1728) 

at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 

at hudson.model.ResourceController.execute(ResourceController.java:98) 

at hudson.model.Executor.run(Executor.ja 
va:405)
 




We're not using a JDK tool in our builds.

This has become a huge pain.  I can see from your link that Oracle is 
probably to blame, but I don't see where I can change Jenkins' mind about 
what JDK to look for.

Thanks again.


On Friday, December 1, 2017 at 1:58:11 PM UTC-5, Devin Nusbaum wrote:
>
> I suspect the error is being thrown by the JDK installer tool and is 
> unrelated to EnvInject. Do you have a full stack trace, and are you using a 
> JDK tool in your build configured with the “Install from java.sun.com” 
> method to install JDK 9? if so, it looks like Oracle has removed the 
> 32-bit JDK 9 downloads , so I guess 
> you could use JDK 8 instead.
>
>

-- 
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/5653a824-6cbc-4edf-bba9-a6a3c1d1e3b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build Docker Image from a Dockerized Jenkins

2017-12-04 Thread Jeeva Chelladhurai
I would like to run my builds inside docker, so that I can manage different
run times like node, python, go thru docker images.

- Jeeva

On Mon, Dec 4, 2017 at 5:51 PM, nicolas de loof 
wrote:

> (another) plugin of mines.
> Same design as docker-pipeline's "docker.inside"
>
> Can you please describe your use-case so we give better advise ?
>
> if you just want to "build Docker images" as your initial message told,
> then just run "docker build" within your job, what else ?
>
> 2017-12-04 13:15 GMT+01:00 Jeeva Chelladhurai :
>
>> Any  thoughts on https://wiki.jenkins.io/displa
>> y/JENKINS/CloudBees+Docker+Custom+Build+Environment+Plugin
>>
>> On Mon, Dec 4, 2017 at 12:04 PM, Jeeva Chelladhurai 
>> wrote:
>>
>>>
>>>
 I have not tried this, so, cannot vouch for this. Please be cautious
 about the approach presented in this blog.

 http://niels.nu/blog/2017/continuous-blog-delivery-p2.html : you might
 be interested in Docker-in-Docker.


 Thanks for the suggestion.. Docker-in-Docker is been discouraged here
>>> is good read on it https://jpetazzo.github.io/
>>> 2015/09/03/do-not-use-docker-in-docker-for-ci/
>>>
>>> - Jeeva
>>>
>>
>>
>>
>> --
>> Jeeva K S Chelladhurai
>>
>> --
>> 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/ms
>> gid/jenkinsci-users/CAK5CbZVSDwjOAUe_uB_u89GRufSrbk2MyeUzSHz
>> 9w88K6af0QA%40mail.gmail.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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/CANMVJznKg%3DXKpeaT62PVkmEvLh4kruCyc1HV%
> 2BQGFNtnjLhX%3DLQ%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jeeva K S Chelladhurai

-- 
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/CAK5CbZVoig-s%3DvfVi5SEcrLVjBwZ5-0danHP-X54_CogRT9n0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: About the Memory Consumption Issue of Jenkins

2017-12-04 Thread Artur Szostak
Jenkins is a Java application, and Java applications typically do not have a 
deterministic memory behaviour. You really cannot say anything with a single 
login/logout cycle. If you keep seeing the memory consumption increase after an 
extended period of time with many login/logout cycles, then you can start 
worrying about possible memory issues.
In addition, if you are concerned with ~ 2GB memory usage in Jenkins, then you 
are looking at the wrong product. But I doubt you will find anything more 
streamlined anyway. Most continuous integration systems are built on Java, or 
Python or similar, and these tend to all be hogs when it comes to memory 
consumption. In principle it does not have to be like that. But the reality is 
that most languages and systems encourage bloat nowadays.

Cheers

Artur


From: jenkinsci-users@googlegroups.com  on 
behalf of Yang, Bruce (NSB - CN/Hangzhou) 
Sent: 13 November 2017 03:04:49
To: jenkinsci-users@googlegroups.com
Cc: Yang, Bruce (NSB - CN/Hangzhou)
Subject: About the Memory Consumption Issue of Jenkins

Hi, Jenkins Engineer,
I am a new Jenkins user from the corporation of Nokia china. There is a 
question when I use the Jenkins software and don’t know how to solve it. I also 
find the answer via searching web, reading the manual, etc. so I hope you can 
give me some helps if it is convenient to you.

Question description:

Ø  I have already complete the installation of Jenkins in the red hat Linux 
operating system(refer to this link: Installing Jenkins on Red Hat 
distributions)
 and then start the Jenkins service. I execute the top command to find the 
memory consumption of this service, you can find the memory consumption is 
2.2%, the result like the screenshot as below:

[cid:image001.jpg@01D35C66.D4464170]


Ø  Sencond step, I logon the jenkins server in the web, the result as below 
screenshot shown:

[cid:image002.jpg@01D35C66.D4464170]

and then the service increase the memory consumption to 6.2%, the result as 
below screenshot shown:

[cid:image003.jpg@01D35C66.D4464170]


Ø  Third step, I log out the jenkins service, but the consumption of this 
service does not demote yet. The result as below screenshot shown:

[cid:image004.jpg@01D35C66.D4464170]

So we can get a conclusion:

u  logging on jenkins, the memory consumption increase;

u  logging out jenkins, the memory consumption equal to logging on jenkins and 
does not demote yet.

In my opinion or guess, when we logging out jenkins service, the memory 
consumption should demote, in fact it is not. I think it is a wasting to CPU 
memory when we do not use jenkins service yet. I am not sure whether I configre 
the jenkins service incorrect or I need more configuration, it’s confused to 
me. So I wish you can give a comments or correct configurations about this 
question. Thank you before!


Best Regards!
Bruce Yang
--
Prototyping SW Specialist
Office: Building B, No.68 Dongxin Road, Binjiang District, Hangzhou, China
Postcode: 310053
Mobile: +86-13738176232
Email: bruce.y...@nokia-sbell.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/HE1PR07MB318052EBEB0221775FB5D864D22B0%40HE1PR07MB3180.eurprd07.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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/9b22a449b1ef494f8c3f740d8c63633b%40partner.eso.org.
For more options, visit https://groups.google.com/d/optout.


Re: How can I inject environment variables into my groovy class?

2017-12-04 Thread red 888
I guess it took longer than it should have to realize I was barking up the 
wrong tree, but let me explain why I wanted this.

I'm using the AWS java sdk. The AWS sdk looks for these env vars and pulls 
them in for creds automatically if they are set in the current session. Of 
course you can pass them in manually, but this feature is quite convenient! 
I'm calling the AWS SDK from a groovy class like this because its super 
portable and behaves almost like a lightweight jenkins plugin- I really 
like the idea of writing reusable api wrappers in groovy classes for the 
pipeline like this.

The GCP SDK has similar features where it looks for env vars for config.

It just would be nice to be able to define this once in the environment{} 
directive before calling these api wrapper classes.


On Sunday, December 3, 2017 at 3:47:19 PM UTC-5, Daniel Butler wrote:
>
> If you’re dealing with a stubborn library that’s forcing you to use 
> environment variables to pass in parameters you’re in for more pain than 
> it’s worth trying to run it within the pipeline script environment.
>
>  
>
> Use it by running a groovy script externally, e.g.
>
>  
>
> sh “groovy MyScript.groovy”
>
>  
>
> and then you’ve got all the environment variables setup and you’re in a 
> standard groovy environment without the pipeline restrictions and 
> idiosyncrasies.
>
>  
>
>  
>
>  
>
> *From: *red 888 
> *Sent: *03 December 2017 00:28
> *To: *Jenkins Users 
> *Subject: *Re: How can I inject environment variables into my groovy 
> class?
>
>  
>
> "In the pipeline there’s the global variable `env` which is a map of all 
> the currently declared environment variables (JOB_NAME etc) you could pass 
> into your class."
>
>  
>
> Is there a way to do that so all those envs are imported and accessible in 
> the class like they are system variables? For example if I do a printenv 
> from the pipeline "MyVar" shows up like its a system variable, I want it to 
> show up like that from in my class too. Is there an elegant way of 
> importing all the vars in "env" into my class and making them access like 
> shell variables?
>
>
>
> On Friday, December 1, 2017 at 9:08:12 AM UTC-5, Daniel Butler wrote:
>
> If you’re writing a groovy class that’s run from a library in the pipeline 
> script then you’re not going to be able to use System.getEnv().
>
>  
>
> There’s a few approaches you can take that do work:
>
>- You can pass in the values you need as parameters to the 
>methods/constructors you’re using.
>- In the pipeline there’s the global variable `env` which is a map of 
>all the currently declared environment variables (JOB_NAME etc) you could 
>pass into your class.
>- Pass in `this` from the pipeline script. You can then use this 
>object to access anything in pipeline, (Let’s assume you called the 
>field/parameter ctx) i.e. ctx.env.JOB_NAME or ctx.powershell(“write-host 
>‘spooky’”)
>
>  
>
> I noticed also you’ve got a direct execution of a process commented out, 
> don’t do that either. The same way System.getEnv() doesn’t work, doing that 
> will not behave as expected either (Assuming the sandbox will let you)
>
>  
>
>  
>
> Regards,
>
> Daniel.
>
>  
>
> *From: *red 888
> *Sent: *29 November 2017 20:28
> *To: *Jenkins Users
> *Subject: *Re: How can I inject environment variables into my groovy 
> class?
>
>  
>
> So this is a problem for me because the APIs I'm using in the groovy class 
> are looking for OS level environment variables.
>
>  
>
> Is there any way to set these variables with jenkins?
>
> On Tuesday, November 28, 2017 at 5:54:37 PM UTC-5, mpapo - Michael 
> Pailloncy wrote:
>
> Pipeline environment variables are not stored at the OS level. That's why 
> you are not able to get them using *System.getenv() *(which only list OS 
> level environment variables).
>
> But you should be able to retrieve them like any other classical 
> environment variables : with the "${MyVar}" syntax inside your shared lib 
> class.
>
>  
>
> Hopefully it helps.
>
>  
>
> Michaël
>
>  
>
> 2017-11-28 22:30 GMT+01:00 red 888 :
>
> My pipeline is using the environment directive to set an environment var 
> and then calls a groovy class:
>
>  
>
> def call(int blah) {
>
> pipeline {
> agent any
>
> environment {
> MyVar = credentials('djsjflsjfljsf')
> }
>
> stages {
> stage('Stage ONE') {
> steps {
> echo test.*methodA*()
>
> 
>
>  
>
>  
>
> But from in my groovy class I don't see those environment variables:
>
>  
>
> // vars/test.groovy
>
>  
>
> class test implements Serializable {
> static methodA (){
>
> def env = System.*getenv*()
> return env.dump()
> //return ['powershell', 'ls env:'].execute().text
>
> }
>
>   
>
> env.dump() and listing envs from the shell from inside the class doesn't 
> show those variables I added in the environment directive. 

Re: Build Docker Image from a Dockerized Jenkins

2017-12-04 Thread nicolas de loof
(another) plugin of mines.
Same design as docker-pipeline's "docker.inside"

Can you please describe your use-case so we give better advise ?

if you just want to "build Docker images" as your initial message told,
then just run "docker build" within your job, what else ?

2017-12-04 13:15 GMT+01:00 Jeeva Chelladhurai :

> Any  thoughts on https://wiki.jenkins.io/display/JENKINS/CloudBees+
> Docker+Custom+Build+Environment+Plugin
>
> On Mon, Dec 4, 2017 at 12:04 PM, Jeeva Chelladhurai 
> wrote:
>
>>
>>
>>> I have not tried this, so, cannot vouch for this. Please be cautious
>>> about the approach presented in this blog.
>>>
>>> http://niels.nu/blog/2017/continuous-blog-delivery-p2.html : you might
>>> be interested in Docker-in-Docker.
>>>
>>>
>>> Thanks for the suggestion.. Docker-in-Docker is been discouraged here is
>> good read on it https://jpetazzo.github.io/2015/09/03/do-not-use-docker-i
>> n-docker-for-ci/
>>
>> - Jeeva
>>
>
>
>
> --
> Jeeva K S Chelladhurai
>
> --
> 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/CAK5CbZVSDwjOAUe_uB_u89GRufSrbk2MyeUzSHz9w88K6af0Q
> A%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CANMVJznKg%3DXKpeaT62PVkmEvLh4kruCyc1HV%2BQGFNtnjLhX%3DLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build Docker Image from a Dockerized Jenkins

2017-12-04 Thread Jeeva Chelladhurai
Any  thoughts on
https://wiki.jenkins.io/display/JENKINS/CloudBees+Docker+Custom+Build+Environment+Plugin

On Mon, Dec 4, 2017 at 12:04 PM, Jeeva Chelladhurai 
wrote:

>
>
>> I have not tried this, so, cannot vouch for this. Please be cautious
>> about the approach presented in this blog.
>>
>> http://niels.nu/blog/2017/continuous-blog-delivery-p2.html : you might
>> be interested in Docker-in-Docker.
>>
>>
>> Thanks for the suggestion.. Docker-in-Docker is been discouraged here is
> good read on it https://jpetazzo.github.io/2015/09/03/do-not-use-docker-
> in-docker-for-ci/
>
> - Jeeva
>



-- 
Jeeva K S Chelladhurai

-- 
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/CAK5CbZVSDwjOAUe_uB_u89GRufSrbk2MyeUzSHz9w88K6af0QA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: trouble with Bitbucket Branch Source Plugin

2017-12-04 Thread i.ka...@betterfly-tourism.com
Hi,

You need to add a credential with Bitbucket user/password. It's documented here:

https://github.com/jenkinsci/credentials-plugin/blob/master/docs/user.adoc

Ivan

- Mail original -
De: "itchymuzzle" 
À: "jenkinsci-users" 
Envoyé: Mardi 21 Novembre 2017 23:44:05
Objet: Re: trouble with Bitbucket Branch Source Plugin

Not an answer to your question, but to get to your issue you must have 
gotten past the one I am having.  Can you take a look at my question? 
[https://groups.google.com/forum/#!topic/jenkinsci-users/n3JaXcXFzVs]  
Thanks.

-- 
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/f77cf19d-5351-499b-9fd1-38e624e64dac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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/2036178316.15747076.1512376160399.JavaMail.zimbra%40betterfly-tourism.com.
For more options, visit https://groups.google.com/d/optout.