Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Improve logging and concurrency in controller #93

Merged
merged 3 commits into from
Feb 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ install:
- test/e2e/travis-kube-setup.sh
- glide -h > /dev/null || go get github.com/Masterminds/glide
# Needed for some integration tests
- nats-streaming-server -h > /dev/null || get github.com/nats-io/nats-streaming-server
- nats-streaming-server -h > /dev/null || go get github.com/nats-io/nats-streaming-server

before_script:
# Build
Expand Down
6 changes: 3 additions & 3 deletions Docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Fission Workflow

- Overview
- [Overview](../README.md)
- [Terminology](./terminology.md)
- [System Architecture](./architecture.md)
- Installation
- Roadmap
- [Installation](../INSTALL.md)
- [Roadmap](./roadmap.md)
1 change: 1 addition & 0 deletions Docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This document describes the high-level architecture of Fission Workflows.

![System Architecture](./assets/sysarch.png)

*System Architecture of Fission Workflows*

### API (Server)
Expand Down
5 changes: 3 additions & 2 deletions Docs/controller-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ It makes use of the scheduler to determine the strategy towards the completion o
It makes use of the InvocationApi, FunctionApi and WorkflowApi to perform actions.

## Control Flow
The controller can best be described as an interruptible control loop.
The controller can best be described as an interruptable control loop.
It contains the following ways of managing the lifecycle of invocations.
- Long control loop
- Short control loop
Expand All @@ -25,7 +25,8 @@ This is meant to capture any invocations of which the notification (see notifica
The notification resembles more or less an interrupt.
Whenever a relevant event occurs for an invocation, the controller receives a notification of this event.
Note that notifications are entirely optional, and only serve to reduce the latency of a workflow invocation.
In case of errors or an overload of notifications, the short or long control loop will pick up the invocation
In case of errors or an overload of notifications, the short or long control loop will pick up the invocation.
The controller is not obligated to handle a notification.


## Procedure
Expand Down
9 changes: 9 additions & 0 deletions Docs/terminology.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@ Throughout the system it is often also called a "function"".

#### Workflow Engine
The core part of the Workflow Management System, responsible for the scheduling and controlling of workflow.


## Common abbreviations
```
wf = workflow
wfi = worfklow invocation
ctrl = controller
expr = expression
```
10 changes: 10 additions & 0 deletions Docs/wip/expression-parser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Expression Parser

TODO

Contents
- General concept
- Use cases
- Syntax
- functions
- advanced: adding custom functions
14 changes: 14 additions & 0 deletions Docs/wip/instrumentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Instrumentation

This document contains description and high-level documentation on the instrumentation of the system.
The instrumentation here is considered to encompass tracing, logging and metrics.

## Logging

TODO

Common fields:
- ctrl: name of the controller if applicable
- wf: id of the workflow if applicable
- wfi: id of the workflow invocation if applicable
- component: name of component (controller, api, apiserver, fnenv)
File renamed without changes.
3 changes: 0 additions & 3 deletions build/foo.py

This file was deleted.

4 changes: 4 additions & 0 deletions hack/docker-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ NS=$1
echo "Using tag: ${TAG} and org ${NS}"
BUNDLE_IMAGE=${NS}/fission-workflows-bundle
ENV_IMAGE=${NS}/workflow-env
BUILD_ENV_IMAGE=${NS}/workflow-build-env

# Check if images with tags exist
local_image_exists ${BUNDLE_IMAGE} ${TAG}
local_image_exists ${ENV_IMAGE} ${TAG}
local_image_exists ${BUILD_ENV_IMAGE} ${TAG}

# Publish
read -p "Publish images with '${TAG}' to Dockerhub namespace '${NS}'? " -n 1 -r
Expand All @@ -40,4 +42,6 @@ then
docker push ${BUNDLE_IMAGE}:${TAG}
echo "Publishing ${ENV_IMAGE}:${TAG}"
docker push ${ENV_IMAGE}:${TAG}
echo "publishing ${BUILD_ENV_IMAGE}:${TAG}"
docker push ${BUILD_ENV_IMAGE}:${TAG}
fi
102 changes: 0 additions & 102 deletions pkg/controller/controller.go

This file was deleted.

4 changes: 2 additions & 2 deletions pkg/controller/expr/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Resolver interface {
}

var (
RESOLVING_TIMEOUT = time.Duration(100) * time.Millisecond
ResolvingTimeout = time.Duration(100) * time.Millisecond

ErrTimeOut = errors.New("expression resolver timed out")
)
Expand Down Expand Up @@ -96,7 +96,7 @@ func (oe *JavascriptExpressionParser) Resolve(rootScope interface{}, currentScop
}

go func() {
<-time.After(RESOLVING_TIMEOUT)
<-time.After(ResolvingTimeout)
scoped.Interrupt <- func() {
panic(ErrTimeOut)
}
Expand Down
Loading