Skip to content

Commit 69824ad

Browse files
Ticket #63 : Write documentation
1 parent a04039f commit 69824ad

File tree

26 files changed

+572
-100
lines changed

26 files changed

+572
-100
lines changed

EventMeshDockerFile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM mcr.microsoft.com/dotnet/aspnet:5.0
2+
3+
COPY build/results/services/EventMeshServer/ App/
4+
ENV ASPNETCORE_URLS=http://*:5001
5+
6+
EXPOSE 5001
7+
EXPOSE 4000
8+
9+
WORKDIR /App
10+
11+
ENTRYPOINT ["dotnet", "EventMesh.Runtime.Website.dll"]

default.ps1

Lines changed: 62 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,12 @@ task default -depends local
1717
task local -depends compile, test
1818
task ci -depends clean, release, local, pack, publish
1919

20-
task publish {
21-
exec { dotnet publish $source_dir\FaasNet.Function.GetSql\FaasNet.Function.GetSql.csproj -c $config -o $result_dir\services\RuntimeGetSql }
22-
exec { dotnet publish $source_dir\FaasNet.Function.Transform\FaasNet.Function.Transform.csproj -c $config -o $result_dir\services\RuntimeTransform }
23-
exec { dotnet publish $source_dir\FaasNet.Kubernetes\FaasNet.Kubernetes.csproj -c $config -o $result_dir\services\Kubernetes }
24-
exec { dotnet publish $source_dir\FaasNet.Gateway.SqlServer.Startup\FaasNet.Gateway.SqlServer.Startup.csproj -c $config -o $result_dir\services\Gateway }
25-
exec { dotnet publish $source_dir\FaasNet.CLI\FaasNet.CLI.csproj -c $config -o $result_dir\cli }
26-
}
20+
# DEV tasks
21+
task packDev -depends clean, packNoSuffix, packTemplate
22+
task dockerDev -depends clean, publishDockerDev
2723

28-
task publishTemplate {
29-
exec { dotnet pack $source_dir\FaasNet.Templates\FaasNet.Templates.csproj -c $config --no-build --output $result_dir }
30-
}
24+
# CI tasks
25+
task dockerCI -depends clean, publishDockerCI
3126

