Giter VIP home page Giter VIP logo

pipelines-tutorial's Introduction

OpenShift Pipelines Tutorial

Welcome to the OpenShift Pipelines tutorial!

OpenShift Pipelines is a cloud-native, continuous integration and delivery (CI/CD) solution for building pipelines using Tekton. Tekton is a flexible, Kubernetes-native, open-source CI/CD framework that enables automating deployments across multiple platforms (Kubernetes, serverless, VMs, etc) by abstracting away the underlying details.

OpenShift Pipelines features:

  • Standard CI/CD pipeline definition based on Tekton
  • Build images with Kubernetes tools such as S2I, Buildah, Buildpacks, Kaniko, etc
  • Deploy applications to multiple platforms such as Kubernetes, serverless and VMs
  • Easy to extend and integrate with existing tools
  • Scale pipelines on-demand
  • Portable across any Kubernetes platform
  • Designed for microservices and decentralized teams
  • Integrated with the OpenShift Developer Console

This tutorial walks you through pipeline concepts and how to create and run a simple pipeline for building and deploying a containerized app on OpenShift, and in this tutorial, we will use Triggers to handle a real GitHub webhook request to kickoff a PipelineRun.

In this tutorial you will:

Prerequisites

You need an OpenShift 4 cluster in order to complete this tutorial. If you don't have an existing cluster, go to http://try.openshift.com and register for free in order to get an OpenShift 4 cluster up and running on AWS within minutes.

You will also use the Tekton CLI (tkn) through out this tutorial. Download the Tekton CLI by following instructions available on the CLI GitHub repository.

Concepts

Tekton defines a number of Kubernetes custom resources as building blocks in order to standardize pipeline concepts and provide a terminology that is consistent across CI/CD solutions. These custom resources are an extension of the Kubernetes API that let users create and interact with these objects using kubectl and other Kubernetes tools.

The custom resources needed to define a pipeline are listed below:

  • Task: a reusable, loosely coupled number of steps that perform a specific task (e.g. building a container image)
  • Pipeline: the definition of the pipeline and the Tasks that it should perform
  • TaskRun: the execution and result of running an instance of task
  • PipelineRun: the execution and result of running an instance of pipeline, which includes a number of TaskRuns

Tekton Architecture

In short, in order to create a pipeline, one does the following:

  • Create custom or install existing reusable Tasks
  • Create a Pipeline and PipelineResources to define your application's delivery pipeline
  • Create a PersistentVolumeClaim to provide the volume/filesystem for pipeline execution or provide a VolumeClaimTemplate which creates a PersistentVolumeClaim
  • Create a PipelineRun to instantiate and invoke the pipeline

For further details on pipeline concepts, refer to the Tekton documentation that provides an excellent guide for understanding various parameters and attributes available for defining pipelines.

The Tekton API enables functionality to be separated from configuration (e.g. Pipelines vs PipelineRuns) such that steps can be reusable.

Triggers extend the Tekton architecture with the following CRDs:

  • TriggerTemplate - Templates resources to be created (e.g. Create PipelineResources and PipelineRun that uses them)
  • TriggerBinding - Validates events and extracts payload fields
  • Trigger - combines TriggerTemplate, TriggerBindings and interceptors.
  • EventListener - provides an addressable endpoint (the event sink). Trigger is referenced inside the EventListener Spec. It uses the extracted event parameters from each TriggerBinding (and any supplied static parameters) to create the resources specified in the corresponding TriggerTemplate. It also optionally allows an external service to pre-process the event payload via the interceptor field.
  • ClusterTriggerBinding - A cluster-scoped TriggerBinding

Using tektoncd/triggers in conjunction with tektoncd/pipeline enables you to easily create full-fledged CI/CD systems where the execution is defined entirely through Kubernetes resources.

You can learn more about triggers by checking out the docs

In the following sections, you will go through each of the above steps to define and invoke a pipeline.

Install OpenShift Pipelines

OpenShift Pipelines is provided as an add-on on top of OpenShift that can be installed via an operator available in the OpenShift OperatorHub. Follow these instructions in order to install OpenShift Pipelines on OpenShift via the OperatorHub.

OpenShift OperatorHub

Deploy Sample Application

Create a project for the sample application that you will be using in this tutorial:

$ oc new-project pipelines-tutorial

OpenShift Pipelines automatically adds and configures a ServiceAccount named pipeline that has sufficient permissions to build and push an image. This service account will be used later in the tutorial.

Run the following command to see the pipeline service account:

$ oc get serviceaccount pipeline

You will use the simple application during this tutorial, which has a frontend and backend

You can also deploy the same applications by applying the artifacts available in k8s directory of the respective repo

If you deploy the application directly, you should be able to see the deployment in the OpenShift Web Console by switching over to the Developer perspective of the OpenShift Web Console. Change from Administrator to Developer from the drop down as shown below:

Developer Perspective

Make sure you are on the pipelines-tutorial project by selecting it from the Project dropdown menu. Either search for pipelines-tutorial in the search bar or scroll down until you find pipelines-tutorial and click on the name of your project.

Projects

Install Tasks

Tasks consist of a number of steps that are executed sequentially. Tasks are executed/run by creating TaskRuns. A TaskRun will schedule a Pod. Each step is executed in a separate container within the same pod. They can also have inputs and outputs in order to interact with other tasks in the pipeline.

Here is an example of a Maven task for building a Maven-based Java application:

apiVersion: tekton.dev/v1
kind: Task
metadata:
  name: maven-build
spec:
  workspaces:
   -name: filedrop
  steps:
  - name: build
    image: maven:3.6.0-jdk-8-slim
    command:
    - /usr/bin/mvn
    args:
    - install

When a task starts running, it starts a pod and runs each step sequentially in a separate container on the same pod. This task happens to have a single step, but tasks can have multiple steps, and, since they run within the same pod, they have access to the same volumes in order to cache files, access configmaps, secrets, etc. You can specify volume using workspace. It is recommended that Tasks uses at most one writeable Workspace. Workspace can be secret, pvc, config or emptyDir.

Note that only the requirement for a git repository is declared on the task and not a specific git repository to be used. That allows tasks to be reusable for multiple pipelines and purposes. You can find more examples of reusable tasks in the Tekton Catalog and OpenShift Catalog repositories.

Install the apply-manifests and update-deployment tasks from the repository using oc or kubectl, which you will need for creating a pipeline in the next section:

$ oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/01_pipeline/01_apply_manifest_task.yaml

$ oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/01_pipeline/02_update_deployment_task.yaml

You can take a look at the tasks you created using the Tekton CLI:

$ tkn task ls

NAME                AGE
apply-manifests     10 seconds ago
update-deployment   4 seconds ago

We will be using buildah clusterTasks, which gets installed along with Operator. Operator installs few ClusterTask which you can see.

$ tkn clustertasks ls
NAME                       DESCRIPTION   AGE
buildah                                  1 day ago
buildah-v0-14-3                          1 day ago
git-clone                                1 day ago
s2i-php                                  1 day ago
tkn                                      1 day ago

Create Pipeline

A pipeline defines a number of tasks that should be executed and how they interact with each other via their inputs and outputs.

In this tutorial, you will create a pipeline that takes the source code of the application from GitHub and then builds and deploys it on OpenShift.

Pipeline Diagram

Here is the YAML file that represents the above pipeline:

apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
  name: build-and-deploy
spec:
  workspaces:
  - name: shared-workspace
  params:
  - name: deployment-name
    type: string
    description: name of the deployment to be patched
  - name: git-url
    type: string
    description: url of the git repo for the code of deployment
  - name: git-revision
    type: string
    description: revision to be used from repo of the code for deployment
    default: master
  - name: IMAGE
    type: string
    description: image to be build from the code
  tasks:
  - name: fetch-repository
    taskRef:
      name: git-clone
      kind: ClusterTask
    workspaces:
    - name: output
      workspace: shared-workspace
    params:
    - name: url
      value: $(params.git-url)
    - name: subdirectory
      value: ""
    - name: deleteExisting
      value: "true"
    - name: revision
      value: $(params.git-revision)
  - name: build-image
    taskRef:
      name: buildah
      kind: ClusterTask
    params:
    - name: IMAGE
      value: $(params.IMAGE)
    workspaces:
    - name: source
      workspace: shared-workspace
    runAfter:
    - fetch-repository
  - name: apply-manifests
    taskRef:
      name: apply-manifests
    workspaces:
    - name: source
      workspace: shared-workspace
    runAfter:
    - build-image
  - name: update-deployment
    taskRef:
      name: update-deployment
    params:
    - name: deployment
      value: $(params.deployment-name)
    - name: IMAGE
      value: $(params.IMAGE)
    runAfter:
    - apply-manifests

Once you deploy the pipelines, you should be able to visualize pipeline flow in the OpenShift Web Console by switching over to the Developer perspective of the OpenShift Web Console. Select pipeline tab, select project as pipelines-tutorial and click on pipeline build-and-deploy

Pipeline-view

This pipeline helps you to build and deploy backend/frontend, by configuring right resources to pipeline.

Pipeline Steps:

  1. Clones the source code of the application from a git repository by referring (git-url and git-revision param)
  2. Builds the container image of application using the buildah clustertask that uses Buildah to build the image
  3. The application image is pushed to an image registry by refering (image param)
  4. The new application image is deployed on OpenShift using the apply-manifests and update-deployment tasks.

