On Thu, Aug 11, 2016 at 11:10 AM, Akshaya Khare <khare...@husky.neu.edu> wrote:
> Hi, > > Thanks for the detailed explanation, and I did get far but got stuck again. > So I was able to build a slave Jenkins image and created a buildconfig. > After updating the Kubernetes plugin configurations, I was able to spawn a > new pod, but the pod fails with the error "ContainerCannotRun". > On seeing the logs of the pod, it shows: > > *exec: "/var/lib/jenkins/run-jnlp-client": permission denied* > sounds like /var/lib/jenkins/run-jnlp-client doesn't have the right read/execute permissions set. How are you building the slave image? > > I tried giving admin privileges to my user, and also edit privileges to > the serviceaccount in my project: > > > *oc policy add-role-to-group edit system:serviceaccounts -n jenkinstin2* > How can I make sure that the pod runs without any permissions issues? > > On Mon, Aug 8, 2016 at 3:55 PM, Ben Parees <bpar...@redhat.com> wrote: > >> The sample defines a buildconfig which ultimately uses this directory as >> the context for a docker build: >> https://github.com/siamaksade/jenkins-s2i-example/tree/master/slave >> >> it does that by pointing the buildconfig to this repo: >> https://github.com/siamaksade/jenkins-s2i-example >> >> and the context directory named "slave" within that repo: >> https://github.com/siamaksade/jenkins-s2i-example/tree/master/slave >> >> which you can see defined here: >> https://github.com/siamaksade/jenkins-s2i-example/blob/maste >> r/jenkins-slave-builder-template.yaml#L36-L40 >> >> https://github.com/siamaksade/jenkins-s2i-example/blob/maste >> r/jenkins-slave-builder-template.yaml#L61-L68 >> >> If you are trying to build your own slave image, you need to point to a >> repo (and optionally a contextdir within that repo) that contains an >> appropriate Dockerfile, as the example does. >> >> >> >> On Mon, Aug 8, 2016 at 2:43 PM, Akshaya Khare <khare...@husky.neu.edu> >> wrote: >> >>> Hi Ben, >>> >>> So after making changes to the imagestream, I wasn't able to get the >>> build running initially. >>> But that was because already there were failed builds and buildconfigs >>> which were preventing the build to run successfully. >>> >>> Once I deleted the old failed builds, I was able to get the new build >>> running, but it failed once I tried running my Jenkins job. >>> I gave my github repository as the repository url for the build, and >>> this is the log i get for the failed pod: >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> *I0808 14:06:51.779594 1 source.go:96] git ls-remote >>> https://github.com/akshayakhare/ims/ <https://github.com/akshayakhare/ims/> >>> --headsI0808 14:06:51.779659 1 repository.go:275] Executing git >>> ls-remote https://github.com/akshayakhare/ims/ >>> <https://github.com/akshayakhare/ims/> --headsI0808 14:07:06.989568 1 >>> source.go:189] Cloning source from https://github.com/akshayakhare/ims/ >>> <https://github.com/akshayakhare/ims/>I0808 14:07:06.989649 1 >>> repository.go:275] Executing git clone --recursive >>> https://github.com/akshayakhare/ims/ <https://github.com/akshayakhare/ims/> >>> /tmp/docker-build543901321...I0808 14:07:35.174676 1 >>> repository.go:300] Out: Merge pull request #28 from >>> chemistry-sourabh/LoggingI0808 14:07:35.174708 1 common.go:78] >>> Setting build revision to >>> &api.GitSourceRevision{Commit:"79ed71a8470c973c6f6cad380657c2df93948345", >>> Author:api.SourceControlUser{Name:"Akshaya Khare", >>> Email:"akshayakh...@gmail.com <akshayakh...@gmail.com>"}, >>> Committer:api.SourceControlUser{Name:"GitHub", Email:"nore...@github.com >>> <nore...@github.com>"}, Message:"Merge pull request #28 from >>> chemistry-sourabh/Logging"}F0808 14:07:35.200435 1 builder.go:185] >>> Error: build error: open /tmp/docker-build543901321/Dockerfile: no such >>> file or directory* >>> Do i need to create a docker file in my repository to run successfully? >>> You mentioned that the sample git given in the blog uses a "slave" sub >>> directory, will I have to create a similar structure in my repository? >>> >>> Looking at the sample Docker file given in the blog below, makes me >>> believe that it copies the workspace from the current image to its own >>> container and then runs it: >>> https://github.com/siamaksade/jenkins-s2i-example/blob/maste >>> r/slave/Dockerfile >>> >>> Is my understanding correct? >>> >>> >>> On Fri, Aug 5, 2016 at 4:39 PM, Ben Parees <bpar...@redhat.com> wrote: >>> >>>> You'll need to define the imagestream you've got the build pushing to, >>>> the sample does that here: >>>> https://github.com/siamaksade/jenkins-s2i-example/blob/maste >>>> r/jenkins-slave-builder-template.yaml#L12-L21 >>>> >>>> you'll need to name the imagestream "jdk8-jenkins-slave" in your case. >>>> >>>> >>>> On Fri, Aug 5, 2016 at 4:06 PM, Akshaya Khare <khare...@husky.neu.edu> >>>> wrote: >>>> >>>>> I've attached the buildconfig, and the project name is "jenkinstin2"... >>>>> >>>>> On Fri, Aug 5, 2016 at 2:38 PM, Ben Parees <bpar...@redhat.com> wrote: >>>>> >>>>>> >>>>>> >>>>>> On Fri, Aug 5, 2016 at 2:28 PM, Akshaya Khare <khare...@husky.neu.edu >>>>>> > wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I have a project configured in jenkins container(thanks to Ben >>>>>>> Parees for suggesting s2i, it works like a charm) running on openshiift >>>>>>> which I need to test every time there is a pull request from github. >>>>>>> >>>>>>> And we are planning to run those test cases on a separate node, >>>>>>> since the environment is ideal for testing. >>>>>>> I was following this blog by Siamak Sadeghianfar which seems to do >>>>>>> exactly the thing which I'm expecting it to do. >>>>>>> >>>>>>> https://blog.openshift.com/openshift-3-2-jenkins-s2i-slave-pods/ >>>>>>> >>>>>>> Now whenever I try creating the slave image from the UI, I get an >>>>>>> error saying: >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> *"build failed 44 hours ago - 29d91a3: added metadata to Dockerfile >>>>>>> (Siamak Sadeghianfar <ssade...@redhat.com >>>>>>> <ssade...@redhat.com>>)""bc/jenkins is pushing to >>>>>>> imagestreamtag/jenkins:latest that is using is/jenkins, but that image >>>>>>> stream does not exist"* >>>>>>> >>>>>> >>>>>> can you share your buildconfig definition (json or yaml) and the >>>>>> name of the project you've defined it in? >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> >>>>>>> I can see the docker image :->* <local-ip>:5000/jenkinstin2/jenkins >>>>>>> *without any tags. >>>>>>> >>>>>>> What have I messed up here? >>>>>>> >>>>>>> And what should be the repository URL for this >>>>>>> jenkins-slave-builder, I tried giving my github project url and also the >>>>>>> sample jenkins-s2i-example.git url, both end up giving the same error. >>>>>>> >>>>>> >>>>>> the repository the buildconfig references? depends what you want to >>>>>> build, but it doesn't sound like that is your current issue. >>>>>> >>>>>> the example i think you're following uses this repository as the >>>>>> source repo input for the slave image build: >>>>>> >>>>>> https://github.com/siamaksade/jenkins-s2i-example.git >>>>>> >>>>>> but it uses a context subdirectory of "slave". >>>>>> >>>>>> you can see the build config definition (and relevant parameters) here: >>>>>> https://raw.githubusercontent.com/siamaksade/jenkins-s2i-example/master/jenkins-slave-builder-template.yaml >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> >>>>>>> Also I got the master image running, but apparently the >>>>>>> configuration *doesn't* have the one field it certainly needs to >>>>>>> have... >>>>>>> >>>>>>> *Restrict where this project can be run* >>>>>>> >>>>>> >>>>>> sorry, not sure what you're referring to here or where you expect >>>>>> this to be configured? >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> >>>>>>> Is this a bug of some sort? >>>>>>> -- >>>>>>> *Thanks & Regards,* >>>>>>> *AK* >>>>>>> *312-785-3508 <312-785-3508>* >>>>>>> >>>>>>> _______________________________________________ >>>>>>> users mailing list >>>>>>> users@lists.openshift.redhat.com >>>>>>> http://lists.openshift.redhat.com/openshiftmm/listinfo/users >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Ben Parees | OpenShift >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> *Thanks & Regards,* >>>>> *Akshaya Khare* >>>>> *312-785-3508 <312-785-3508>* >>>>> >>>> >>>> >>>> >>>> -- >>>> Ben Parees | OpenShift >>>> >>>> >>> >>> >>> -- >>> *Thanks & Regards,* >>> *Akshaya Khare* >>> *312-785-3508 <312-785-3508>* >>> >> >> >> >> -- >> Ben Parees | OpenShift >> >> > > > -- > *Thanks & Regards,* > *Akshaya Khare* > *312-785-3508 <312-785-3508>* > -- Ben Parees | OpenShift
_______________________________________________ users mailing list users@lists.openshift.redhat.com http://lists.openshift.redhat.com/openshiftmm/listinfo/users