3227
task clean {
3328
rd "$source_dir\artifacts" -recurse -force -ErrorAction SilentlyContinue | out-null
@@ -76,22 +71,6 @@ task publishHelmAndWebsite {
7671
exec { git checkout master }
7772
}
7873

79-
task buildLocalDockerImage -depends publish {
80-
exec { npm run docker --prefix $source_dir\FaasNet.Website }
81-
exec { docker build -f RuntimeGetSqlDockerfile -t localhost:5000/faasgetsql . }
82-
exec { docker build -f RuntimeTransformDockerfile -t localhost:5000/faastransform . }
83-
exec { docker build -f KubernetesDockerfile -t localhost:5000/faaskubernetes . }
84-
exec { docker build -f GatewayDockerfile -t localhost:5000/faasgateway . }
85-
exec { docker build -f WebsiteDockerfile -t localhost:5000/faaswebsite . }
86-
exec { docker build -f PrometheusDockerfile -t localhost:5000/faasprometheus . }
87-
exec { docker push localhost:5000/faasgetsql }
88-
exec { docker push localhost:5000/faastransform }
89-
exec { docker push localhost:5000/faaskubernetes }
90-
exec { docker push localhost:5000/faasgateway }
91-
exec { docker push localhost:5000/faaswebsite }
92-
exec { docker push localhost:5000/faasprometheus }
93-
}
94-
9574
task initLocalKubernetes {
9675
exec { kubectl apply -f ./kubernetes/faas-namespace.yml }
9776
exec { kubectl apply -f ./kubernetes/run-mssql.yml --namespace=faas }
@@ -118,26 +97,20 @@ task initDevKubernetes {
11897
exec { kubectl apply -f ./kubernetes/faas-kubernetes-external-svc.yml --namespace=faas }
11998
}
12099

121-
task builderDockerImage -depends publish {
122-
exec { npm run docker --prefix $source_dir\FaasNet.Website }
123-
exec { docker build -f RuntimeGetSqlDockerfile -t simpleidserver/faasgetsql:0.0.4 . }
124-
exec { docker build -f RuntimeTransformDockerfile -t simpleidserver/faastransform:0.0.4 . }
125-
exec { docker build -f KubernetesDockerfile -t simpleidserver/faaskubernetes:0.0.4 . }
126-
exec { docker build -f GatewayDockerfile -t simpleidserver/faasgateway:0.0.4 . }
127-
exec { docker build -f WebsiteDockerfile -t simpleidserver/faaswebsite:0.0.4 . }
128-
exec { docker build -f PrometheusDockerfile -t simpleidserver/faasprometheus:0.0.4 . }
129-
exec { docker push simpleidserver/faasgetsql:0.0.4 }
130-
exec { docker push simpleidserver/faastransform:0.0.4 }
131-
exec { docker push simpleidserver/faaskubernetes:0.0.4 }
132-
exec { docker push simpleidserver/faasgateway:0.0.4 }
133-
exec { docker push simpleidserver/faaswebsite:0.0.4 }
134-
exec { docker push simpleidserver/faasprometheus:0.0.4 }
100+
# Publish assets
101+
task publishCLI {
102+
exec { dotnet publish $source_dir\FaasNet.CLI\FaasNet.CLI.csproj -c $config -o $result_dir\cli }
135103
}
136104

137-
task packTemplate {
138-
exec { dotnet pack $source_dir\FaasNet.Templates\FaasNet.Templates.csproj -c $config --no-build --output $result_dir }
105+
task publishDocker {
106+
exec { dotnet publish $source_dir\FaasNet.Function.GetSql\FaasNet.Function.GetSql.csproj -c $config -o $result_dir\services\RuntimeGetSql }
107+
exec { dotnet publish $source_dir\FaasNet.Function.Transform\FaasNet.Function.Transform.csproj -c $config -o $result_dir\services\RuntimeTransform }
108+
exec { dotnet publish $source_dir\FaasNet.Kubernetes\FaasNet.Kubernetes.csproj -c $config -o $result_dir\services\Kubernetes }
109+
exec { dotnet publish $source_dir\FaasNet.Gateway.SqlServer.Startup\FaasNet.Gateway.SqlServer.Startup.csproj -c $config -o $result_dir\services\Gateway }
110+
exec { dotnet publish $source_dir\EventMesh.Runtime.Website\EventMesh.Runtime.Website.csproj -c $config -o $result_dir\services\EventMeshServer }
139111
}
140112

113+
# Pack
141114
task pack -depends release, compile {
142115
exec { dotnet pack $source_dir\FaasNet.Runtime\FaasNet.Runtime.csproj -c $config --no-build $versionSuffix --output $result_dir }
143116
exec { dotnet pack $source_dir\EventMesh.Runtime\EventMesh.Runtime.csproj -c $config --no-build $versionSuffix --output $result_dir }
@@ -154,6 +127,53 @@ task packNoSuffix -depends release, compile {
154127
exec { dotnet pack $source_dir\EventMesh.Runtime.Kafka\EventMesh.Runtime.Kafka.csproj -c $config --output $result_dir }
155128
}
156129

130+
task packTemplate {
131+
exec { dotnet pack $source_dir\FaasNet.Templates\FaasNet.Templates.csproj -c $config --no-build --output $result_dir }
132+
}
133+
134+
# Docker
135+
task buildDockerDev -depends publishDocker {
136+
exec { npm run docker --prefix $source_dir\FaasNet.Website }
137+
exec { docker build -f RuntimeGetSqlDockerfile -t localhost:5000/faasgetsql . }
138+
exec { docker build -f RuntimeTransformDockerfile -t localhost:5000/faastransform . }
139+
exec { docker build -f KubernetesDockerfile -t localhost:5000/faaskubernetes . }
140+
exec { docker build -f GatewayDockerfile -t localhost:5000/faasgateway . }
141+
exec { docker build -f WebsiteDockerfile -t localhost:5000/faaswebsite . }
142+
exec { docker build -f PrometheusDockerfile -t localhost:5000/faasprometheus . }
143+
exec { docker build -f EventMeshDockerFile -t localhost:5000/eventmeshserver . }
144+
}
145+
146+
task buildDockerCI -depends publishDocker {
147+
exec { npm run docker --prefix $source_dir\FaasNet.Website }
148+
exec { docker build -f RuntimeGetSqlDockerfile -t simpleidserver/faasgetsql:0.0.5 . }
149+
exec { docker build -f RuntimeTransformDockerfile -t simpleidserver/faastransform:0.0.5 . }
150+
exec { docker build -f KubernetesDockerfile -t simpleidserver/faaskubernetes:0.0.5 . }
151+
exec { docker build -f GatewayDockerfile -t simpleidserver/faasgateway:0.0.5 . }
152+
exec { docker build -f WebsiteDockerfile -t simpleidserver/faaswebsite:0.0.5 . }
153+
exec { docker build -f PrometheusDockerfile -t simpleidserver/faasprometheus:0.0.5 . }
154+
exec { docker build -f EventMeshDockerFile -t simpleidserver/eventmeshserver:0.0.5 . }
155+
}
156+
157+
task publishDockerDev -depends buildDockerDev {
158+
exec { docker push localhost:5000/faasgetsql }
159+
exec { docker push localhost:5000/faastransform }
160+
exec { docker push localhost:5000/faaskubernetes }
161+
exec { docker push localhost:5000/faasgateway }
162+
exec { docker push localhost:5000/faaswebsite }
163+
exec { docker push localhost:5000/faasprometheus }
164+
exec { docker push localhost:5000/eventmeshserver }
165+
}
166+
167+
task publishDockerCI -depends publishDocker {
168+
exec { docker push simpleidserver/faasgetsql:0.0.5 }
169+
exec { docker push simpleidserver/faastransform:0.0.5 }
170+
exec { docker push simpleidserver/faaskubernetes:0.0.5 }
171+
exec { docker push simpleidserver/faasgateway:0.0.5 }
172+
exec { docker push simpleidserver/faaswebsite:0.0.5 }
173+
exec { docker push simpleidserver/faasprometheus:0.0.5 }
174+
exec { docker push simpleidserver/eventmeshserver:0.0.5 }
175+
}
176+
157177
task test {
158178
Push-Location -Path $base_dir\tests\EventMesh.Runtime.Tests
159179

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Docker
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Kafka
2+
3+
An EventMesh server can be configured to consume and publish messages from / to Apache Kafka.
4+
5+
> [!WARNING]
6+
> Before you start, Make sure there is a Visual Studio Solution with a [configured EventMesh server](/documentation/eventmesh/installation.html).
7+
8+
## Source Code
9+
10+
The source code of this project can be found [here](https://github.com/simpleidserver/FaasNet/tree/master/samples/EventMeshServerKafka).
11+
12+
## Configure EventMesh server
13+
14+
The Nuget package `EventMesh.Runtime.Kafka` must be installed.
15+
16+
```
17+
dotnet add package EventMesh.Runtime.Kafka
18+
```
19+
20+
21+
Edit the file containing the configuration of the EventMesh server and add the line `AddKafka()` after `RuntimeHostBuilder` or `AddRuntime`.
22+
23+
Standalone EventMesh server :
24+
25+
```
26+
new RuntimeHostBuilder(opt =>
27+
{
28+
opt.Port = "localhost";
29+
opt.Urn = 4000;
30+
}).AddKafka();
31+
```
32+
33+
34+
EventMesh server with UI :
35+
36+
```
37+
services.AddRuntimeWebsite(opt =>
38+
{
39+
opt.Urn = "localhost";
40+
opt.Port = 4000;
41+
}).AddKafka();
42+
```
43+
44+
The function `AddKafka` accepts one optional parameter in entry. It can be used to configure the behavior of the library.
45+
The following properties can be configured :
46+
47+
48+
| Property | Description | Default value |
49+
| ------------------ | ---------------------------------------------------------------------------------------------------- | ----------------------- |
50+
| BootstrapServers | Initial list of brokers as a CSV list of broker host or host:port. | localhost:29092 |
51+
| BrokerName | Name of the configured message broker. This value must be unique for each configure message broker | kafka |

docs/documentation/eventmesh/installation.md renamed to docs/documentation/eventmesh/nuget.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> [!NOTE]
44
> The source code of this project can be found [here](https://github.com/simpleidserver/FaasNet/tree/master/samples/EventMeshServerInMemory).
55
6-
An EventMesh Server can be hosted in a console application.
6+
A standalone EventMesh Server can be hosted in a console application.
77

88
```
99
mkdir QuickStart

docs/documentation/eventmesh/portal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Portal
22

3-
A portal can be installed to administrate an EventMesh Server.
3+
A portal can be installed to administrate the EventMesh Server.
44

55
```
66
mkdir QuickStart

docs/documentation/eventmesh/rabbitmq.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The Nuget package `EventMesh.Runtime.AMQP` must be installed.
1717
dotnet add package EventMesh.Runtime.AMQP
1818
```
1919

20-
Edit the file which contains the configuration of the EventMesh server and add the line `AddAMQP()` after `RuntimeHostBuilder` or `AddRuntime`.
20+
Edit the file containing the configuration of the EventMesh server and add the line `AddAMQP()` after `RuntimeHostBuilder` or `AddRuntime`.
2121

2222
Standalone EventMesh server :
2323

@@ -40,5 +40,12 @@ EventMesh server with UI :
4040
}).AddAMQP();
4141
```
4242

43-
The `AddAMQP` accepts one optional parameter in entry. It can be used to update update the options.
43+
The function `AddAMQP` accepts one optional parameter in entry. It can be used to configure the behavior of the library.
44+
The following properties can be configured :
4445

46+
| Property | Description | Default value |
47+
| ------------------ | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
48+
| TopicName | Name of the RabbitMQ exchange. Used during publish-subscribe | amq.topic |
49+
| QueueName | A queue with the following pattern `{QueueName}-{TopicName}` is created when a session subscribe to a topic | streamQueue |
50+
| BrokerName | Name of the configured message broker. This value must be unique for each configure message broker | amqp |
51+
| ConnectionFactory | Contains the configuration used to establish connection with RabbitMQ | HostName: 127.0.0.1, Port: 5672, UserName: guest, Password: guest |

docs/documentation/functions/create.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# Create a function
22

3-
Install FaasNet template. This utility can be used to generate Function project in C#.
4-
5-
```
6-
dotnet new --install FaasNet.Templates
7-
```
8-
93
Create a Function project
104

115
```

docs/documentation/gettingstarted/index.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,20 @@ If the `faasnet` repository is already installed, its latest version can be down
2727

2828
```
2929
helm repo update
30-
```
30+
```
31+
32+
## Template
33+
34+
Install FaasNet template :
35+
36+
```
37+
dotnet new --install FaasNet.Templates
38+
```
39+
40+
| Command line | Description |
41+
| ------------------------- | ------------------------------------------------------------------- |
42+
| dotnet new evtmeshinmem | Standalone EventMesh server plugged with an InMemory broker |
43+
| dotnet new evtmeshkafka | Standalone EventMesh server plugged with an Apache Kafka broker |
44+
| dotnet new evtmeshrabbitmq | Standalone EventMesh server plugged with a RabbitMQ broker |
45+
| dotnet new evtmeshinmemui | EventMesh server with a UI plugged with an InMemory broker |
46+
| dotnet new faasnetfn | Empty function project |

docs/documentation/toc.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,26 @@
2222
items:
2323
- name: Concepts
2424
href: eventmesh/concepts.md
25-
- name: Installation
26-
href: eventmesh/installation.md
25+
- name: Install server
26+
items:
27+
- name: Nuget
28+
href: eventmesh/nuget.md
29+
- name: Docker
30+
href: eventmesh/docker.md
31+
- name: Portal
32+
href: eventmesh/portal.md
2733
- name: Message brokers
2834
items:
2935
- name: RabbitMQ
3036
href: eventmesh/rabbitmq.md
31-
- name: Portal
32-
href: eventmesh/portal.md
33-
- name: Listen topics
34-
href: eventmesh/listentopics.md
35-
- name: Publish messages
36-
href: eventmesh/publishmessages.md
37+
- name: Apache Kafka
38+
href: eventmesh/kafka.md
39+
- name: Configure client
40+
items:
41+
- name: Listen topics
42+
href: eventmesh/listentopics.md
43+
- name: Publish messages
44+
href: eventmesh/publishmessages.md
3745
- name: Protocol
3846
href: eventmesh/protocol.md
3947
- name: CLI

0 commit comments

Comments
 (0)