You might have noticed that there are no references to the git repository or the image registry it will be pushed to in pipeline. That's because pipeline in Tekton are designed to be generic and re-usable across environments and stages through the application's lifecycle. Pipelines abstract away the specifics of the git source repository and image to be produced as PipelineResources or Params. When triggering a pipeline, you can provide different git repositories and image registries to be used during pipeline execution. Be patient! You will do that in a little bit in the next section.

The execution order of tasks is determined by dependencies that are defined between the tasks via inputs and outputs as well as explicit orders that are defined via runAfter.

workspaces field allows you to specify one or more volumes that each Task in the Pipeline requires during execution. You specify one or more Workspaces in the workspaces field.

Create the pipeline by running the following:

$ oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/01_pipeline/04_pipeline.yaml

Alternatively, in the OpenShift Web Console, you can click on the + at the top right of the screen while you are in the pipelines-tutorial project:

OpenShift Console - Import Yaml

Upon creating the pipeline via the web console, you will be taken to a Pipeline Details page that gives an overview of the pipeline you created.

Check the list of pipelines you have created using the CLI:

$ tkn pipeline ls

NAME               AGE            LAST RUN   STARTED   DURATION   STATUS
build-and-deploy   1 minute ago   ---        ---       ---        ---

Trigger Pipeline

Now that the pipeline is created, you can trigger it to execute the tasks specified in the pipeline.

Note :-

If you are not into the pipelines-tutorial namespace, and using another namespace for the tutorial steps, please make sure you update the frontend and backend image resource to the correct url with your namespace name like so :

image-registry.openshift-image-registry.svc:5000/<namespace-name>/pipelines-vote-api:latest

A PipelineRun is how you can start a pipeline and tie it to the persistentVolumeClaim and params that should be used for this specific invocation.

Let's start a pipeline to build and deploy the backend application using tkn:

$ tkn pipeline start build-and-deploy \
    --prefix-name build-deploy-api-pipelinerun \
    -w name=shared-workspace,volumeClaimTemplateFile=https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/01_pipeline/03_persistent_volume_claim.yaml \
    -p deployment-name=pipelines-vote-api \
    -p git-url=https://github.com/openshift/pipelines-vote-api.git \
    -p IMAGE=image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/pipelines-vote-api \
    --use-param-defaults


Pipelinerun started: vote-api-t9tpq

In order to track the pipelinerun progress run:
tkn pipelinerun logs vote-api-t9tpq -f -n pipelines-tutorial

Similarly, start a pipeline to build and deploy the frontend application:

$ tkn pipeline start build-and-deploy \
    --prefix-name build-deploy-ui-pipelinerun \
    -w name=shared-workspace,volumeClaimTemplateFile=https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/01_pipeline/03_persistent_volume_claim.yaml \
    -p deployment-name=pipelines-vote-ui \
    -p git-url=https://github.com/openshift/pipelines-vote-ui.git \
    -p IMAGE=image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/pipelines-vote-ui \
    --use-param-defaults

PipelineRun started: vote-ui-9tb2q

In order to track the PipelineRun progress run:
tkn pipelinerun logs vote-ui-9tb2q -f -n pipelines-tutorial

As soon as you start the build-and-deploy pipeline, a pipelinerun will be instantiated and pods will be created to execute the tasks that are defined in the pipeline.

$ tkn pipeline list
NAME               AGE              LAST RUN        STARTED          DURATION   STATUS
build-and-deploy   10 minutes ago   vote-ui-9tb2q   47 seconds ago   ---        Running

Above we have started build-and-deploy pipeline, with relevant pipeline resources to deploy the backend/frontend applications using single pipeline

$ tkn pipelinerun ls
NAME             STARTED         DURATION   STATUS
vote-ui-9tb2q    1 minute ago    ---        Running
vote-api-t9tpq   1 minute ago    ---        Running

Check out the logs of the pipelinerun as it runs using the tkn pipeline logs command which interactively allows you to pick the pipelinerun of your interest and inspect the logs:

$ tkn pipeline logs -f
? Select pipelinerun:  [Use arrows to move, type to filter]
> vote-ui-9tb2q started 3 minutes ago
  vote-api-t9tpq started 7 minutes ago

After a few minutes, the pipeline should finish successfully.

$ tkn pipelinerun list
NAME             STARTED         DURATION   STATUS
vote-ui-9tb2q    1 minute ago    1m23s      Succeeded
vote-api-t9tpq   5 minutes ago   1m31s      Succeeded

Looking back at the project, you should see that the images are successfully built and deployed.

Application Deployed

You can get the route of the application by executing the following command and access the application

$ oc get route pipelines-vote-ui --template='http://{{.spec.host}}'

If you want to re-run the pipeline again, you can use the following short-hand command to rerun the last pipelinerun again that uses the same workspaces, params and service account used in the previous pipeline run:

$ tkn pipeline start build-and-deploy --last

Whenever there is any change to your repository we need to start the pipeline explicitly to see new changes take effect.

Triggers

Triggers in conjunction with pipelines enable us to hook our Pipelines to respond to external GitHub events (push events, pull requests etc).

Prerequisites

You need an OpenShift 4 cluster running on AWS, Azure or onprem in order to complete this tutorial. If you don't have an existing cluster, go to http://try.openshift.com and register for free in order to get an OpenShift 4 cluster up and running on AWS within minutes.

NOTE: Running cluster localy crc won't work, as we need webhook-url to be accessable to github-repos

Adding Triggers to our Application:

Now let’s add a TriggerTemplate, TriggerBinding, and an EventListener to our project.

Trigger Template

A TriggerTemplate is a resource that has parameters that can be substituted anywhere within the resources of a template.

The definition of our TriggerTemplate is given in 03_triggers/02-template.yaml.

apiVersion: triggers.tekton.dev/v1beta1
kind: TriggerTemplate
metadata:
  name: vote-app
spec:
  params:
  - name: git-repo-url
    description: The git repository url
  - name: git-revision
    description: The git revision
    default: master
  - name: git-repo-name
    description: The name of the deployment to be created / patched

  resourcetemplates:
  - apiVersion: tekton.dev/v1
    kind: PipelineRun
    metadata:
      generateName: build-deploy-$(tt.params.git-repo-name)-
    spec:
      taskRunTemplate:
        serviceAccountName: pipeline
      pipelineRef:
        name: build-and-deploy
      params:
      - name: deployment-name
        value: $(tt.params.git-repo-name)
      - name: git-url
        value: $(tt.params.git-repo-url)
      - name: git-revision
        value: $(tt.params.git-revision)
      - name: IMAGE
        value: image-registry.openshift-image-registry.svc:5000/$(context.pipelineRun.namespace)/$(tt.params.git-repo-name)
      workspaces:
      - name: shared-workspace
        volumeClaimTemplate:
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 500Mi

Run the following command to apply Triggertemplate.

$ oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/03_triggers/02_template.yaml

Trigger Binding

TriggerBindings is a map enable you to capture fields from an event and store them as parameters, and replace them in triggerTemplate whenever an event occurs.

The definition of our TriggerBinding is given in 03_triggers/01_binding.yaml.

apiVersion: triggers.tekton.dev/v1beta1
kind: TriggerBinding
metadata:
  name: vote-app
spec:
  params:
  - name: git-repo-url
    value: $(body.repository.url)
  - name: git-repo-name
    value: $(body.repository.name)
  - name: git-revision
    value: $(body.head_commit.id)

The exact paths (keys) of the parameters we need can be found by examining the event payload (eg: GitHub events).

Run the following command to apply TriggerBinding.

$ oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/03_triggers/01_binding.yaml

Trigger

Trigger combines TriggerTemplate, TriggerBindings and interceptors. They are used as ref inside the EventListener.

The definition of our Trigger is given in 03_triggers/03_trigger.yaml.

apiVersion: triggers.tekton.dev/v1beta1
kind: Trigger
metadata:
  name: vote-trigger
spec:
  serviceAccountName: pipeline
  interceptors:
    - ref:
        name: "github"
      params:
        - name: "secretRef"
          value:
            secretName: github-secret
            secretKey: secretToken
        - name: "eventTypes"
          value: ["push"]
  bindings:
    - ref: vote-app
  template:
    ref: vote-app

The secret is to verify events are coming from the correct source code management.

---
apiVersion: v1
kind: Secret
metadata:
  name: github-secret
type: Opaque
stringData:
  secretToken: "1234567"

Run the following command to apply Trigger.

$ oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/03_triggers/03_trigger.yaml

Event Listener

This component sets up a Service and listens for events. It also connects a TriggerTemplate to a TriggerBinding, into an addressable endpoint (the event sink)

The definition for our EventListener can be found in 03_triggers/04_event_listener.yaml.

apiVersion: triggers.tekton.dev/v1beta1
kind: EventListener
metadata:
  name: vote-app
spec:
  serviceAccountName: pipeline
  triggers:
    - triggerRef: vote-trigger
  • Run the following command to create EventListener.
$ oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/03_triggers/04_event_listener.yaml

Note: EventListener will setup a Service. We need to expose that Service as an OpenShift Route to make it publicly accessible.

  • Run the below command to expose the EventListener service as a route
$ oc expose svc el-vote-app

Configuring GitHub WebHooks

Now we need to configure webhook-url on backend and frontend source code repositories with the Route we exposed previously.

  • Run the below command to get webhook-url
$ echo "URL: $(oc  get route el-vote-app --template='http://{{.spec.host}}')"

Note:

