Skip to content

Commit

Permalink
Merge pull request #4 from awakari/switch-to-text-conditions
Browse files Browse the repository at this point in the history
switch to text conditions
  • Loading branch information
akurilov authored Jul 2, 2023
2 parents 4e8ecda + 8086a5d commit 509b88d
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 147 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.7.0
version: v3.12.0

- name: Build Helm Chart
run: |
Expand Down
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The chart deploys the following minimum set of components:
2. NATS in the Jetstream mode (if NATS usage is enabled).
3. Specific queue wrapper service (e.g. [queue-nats](https://github.com/awakari/queue-nats))
4. Specific distributed semaphore service (e.g. [semaphore-nats](https://github.com/awakari/semaphore-nats))
5. Specific condition services (e.g. [kiwi-tree](https://github.com/awakari/kiwi-tree))
5. Specific condition services (e.g. [text](https://github.com/awakari/conditions-text))
6. [Subscriptions](https://github.com/awakari/subscriptions) service
7. [Matches](https://github.com/awakari/matches) service
8. [Messages](https://github.com/awakari/messages) service
Expand All @@ -36,23 +36,36 @@ For a component-specific options see the corresponding sub-chart configuration.

| Variable | Default | Description |
|------------------------|---------|--------------------------------------------------------------------------------------------------------------------------|
| conditions.kiwi.tree | `true` | Enables the kiwi-tree conditions usage. May be used together with other conditions implementations. |
| mongodb.internal | `true` | Defines whether to deploy the MongoDB internally or use external one. |
| queue.backend.nats | `true` | Enables the NATS JetStream queue wrapper service. Exclusive, can not be used together with other queue backends. |
| semaphore.backend.nats | `true` | Enables the NATS-based distributed semaphore service. Exclusive, can not be used together with other semaphore backends. |

# 3. Deployment

Install and start minikube:
```shell
minikube start
```

Create the target namespace:
```shell
kubectl create namespace awakari
```

Create the image pull secret:
```shell
kubectl create secret generic github-registry \
-n awakari
--from-file=.dockerconfigjson=<home/.docker/config.json> \
--type=kubernetes.io/dockerconfigjson
```

> **Note**
>
> To use external MongoDB, use the values file [values-mongodb-ext.yaml](helm/core/values-mongodb-ext.yaml) for the
> reference and substitute these with own values.
Install the package built locally:
[Build a package locally](#63-building) and install the package built locally:
```shell
helm install core core-0.0.0.tgz -n awakari
```
Expand All @@ -61,7 +74,7 @@ helm install core core-0.0.0.tgz -n awakari
>
> Do not change the "core" release name
Or use an existing:
Alternatively, use the existing published helm package:
```shell
helm repo add awakari-core https://awakari.github.io/core

Expand Down Expand Up @@ -95,7 +108,7 @@ Refer to [Client SDK Usage](https://github.com/awakari/client-sdk-go#3-usage).
The core of Awakari consist of:
* Storages
* [Subscriptions](https://github.com/awakari/subscriptions)
* Conditions, e.g. [Kiwi Tree](https://github.com/awakari/kiwi-tree)
* Conditions, e.g. [Text](https://github.com/awakari/conditions-text)
* [Matches](https://github.com/awakari/matches)
* [Messages](https://github.com/awakari/messages)
* Stateless components
Expand Down Expand Up @@ -123,6 +136,7 @@ TODO

Build a helm package:
```shell
helm dependency update helm/core
helm package helm/core
```

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ module github.com/awakari/core
go 1.20

require (
github.com/awakari/client-sdk-go v0.0.4
github.com/awakari/client-sdk-go v1.0.0
github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.14.0
github.com/kelseyhightower/envconfig v1.4.0
github.com/stretchr/testify v1.8.0
google.golang.org/grpc v1.55.0
google.golang.org/protobuf v1.30.0
)

Expand All @@ -18,6 +19,5 @@ require (
golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect
google.golang.org/grpc v1.55.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/awakari/client-sdk-go v0.0.4 h1:4cabzPs0/8dZOKgMQoz+upFhTjwiz9MIoTahohEEUqg=
github.com/awakari/client-sdk-go v0.0.4/go.mod h1:QMPZGt4vNYscux4MjeSQUloFY8iYhR81ztG44FuUmzI=
github.com/awakari/client-sdk-go v1.0.0 h1:0SWNer2Z2qdDpHtugD58mb8KeGnYwQBwOLOdhfLcE1M=
github.com/awakari/client-sdk-go v1.0.0/go.mod h1:QMPZGt4vNYscux4MjeSQUloFY8iYhR81ztG44FuUmzI=
github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.14.0 h1:dEopBSOSjB5fM9r76ufM44AVj9Dnz2IOM0Xs6FVxZRM=
github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.14.0/go.mod h1:qDSbb0fgIfFNjZrNTPtS5MOMScAGyQtn1KlSvoOdqYw=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
12 changes: 2 additions & 10 deletions helm/core/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,9 @@ dependencies:
condition: queue.backend.nats
alias: queue

- name: kiwi-tree
- name: conditions-text
version: 0.0.0
repository: "https://awakari.github.io/kiwi-tree"
alias: conditions-kiwi-tree-complete
condition: conditions.kiwi.tree

- name: kiwi-tree
version: 0.0.0
repository: "https://awakari.github.io/kiwi-tree"
alias: conditions-kiwi-tree-partial
condition: conditions.kiwi.tree
repository: "https://awakari.github.io/conditions-text"

- name: messages
version: 0.0.0
Expand Down
29 changes: 13 additions & 16 deletions helm/core/values-mongodb-ext.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
mongodb:
internal: false

conditions-kiwi-tree-complete:
conditions-text:
db:
protocol: "mongodb+srv"
# hostname: "db.cluster.mongodb.net"
# username: "user-placeholder"
# password:
# raw: "password-placeholder"
tls:
enabled: true
insecure: true

conditions-kiwi-tree-partial:
db:
protocol: "mongodb+srv"
# hostname: "db.cluster.mongodb.net"
# username: "user-placeholder"
# password:
password:
secret:
enabled: false
# raw: "password-placeholder"
tls:
enabled: true
Expand All @@ -28,7 +19,9 @@ matches:
protocol: "mongodb+srv"
# hostname: "db.cluster.mongodb.net"
# username: "user-placeholder"
# password:
password:
secret:
enabled: false
# raw: "password-placeholder"
tls:
enabled: true
Expand All @@ -39,7 +32,9 @@ messages:
protocol: "mongodb+srv"
# hostname: "db.cluster.mongodb.net"
# username: "user-placeholder"
# password:
password:
secret:
enabled: false
# raw: "password-placeholder"
tls:
enabled: true
Expand All @@ -50,7 +45,9 @@ subscriptions:
protocol: "mongodb+srv"
# hostname: "db.cluster.mongodb.net"
# username: "user-placeholder"
# password:
password:
secret:
enabled: false
# raw: "password-placeholder"
tls:
enabled: true
Expand Down
41 changes: 12 additions & 29 deletions helm/core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ serviceAccount:
# If not set and create is true, a name is generated using the fullname template
name: ""

conditions:
kiwi:
tree: true
# bird: true
# etc

mongodb:
internal: true
auth:
Expand Down Expand Up @@ -81,30 +75,23 @@ queue:
nats:
uri: "nats://core-nats:4222"

conditions-kiwi-tree-complete:
db:
hostname: "core-mongodb:27017"
name: kiwi-tree
table:
# Database table name to use.
name: "kiwi-tree-complete"
username: "root"
password:
secret:
enabled: true
name: "core-mongodb"

conditions-kiwi-tree-partial:
conditions-text:
db:
hostname: "core-mongodb:27017"
name: "conditions-text"
table:
# Database table name to use.
name: "kiwi-tree-partial"
name: "conditions-text"
lockTtl:
create: "1000s"
username: "root"
password:
secret:
enabled: true
name: "core-mongodb"
text:
splitLimit: 1024
mostFreqLimit: 256

matches:
# Database related configuration.
Expand All @@ -129,10 +116,8 @@ messages:
subscriptions:
api:
uri:
kiwi:
tree:
complete: "core-conditions-kiwi-tree-complete:50051"
partial: "core-conditions-kiwi-tree-partial:50051"
conditions:
text: "core-conditions-text:50051"
db:
hostname: "core-mongodb:27017"
username: "root"
Expand All @@ -153,10 +138,8 @@ reader:
writer:
api:
conditions:
kiwi:
tree:
completeUri: "core-conditions-kiwi-tree-complete:50051"
partialUri: "core-conditions-kiwi-tree-partial:50051"
text:
uri: "core-conditions-text:50051"
subscriptions:
uri: "core-subscriptions:50051"
matches:
Expand Down
Loading

0 comments on commit 509b88d

Please sign in to comment.