Skip to content

Commit

Permalink
Update docs (#225)
Browse files Browse the repository at this point in the history
* docs(): adding docs for webhook gateway

* docs(): adding docs for webhook

* docs(): adding docs for calendar

* docs(): adding docs for calendar

* docs(): adding docs for calendar

* docs(): updating docs and adding docs for artifact

* docs(): adding docs for artifact

* feature(): support listening to multiple S3 events

* docs(): updating docs

* docs(): adding docs for file

* chore(): update artifact configmap

* docs(): adding docs for resource

* docs(): adding docs for resource

* docs(): adding docs for stream

* docs(): adding docs for aws sns

* docs(): adding docs for aws sns

* docs(): adding docs for aws sns

* feature(): adding trello gateway

* docs(): adding docs for aws sqs

* docs(): adding docs for gcp pubsub

* docs(): adding docs for github

* docs(): adding docs for github

* docs(): adding docs for github

* docs(): adding docs

* docs(): adding docs for slack

* docs(): adding docs for storage grid

* docs(): adding docs for storage grid

* docs(): adding docs for trello

* docs(): adding docs for trello

* fix(): fixing artifact gateway validation

* docs(): adding docs

* docs(): adding docs

* fix(): gateway dispatcher logging fix

* chore(): fix docs

* chore(): updating github sensor example

* fix(): examples

* chore(): update image tag

* docs(): removing FAQ

* docs(): updating gateway docs

* docs(): updating gateway docs
  • Loading branch information
VaibhavPage authored and magaldima committed Mar 21, 2019
1 parent a913daf commit cb6aa09
Show file tree
Hide file tree
Showing 65 changed files with 780 additions and 1,043 deletions.
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ override LDFLAGS += \
# docker image publishing options
DOCKER_PUSH?=true
IMAGE_NAMESPACE?=argoproj
IMAGE_TAG?=v0.8
IMAGE_TAG?=latest

ifeq (${DOCKER_PUSH},true)
ifndef IMAGE_NAMESPACE
Expand All @@ -35,9 +35,9 @@ endif

# Build the project images
.DELETE_ON_ERROR:
all: sensor-linux sensor-controller-linux gateway-controller-linux gateway-client-linux webhook-linux calendar-linux resource-linux artifact-linux file-linux nats-linux kafka-linux amqp-linux mqtt-linux storage-grid-linux github-linux hdfs-linux gitlab-linux sns-linux sqs-linux pubsub-linux trello-linux
all: sensor-linux sensor-controller-linux gateway-controller-linux gateway-client-linux webhook-linux calendar-linux resource-linux artifact-linux file-linux nats-linux kafka-linux amqp-linux mqtt-linux storage-grid-linux github-linux hdfs-linux gitlab-linux sns-linux sqs-linux pubsub-linux slack-linux

all-images: sensor-image sensor-controller-image gateway-controller-image gateway-client-image webhook-image calendar-image resource-image artifact-image file-image nats-image kafka-image amqp-image mqtt-image storage-grid-image github-image gitlab-image sns-image pubsub-image hdfs-image sqs-image trello-image
all-images: sensor-image sensor-controller-image gateway-controller-image gateway-client-image webhook-image calendar-image resource-image artifact-image file-image nats-image kafka-image amqp-image mqtt-image storage-grid-image github-image gitlab-image sns-image pubsub-image hdfs-image sqs-image slack-image

all-controller-images: sensor-controller-image gateway-controller-image

Expand Down Expand Up @@ -263,15 +263,15 @@ sqs-image: sqs-linux
docker build -t $(IMAGE_PREFIX)aws-sqs-gateway:$(IMAGE_TAG) -f ./gateways/community/aws-sqs/Dockerfile .
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)aws-sqs-gateway:$(IMAGE_TAG) ; fi

trello:
go build -v -ldflags '${LDFLAGS}' -o ${DIST_DIR}/trello-gateway ./gateways/community/trello/cmd
slack:
go build -v -ldflags '${LDFLAGS}' -o ${DIST_DIR}/slack-gateway ./gateways/community/slack/cmd