Fork the backend and frontend source code repositories so that you have sufficient privileges to configure GitHub webhooks.

Configure webhook manually

Open the forked GitHub repo (Go to Settings > Webhook). Click on Add Webhook > Add

$ echo "$(oc  get route el-vote-app --template='http://{{.spec.host}}')"

to payload URL > Select Content type as application/json > Add secret eg: 1234567 > Click on Add Webhook

Add webhook

  • Follow the above procedure to configure the webhook on frontend repo

Now we should see a webhook configured on your forked source code repositories (on our GitHub Repo, go to Settings>Webhooks).

Webhook-final

Great!, We have configured webhooks

Trigger pipeline Run

When we perform any push event on the backend the following should happen.

  1. The configured webhook in vote-api GitHub repository should push the event payload to our route (exposed EventListener Service).

  2. The Event-Listener will pass the event to the TriggerBinding and TriggerTemplate pair.

  3. TriggerBinding will extract parameters needed for rendering the TriggerTemplate. Successful rendering of TriggerTemplate should create 2 PipelineResources (source-repo-vote-api and image-source-vote-api) and a PipelineRun (build-deploy-vote-api)

We can test this by pushing a commit to vote-api repository from GitHub web ui or from the terminal.

Let’s push an empty commit to vote-api repository.

$ git commit -m "empty-commit" --allow-empty && git push origin master
...
Writing objects: 100% (1/1), 190 bytes | 190.00 KiB/s, done.
Total 1 (delta 0), reused 0 (delta 0)
To github.com:<github-username>/pipelines-vote-api.git
   72c14bb..97d3115  master -> master

Watch the OpenShift WebConsole Developer perspective and a PipelineRun will be automatically created.

pipeline-run-api

pipelines-tutorial's People

Contributors

buildbricks avatar chmouel avatar danielhelfand avatar east4ming avatar jkandasa avatar joellord avatar khrm avatar marcoportillo avatar openshift-ci[bot] avatar openshift-merge-bot[bot] avatar openshift-merge-robot avatar piyush-garg avatar ppitonak avatar praveen4g0 avatar rbaumgar avatar samueltauil avatar savitaashture avatar siamaksade avatar sthaha avatar sudhishmk avatar thrasher-redhat avatar vdemeester avatar veeresharadhya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pipelines-tutorial's Issues

Build Trigger when commiting change to git fails

I am trying this tutorial, step by step, I did it all, my problem is that my project have a diferent namespace and not "pipelines-tutorial", I don't want to use this name, because I am already using this for a real project. I did change it when I added the PipelineRun:

image-registry.openshift-image-registry.svc:5000/<namespace-name>/vote-api:latest

and all the other steps run well. The problem is when I commit changes and try it to build it, it throws me this error:

image

what I can see here is that is using image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/vote-api:latest instead of my real namespace project, and already change it in all my other yaml files, I also checked the Dockerfile in both project (Vote-ui and Vote-api) and there is not pipelines-tutorial anywhere.

I also have this:

image

it is using the default pipelines-tutorial by default even if I changed it all. Maybe is there a place I forgot? I am very beginner with CD/CI, Docker.

Can you help me with this?

json: unknown field "volumeClaimTemplate"

Following the demo on IBM Cloud ROKS. Not sure where to go. Are there logs that could provide more detail?

[f*****@localhost ~]$ tkn pipeline start build-and-deploy
-w name=shared-workspace,volumeClaimTemplateFile=https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/01_pipeline/03_persistent_volume_claim.yaml
-p deployment-name=vote-api
-p git-url=http://github.com/openshift-pipelines/vote-api.git
-p IMAGE=image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/vote-api \

