Bug 1439065 - [free][free-int] cannot create jenkins pipeline buildConfig when no jenkins server preinstall
Summary: [free][free-int] cannot create jenkins pipeline buildConfig when no jenkins s...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Build
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Abhishek Gupta
QA Contact: Wenjing Zheng
URL:
Whiteboard:
Depends On: 1439066
Blocks: 1439859
TreeView+ depends on / blocked
 
Reported: 2017-04-05 07:09 UTC by Dongbo Yan
Modified: 2017-05-01 20:39 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1439859 (view as bug list)
Environment:
Last Closed: 2017-05-01 20:39:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dongbo Yan 2017-04-05 07:09:49 UTC
Description of problem:
cannot create jenkins pipeline buildConfig on free-int env

Version-Release number of selected component (if applicable):
openshift v3.5.5
kubernetes v1.5.2+43a9be4

How reproducible:
Always

Steps to Reproduce:
1.Create a project on free-int
2.Create a pipeline bc
 $ oc new-app https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/pipeline/samplepipeline.yaml
3.Check pipeline bc
 $ oc get bc

Actual results:
There is no pipeline bc

Expected results:
Pipeline bc should be existing

Additional info:

Comment 1 Dongbo Yan 2017-04-05 07:46:32 UTC
When we create jenkins server firstly
$ oc new-app jenkins-persistent
$ oc policy add-role-to-user edit system:serviceaccount:<project>:jenkins

Then create pipeline bc, it will succeed
$ oc new-app https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/pipeline/samplepipeline.yaml
$ oc get bc
NAME                     TYPE              FROM      LATEST
nodejs-mongodb-example   Source            Git       0
sample-pipeline          JenkinsPipeline             0

If there is no jenkins server existing before pipeline bc creating, it will fail

Comment 2 Ben Parees 2017-04-05 13:57:57 UTC
this is failing because the cluster appears to be configured to use "openshift/jenkins-ephemeral" as the auto-provisioning template when a jenkins server is needed.

Since that template doesn't exist (probably should be just openshift/jenkins?), when we attempt to create a pipeline buildconfig, the creation fails (part of the creation will attempt to provision the jenkins server via the non-existent template and fail, thus failing the buildconfig creation).

That's also why it works if you provision the jenkins server yourself, since then the buildconfig pipeline creation can skip the auto-provision logic, and not hit the failure.

You can see this from the new-app output:
-> Creating resources ...
    error: Jenkins pipeline template openshift/jenkins-ephemeral not found

Assigning to Abhishek since the online environment is misconfigured.

Instructions for configuring what template should be used for autoprovisioning can be found here:
https://docs.openshift.org/latest/install_config/configuring_pipeline_execution.html

Comment 3 Ben Parees 2017-04-05 13:58:47 UTC
(correction to above: it should be openshift/jenkins-persistent)

Comment 5 Miciah Dashiel Butler Masters 2017-04-06 17:23:35 UTC
origin/master PR: https://github.com/openshift/origin/pull/13649

Comment 7 Dongbo Yan 2017-04-07 07:43:22 UTC
Test on free-int
openshift v3.5.5.3
kubernetes v1.5.2+43a9be4

Actual result: create pipeline bc successfully

$ oc new-app jenkins-pipeline-example
--> Deploying template "dyan8/jenkins-pipeline-example" to project dyan8

     jenkins-pipeline-example
     ---------
     This example showcases the new Jenkins Pipeline integration in OpenShift,
     which performs continuous integration and deployment right on the platform.
     The template contains a Jenkinsfile - a definition of a multi-stage CI/CD process - that
     leverages the underlying OpenShift platform for dynamic and scalable
     builds. OpenShift integrates the status of your pipeline builds into the web
     console allowing you to see your entire application lifecycle in a single view.

     A Jenkins server will be automatically instantiated in this project to manage
     the Pipeline BuildConfig created by this template.  You will be able to log in to
     it using your OpenShift user credentials.


     * With parameters:
        * Name=nodejs-mongodb-example
        * Application Hostname=
        * Git Repository URL=https://github.com/openshift/nodejs-ex.git
        * Database Name=sampledb
        * MongoDB Username=userJ1N # generated
        * MongoDB Password=xRp4rNXYnlpYOiGF # generated
        * Memory Limit=256Mi
        * Memory Limit (MongoDB)=256Mi
        * Database Service Name=mongodb
        * Database Administrator Password=o1VQcROeGdGu6J4t # generated
        * Git Reference=
        * Context Directory=
        * GitHub Webhook Secret=SR0bHkQwev65kTBEEmidNENgmFHrhMKNaw5tVrFG # generated
        * Generic Webhook Secret=aViwkWMkPVterTbKYdAOYiDcqtW4KOx5SH2CkMyX # generated
        * Custom NPM Mirror URL=
        * Namespace=openshift

--> Creating resources ...
    buildconfig "sample-pipeline" created
    service "nodejs-mongodb-example" created
    route "nodejs-mongodb-example" created
    imagestream "nodejs-mongodb-example" created
    buildconfig "nodejs-mongodb-example" created
    deploymentconfig "nodejs-mongodb-example" created
    service "mongodb" created
    deploymentconfig "mongodb" created
--> Success
    Use 'oc start-build sample-pipeline' to start a build.
    Use 'oc start-build nodejs-mongodb-example' to start a build.
    Run 'oc status' to view your app.


Note You need to log in before you can comment on or make changes to this bug.