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

Commit

Permalink
fixup: markdown styling
Browse files Browse the repository at this point in the history
  • Loading branch information
gireeshpunathil committed Oct 2, 2019
1 parent 6bc02b9 commit e8714da
Showing 1 changed file with 34 additions and 24 deletions.
58 changes: 34 additions & 24 deletions plgen/plgen.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
plgen generates tekton pipelines that you can deploy onto kubernetes cluster with minimal or zero changes.
# plgen

The tool provides a high level abstraction on top of the tekton pipeline semantics, hiding most of the details
and the yaml complexity altogether. The intent is to drastically improve user experience on working with pipelines, and transforming pipelines as an integral part of kabanero's capabiity.
`plgen` generates tekton pipelines that you can deploy onto kubernetes cluster with minimal or zero changes.

The main attraction of plgen is its input syntax - which it derives from Dockerfile. While Dockerfile uses these verbs to define attributes, execution environment and a sequence of actions that lead upto generation of an image, plgen uses those verbs for sequencing discrete steps into a pipeline definition, with meanings of most of the verbs in-tact.
The tool provides a high level abstraction on top of the tekton pipeline semantics, hiding most of the details and the `yaml complexity` altogether. The intent is to drastically improve user experience on working with pipelines, and transforming pipelines as an integral part of kabanero's capabiity.

The main attraction of `plgen` is its input syntax - which it derives from Dockerfile. While Dockerfile uses these verbs to define attributes, execution environment and a sequence of actions that lead upto generation of an image, `plgen` uses those verbs for sequencing discrete steps into a pipeline definition, with meanings of most of the verbs in-tact.

Supported verbs at the moment are:
ARG, ARGIN, ARGOUT, FROM, RUN, LABEL, ENV, MOUNT, USER
```
ARG
ARGIN
ARGOUT
FROM
RUN
LABEL
ENV
MOUNT
USER
```

Feel free to raise an issue / rfe in this repo, if there is need to define new verbs.


Here is an example input and the generated pipeline:
Here is an example input and the generated pipeline:\s\s
$ cat pl.txt

```Dockerfile
Expand Down Expand Up @@ -132,16 +142,16 @@ spec:
```


The translation specification of the verbs are as follows:
# The Translation Specification

ARG <key=value>
### ARG <key=value>

Alias for ARGIN
Defines an input argument to the pipeline step as key-value pair.
An entry for the key is made to the PipelineResource, and referred by PipelineRun and Pipeline.
The key and values are passed as arg field to the current pipeline step.

Example:
### Example:

Input:

Expand Down Expand Up @@ -175,21 +185,21 @@ Again in Pipeline step, after $ variable translation:
- tar xzvf http://example.com/archive.tar.gz
```
ARGIN <key=value>
### ARGIN <key=value>
Same as ARG <key=value> .
ARGOUT <key=value>
### ARGOUT <key=value>
Defines an output argument to the pipeline step as key-value pair.
An entry for the key is made to the PipelineResource, and referred by PipelineRun and Pipeline.
The key and values are passed as `arg` field to the current pipeline step.

ENV <key-value>
### ENV <key-value>

Defines an environment variable for the container in the pipeline step.
The key and values are passed as `env` field to the current pipeline step.

Example:
### Example:

Input:
`ENV foo=bar`
Expand All @@ -202,12 +212,12 @@ In Pipeline step:
value: bar
```

FROM <image>
### FROM <image>

Defines the container to spin up for the current pipeline step.
The image name is passed as `image` field to the current pipeline step.

Example:
### Example:
Input:
FROM ubuntu

Expand All @@ -220,12 +230,12 @@ In Pipeline step:
```


LABEL <name>
### LABEL <name>

Defines the name of the current pipeline step. It is a mandate that each step starts with a LABEL
The label name is passed as the `name` field to the current pipeline step.

Example:
### Example:
Input:
`LABEL targz`

Expand All @@ -237,13 +247,13 @@ In Pipeline step:
image: ubuntu
```

MOUNT <host=container>
### MOUNT <host=container>

Defines the mount bindings between the host and the container in the current pipeline step.
An entry for `volumeMounts` in the current pipeline step is created with `_host_` as the name and `container` as the `mountPath`
An entry for the `volumes` in the pipeline is created with `_host_` as the name and `host` as the `hostPath`

Example:
### Example:
Input:
`MOUNT containers=/var/lib/containers`
Output:
Expand All @@ -264,13 +274,13 @@ Again in the Pipeline step:
type: unknown
```

RUN <commands>
### RUN <commands>

Defines the shell command(s) that will be run in the target container.
A /bin/bash is spawned in the target container, and the entire command string is passed to it.
$ variable translations occur before the command is dispatched, by looking up in the resources.

Example:
### Example:
Input:
`RUN tar xzvf $input`
Output:
Expand All @@ -284,13 +294,13 @@ In the Pipeline step:
```


USER <user>
### USER <user>

Defines a kubernetes cluster service account that will `own` the generated pipeline.
A Role is created with the user.
A RoleBinding is created with the user, that is bound to `cluster-admin` role.

Example:
### Example:
Input:
`USER kubernetes-user`

Expand Down

0 comments on commit e8714da

Please sign in to comment.