Error: admission webhook "webhook.pipeline.tekton.dev" denied the request: mutation failed: cannot decode incoming new object: json: unknown field "volumeClaimTemplate"`

OpenShift version 4.4.20

tkn version
Client version: 0.11.0
Pipeline version: v0.11.3
Triggers version: v0.4.0

oc version
Client Version: 4.5.0-202005291417-9933eb9
Server Version: 4.4.20
Kubernetes Version: v1.17.1+6af3663

Tutorial pipeline fails at update-deployment step

Details

There isn't much info in the logs, but below is all I was able to find when looking through the pipelinerun yaml.

build-and-deploy-run-kw27h-update-deployment-2nnxc:
      pipelineTaskName: update-deployment
      status:
        conditions:
          - lastTransitionTime: '2020-10-02T18:53:52Z'
            message: >-
              bound workspaces did not match declared workspaces: provided extra
              values: [source]
            reason: TaskRunValidationFailed
            status: 'False'
            type: Succeeded
        podName: ''
        startTime: '2020-10-02T18:53:52Z'

I followed the pipelines tutorial on the openshift docs exactly, but I'm still running into this error.

Below is the command I'm running to start the pipelinerun, as written in the docs:
tkn pipeline start build-and-deploy -w name=shared-workspace,claimName=source-pvc -p deployment-name=vote-api -p git-url=http://github.com/openshift-pipelines/vote-api.git -p IMAGE=image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/vote-api

Any help would be appreciated. Thanks!

cluster proxy settings not being used

Following the tutorial, this fails at the git clone step. I suspect the proxy settings aren't being applied during the build.

[build-ui : git-source-ui-repo-r28v5] {"level":"error","ts":1581440334.8529313,"logger":"fallback-logger","caller":"git/git.go:40","msg":"Error running git [fetch --depth=1 --recurse-submodules=yes origin master]: exit status 128\nfatal: unable to access 'http://github.com/openshift-pipelines/vote-ui.git/': Failed connect to github.com:80; Connection timed out\n","stacktrace":"github.com/tektoncd/pipeline/pkg/git.run\n\t/go/src/github.com/tektoncd/pipeline/pkg/git/git.go:40\ngithub.com/tektoncd/pipeline/pkg/git.Fetch\n\t/go/src/github.com/tektoncd/pipeline/pkg/git/git.go:91\nmain.main\n\t/go/src/github.com/tektoncd/pipeline/cmd/git-init/main.go:39\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:198"}

# oc version
Client Version: v4.2.15
Server Version: 4.2.16
Kubernetes Version: v1.14.6+8bbaf43

no matches for kind "Task" in version "tekton.dev/v1alpha1"

Hi,

I am not able to complete the tutorial with an error related with the task deployment. I am not sure yet what dependency I'm missing, so thought of raising an issue for it:

joalmaraz$ oc create -f https://raw.githubusercontent.com/tektoncd/catalog/master/openshift-client/openshift-client-task.yaml
error: unable to recognize "https://raw.githubusercontent.com/tektoncd/catalog/master/openshift-client/openshift-client-task.yaml": no matches for kind "Task" in version "tekton.dev/v1alpha1"

Or locally referenced:

pipelines-tutorial joalmaraz$ oc create -f openshift-client-task.yaml
error: unable to recognize "openshift-client-task.yaml": no matches for kind "Task" in version "tekton.dev/v1alpha1"

joalmaraz$ oc version
oc v3.11.0+0cbc58b
kubernetes v1.11.0+d4cacc0
features: Basic-Auth

Server https://****:6443
kubernetes v1.14.0+42b6806

Version | State | Started | Completed
4.2.0-0.okd-2019-06-16-213454 | Completed | Jun 17, 10:11 am | Jun 17, 10:31 am

Operator is installed:

image

Thanks.

Jose

Error in PipelineRun

tkn pipeline start build-and-deploy
-w name=shared-workspace,claimName=source-pvc
-p deployment-name=vote-api
-p git-url=http://github.com/openshift-pipelines/vote-api.git
-p IMAGE=image-registry.openshift-image-registry.svc:5000/myproject/vote-api

TypeError
Description:

n is undefined
Component Trace:

in Unknown
in div
in div
in div

6431/t.a@https://console-openshift-console.apps-crc.testing/static/pipelinerun-details-chunk-ee0c16b8da458300f498.min.js:1:175890
Fo@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:136:55337
Ks@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:136:98261
Bs@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:136:84008
Ns@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:136:81035
Ds@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:136:79608
di/<@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:136:41759
t.unstable_runWithPriority@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:144:3878
li@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:136:41488
di@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:136:41705
pi@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:136:41640
Is@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:136:79935
notify@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:23:75933
a</t.notifyNestedSubs@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:23:75503
f</n.notifySubscribers@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:65:2428
a</t.handleChangeWrapper@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:23:75571
v@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:17:122529
b/</</<@https://console-openshift-console.apps-crc.testing/static/main-chunk-dbccb664872199d7c81d.min.js:1:89823
dispatch@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:17:126016
l/<@https://console-openshift-console.apps-crc.testing/static/main-chunk-dbccb664872199d7c81d.min.js:1:84211
a@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:120:167477
k/<@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:120:167599
l@https://console-openshift-console.apps-crc.testing/static/vendors~main-chunk-5d16dae3ac38abab85aa.min.js:120:170236

Trigger Pipeline fails

Trying this tutorial on Openshift 4.4 environment. In the Trigger pipeline section, when tried to run this command it throws error

tkn pipeline start build-and-deploy -w name=shared-workspace, volumeClaimTemplateFile=https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/01_pipeline/03_persistent_volume_claim.yaml -p deployment-name=vote-api -p git-url=http://github.com/openshift-pipelines/vote-api.git -p IMAGE=image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/vote-api

Error: admission webhook "webhook.pipeline.tekton.dev" denied the request: mutation failed: cannot decode incoming new object: json: unknown field "volumeClaimTemplate"

Am I missing something here?
(Webhook content comes below this section in the tutorial)

Liveness and Readiness Probes Fail for Spring Petclinic Sample App

Following the steps in this tutorial and after implementing the workaround in #6, the Spring Petclinic sample app gets into a CrashLoopBackOff with the following errors:

FailedScheduling:

Warning  FailedScheduling  5m3s                   default-scheduler                      Binding rejected: Operation cannot be fulfilled on pods/binding "spring-petclinic-1-x2sct": pod spring-petclinic-1-x2sct is already assigned to node "ip-10-0-142-204.ec2.internal"

Liveness and Readiness Probe Issues:

Warning  Unhealthy         5s (x4 over 35s)   kubelet, ip-10-0-142-204.ec2.internal  Readiness probe failed: Get http://10.130.2.56:8080/: dial tcp 10.130.2.56:8080: connect: connection refused
Warning  Unhealthy         4s (x4 over 34s)   kubelet, ip-10-0-142-204.ec2.internal  Liveness probe failed: Get http://10.130.2.56:8080/: dial tcp 10.130.2.56:8080: connect: connection refused

Disabling the Liveness and Readiness probes in petclinic.yaml allows the application to successfully deploy through the example pipeline.

Build error in step update-ui-image

Hi all,
tested on Openshift CRC 4.2.13

getting this error

web console:

update-ui-image

step-patch
Error from server (NotFound): deployments.extensions "ui" not found

command line:
....
[build-ui : image-digest-exporter-grtqg] {"level":"warn","ts":1579104550.7637124,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: "KO_DATA_PATH" does not exist or is empty"}
[build-ui : image-digest-exporter-grtqg] {"level":"info","ts":1579104550.7639525,"logger":"fallback-logger","caller":"imagedigestexporter/main.go:58","msg":"ImageResource api-image doesn't have an index.json file: stat /builder/home/image-outputs/image/index.json: no such file or directory"}

[apply-ui-manifests : git-source-api-repo-bgr9t] {"level":"warn","ts":1579104566.547371,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: "KO_DATA_PATH" does not exist or is empty"}
[apply-ui-manifests : git-source-api-repo-bgr9t] {"level":"info","ts":1579104569.0245762,"logger":"fallback-logger","caller":"git/git.go:103","msg":"Successfully cloned http://github.com/openshift-pipelines/vote-api.git @ master in path /workspace/source"}

[apply-ui-manifests : apply] Applying manifests in k8s directory
[apply-ui-manifests : apply] deployment.apps/api configured
[apply-ui-manifests : apply] service/api unchanged
[apply-ui-manifests : apply] -----------------------------------

[update-ui-image : patch] Error from server (NotFound): deployments.extensions "ui" not found

failed to get logs for task update-ui-image : container step-patch has failed

Provide example usage that uses Deployment (instead of DeploymentConfig)

It would be nice to have an example that uses a Deployment instead of a DeploymentConfig. The openshift 4.x documentation states:

It is recommended to use Deployments unless you need a specific feature or behavior provided by DeploymentConfigs footnote:[https://docs.openshift.com/container-platform/4.2/applications/deployments/what-deployments-are.html]. Deployments do not support (yet) automatically rolling back to the last successfully deployed ReplicaSet in case of a failure.

Does openshift pipelines requires the usage of DeploymentConfig ?

Pipeline is running fine with all tasks - but it is not creating a route/frontend app

Hi,

I'm using Openshift 4.5.11.

After creating the pipeline successfully I switched to the "Developer" Console to take a look into the "Topolopgy View" to figure that both Images image/apps have been deployed - but I see only the "API". It' did not create the frontend App with the route.

I can re-run the the pipeline with "tkn pipeline start build-and-deploy --last" over and over with out any errors but yet, no route/front end app.

Any Idea?
Thanks!

topology_view

no matches for kind "Trigger" in version "triggers.tekton.dev/v1alpha1" with OCP 4.5.11

Morning,

my second Issue I did recognize after creating the trigger-template and the trigger-binding (which have been successful).
Always with trying apply the "trigger" yaml file I get the follow error message:

"error: unable to recognize "03_trigger.yaml": no matches for kind "Trigger" in version "triggers.tekton.dev/v1alpha1""

YAML Content:

apiVersion: triggers.tekton.dev/v1alpha1
kind: Trigger
metadata:
name: vote-trigger
spec:
serviceAccountName: pipeline
bindings:

  • ref: vote-app
    template:
    name: vote-app

I did try out a couple of hints and clues in the GIT articles, without being successful yet.

TA
Wolfgang

WebUI Error after Trigger Creation

OCP Version: 4.6.12
Openshift Pipelines Version: 1.2.3
Tekton Pipelines: v0.16.3
Tekton Triggers: v0.8.1
ClusterTasks based on Tekton Catalog 0.16

I followed the tutorial step by step. After creation of the "Event Listener" an Error on the WebUI occoured.
Clicking on the menu "Pipelines" as well as the menu "Triggers" raise the problem repeatably. The WebUI completely blanks when using the mentioned menus.

Error in developer console:
vendorsmain-chunk-097f186a6bd6062a5833.min.js:159202 TypeError: Cannot read property 'name' of undefined
at admin-pipeline
admin-tasks~pipeline-builder-edit-page~pipeline-builder-page~pipeline-details~pipeli~8d3f0553-chunk-108e39123867785f9969.min.js:1 at Array.map (<anonymous>) at b (admin-pipeline~admin-taskspipeline-builder-edit-pagepipeline-builder-pagepipeline-detailspipeli8d3f0553-chunk-108e39123867785f9969.min.js:1)
at Array.map ()
at admin-pipeline
admin-tasks~pipeline-builder-edit-page~pipeline-builder-page~pipeline-details~pipeli~8d3f0553-chunk-108e39123867785f9969.min.js:1 at Object.useMemo (vendors~main-chunk-097f186a6bd6062a5833.min.js:159202) at Object.useMemo (vendors~main-chunk-097f186a6bd6062a5833.min.js:159167) at v (admin-pipeline~admin-taskspipeline-builder-edit-pagepipeline-builder-pagepipeline-detailspipeli8d3f0553-chunk-108e39123867785f9969.min.js:1)
at a.a (admin-pipeline-chunk-ba2b32ed7673e4d4b4f6.min.js:1)
at No (vendors
main-chunk-097f186a6bd6062a5833.min.js:159202)

webui_error

How to load SSL CA bundle certificate when doing git pull

Hello,

We are betting the following error when trying to pull from our private git repository

{"level":"error","ts":1587756144.758596,"logger":"fallback-logger","caller":"git/git.go:41","msg":"Error running git [fetch --recurse-submodules=yes --depth=1 origin master]: exit status 128\nfatal: unable to access 'https://gitlab.company.com/machine-shop/insight.git/': Peer's Certificate issuer is not recognized.\n","stacktrace":"github.com/tektoncd/pipeline/pkg/git.run\n\t/go/src/github.com/tektoncd/pipeline/pkg/git/git.go:41\ngithub.com/tektoncd/pipeline/pkg/git.Fetch\n\t/go/src/github.com/tektoncd/pipeline/pkg/git/git.go:90\nmain.main\n\t/go/src/github.com/tektoncd/pipeline/cmd/git-init/main.go:51\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:203"}

Running pipeline-tutorial on openshift 4.3.1

OpenShift Version
4.3.1
Installed
openshift-pipelines-operator.v0.10.7

on ibm cloud

when I follow this example

pipeline-tutorial

after started the pipeline run, when I try to get the logs

[build-ui : build] STEP 2: LABEL "io.openshift.s2i.build.image"="registry.access.redhat.com/rhscl/python-36-rhel7" "io.openshift.s2i.build.source-location"="."
[build-ui : build] error building at STEP "LABEL "io.openshift.s2i.build.image" "registry.access.redhat.com/rhscl/python-36-rhel7" "io.openshift.s2i.build.source-location" "."": error ensuring container path "/opt/app-root/src": lstat /var/lib/containers/storage/overlay/262cf5f36861100bf27c9eb5f9baa42f2471984ee129a5f1dd901d81cf3d4cbd/merged/opt: invalid argument

failed to get logs for task build-ui : container step-build has failed : [{"name":"","digest":"","key":"StartedAt","value":"2020-03-18T05:00:49Z","resourceRef":{}}]`