trello-linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make trello
slack-linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make slack

trello-image: trello-linux
docker build -t $(IMAGE_PREFIX)trello-gateway:$(IMAGE_TAG) -f ./gateways/community/trello/Dockerfile .
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)trello-gateway:$(IMAGE_TAG) ; fi
slack-image: slack-linux
docker build -t $(IMAGE_PREFIX)slack-gateway:$(IMAGE_TAG) -f ./gateways/community/slack/Dockerfile .
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)slack-gateway:$(IMAGE_TAG) ; fi

test:
go test $(shell go list ./... | grep -v /vendor/) -race -short -v
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ Lets deploy a webhook gateway and sensor,
3. [Trigger](docs/trigger-guide.md)
4. [Communication between gateway and sensor](docs/communication.md)
5. [Controllers](docs/controllers-guide.md)
6. [Setup Gateways & Sensors](docs/setup.md)
## Contribute
Read and abide by the [Argo Events Code of Conduct](https://github.com/argoproj/argo-events/blob/master/CODE_OF_CONDUCT.md)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.0
0.8.3
Binary file added docs/assets/calendar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/github-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/gitlab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/k8s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/netapp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pubsub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/s3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/slack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/sns.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/sqs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/stream.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/webhook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions docs/setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Setup

1. [Webhook](../gateways/core/webhook/README.md)
2. [Calendar](../gateways/core/calendar/README.md)
3. [Minio S3](../gateways/core/artifact/README.md)
4. [Resource](../gateways/core/resource/README.md)
5. [Stream](../gateways/core/stream/README.md)
6. [AWS SNS](../gateways/community/aws-sns/README.md)
7. [AWS SQS](../gateways/community/aws-sqs/README.md)
8. [GCP PubSub](../gateways/community/gcp-pubsub/README.md)
9. [Gitlab](../gateways/community/gitlab/README.md)
10. [Github](../gateways/community/github/README.md)
11. [HDFS](../gateways/community/hdfs)
12. [Slack](../gateways/community/slack/README.md)
13. [StorageGrid](../gateways/community/storagegrid/README.md)
4 changes: 3 additions & 1 deletion examples/gateways/artifact-gateway-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ data:
bucket:
name: input
endpoint: minio-service.argo-events:9000
event: s3:ObjectCreated:Put
events:
- s3:ObjectCreated:Put
- s3:ObjectRemoved:Delete
filter:
prefix: ""
suffix: ""
Expand Down
4 changes: 2 additions & 2 deletions examples/gateways/calendar-gateway-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ metadata:
name: calendar-gateway-configmap
data:
interval: |-
interval: 55s
interval: 10s
schedule: |-
schedule: 30 * * * *
schedule: "30 * * * *"
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions examples/gateways/slack-gateway-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: slack-gateway-configmap
data:
notification_1: |-
hook:
endpoint: "/event"
port: "12000"
url: "URL_OF_SERVICE"
token:
name slack-secret
key: tokenkey
45 changes: 45 additions & 0 deletions examples/gateways/slack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: argoproj.io/v1alpha1
kind: Gateway
metadata:
name: slack-gateway
labels:
gateways.argoproj.io/gateway-controller-instanceid: argo-events
gateway-name: "slack-gateway"
spec:
processorPort: "9330"
eventProtocol:
type: "HTTP"
http:
port: "9300"
template:
metadata:
name: "slack-gateway"
labels:
gateway-name: "slack-gateway"
spec:
containers:
- name: "gateway-client"
image: "argoproj/gateway-client"
imagePullPolicy: "Always"
command: ["/bin/gateway-client"]
- name: "slack-events"
image: "argoproj/slack-gateway"
imagePullPolicy: "Always"
command: ["/bin/slack-gateway"]
serviceAccountName: "argo-events-sa"
service:
metadata:
name: slack-gateway-svc
spec:
selector:
gateway-name: "slack-gateway"
ports:
- port: 12000
targetPort: 12000
type: LoadBalancer
configMap: "slack-gateway-configmap"
type: "slack"
eventVersion: "1.0"
watchers:
sensors:
- name: "slack-sensor"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ metadata:
name: storage-grid-gateway-configmap
data:
foo: |-
port: "8080"
endpoint: "/"
hook:
port: "8080"
endpoint: "/"
events:
- "ObjectCreated:Put"
8 changes: 4 additions & 4 deletions examples/sensors/github.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ spec:
group: argoproj.io
version: v1alpha1
kind: Workflow
parameters:
- src:
event: "github-gateway:project_1"
dest: spec.arguments.parameters.0.value
source:
inline: |
apiVersion: argoproj.io/v1alpha1
Expand All @@ -50,3 +46,7 @@ spec:
image: docker/whalesay:latest
command: [cowsay]
args: ["{{inputs.parameters.message}}"]
resourceParameters:
- src:
event: "github-gateway:project_1"
dest: spec.arguments.parameters.0.value
5 changes: 0 additions & 5 deletions examples/sensors/hdfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ spec:
group: argoproj.io
version: v1alpha1
kind: Workflow
parameters:
- src:
event: "hdfs-gateway:tmpdir"
path: name
dest: spec.templates.0.container.args.1
source:
inline: |
apiVersion: argoproj.io/v1alpha1
Expand Down
51 changes: 51 additions & 0 deletions examples/sensors/slack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
name: slack-sensor
labels:
sensors.argoproj.io/sensor-controller-instanceid: argo-events
spec:
template:
containers:
- name: "sensor"
image: "argoproj/sensor"
imagePullPolicy: Always
serviceAccountName: argo-events-sa
eventProtocol:
type: "HTTP"
http:
port: "9300"
dependencies:
- name: "slack-gateway:notification_1"
triggers:
- template:
name: slack-workflow
group: argoproj.io
version: v1alpha1
kind: Workflow
source:
inline: |
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: slack-
spec:
entrypoint: whalesay
arguments:
parameters:
- name: message
# this is the value that should be overridden
value: hello world
templates:
- name: whalesay
inputs:
parameters:
- name: message
container:
image: docker/whalesay:latest
command: [cowsay]
args: ["{{inputs.parameters.message}}"]
resourceParameters:
- src:
event: "slack-gateway:notification_1"
dest: spec.arguments.parameters.0.value
File renamed without changes.
42 changes: 42 additions & 0 deletions gateways/community/aws-sns/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<p align="center">
<img src="https://github.com/argoproj/argo-events/blob/ebdbdd4a2a8ce47a0fc6e9a6a63531be2c26148a/docs/assets/sns.png?raw=true" alt="AWS SNS"/>
</p>

<br/>

# AWS SNS

AWS SNS gateway listens to notifications from SNS.

### How to define an event source in confimap?
An entry in the gateway configmap corresponds to [this](https://github.com/argoproj/argo-events/blob/a913dafbf000eb05401ef2c847b29152af82977f/gateways/community/aws-sns/config.go#L70-L75).

### Why is there webhook in the gateway?
Because one of the ways you can receive notifications from SNS is over http. So the gateway runs a http server internally.
Once you create a new gateway configmap or add a new event source entry in the configmap, the gateway will register the url of the server on AWS.
All notifications for that topic will then be dispatched by SNS over to the endpoint specified in event source.

The gateway spec defined in `examples` has a `serviceSpec`. This service is used to expose the gateway server to the outside world.

**How to get the URL for the service?**
Depending upon the Kubernetes provider, you can create the Ingress or Route.

## Setup

**1. Install [Gateway](../../../examples/gateways/aws-sns.yaml)**

We are installing gateway before creating configmap. Because we need to have the gateway pod running and a service backed by the pod, so
that we can get the URL for the service.

Make sure gateway pod and service is running

**2. Install [Gateway Configmap](../../../examples/gateways/aws-sns-gateway-configmap.yaml)**

**3. Install [Sensor](../../../examples/sensors/aws-sns.yaml)**

Make sure sensor pod is created.

**4. Trigger Workflow**

As soon as there is message on your SNS topic, a workflow will be triggered.

30 changes: 30 additions & 0 deletions gateways/community/aws-sqs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<p align="center">
<img src="https://github.com/argoproj/argo-events/blob/ebdbdd4a2a8ce47a0fc6e9a6a63531be2c26148a/docs/assets/sqs.png?raw=true" alt="AWS SQS"/>
</p>

<br/>

# AWS SQS

AWS SNS gateway consumes messages from SQS queue.

### How to define an event source in confimap?
An entry in configmap corresponds to [this](https://github.com/argoproj/argo-events/blob/a913dafbf000eb05401ef2c847b29152af82977f/gateways/community/aws-sqs/config.go#L37-L51).

Because SQS works on polling, you need to provide a `waitTimeSeconds`.

## Setup

**1. Install [Gateway](../../../examples/gateways/aws-sqs.yaml)**

Make sure gateway pod and service is running

**2. Install [Gateway Configmap](../../../examples/gateways/aws-sqs-gateway-configmap.yaml)**

**3. Install [Sensor](../../../examples/sensors/aws-sqs.yaml)**

Make sure sensor pod is created.

**4. Trigger Workflow**

As soon as there a message is consumed from SQS queue, a workflow will be triggered.
30 changes: 30 additions & 0 deletions gateways/community/gcp-pubsub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<p align="center">
<img src="https://github.com/argoproj/argo-events/blob/ebdbdd4a2a8ce47a0fc6e9a6a63531be2c26148a/docs/assets/pubsub.png?raw=true" alt="GCP PubSub"/>
</p>

<br/>

# GCP PubSub

GCP PubSub gateway listens to event streams on google cloud pub sub topics.


### How to define an event source in confimap?
An entry in the gateway configmap corresponds to [this](https://github.com/argoproj/argo-events/blob/a913dafbf000eb05401ef2c847b29152af82977f/gateways/community/gcp-pubsub/config.go#L31-L36).

Make sure to mount credentials file for authentication in gateway pod and refer the path in `credentialsFile`.

## Setup
**1. Install [Gateway Configmap](../../../examples/gateways/gcp-pubsub-gateway-configmap.yaml)**

**2. Install [Gateway](../../../examples/gateways/gcp-pubsub.yaml)**

Make sure gateway pod and service is running

**3. Install [Sensor](../../../examples/sensors/gcp-pubsub.yaml)**

Make sure sensor pod is created.

**4. Trigger Workflow**

As soon as there a message is consumed from PubSub topic, a workflow will be triggered.
43 changes: 43 additions & 0 deletions gateways/community/github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<p align="center">
<img src="https://github.com/argoproj/argo-events/blob/ebdbdd4a2a8ce47a0fc6e9a6a63531be2c26148a/docs/assets/github-logo.png?raw=true" alt="GitHub"/>
</p>

<br/>

# Github

The gateway listens to events from GitHub.

Refer [here](https://developer.github.com/v3/activity/events/types/) for more information on type of events.

### How to define an event source in confimap?
An entry in the gateway configmap corresponds to [this](https://github.com/argoproj/argo-events/blob/30eaa296651e80b11ffef3b20464a08a2041eb09/gateways/community/github/config.go#L50-L73).

Refer [this](https://developer.github.com/v3/repos/hooks/#get-single-hook) to understand the structure of webhook.

The gateway spec defined in `examples` has a `serviceSpec`. This service is used to expose the gateway server and make it reachable from GitHub.

The event payload dispatched from gateway contains the type of the event in the headers.

**How to get the URL for the service?**

Depending upon the Kubernetes provider, you can create the Ingress or Route.

## Setup

**1. Install [Gateway](../../../examples/gateways/github.yaml)**

We are installing gateway before creating configmap. Because we need to have the gateway pod running and a service backed by the pod, so
that we can get the URL for the service.

Make sure gateway pod and service is running

**2. Install [Gateway Configmap](../../../examples/gateways/github-gateway-configmap.yaml)**

**3. Install [Sensor](../../../examples/sensors/github.yaml)**

Make sure sensor pod is created.

**4. Trigger Workflow**

Depending upon the event you subscribe to, a workflow will be triggered.
Loading

0 comments on commit cb6aa09

Please sign in to comment.