Re: Kubernetes plugin ( want to run slave as pod )

2017-12-30 Thread Carlos Sanchez
what logs and events are you getting when you run

* kubectl logs your_pod_slave
* kubectl describe your_pod_slave

are you getting "failed to open log file" there? if you do it looks like a
kubernetes issue, like https://github.com/kubernetes/kubernetes/issues/45911
that points to your container running out of memory



On Thu, Dec 28, 2017 at 6:51 PM, Vamsi krishna 
wrote:

> Hello Team,
>
> I am using kubernetes plugin 1.1
> My cluster is running in local Host.. Jenkins is running in outside
> cluster..
> I want to run my Jenkins build jobs with slave pod in containers..after
> build job is done my slave pod has to kill automatically..
> Pod is killing automatically when build job is done..but issue is
> My job is running on jenkins/jnlp-slave image not in my base image.for
> that I mentioned jnlp as my container name then job is not able to run
> showing pending slave-td45h is offline.
>
> How to connect my container to  talk to the Jenkins. I am trying for the
> freestyle jobs.
>
> I created image with making baseimage of  in my dockerfike i mentioned
> FROM Jenkins/jnlp-slave is it right to use like this..
> If u want I will show my total dockerfile..
>
> From jenkins/jnlp-slave
> USER root
>
> ENV NPM_CONFIG_LOGLEVEL info
> ENV NODE_VERSION 8.9.0
> ENV COMPOSE_VERSION 1.12.0
>
> # NodeJS (from https://github.com/nodejs/docker-node/blob/
> 12ba2e5432cd50037b6c0cf53464b5063b028227/8.1/Dockerfile)
> # gpg keys listed at https://github.com/nodejs/node#release-team
> RUN set -ex \
>   && for key in \
> 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
> FD3A5288F042B6850C66B31F09FE44734EB7990E \
> 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
> DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
> C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
> B9AE9905FFD7803F25714661B63B535A4C206CA9 \
> 56730D5401028683275BD23C23EFEFE93C4CFFFE \
> 77984A986EBC2AA786BC0F66B01FBB92821C587A \
>   ; do \
> gpg --keyserver pgp.mit.edu --recv-keys "$key" || \
> gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \
> gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \
>   done
>
>
> RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
>   && case "${dpkgArch##*-}" in \
> amd64) ARCH='x64';; \
> ppc64el) ARCH='ppc64le';; \
> s390x) ARCH='s390x';; \
> arm64) ARCH='arm64';; \
> armhf) ARCH='armv7l';; \
> *) echo "unsupported architecture"; exit 1 ;; \
>   esac \
>   && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_
> VERSION-linux-$ARCH.tar.xz" \
>   && curl -SLO --compressed "https://nodejs.org/dist/v$
> NODE_VERSION/SHASUMS256.txt.asc" \
>   && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
>   && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt |
> sha256sum -c - \
>   && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local
> --strip-components=1 \
>   && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc
> SHASUMS256.txt \
>   && ln -s /usr/local/bin/node /usr/local/bin/nodejs
>
> RUN apt-get update && apt-get install -y git jq rsync g++ build-essential
> && apt-get clean
>
> ADD jenkins-slave /usr/local/bin
>
> USER jenkins
>
> using this image my container is not running properly getting logs as failed
> to open log file "/var/log/pods/70d9def9-ebf7-
> 11e7-867e-005056bf5570/jnlp_0.log": open /var/log/pods/70d9def9-ebf7-
> 11e7-867e-005056bf5570/jnlp_0.log: no such file or directory
> these are the logs  i am getting any idea... if this container runs
> succesfully then i can run my jenkins job in this container. because i did
> base image as jenkins/jnlp-slave.   Can anyone please help me.. I have this
> issue since week.
>
> --
> 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/c1d734a7-d4f7-444b-8689-81ab3929384b%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/CALHFn6N0Y0iCwKniof%2BpSzEq9HMF0TbgqO_Lx9WWt%3DNE5ko2Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Groovy code in Pipeline and CPS trouble

2017-12-30 Thread David Karr
On Thu, Dec 28, 2017 at 6:17 AM, Ramanathan Muthaiah
 wrote:
> Hello All,
>
> I have tested the below snippet of code in myjenkinsurl/script and it works
> fine.
>
> However, same code (embedded or loaded via external Groovy code) in Pipeline
> workflow script fails, inspite of CPS annotation (with the stacktrace that's
> given after this code snippet) ?
>
> NOTE:
> First print statement in 'getjobName' function successfully matches the job
> (using regex).
>
> #!/usr/bin/env groovy
>
> import org.jenkinsci.plugins.workflow.job.*
>
> @NonCPS
> def getjobName(String job) {
> for (item in Jenkins.instance.items) {
> if (item =~ /metamon-alert-configs/ ) {
> println item.getName()
> jobname = item
> }
> }
>
> for (build in jobname.Builds()) {
> println build
> }
> }
>
>
> node('master') {
> stage('getlog') {
> def jobname = getjobName("mon-alert-configs")
> }
> }
>
>
> Reading (novice at it) the stacktrace suggests it's to do with serialization
> of variables but the annotation should take care of that, isn't it ?
>
> an exception which occurred:
> in field groovy.lang.Closure.delegate
> in object org.jenkinsci.plugins.workflow.cps.CpsClosure2@72ae419a
> in field org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.closures
> in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@401a5d46
> in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@401a5d46
> Caused: java.io.NotSerializableException:
> org.jenkinsci.plugins.workflow.job.WorkflowJob
> at
> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
> at
> org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
> at
> org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
> at
> org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
> at
> org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344)
> at java.util.LinkedHashMap.internalWriteEntries(LinkedHashMap.java:333)
> . . . . .
> . . . . .

No, the annotation wouldn't help with this, I believe.

The problem is, when "job steps" execute, objects are deserialized
before and after.  If Jenkins has to try to serialize something in
scope that is not serializable, you will get that exception. What is
often very frustrating is that the stacktrace won't tell you which
variable contains something that is not serializable. What it will
usually tell you is what type was not serializable. If you're lucky,
it will be obvious what variable has a value of that type. In your
case, I believe is it obvious.

The other thing that is not obvious is that "println" is a job step.

If you really need to do a println, then right before you call it, you
have to assign "null" to variables containing values of
non-serializable types.

In your "getjobName" method, it's odd that your formal parameter is
called "job", when it's really "jobName", and then you appear to
assign to "jobname", which isn't defined anywhere, but the value
actually represents a "Job", not a "jobname".

>
>
> /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/68199c67-9ccf-42e2-8bf3-f38fe4708350%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/CAA5t8VrrGDF7OJrLxeQeySmAUT4sT3mppRZY9_in1-iBbx3s1w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: get_job_info() of pyhton-jenkins not working

2017-12-30 Thread Oleg Nenashev
Please raise a ticket in the Openstack community.
Python-Jenkins tool is under their governance afaik: 
https://github.com/openstack/python-jenkins.

пятница, 29 декабря 2017 г., 15:23:48 UTC+1 пользователь PriNce YaSh 
написал:
>
>
> https://stackoverflow.com/questions/48023425/get-job-info-giving-item-not-found-error-python-jenkins
>

-- 
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/3450fdae-34a5-423a-9f8f-84d9e9a5c46e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.