the detail logs:
`tkn pipelinerun logs build-and-deploy-run-wcp2z -f -n pipelines-tutorial
(base) Qianyangs-MBP:kevin-openshift-v4 qianyangyu$ tkn pipeline list
NAME AGE LAST RUN STARTED DURATION STATUS
build-and-deploy 18 minutes ago build-and-deploy-run-wcp2z 1 minute ago --- Running
(base) Qianyangs-MBP:kevin-openshift-v4 qianyangyu$ tkn pipeline logs -f
....

[build-api : git-source-api-repo-zjvxx] {"level":"info","ts":1584507618.453761,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: "KO_DATA_PATH" does not exist or is empty"}
[build-api : git-source-api-repo-zjvxx] {"level":"info","ts":1584507646.4758844,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: "KO_DATA_PATH" does not exist or is empty"}
[build-api : git-source-api-repo-zjvxx] {"level":"info","ts":1584507648.5243325,"logger":"fallback-logger","caller":"git/git.go:102","msg":"Successfully cloned http://github.com/openshift-pipelines/vote-api.git @ master in path /workspace/source"}
[build-api : git-source-api-repo-zjvxx] {"level":"warn","ts":1584507648.5244727,"logger":"fallback-logger","caller":"git/git.go:149","msg":"Unexpected error: creating symlink: symlink /tekton/home/.ssh /root/.ssh: file exists"}
[build-api : git-source-api-repo-zjvxx] {"level":"info","ts":1584507648.6062376,"logger":"fallback-logger","caller":"git/git.go:130","msg":"Successfully initialized and updated submodules in path /workspace/source"}

[build-ui : generate] {"level":"info","ts":1584507622.4569638,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: "KO_DATA_PATH" does not exist or is empty"}
[build-ui : generate] Application dockerfile generated in /gen-source/Dockerfile.gen

[build-api : build] {"level":"info","ts":1584507632.1757002,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: "KO_DATA_PATH" does not exist or is empty"}
[build-api : build] STEP 1: FROM golang:alpine AS builder
[build-api : build] Getting image source signatures
[build-api : build] Copying blob sha256:d909eff282003e2d64af08633f4ae58f8cab4efc0a83b86579b4bbcb0ac90956
[build-api : build] Copying blob sha256:cbb0d8da1b304e1b4f86e0a2fb11185850170e41986ce261dc30ac043c6a4e55
[build-api : build] Copying blob sha256:a50ef8b76e536c1f848f61399fe1e8721531496a1a3501124e2b24f4677f0cd0
[build-api : build] Copying blob sha256:c9b1b535fdd91a9855fb7f82348177e5f019329a58c53c47272962dd60f71fc9
[build-api : build] Copying blob sha256:8b9d9d6824f5457e80af26521acf1c1e52493e7a72889d778eb9bcc5f7eb68c4
[build-api : build] Copying config sha256:51e47ee4db586c983e61a925bea3b7b08f2d7b95718e3bd3fac3da97c1c6325f
[build-api : build] Writing manifest to image destination
[build-api : build] Storing signatures
[build-api : build] STEP 2: WORKDIR /build
[build-api : build] 4b4d17ba12c7cfe122a9b3ed8a5a3687a280d6761547aee55586251584af5321
[build-api : build] STEP 3: ADD . /build/
[build-api : build] 2cb4b995b852e4f1aa3a2fa736d64ad88c8c6b668c53a9b5903f70cf9bf45ce2
[build-api : build] STEP 4: RUN GOOS=linux GARCH=amd64 CGO_ENABLED=0 go build -mod=vendor -o api-server .
[build-ui : build] {"level":"info","ts":1584507640.7401912,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: "KO_DATA_PATH" does not exist or is empty"}
[build-ui : build] STEP 1: FROM registry.access.redhat.com/rhscl/python-36-rhel7
[build-ui : build] Getting image source signatures
[build-ui : build] Copying blob sha256:6a4fa4bc2d06e942c0e92d69614b4ee30c2d409c95f29a3a22ece8087ce164be
[build-ui : build] Copying blob sha256:455ea8ab06218495bbbcb14b750a0d644897b24f8c5dcf9e8698e27882583412
[build-ui : build] Copying blob sha256:bb13d92caffa705f32b8a7f9f661e07ddede310c6ccfa78fb53a49539740e29b
[build-ui : build] Copying blob sha256:c8106f599d69375cbfc2ef44b11812ddc33938ab1e94860b02c262118f837611
[build-ui : build] Copying blob sha256:84e620d0abe585d05a7bed55144af0bc5efe083aed05eac1e88922034ddf1ed2
[build-ui : build] Copying config sha256:3c93c53ba3715f62aad12366410a1cd57957c39f573c0681807000d12f3cccdc
[build-ui : build] Writing manifest to image destination
[build-ui : build] Storing signatures
[build-ui : build] STEP 2: LABEL "io.openshift.s2i.build.image"="registry.access.redhat.com/rhscl/python-36-rhel7" "io.openshift.s2i.build.source-location"="."
[build-ui : build] error building at STEP "LABEL "io.openshift.s2i.build.image" "registry.access.redhat.com/rhscl/python-36-rhel7" "io.openshift.s2i.build.source-location" "."": error ensuring container path "/opt/app-root/src": lstat /var/lib/containers/storage/overlay/262cf5f36861100bf27c9eb5f9baa42f2471984ee129a5f1dd901d81cf3d4cbd/merged/opt: invalid argument

failed to get logs for task build-ui : container step-build has failed : [{"name":"","digest":"","key":"StartedAt","value":"2020-03-18T05:00:49Z","resourceRef":{}}]
[build-api : build] f72f609911547c6bf2364e63cf786987cd7189c74d787d585d659284b7feba77
[build-api : build] STEP 5: FROM scratch
[build-api : build] STEP 6: WORKDIR /app

a related issue

build-step failure

When triggering the pipeline, I am encountering the following issue:

[build : build-step-git-source-petclinic-git-4wq7q] {"level":"warn","ts":1564963582.9377377,"logger":"fallback-logger","caller":"logging/config.go:65","msg":"Fetch GitHub commit ID from kodata failed: "KO_DATA_PATH" does not exist or is empty"}
[build : build-step-git-source-petclinic-git-4wq7q] {"level":"info","ts":1564963583.5528753,"logger":"fallback-logger","caller":"git/git.go:102","msg":"Successfully cloned https://github.com/spring-projects/spring-petclinic @ master in path /workspace/source"}

[build : build-step-generate] Application dockerfile generated in /gen-source/Dockerfile.gen

[build : build-step-image-digest-exporter-generate-l2bw2] []

[build : build-step-build] STEP 1: FROM registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift
[build : build-step-build] Getting image source signatures
[build : build-step-build] Copying blob sha256:5c2598df456066d90ae3ed81592c54247800071c7ee8845985a93db7e95e936f
[build : build-step-build] Copying blob sha256:dc4e07da33bca48edefbcba8dadefa8e7ffc6fe3e8ee4db140600a62862a16ac
[build : build-step-build] Copying blob sha256:50408d34b7db1a7cac449215c8bf82b020a4e61bd542f66a8766b4804f3882fe
[build : build-step-build] Copying config sha256:b1a978b29b74ee26fe1adf1c95a533cf56c815b87f9a742fac28ce493f9fc894
[build : build-step-build] Writing manifest to image destination
[build : build-step-build] Storing signatures
[build : build-step-build] STEP 2: LABEL "io.openshift.s2i.build.image"="registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift" "io.openshift.s2i.build.source-location"="."
[build : build-step-build] 8b2b389b626d89517df954c54d3715dce9d066c482e1580e85ce2c7938d25017
[build : build-step-build] STEP 3: USER root
[build : build-step-build] 4f804bba78e994166483a49012491687e9be8cd785085ac152105dcf86bd2278
[build : build-step-build] STEP 4: COPY upload/src /tmp/src
[build : build-step-build] error building at STEP "COPY upload/src /tmp/src": no files found matching "/workspace/upload/src": no such file or directory

failed to get logs for task build : container build-step-build has failed : Error

Tutorial throws error

When running the tutorial, I'm getting this error in v0.10.7:
`
tkn pr describe build-and-deploy-ex8xsq
Name: build-and-deploy-ex8xsq
Namespace: pipelines-tutorial
Pipeline Ref: build-and-deploy
Service Account: pipeline
Timeout: 1h0m0s
Labels:
tekton.dev/pipeline=build-and-deploy

Status

STARTED DURATION STATUS
3 minutes ago 0 seconds Failed(PipelineValidationFailed)

Message

invalid input resources: TaskRun's declared resources didn't match usage in Task: [source]
`

Pipeline run fails with PVC issue

I set up the tutorial pipeline on OCP 4.2 using the provided instructions. Afterwards, the pipeline looks as expected, with all checks returning the expected results.
When I run the pipline though, the run fails, because a PVC cannot be bound to a PV:

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: petclinic-deploy-pipeline-run-nl62q-pvc
namespace: pipelines-tutorial
selfLink: >-
/api/v1/namespaces/pipelines-tutorial/persistentvolumeclaims/petclinic-deploy-pipeline-run-nl62q-pvc
uid: 41bae36f-104a-11ea-8e86-00000a10063b
resourceVersion: '5774327'
creationTimestamp: '2019-11-26T12:42:50Z'
ownerReferences:
- apiVersion: tekton.dev/v1alpha1
kind: PipelineRun
name: petclinic-deploy-pipeline-run-nl62q
uid: 41b42f70-104a-11ea-b7cb-00000a10063a
controller: true
blockOwnerDeletion: true
finalizers:
- kubernetes.io/pvc-protection
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
volumeMode: Filesystem
status:
phase: Pending

Error event:
PVCpetclinic-deploy-pipeline-run-nl62q-pvc
NamespaceNSpipelines-tutorial
Nov 26, 1:47 pm
Generated from persistentvolume-controller
19 times in the last 4 minutes
no persistent volumes available for this claim and no storage class is set

I created a PV beforehand to service the PVC bind (no storageClass, volume mode Filesystem), but it doesn't get used:

kind: PersistentVolume
apiVersion: v1
metadata:
name: pipeline-storage
selfLink: /api/v1/persistentvolumes/pipeline-storage
uid: 02156811-102a-11ea-b7cb-00000a10063a
resourceVersion: '5772668'
creationTimestamp: '2019-11-26T08:51:59Z'
finalizers:
- kubernetes.io/pv-protection
spec:
capacity:
storage: 5Gi
nfs:
server: 10.16.4.176
path: /data
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Recycle
volumeMode: Filesystem
status:
phase: Available

How can I get this resolved?

Ability to burst builds into cloud as capacity becomes limited

Alternative tools such as CloudBees have a central operations manager that controls where to schedule builds. As an on-premise cluster reaches capacity the operations manager is able to target builds to an alternative on a scale public cloud cluster. While Tekton tasks can be directed to a specific target, is there a way to have the target be controlled by the build queue depth, cluster capacity, etc?

failed to run pipeline-tutorial on openshift 4.3.1

OpenShift Version
4.3.1
Installed
openshift-pipelines-operator.v0.10.7

on ibm cloud

when I follow this example

pipeline-tutorial

after started the pipeline run, when I try to get the logs

`[build-ui : build] STEP 2: LABEL "io.openshift.s2i.build.image"="registry.access.redhat.com/rhscl/python-36-rhel7" "io.openshift.s2i.build.source-location"="."
[build-ui : build] error building at STEP "LABEL "io.openshift.s2i.build.image" "registry.access.redhat.com/rhscl/python-36-rhel7" "io.openshift.s2i.build.source-location" "."": error ensuring container path "/opt/app-root/src": lstat /var/lib/containers/storage/overlay/262cf5f36861100bf27c9eb5f9baa42f2471984ee129a5f1dd901d81cf3d4cbd/merged/opt: invalid argument

failed to get logs for task build-ui : container step-build has failed : [{"name":"","digest":"","key":"StartedAt","value":"2020-03-18T05:00:49Z","resourceRef":{}}]`

the detail logs:
`tkn pipelinerun logs build-and-deploy-run-wcp2z -f -n pipelines-tutorial
(base) Qianyangs-MBP:kevin-openshift-v4 qianyangyu$ tkn pipeline list
NAME AGE LAST RUN STARTED DURATION STATUS
build-and-deploy 18 minutes ago build-and-deploy-run-wcp2z 1 minute ago --- Running
(base) Qianyangs-MBP:kevin-openshift-v4 qianyangyu$ tkn pipeline logs -f
....

[build-api : git-source-api-repo-zjvxx] {"level":"info","ts":1584507618.453761,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: "KO_DATA_PATH" does not exist or is empty"}
[build-api : git-source-api-repo-zjvxx] {"level":"info","ts":1584507646.4758844,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: "KO_DATA_PATH" does not exist or is empty"}
[build-api : git-source-api-repo-zjvxx] {"level":"info","ts":1584507648.5243325,"logger":"fallback-logger","caller":"git/git.go:102","msg":"Successfully cloned http://github.com/openshift-pipelines/vote-api.git @ master in path /workspace/source"}
[build-api : git-source-api-repo-zjvxx] {"level":"warn","ts":1584507648.5244727,"logger":"fallback-logger","caller":"git/git.go:149","msg":"Unexpected error: creating symlink: symlink /tekton/home/.ssh /root/.ssh: file exists"}
[build-api : git-source-api-repo-zjvxx] {"level":"info","ts":1584507648.6062376,"logger":"fallback-logger","caller":"git/git.go:130","msg":"Successfully initialized and updated submodules in path /workspace/source"}

[build-ui : generate] {"level":"info","ts":1584507622.4569638,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: "KO_DATA_PATH" does not exist or is empty"}
[build-ui : generate] Application dockerfile generated in /gen-source/Dockerfile.gen

[build-api : build] {"level":"info","ts":1584507632.1757002,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: "KO_DATA_PATH" does not exist or is empty"}
[build-api : build] STEP 1: FROM golang:alpine AS builder
[build-api : build] Getting image source signatures
[build-api : build] Copying blob sha256:d909eff282003e2d64af08633f4ae58f8cab4efc0a83b86579b4bbcb0ac90956
[build-api : build] Copying blob sha256:cbb0d8da1b304e1b4f86e0a2fb11185850170e41986ce261dc30ac043c6a4e55
[build-api : build] Copying blob sha256:a50ef8b76e536c1f848f61399fe1e8721531496a1a3501124e2b24f4677f0cd0
[build-api : build] Copying blob sha256:c9b1b535fdd91a9855fb7f82348177e5f019329a58c53c47272962dd60f71fc9
[build-api : build] Copying blob sha256:8b9d9d6824f5457e80af26521acf1c1e52493e7a72889d778eb9bcc5f7eb68c4
[build-api : build] Copying config sha256:51e47ee4db586c983e61a925bea3b7b08f2d7b95718e3bd3fac3da97c1c6325f
[build-api : build] Writing manifest to image destination
[build-api : build] Storing signatures
[build-api : build] STEP 2: WORKDIR /build
[build-api : build] 4b4d17ba12c7cfe122a9b3ed8a5a3687a280d6761547aee55586251584af5321
[build-api : build] STEP 3: ADD . /build/
[build-api : build] 2cb4b995b852e4f1aa3a2fa736d64ad88c8c6b668c53a9b5903f70cf9bf45ce2
[build-api : build] STEP 4: RUN GOOS=linux GARCH=amd64 CGO_ENABLED=0 go build -mod=vendor -o api-server .
[build-ui : build] {"level":"info","ts":1584507640.7401912,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: "KO_DATA_PATH" does not exist or is empty"}
[build-ui : build] STEP 1: FROM registry.access.redhat.com/rhscl/python-36-rhel7
[build-ui : build] Getting image source signatures
[build-ui : build] Copying blob sha256:6a4fa4bc2d06e942c0e92d69614b4ee30c2d409c95f29a3a22ece8087ce164be
[build-ui : build] Copying blob sha256:455ea8ab06218495bbbcb14b750a0d644897b24f8c5dcf9e8698e27882583412
[build-ui : build] Copying blob sha256:bb13d92caffa705f32b8a7f9f661e07ddede310c6ccfa78fb53a49539740e29b
[build-ui : build] Copying blob sha256:c8106f599d69375cbfc2ef44b11812ddc33938ab1e94860b02c262118f837611
[build-ui : build] Copying blob sha256:84e620d0abe585d05a7bed55144af0bc5efe083aed05eac1e88922034ddf1ed2
[build-ui : build] Copying config sha256:3c93c53ba3715f62aad12366410a1cd57957c39f573c0681807000d12f3cccdc
[build-ui : build] Writing manifest to image destination
[build-ui : build] Storing signatures
[build-ui : build] STEP 2: LABEL "io.openshift.s2i.build.image"="registry.access.redhat.com/rhscl/python-36-rhel7" "io.openshift.s2i.build.source-location"="."
[build-ui : build] error building at STEP "LABEL "io.openshift.s2i.build.image" "registry.access.redhat.com/rhscl/python-36-rhel7" "io.openshift.s2i.build.source-location" "."": error ensuring container path "/opt/app-root/src": lstat /var/lib/containers/storage/overlay/262cf5f36861100bf27c9eb5f9baa42f2471984ee129a5f1dd901d81cf3d4cbd/merged/opt: invalid argument

failed to get logs for task build-ui : container step-build has failed : [{"name":"","digest":"","key":"StartedAt","value":"2020-03-18T05:00:49Z","resourceRef":{}}]
[build-api : build] f72f609911547c6bf2364e63cf786987cd7189c74d787d585d659284b7feba77
[build-api : build] STEP 5: FROM scratch
[build-api : build] STEP 6: WORKDIR /app

`

a related issue

Error while running pipeline - couldn't determine what "/var/lib/containers/.../merged is"

Hi,

I'm trying pipeline tutorial, just changed the repo and Dockerfile.
All resources created, when I run pipeline I'm hitting the following error:

Any hints what might be wrong? Here is pipeline and the Dockerfile

tkn pipelinerun logs build-and-deploy-run-hq4lz -f

[build-image : git-source-app-repo-qh8fd] {"level":"info","ts":1589824315.4050386,"caller":"git/git.go:105","msg":"Successfully cloned http://github.com/gasgithub/get-started-java.git @ master in path /workspace/source"}
[build-image : git-source-app-repo-qh8fd] {"level":"warn","ts":1589824315.4058552,"caller":"git/git.go:152","msg":"Unexpected error: creating symlink: symlink /tekton/home/.ssh /root/.ssh: file exists"}
[build-image : git-source-app-repo-qh8fd] {"level":"info","ts":1589824315.5597413,"caller":"git/git.go:133","msg":"Successfully initialized and updated submodules in path /workspace/source"}

[build-image : build] [STEP 1: FROM ibmcom/websphere-liberty:kernel-java8-ibmjava-ubi
[build-image : build] [Getting image source signatures
[build-image : build] [Copying blob sha256:58e1deb9693dfb1704ccce2f1cf0e4d663ac77098a7a0f699708a71549cbd924
...
[build-image : build] [0mCopying config sha256:25b630d683bb524a292779ef58d2200da5eda80ffe6f94652b91ac0ba16a202d
[[build-image : build] [Writing manifest to image destination
[[build-image : build] [Storing signatures
[[build-image : build] [STEP 2: COPY --chown=1001:0  target/GetStartedJava.war /config/apps/
[[build-image : build] [error dry-running "COPY --chown=1001:0  target/GetStartedJava.war /config/apps/": couldn't determine what "/var/lib/containers/storage/overlay/86fe61b71cde8535b700d3faaa10cb54715c976f1c3792ecc85623e0c614ba97/merged" is: stat /var/lib/containers/storage/overlay/86fe61b71cde8535b700d3faaa10cb54715c976f1c3792ecc85623e0c614ba97/merged: invalid argument

[mfailed to get logs for task build-image : container step-build has failed  : [{"key":"StartedAt","value":"2020-05-18T17:51:55Z","resourceRef":{}}]

Error in Tutorial Pipeline Run

When I try to run the tutorial on an OCP 4 cluster I can reach the point where I create the pipeline but there are no resources in this YAML:

https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/01_pipeline/04_pipeline.yaml

and I don't get any output when I try:

tkn resource ls.
When I try to run the pipeline using

tkn pipeline start build-and-deploy \
    -w name=shared-workspace,claimName=source-pvc \
    -p deployment-name=vote-api \
    -p git-url=http://github.com/openshift-pipelines/vote-api.git \
    -p IMAGE=image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/vote-api

The run fails with the following error:

invalid input params: didn't need these params but they were provided anyway: [IMAGE]

Removing the -p IMAGE parameter still results in that error.

Thanks,

Atef

PipelineRun Fails After Following Steps Under Trigger Pipeline

After running the steps in this tutorial using an RHPDS 4.1 cluster, I triggered a pipeline after creating the git and image PipelineResources by running oc create -f petclinic-deploy-pipelinerun.yaml with the following:

apiVersion: tekton.dev/v1alpha1
kind: PipelineRun
metadata:
  generateName: petclinic-deploy-pipelinerun-
spec:
  pipelineRef:
    name: deploy-pipeline
  trigger:
    type: manual
  serviceAccount: 'pipeline'
  resources:
  - name: app-git
    resourceRef:
      name: petclinic-git
  - name: app-image
    resourceRef:
      name: petclinic-image

After running tkn pr ls I get:

NAME                                 STARTED          DURATION   STATUS   
petclinic-deploy-pipelinerun-4pqkp   15 minutes ago   1 second   Failed  

I then looked through the events on my cluster and found the following error message:

Missing or invalid Task pipelines-tutorial/s2i-java-8: pods
        "petclinic-deploy-pipelinerun-qwq6k-build-hnq2g-pod-f9e7df" is
        forbidden: [minimum memory usage per Container is 6Mi, but request is
        0., minimum memory usage per Container is 6Mi, but request is 0.,
        minimum memory usage per Container is 6Mi, but request is 0., minimum
        memory usage per Container is 6Mi, but request is 0., minimum memory
        usage per Container is 6Mi, but request is 0., minimum memory usage per
        Container is 6Mi, but request is 0., minimum memory usage per Container
        is 6Mi, but request is 0.]

Running tkn task ls -n pipelines-tutorial shows that s2i-java-8 was added:

NAME               AGE
openshift-client   1 hour ago
s2i-java-8         1 hour ago

Error from server (NotFound): deployments.apps "vote-ui" not found

When I run the pipeline along with the instruction, I got this error.

I0727 21:54:00.303203 11 request.go:621] Throttling request took 1.186453224s, request: GET:https://172.30.0.1:443/apis/snapshot.storage.k8s.io/v1beta1?timeout=32s
Error from server (NotFound): deployments.apps "vote-ui" not found

I created the resources as below but I can't find where the pipeline refers to "vote-ui" as deployment.apps resource.
$ tkn resource list
NAME TYPE DETAILS
api-repo git url: http://github.com/openshift-pipelines/vote-api.git
ui-repo git url: http://github.com/openshift-pipelines/vote-ui.git
api-image image url: image-registry.openshift-image-registry.svc:5000/user1-cloudnative-pipeline/vote-api:latest
ui-image image url: image-registry.openshift-image-registry.svc:5000/user1-cloudnative-pipeline/vote-ui:latest

error copying layers and metadata

@siamaksade
I'm testing this tutorial on ocp 4.2 using tkn cli v0.4.0 and I'm facing this error:

build-s2i : push] error copying layers and metadata from "containers-storage:[overlay@/var/lib/containers/storage+/var/run/containers/storage:overlay.imagestore=/var/lib/shared,overlay.mount_program=/usr/bin/fuse-overlayfs,overlay.mountopt=nodev,metacopy=on]image-registry.openshift-image-registry.svc:5000/pipelines-demo/spring-petclinic:latest" to "docker://image-registry.openshift-image-registry.svc:5000/pipelines-demo/spring-petclinic:latest": Error writing blob: Error initiating layer upload to /v2/pipelines-demo/spring-petclinic/blobs/uploads/ in image-registry.openshift-image-registry.svc:5000: unauthorized: authentication required

Pipeline tutorial fails on 'crc-macos-1.0.0-beta.5'

When following this tutorial with the crc-macos-1.0.0-beta.5 local install of openshift, I end up with this: https://gist.github.com/brujoand/72a564d1cd7d89586a7df181753457f4 which is the output log with the mvn download lines grepped out.

I can't really tell what the problem is. But this looks problematic:

[build : image-digest-exporter-generate-j8j8x] 2019/09/30 12:19:12 ImageResource petclinic-image doesn't have an index.json file: stat /builder/home/image-outputs/image/index.json: no such file or directory

Also this one at the end:

[deploy : oc] Error: unknown command "$(inputs.params.ARGS)" for "oc"

Any pointers on how to debug this?

Error: invalid input format for workspace

Following the tutorial and at the point where I execute:

tkn pipeline start build-and-deploy \
    -w name=shared-workspace,volumeClaimTemplateFile=https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/01_pipeline/03_persistent_volume_claim.yaml \
    -p deployment-name=vote-api \
    -p git-url=http://github.com/openshift-pipelines/vote-api.git \
    -p IMAGE=image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/vote-api \

There is an error:

Error: invalid input format for workspace : name=shared-workspace,volumeClaimTemplateFile=https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/01_pipeline/03_persistent_volume_claim.yaml

I can read the URL 03_persistent_volume_claim.yaml

$ oc version
Client Version: 4.4.0-202005290638-1960dd7
Server Version: 4.4.20
Kubernetes Version: v1.17.1+6af3663

$ tkn version
Client version: 0.9.0
Pipeline version: v0.11.3

Tutorial fails validating Task - update-deployment

A recent commit to master has added a workspaces in the update-deployment task which isn't necessary and the tutorial fails to run successfully.

Version Info:

client version: dev          🙏😝
  ❯ git rev-parse --short HEAD
     9a414070

Pipeline version: v0.16.3
Triggers version: v0.8.1

Steps:

  ./demo.sh setup
  ./demo.sh run
❯ tkn tr desc build-and-deploy-run-jrcf5-update-deployment-z2wl8
Name:              build-and-deploy-run-jrcf5-update-deployment-z2wl8
Namespace:         pipelines-tutorial
Task Ref:          update-deployment
Service Account:   pipeline
Timeout:           1h0m0s
Labels:
 app.kubernetes.io/managed-by=tekton-pipelines
 tekton.dev/pipeline=build-and-deploy
 tekton.dev/pipelineRun=build-and-deploy-run-jrcf5
 tekton.dev/pipelineTask=update-deployment
 tekton.dev/task=update-deployment

🌡️  Status

STARTED          DURATION    STATUS
13 minutes ago   ---         Failed(TaskRunValidationFailed)              <<<<< Fails Validation 🤯

MAVEN_CLEAR_REPO=${inputs.params.MAVEN_CLEAR_REPO}: bad substitution

I'm trying to retest this tutorial to make sure if this is still working on OCP 4.1 since I'm done all the steps successfully a few weeks ago. The PipelineRun is failed as below:

➜ spring-petclinic git:(master) tkn pipeline logs -f
? Select pipeline : petclinic-deploy-pipeline
? Select pipelinerun : petclinic-deploy-pipeline-run-xlmw9 started 4 seconds ago
[build : create-dir-image-g87x8] {"level":"warn","ts":1571376051.427172,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: open /var/run/ko/HEAD: no such file or directory"}
[build : create-dir-image-g87x8] {"level":"info","ts":1571376051.4284658,"logger":"fallback-logger","caller":"bash/main.go:64","msg":"Successfully executed command "sh -c mkdir -p /workspace/output/image"; output "}

[build : git-source-petclinic-git-svt2v] {"level":"warn","ts":1571376051.6579278,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: "ref: refs/heads/master" is not a valid GitHub commit ID"}
[build : git-source-petclinic-git-svt2v] {"level":"info","ts":1571376054.3768287,"logger":"fallback-logger","caller":"git/git.go:102","msg":"Successfully cloned https://github.com/spring-projects/spring-petclinic @ master in path /workspace/source"}

[build : gen-env-file] /bin/sh: MAVEN_CLEAR_REPO=${inputs.params.MAVEN_CLEAR_REPO}: bad substitution

Sometimes I have different errors:
[jboss@workspacem6t97jyjwma48bkf payment-service]$ tkn pipeline logs -f
? Select pipeline : petclinic-deploy-pipeline
? Select pipelinerun : petclinic-deploy-pipeline-run-72v9r started 17 seconds ago

[build : create-dir-image-sl8vk] {"level":"warn","ts":1571749550.4025996,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from koda
ta failed: open /var/run/ko/HEAD: no such file or directory"}
[build : create-dir-image-sl8vk] {"level":"info","ts":1571749550.403944,"logger":"fallback-logger","caller":"bash/main.go:64","msg":"Successfully executed command "sh -c
mkdir -p /workspace/output/image"; output "}

[build : git-source-petclinic-git-tcg4m] {"level":"warn","ts":1571749551.1254249,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID f
rom kodata failed: "ref: refs/heads/master" is not a valid GitHub commit ID"}
[build : git-source-petclinic-git-tcg4m] {"level":"info","ts":1571749553.8468623,"logger":"fallback-logger","caller":"git/git.go:102","msg":"Successfully cloned https://gi
thub.com/spring-projects/spring-petclinic @ master in path /workspace/source"}

[build : generate] Build failed
[build : generate] ERROR: An error occurred: stat ${inputs.params.PATH_CONTEXT}: no such file or directory

failed to get logs for task build : container step-generate has failed : Error

admission webhook "webhook.tekton.dev" denied the request:

Hi

I am following this tutorial with CRC openshift 4.5 cluster. I used the web console to installed openshift pipeline via OpenShift OperatorHub. When I try to create anything regarding manifest, tasks, pipelinereosurce, etc, I get the following error:

Error from server (BadRequest): error when creating "/home/ybello/PycharmProjects/sdp-pipeline/01_apply_manifest_task.yaml": admission webhook "webhook.tekton.dev" denied the request: mutation failed: cannot decode incoming new object: json: unknown field "managedFields"

Any suggestion will be appreciated, thank you.

openshift-client (kind:Task) creation failed

While creating an openshift-client task, it failed with the message:

[core@master-0 ~]$ curl -O https://raw.githubusercontent.com/tektoncd/catalog/master/openshift-client/openshift-client-task.yaml
[core@master-0 ~]$ oc create -f openshift-client-task.yaml 
Error from server (InternalError): error when creating "openshift-client-task.yaml": Internal error occurred: admission webhook "webhook.tekton.dev" denied the request: mutation failed: cannot decode incoming new object: json: cannot unmarshal array into Go struct field ParamSpec.default of type string

However, I was able to create the s2i-java-8-task in the same way.

Version: OpenShift v4.1.14

Update the tutorial to use tkn

Since this tutorial expects the user to use OpenShift, it should guide users to use tkn instead of oc where applicable.

Tutorial bugs

I ran into a couple of issues going through this tutorial.

1. workingDir instead of workingdir

apply_manifest_task.yaml has a typo:

      workingdir: /workspace/source

should be

      workingDir: /workspace/source

2. run with pipeline ServiceAccount

The tutorial does not specify a ServiceAccount when creating the PipelineRun. So, it fails when pushing images to the internal registry:

tkn pipeline start build-and-deploy

Instead, we should run the PipelineRun under the pipeline ServiceAccount

tkn pipeline start build-and-deploy --serviceaccount pipeline

Add commands instructions for deploying frontend and backend

The instructions for deploying the app is not sufficiently clear:

You can also deploy the same applications by applying the artifacts available in k8s directory of the respective repo

It should provide the commands as well on how to deploy the apps with oc apply -f ...

pipelines run failed during the build push with unauthorized: authentication required

Testing this tutorial on a OCP 4.1.2 version and after creating the PipelineRun, I'm checking the logs :
tkn pr logs petclinic-deploy-pipelinerun-6d94f -f

[build : build] [INFO] BUILD SUCCESS
[build : build] [INFO] ------------------------------------------------------------------------
[build : build] [INFO] Total time: 53.768 s
[build : build] [INFO] Finished at: 2019-06-21T08:58:28Z
[build : build] [INFO] Final Memory: 93M/197M
[build : build] [INFO] ------------------------------------------------------------------------
[build : build] [WARNING] The requested profile "openshift" could not be activated because it does not exist.
[build : build] INFO Copying deployments from target to /deployments...
[build : build] '/tmp/src/target/spring-petclinic-2.1.0.BUILD-SNAPSHOT.jar' -> '/deployments/spring-petclinic-2.1.0.BUILD-SNAPSHOT.jar'
[build : build] 8544c38aeb6febc5fcff824b9929639e723324458c1bd64d0afca308c8d42ce5
[build : build] STEP 8: CMD /usr/local/s2i/run
[build : build] STEP 9: COMMIT image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/spring-petclinic
[build : build] 8aa00132f8b1ef9c19d1395cfd4836931d69797da7ac87b4a4a3d38970c59350

[build : image-digest-exporter-build-dlqm4] []

[build : push] Getting image source signatures
[build : push] unauthorized: authentication required

any ideas ?

I tried to update the Task s2i-java-8 from

- default: "true"
      description: Verify the TLS on the registry endpoint (for push/pull to a non-TLS
        registry)
      name: TLSVERIFY

to 
- default: "false"
      description: Verify the TLS on the registry endpoint (for push/pull to a non-TLS
        registry)
      name: TLSVERIFY

but same error .
the OCP is a standard OCP 4.1.2 running on AWS (no advanced settings)

Error creating resources and running demo

Using OCP 4.4.3 When running the tutorial, I'm getting this error in v0.10.7:
oc create -f 04_pipeline.yaml

error: unable to recognize "04_pipeline.yaml": no matches for kind "Pipeline" in version "tekton.dev/v1beta1"

the reason is the version of the API is v1beta1 but the operator is using/expecting v1alpha1
in the other hand if i do the same for the apply-mainfests it would error :

Error from server (BadRequest): error when creating "01_apply_manifest_task.yaml": admission webhook "webhook.tekton.dev" denied the request: mutation failed: cannot decode incoming new object: json: unknown field "params"

this time is because the schema has changed between alpha and beta. please make sure all yamls are using the same version and running with latest Pipline operator (at the moment is v0.10.7)

cannot create build for setup one

I try it on openshift 4.2
NAME TYPE DETAILS
api-repo git url: http://github.com/openshift-pipelines/vote-api.git
ui-repo git url: http://github.com/openshift-pipelines/vote-ui.git
api-image image url: image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/api:latest
ui-image image url: image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/ui:latest
frances@francess-mbp pipelines-tutorial % tkn pipeline start build-and-deploy
? Choose the git resource to use for api-repo: api-repo (http://github.com/openshift-pipelines/vote-api.git)
? Choose the image resource to use for api-image: api-image (image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/api:latest)
? Choose the git resource to use for ui-repo: api-repo (http://github.com/openshift-pipelines/vote-api.git)
? Choose the image resource to use for ui-image: api-image (image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/api:latest)
Pipelinerun started: build-and-deploy-run-5w6c6
Showing logs...
task build-api failed: failed to run the pod build-and-deploy-run-5w6c6-build-api-wbjqd-pod-9c8501
task build-ui failed: failed to run the pod build-and-deploy-run-5w6c6-build-ui-fwkcd-pod-297c64

Unable to trigger pipeline successfully

After issuing the command:
$ tkn pipeline start build-and-deploy

I'm seeing this in the log:

[build-ui : build] error building at STEP "LABEL "io.openshift.s2i.build.image" "registry.access.redhat.com/rhscl/python-36-rhel7" "io.openshift.s2i.build.source-location" "."": error ensuring container path "/opt/app-root/src": lstat /var/lib/containers/storage/overlay/5e00638bac323dbd1b4584674a5c9047b7ca6a32d63f84a75d4e72cd96e43827/merged/opt: invalid argument

failed to get logs for task build-ui : container step-build has failed  : [{"name":"","digest":"","key":"StartedAt","value":"2020-03-05T07:51:38Z","resourceRef":{}}]

This is what I'm seeing in the task run YAML:

    - container: step-build
      imageID: >-
        quay.io/buildah/stable@sha256:52a993631e5f13f142c1de0ac19ed2188a1a4190bf4530ecaecb23bece0289c3
      name: build
      terminated:
        containerID: >-
          cri-o://e3c259c8d8290069f646c0178b1c3c0c77d1b4dc04a951017abee83f21113d54
        exitCode: 1
        finishedAt: '2020-03-05T07:52:04Z'
        reason: Error
        startedAt: '2020-03-05T07:51:38Z'

Any idea what went wrong here? Thanks in advance!

Use DeploymentConfig instead of Deployment

When the user starts the pipeline, the image is built and application is deployed. However, when the pipeline is started second time, the image is built but the old version continues to work.

The reason is that the tasks apply-manifests and update-deployment don't change anything (they replace the string with the same string) and therefore the deployment doesn't notice the change, see https://kubernetes.io/docs/concepts/workloads/controllers/deployment/

Note: A Deployment’s rollout is triggered if and only if the Deployment’s Pod template (that is, .spec.template) is changed, for example if the labels or container images of the template are updated. Other updates, such as scaling the Deployment, do not trigger a rollout.

there are multiple ways how to solve it:

  1. add some kind of restart to the pipeline
  2. replace Deployment with DeploymentConfig which is able to trigger rollout on change in image stream
  3. start versioning/tagging the image, i.e. don't use latest tag but e.g. timestamp
  4. use sha digest instead of tag latest

@vdemeester suggested the following

in the future we should use result instead of image PipelineResource, and have a step in those build that know how to get the digest

The fastest and easiest change is to use DeploymentConfig instead of Deployment.

DockerFile not found when running webhooks

Expected Behavior

Pipeline should rebuild with changes

Actual Behavior

Pipeline errors with DockerFile not found

Steps to Reproduce the Problem

  1. Run demo as specified in Repo
  2. Fork Repo and setup webhook
  3. Push to git to trigger webhook to start new pipeline build
  4. Pipeline fails during STEP-BUILD with error:
    error reading info about "/workspace/source/Dockerfile": stat /workspace/source/Dockerfile: no such file or directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.