-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
11 changed files
with
74 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,6 @@ jobs: | |
- name: Lint | ||
run: | | ||
./scripts/lint.sh | ||
yarn eslint | ||
- name: Test | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1 @@ | ||
# Infrastructure | ||
|
||
- [Infrastructure](#infrastructure) | ||
- [Components](#components) | ||
- [Networking](#networking) | ||
|
||
## Components | ||
|
||
The Airy Core Platform components require the following systems to run: | ||
|
||
- A [Kafka](https://kafka.apache.org) cluster (which in turn requires [zookeeper](https://zookeeper.apache.org)) | ||
- The [Confluent Schema registry](https://github.com/confluentinc/schema-registry) | ||
- A [PostgreSQL](https://www.postgresql.org/) database | ||
|
||
We also provide Kubernetes manifests for the Airy Core Platform applications, | ||
they are located in [this folder](/infrastructure/deployments). If you need to | ||
customize any aspect of the deployment process, the `../scripts/bootstrap.sh` | ||
and `provisioning.sh` scripts are good entry-points. | ||
|
||
## Networking | ||
|
||
As the Airy Core Platform runs in Kubernetes, using the [K3OS](https://k3os.io/) distribution. | ||
All of the necessary services exposed with [Traefik](https://traefik.io/) ingress controller. | ||
Through that ingress controller, the internal services are exposed and can be | ||
accessed from outside of the Vagrant box. | ||
|
||
Since k3os kubernetes clusters are usually not exposed to the public internet, | ||
we included an ngrok client to facilitate the integration of sources (via webhooks). | ||
|
||
For the Airy Core Platform to be accessible from the outside (for | ||
example from Facebook, in order to send events to the Facebook webhook), the | ||
system must have public access. To facilitate the process, we included a | ||
[ngrok](https://ngrok.com/) client deployment inside the cluster. The ngrok | ||
client connects to our hosted ngrok server at `tunnel.airy.co`, creates a unique | ||
public endpoint (ex. https://some-random-string.tunnel.airy.co/facebook) and redirects | ||
the traffic to the local Facebook webhook pod. When starting, the Airy Core | ||
Platform prints the public URL for the Facebook webhook. You can also check it | ||
by running the `/vagrant/scripts/status.sh` script from inside the Airy Core | ||
Platform box or directly: | ||
|
||
```sh | ||
vagrant ssh -c /vagrant/scripts/status.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,43 @@ | ||
#!/bin/bash | ||
|
||
########################################################################## | ||
# THIS FILE WAS GENERATED. DO NOT EDIT. See /infrastructure/tools/topics # | ||
########################################################################## | ||
|
||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
ZOOKEEPER=airy-cp-zookeeper:2181 | ||
PARTITIONS=${PARTITIONS:-10} | ||
REPLICAS=${REPLICAS:-1} | ||
AIRY_CORE_NAMESPACE=${AIRY_CORE_NAMESPACE:-} | ||
|
||
echo "Creating Kafka topics" | ||
|
||
if [ -n "${AIRY_CORE_NAMESPACE}" ] | ||
then | ||
AIRY_CORE_NAMESPACE="${AIRY_CORE_NAMESPACE}." | ||
echo "Using ${AIRY_CORE_NAMESPACE} to namespace topics" | ||
fi | ||
|
||
|
||
echo "Creating Kafka topics..." | ||
kafka-topics --create --if-not-exists --zookeeper ${ZOOKEEPER} --replication-factor ${REPLICAS} --partitions ${PARTITIONS} --topic "${AIRY_CORE_NAMESPACE}application.communication.channels" 1>/dev/null | ||
|
||
kafka-topics --create --if-not-exists --zookeeper $ZOOKEEPER --replication-factor $REPLICAS --partitions $PARTITIONS --topic application.communication.channels 1>/dev/null | ||
kafka-topics --create --if-not-exists --zookeeper ${ZOOKEEPER} --replication-factor ${REPLICAS} --partitions ${PARTITIONS} --topic "${AIRY_CORE_NAMESPACE}application.communication.messages" --config cleanup.policy=compact min.compaction.lag.ms=86400000 segment.bytes=10485760 1>/dev/null | ||
|
||
kafka-topics --create --if-not-exists --zookeeper $ZOOKEEPER --replication-factor $REPLICAS --partitions $PARTITIONS --topic application.communication.messages --config cleanup.policy=compact min.compaction.lag.ms=86400000 segment.bytes=10485760 1>/dev/null | ||
kafka-topics --create --if-not-exists --zookeeper ${ZOOKEEPER} --replication-factor ${REPLICAS} --partitions ${PARTITIONS} --topic "${AIRY_CORE_NAMESPACE}application.communication.metadata" --config cleanup.policy=compact min.compaction.lag.ms=86400000 segment.bytes=10485760 1>/dev/null | ||
|
||
kafka-topics --create --if-not-exists --zookeeper $ZOOKEEPER --replication-factor $REPLICAS --partitions $PARTITIONS --topic application.communication.metadata --config cleanup.policy=compact min.compaction.lag.ms=86400000 segment.bytes=10485760 1>/dev/null | ||
kafka-topics --create --if-not-exists --zookeeper ${ZOOKEEPER} --replication-factor ${REPLICAS} --partitions ${PARTITIONS} --topic "${AIRY_CORE_NAMESPACE}application.communication.read-receipt" --config cleanup.policy=compact min.compaction.lag.ms=86400000 segment.bytes=10485760 1>/dev/null | ||
|
||
kafka-topics --create --if-not-exists --zookeeper $ZOOKEEPER --replication-factor $REPLICAS --partitions $PARTITIONS --topic application.communication.read-receipt 1>/dev/null | ||
kafka-topics --create --if-not-exists --zookeeper ${ZOOKEEPER} --replication-factor ${REPLICAS} --partitions ${PARTITIONS} --topic "${AIRY_CORE_NAMESPACE}application.communication.tags" --config cleanup.policy=compact min.compaction.lag.ms=86400000 segment.bytes=10485760 1>/dev/null | ||
|
||
kafka-topics --create --if-not-exists --zookeeper $ZOOKEEPER --replication-factor $REPLICAS --partitions $PARTITIONS --topic application.communication.tags --config cleanup.policy=compact min.compaction.lag.ms=86400000 segment.bytes=10485760 1>/dev/null | ||
kafka-topics --create --if-not-exists --zookeeper ${ZOOKEEPER} --replication-factor ${REPLICAS} --partitions ${PARTITIONS} --topic "${AIRY_CORE_NAMESPACE}application.communication.webhooks" 1>/dev/null | ||
|
||
kafka-topics --create --if-not-exists --zookeeper $ZOOKEEPER --replication-factor $REPLICAS --partitions $PARTITIONS --topic application.communication.webhooks 1>/dev/null | ||
kafka-topics --create --if-not-exists --zookeeper ${ZOOKEEPER} --replication-factor ${REPLICAS} --partitions ${PARTITIONS} --topic "${AIRY_CORE_NAMESPACE}ops.application.health" --config retention.ms=3600000 1>/dev/null | ||
|
||
kafka-topics --create --if-not-exists --zookeeper $ZOOKEEPER --replication-factor $REPLICAS --partitions $PARTITIONS --topic ops.application.health --config retention.ms=3600000 1>/dev/null | ||
kafka-topics --create --if-not-exists --zookeeper ${ZOOKEEPER} --replication-factor ${REPLICAS} --partitions ${PARTITIONS} --topic "${AIRY_CORE_NAMESPACE}source.facebook.events" 1>/dev/null | ||
|
||
kafka-topics --create --if-not-exists --zookeeper $ZOOKEEPER --replication-factor $REPLICAS --partitions $PARTITIONS --topic source.facebook.events 1>/dev/null | ||
kafka-topics --create --if-not-exists --zookeeper ${ZOOKEEPER} --replication-factor ${REPLICAS} --partitions ${PARTITIONS} --topic "${AIRY_CORE_NAMESPACE}source.google.events" 1>/dev/null | ||
|
||
kafka-topics --create --if-not-exists --zookeeper $ZOOKEEPER --replication-factor $REPLICAS --partitions $PARTITIONS --topic source.google.events 1>/dev/null | ||
kafka-topics --create --if-not-exists --zookeeper ${ZOOKEEPER} --replication-factor ${REPLICAS} --partitions ${PARTITIONS} --topic "${AIRY_CORE_NAMESPACE}source.twilio.events" 1>/dev/null | ||
|
||
kafka-topics --create --if-not-exists --zookeeper $ZOOKEEPER --replication-factor $REPLICAS --partitions $PARTITIONS --topic source.twilio.events 1>/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters