We love every form of contribution. By participating in this project, you agree
to abide to the TypeStream code of conduct.
- Gradle
- Docker and Docker Compose
- Minikube
- Go
- Protobuf
- Make
- Redpanda (you need
rpklocally. Min version:v24.1.2)
TypeStream is a Kotlin gRPC
application. We use Gradle as our build tool. You can
find the instructions to install it here.
While it's not required, we recommend IntelliJ IDEA to work with our Kotlin codebase.
We also provide an official CLI application called typestream, available at
/cli. The CLI is written in Go.
Clone TypeStream from source:
$ git clone https://github.com/typestreamio/typestream.git
# Cloning into 'typestream'...
# etc..
$ cd typestreamA good way of making sure everything is all right is running the test suite:
./gradlew checkFor the CLI, you can run:
cd cli
makeOpen an issue if you run into any problem.
You can build the TypeStream by running:
./gradlew buildIf you use IntelliJ IDEA, we provide a run configuration that you can use to run
the server. It uses the script scripts/dev/kafkastart.sh to start a local
Redpanda cluster.
Otherwise, you can run the server with:
./scripts/dev/server.shand then, from another window terminal, the CLI with:
./scripts/dev/shell.shWhile this is sufficient to run the server and play around with the CLI
features, it doesn't allow you to work with TypeStream "cloud native" features
(such as the long running jobs scheduler).
To do so, you need to run TypeStream in "k8s mode". The first thing to do is
to push the beta images to a local docker registry. In one terminal, run:
docker run --rm -it --network=host alpine ash -c "apk add socat && socat TCP-LISTEN:5001,reuseaddr,fork TCP:$(minikube -p typestream ip):5001"so that the docker registry is available at localhost:5001. Then, in another terminal, run:
docker run -d -p 5001:5000 --restart=always --name registry registry:2to push the beta images to the local registry. Finally, run:
cd cli
make
./typestream k8s create # add --redpanda to also start a Redpanda cluster inside k8sto create a local k8s cluster with
Minikube using the beta images.
Once you have an healthy minikube cluster, you can connect to the TypeStream
server with the CLI as long as you're running this command in the background:
kubectl port-forward -n typestream svc/server 4242:4242To help people getting started, we provide a few
local commands. If you're to test TypeStream in this context, you need a local
docker registry:
docker run -d -p 5001:5000 --restart=always --name registry registry:2and then you can run:
./scripts/dev/push-images.shYou're now ready to run the server in local mode:
cd cli
make
./typestream local start
./typestream local seedWe try to cover as much as we can with testing. The goal is having each single feature covered by one or more tests. Adding more tests is a great way of contributing to the project!
Once you are set up, you can run the test suite with one command:
./gradlew testYou can create a branch for your changes and try to build from the source as you go:
./gradlew checkPush your branch to your TypeStream fork and open a pull request against the
main branch. We use conventional commits
for our commit messages so follow the convention in the title of your PR
(otherwise, the build will fail).