Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add advanced pipeline examples #12177

Merged
merged 1 commit into from
Dec 9, 2016

Conversation

csrwng
Copy link
Contributor

@csrwng csrwng commented Dec 7, 2016

Adds 2 more pipeline examples to origin. Updates the existing README with instructions for the examples.

@csrwng
Copy link
Contributor Author

csrwng commented Dec 7, 2016

@bparees ptal

@bparees bparees self-assigned this Dec 7, 2016
Copy link
Contributor

@bparees bparees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would like to see this driven entirely via the openshift webconsole, since that should be possible.


If you monitor the pods in your default project, you will also see the slave pod get created and deleted.


## Pipeline of Pipelines Example
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orchestration Pipeline Example sounds nicer :)

oc new-project mapsapp
```

3. To instantiate the pipeline via the Web Console, create the template from this directory first:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can just instantiate it in the console via the "upload" path instead of installing/registering it.

1. Ensure that you have a running OpenShift environment as described in the basic example
2. Create a new project for your pipeline:
```
oc new-project mapsapp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do this from the web console

7. Navigate to *Builds* -> *Pipelines*
8. Click on *Start Pipeline*

The pipeline will instantiate other pipelines and those will in turn instantiate OpenShift objects.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's going to take some time for jenkins to come up before the pipeline will start, probably worth warning users about that so they aren't immediately wondering why it's not running.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(and making it clear that's a first time only thing)


## Blue Green Deployment Example

The `bluegreen-pipeline.yaml` template contains a pipeline that demonstrates alternating blue/green deployments.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with a manual confirmation/approval step.

2. Create a new project for your pipeline:
```
oc new-project bluegreen
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

via webconsole

4. Modify the *Git Repository URL* to contain the URL of your fork
5. Click on *Create*
6. Navigate to *Builds* -> *Pipelines*
7. Click on *Start Pipeline*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(wait for jenkins to start up...then pipeline will run...)

5. Click on *Create*
6. Navigate to *Builds* -> *Pipelines*
7. Click on *Start Pipeline*
8. Once code has been deployed, the pipeline will pause for your approval. Click on the pause icon to approve the pipeline.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/approve the pipeline/approve deployment of the changes/

@@ -0,0 +1,327 @@
apiVersion: v1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you convert samplepipeline.json to yaml? if so, let's delete the json one. (might need to make sure no tests are referencing it)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

samplepipeline.json removed. I didn't find any tests that referred to it. Only the cluster up code, which I fixed up.

@bparees
Copy link
Contributor

bparees commented Dec 7, 2016

@csrwng I feel like this part of the card has gotten neglected in these samples (I know you included it in your other CI sample):

4) use slave pods/images

something else to consider:
Instead of defining a buildconfig in openshift, perform the actual maven build within the slave and then take that war and submit it for a binary build to openshift.  (or push the war to a nexus repo and pull it from there for assembling the app image)


Notes:
-----------------------------------------
Currently there is one pipeline sample that doesn't align or leverage or supplied slave images. By supplying these samples, it will better highlight how we intend our end users to use our supplied builder slaves.

Is there something we can do either to the original samplepipeline.json/yaml, or one of these 2 samples, to better cover demonstrating using a slave node for its intended purpose?

@csrwng csrwng force-pushed the pipeline-examples branch from 0ffaf2c to b84360a Compare December 8, 2016 14:40
@csrwng
Copy link
Contributor Author

csrwng commented Dec 8, 2016

Is there something we can do either to the original samplepipeline.json/yaml, or one of these 2 samples, to better cover demonstrating using a slave node for its intended purpose?

I will switch the bluegreen pipeline to use the nodejs slave for building

@csrwng csrwng force-pushed the pipeline-examples branch 2 times, most recently from 76e0703 to 22121a4 Compare December 8, 2016 21:35
@csrwng
Copy link
Contributor Author

csrwng commented Dec 8, 2016

I added a new pipeline that uses a maven slave to build a WAR

dockerfile: |-
FROM wildfly
COPY ROOT.war /opt/app-root/src/target/ROOT.war
RUN $STI_SCRIPTS_PATH/assemble
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you really need to run assemble vs just copying the war directly into the deployment dir?

## Maven Slave Example

The `maven-pipeline.yaml` template contains a pipeline that uses a maven node to build and package a WAR.
It then builds an image with the WAR using a Docker build.
Copy link
Contributor

@bparees bparees Dec 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using a Docker-strategy OpenShift build.

10. Navigate to *Builds* -> *Pipelines*
11. Click on *Start Pipeline* next to *openshift-jee-sample*

When the pipeline completes, the openshift-jee-sample application should be deployed and running.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment you have below about waiting for jenkins the first time.

8. Modify the *Git Repository URL* to contain the URL of your fork
9. Click on *Create*
10. Navigate to *Builds* -> *Pipelines*
11. Click on *Start Pipeline* next to *bluegreen-pipeline*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment you have above about waiting for jenkins the first time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you missed this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now it's fixed. Also added some text to explain how the routes work with this example.

Copy link
Contributor

@bparees bparees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple of nits but otherwise lgtm.

@csrwng csrwng force-pushed the pipeline-examples branch from 22121a4 to 77f941f Compare December 8, 2016 23:19
@csrwng
Copy link
Contributor Author

csrwng commented Dec 8, 2016

comments addressed

@csrwng csrwng force-pushed the pipeline-examples branch from 77f941f to d0b9dc7 Compare December 9, 2016 14:05
@bparees
Copy link
Contributor

bparees commented Dec 9, 2016

lgtm [merge]

@openshift-bot
Copy link
Contributor

openshift-bot commented Dec 9, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12199/) (Image: devenv-rhel7_5516)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to d0b9dc7

@openshift-bot
Copy link
Contributor

[Test]ing while waiting on the merge queue

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to d0b9dc7

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12199/) (Base Commit: cbc0af0)

@openshift-bot openshift-bot merged commit 1b0d264 into openshift:master Dec 9, 2016
@csrwng csrwng deleted the pipeline-examples branch December 21, 2016 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants