Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

plgen: a pipeline generator #72

Closed
wants to merge 4 commits into from

Conversation

gireeshpunathil
Copy link

@gireeshpunathil gireeshpunathil commented Sep 30, 2019

plgen is a tekton pipeline generator from simple verbs that align to Dockerfile syntax to a reasonable extent. The objective is to provide a more abstract interface to the user, hide the complex kubernetes semantics, and thereby improve the pipeline generation experience.

Fixes: kabanero-io/kabanero-foundation#60

A targz pipeline can be encoded as below:

LABEL targz
USER core
FROM ubuntu
ARG input=http://github.com/foo/archive.tar.gz
ENV foo=bar
RUN tar xzvf $input
RUN cat source/file.txt

which gets (currently) translated to:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: core
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: admin
subjects:
- kind: ServiceAccount
  name: core
  namespace: default
roleRef:
  kind: ClusterRole
  name: cluster-admin
  apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
items:
- apiVersion: tekton.dev/v1alpha1
  kind: PipelineResource
  metadata:
    name: input
  spec:
    type: git
    params:
    - name: resource0
      value: http://github.com/foo/archive.tar.gz
kind: List
---
apiVersion: tekton.dev/v1alpha1
kind: Pipeline
metadata:
  name: l-txt-pipeline
spec:
  resources:
  - name: input
    type: git
  tasks:
  - name: l-txt
    taskRef:
      name: l-txt-task
      kind: ""
    resources:
      inputs:
      - name: input
        resource: input
---
apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
  name: l-txt-task
spec:
  inputs:
    resources:
    - name: input
      type: git
  outputs: {}
  steps:
  - name: targz
    image: ubuntu
    env:
    - name: foo
      value: bar
    command:
    - /bin/bash
    args:
    - -c
    - tar xzvf http://github.com/foo/archive.tar.gz
    - -c
    - cat source/file.txt
---
apiVersion: tekton.dev/v1alpha1
kind: PipelineRun
metadata:
  name: l-txt-pipeline-run
spec:
  serviceAccount: core
  timeout: 1h0m0s
  pipelineRef:
    name: l-txt-pipeline
  trigger:
    type: manual
  resources:
  - name: input
    resourceref:
      name: input
---

Keeping as WIP, as there are real work to be done. Feel free to contribute, I have enabled allow edits from maintainers button.

cc @kvijai82 @stephenkinder @seabaylea @chilanti

@gireeshpunathil gireeshpunathil changed the title pipeline: A pipeline generator [WIP] plgen: a pipeline generator Oct 1, 2019
@gireeshpunathil gireeshpunathil changed the title [WIP] plgen: a pipeline generator plgen: a pipeline generator Oct 2, 2019
@gireeshpunathil
Copy link
Author

with most of the steps completed and a doc in place that outlines the translation specification, I guess this is in good shape now

Removed the WIP label. So up for review!

plgen is a tekton pipeline generator from simple verbs
that align to Dockerfile syntax to a great extend.
This makes it pretty intuitive.

Fixes: kabanero-io/kabanero-foundation#60
@seabaylea
Copy link
Member

Before moving forward with this I'd suggest talking to the Tekton team to see if this is something that the would make sense to the community.

@CLAassistant
Copy link

CLA assistant check
All committers have signed the CLA.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

proposal: pipeline as a first-class kabanero citizen
3 participants