Skip to content

Commit

Permalink
chore: rename to raystack (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
ravisuhag committed Jul 6, 2023
1 parent e504267 commit 1177488
Show file tree
Hide file tree
Showing 86 changed files with 435 additions and 411 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:
tags: |
docker.pkg.github.com/${{ github.repository }}/raccoon:latest
docker.pkg.github.com/${{ github.repository }}/raccoon:${{ steps.get_version.outputs.version-without-v }}
odpf/raccoon:latest
odpf/raccoon:${{ steps.get_version.outputs.version-without-v }}
raystack/raccoon:latest
raystack/raccoon:${{ steps.get_version.outputs.version-without-v }}
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ PROTO_PACKAGE=/proto
generate-proto:
rm -rf .temp
mkdir -p .temp
curl -o .temp/proton.tar.gz -L http://api.github.com/repos/odpf/proton/tarball/main; tar xvf .temp/proton.tar.gz -C .temp/ --strip-components 1
protoc --proto_path=.temp/ .temp/odpf/raccoon/v1beta1/raccoon.proto --go_out=./ --go_opt=paths=import --go_opt=Modpf/raccoon/v1beta1/raccoon.proto=$(PROTO_PACKAGE)
protoc --proto_path=.temp/ .temp/odpf/raccoon/v1beta1/raccoon.proto --go-grpc_opt=paths=import --go-grpc_opt=Modpf/raccoon/v1beta1/raccoon.proto=$(PROTO_PACKAGE) --go-grpc_out=./
curl -o .temp/proton.tar.gz -L http://api.github.com/repos/raystack/proton/tarball/main; tar xvf .temp/proton.tar.gz -C .temp/ --strip-components 1
protoc --proto_path=.temp/ .temp/raystack/raccoon/v1beta1/raccoon.proto --go_out=./ --go_opt=paths=import --go_opt=Mraystack/raccoon/v1beta1/raccoon.proto=$(PROTO_PACKAGE)
protoc --proto_path=.temp/ .temp/raystack/raccoon/v1beta1/raccoon.proto --go-grpc_opt=paths=import --go-grpc_opt=Mraystack/raccoon/v1beta1/raccoon.proto=$(PROTO_PACKAGE) --go-grpc_out=./

# Build Lifecycle
compile:
Expand Down
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Raccoon

![build workflow](https://github.com/odpf/raccoon/actions/workflows/build.yaml/badge.svg)
![package workflow](https://github.com/odpf/raccoon/actions/workflows/package.yaml/badge.svg)
![build workflow](https://github.com/raystack/raccoon/actions/workflows/build.yaml/badge.svg)
![package workflow](https://github.com/raystack/raccoon/actions/workflows/package.yaml/badge.svg)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?logo=apache)](LICENSE)
[![Version](https://img.shields.io/github/v/release/odpf/raccoon?logo=semantic-release)](Version)
[![Version](https://img.shields.io/github/v/release/raystack/raccoon?logo=semantic-release)](Version)

Raccoon is high throughput, low-latency service that provides an API to ingest clickstream data from mobile apps, sites and publish it to Kafka. Raccoon uses the Websocket protocol for peer-to-peer communication and protobuf as the serialization format. It provides an event type agnostic API that accepts a batch (array) of events in protobuf format. Refer [here](https://github.com/odpf/proton/tree/main/odpf/raccoon) for proto definition format that Raccoon accepts.
Raccoon is high throughput, low-latency service that provides an API to ingest clickstream data from mobile apps, sites and publish it to Kafka. Raccoon uses the Websocket protocol for peer-to-peer communication and protobuf as the serialization format. It provides an event type agnostic API that accepts a batch (array) of events in protobuf format. Refer [here](https://github.com/raystack/proton/tree/main/raystack/raccoon) for proto definition format that Raccoon accepts.

<p align="center"><img src="./docs/static/assets/overview.svg" /></p>

Expand All @@ -18,7 +18,7 @@ Raccoon is high throughput, low-latency service that provides an API to ingest c
- **Reduced payload sizes** - Protobuf based
- **Metrics:** - Built-in monitoring includes latency and active connections.

To know more, follow the detailed [documentation](https://odpf.github.io/raccoon/)
To know more, follow the detailed [documentation](https://raystack.github.io/raccoon/)

## Use cases

Expand All @@ -33,10 +33,10 @@ Raccoon can be used as an event collector, event distributor and as a forwarder

Explore the following resources to get started with Raccoon:

- [Guides](https://odpf.github.io/raccoon/guides/overview) provides guidance on deployment and client sample.
- [Concepts](https://odpf.github.io/raccoon/concepts/architecture) describes all important Raccoon concepts.
- [Reference](https://odpf.github.io/raccoon//reference/configurations) contains details about configurations, metrics and other aspects of Raccoon.
- [Contribute](https://odpf.github.io/raccoon/contribute/contribution) contains resources for anyone who wants to contribute to Raccoon.
- [Guides](https://raystack.github.io/raccoon/guides/overview) provides guidance on deployment and client sample.
- [Concepts](https://raystack.github.io/raccoon/concepts/architecture) describes all important Raccoon concepts.
- [Reference](https://raystack.github.io/raccoon//reference/configurations) contains details about configurations, metrics and other aspects of Raccoon.
- [Contribute](https://raystack.github.io/raccoon/contribute/contribution) contains resources for anyone who wants to contribute to Raccoon.

## Run with Docker

Expand All @@ -46,19 +46,19 @@ Explore the following resources to get started with Raccoon:

**Run Docker Image**

Raccoon provides Docker [image](https://hub.docker.com/r/odpf/raccoon) as part of the release. Make sure you have Kafka running on your local and run the following.
Raccoon provides Docker [image](https://hub.docker.com/r/raystack/raccoon) as part of the release. Make sure you have Kafka running on your local and run the following.

```sh
# Download docker image from docker hub
$ docker pull odpf/raccoon
$ docker pull raystack/raccoon

# Run the following docker command with minimal config.
$ docker run -p 8080:8080 \
-e SERVER_WEBSOCKET_PORT=8080 \
-e SERVER_WEBSOCKET_CONN_ID_HEADER=X-User-ID \
-e PUBLISHER_KAFKA_CLIENT_BOOTSTRAP_SERVERS=host.docker.internal:9093 \
-e EVENT_DISTRIBUTION_PUBLISHER_PATTERN=clickstream-%s-log \
odpf/raccoon
raystack/raccoon
```

**Run Docker Compose**
Expand All @@ -71,7 +71,7 @@ $ make docker-run
$ make docker-stop
```

You can consume the published events from the host machine by using `localhost:9094` as kafka broker server. Mind the [topic routing](https://odpf.github.io/raccoon/concepts/architecture#event-distribution) when you consume the events.
You can consume the published events from the host machine by using `localhost:9094` as kafka broker server. Mind the [topic routing](https://raystack.github.io/raccoon/concepts/architecture#event-distribution) when you consume the events.

## Running locally

Expand All @@ -82,7 +82,7 @@ Prerequisite:

```sh
# Clone the repo
$ git clone https://github.com/odpf/raccoon.git
$ git clone https://github.com/raystack/raccoon.git

# Build the executable
$ make
Expand All @@ -94,7 +94,7 @@ $ vim .env
$ ./out/raccoon
```

**Note:** Read the detail of each configurations [here](https://odpf.github.io/raccoon/reference/configuration).
**Note:** Read the detail of each configurations [here](https://raystack.github.io/raccoon/reference/configuration).

## Running tests

Expand All @@ -112,11 +112,11 @@ $ INTEGTEST_BOOTSTRAP_SERVER=localhost:9094 INTEGTEST_HOST=localhost:8080 INTEGT

Development of Raccoon happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving Raccoon.

Read our [contributing guide](https://odpf.github.io/raccoon/contribute/contribution) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Raccoon.
Read our [contributing guide](https://raystack.github.io/raccoon/contribute/contribution) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Raccoon.

To help you get your feet wet and get you familiar with our contribution process, we have a list of [good first issues](https://github.com/odpf/raccoon/labels/good%20first%20issue) that contain bugs which have a relatively limited scope. This is a great place to get started.
To help you get your feet wet and get you familiar with our contribution process, we have a list of [good first issues](https://github.com/raystack/raccoon/labels/good%20first%20issue) that contain bugs which have a relatively limited scope. This is a great place to get started.

This project exists thanks to all the [contributors](https://github.com/odpf/raccoon/graphs/contributors).
This project exists thanks to all the [contributors](https://github.com/raystack/raccoon/graphs/contributors).

## License

Expand Down
4 changes: 2 additions & 2 deletions app/proc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package app
import (
"context"

"github.com/odpf/raccoon/logger"
"github.com/raystack/raccoon/logger"
)

//Run the server
// Run the server
func Run() error {
ctx := context.Background()
ctx, cancel := context.WithCancel(ctx)
Expand Down
14 changes: 7 additions & 7 deletions app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"syscall"
"time"

"github.com/odpf/raccoon/collection"
"github.com/odpf/raccoon/config"
"github.com/odpf/raccoon/logger"
"github.com/odpf/raccoon/metrics"
"github.com/odpf/raccoon/publisher"
"github.com/odpf/raccoon/services"
"github.com/odpf/raccoon/worker"
"github.com/raystack/raccoon/collection"
"github.com/raystack/raccoon/config"
"github.com/raystack/raccoon/logger"
"github.com/raystack/raccoon/metrics"
"github.com/raystack/raccoon/publisher"
"github.com/raystack/raccoon/services"
"github.com/raystack/raccoon/worker"
)

// StartServer starts the server
Expand Down
2 changes: 1 addition & 1 deletion clients/go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ all : setup fmt staticcheck test

setup:
@echo "installing the dependencies..."
go get go.buf.build/odpf/gw/odpf/proton
go get go.buf.build/raystack/gw/raystack/proton
go get golang.org/x/lint
go get google.golang.org/protobuf
go get github.com/gorilla/websocket
Expand Down
33 changes: 26 additions & 7 deletions clients/go/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
# Raccoon Client Library for Go #
# Raccoon Client Library for Go

[![Go Reference](https://pkg.go.dev/badge/google.golang.org/api.svg)](https://pkg.go.dev/google.golang.org/api)

## Requirements

go 1.16 or above

## Install

```bash
go get github.com/odpf/raccoon/clients/go
go get github.com/raystack/raccoon/clients/go
```

## Usage

#### Construct a new REST client, then use the various options on the client.

For example:

```go
import "github.com/odpf/raccoon/clients/go/rest"
import "github.com/raystack/raccoon/clients/go/rest"
```

```go
client, err := rest.New(
rest.WithUrl("http://localhost:8080/api/v1/events"),
Expand All @@ -27,10 +33,13 @@ client, err := rest.New(
see example: [examples/rest](examples/rest/main.go)

#### Construct a new GRPC client, then use the various options on the client.

For example:

```go
import "github.com/odpf/raccoon/clients/go/grpc"
import "github.com/raystack/raccoon/clients/go/grpc"
```

```go
client, err := grpc.New(
grpc.WithAddr("http://localhost:8080"),
Expand All @@ -45,24 +54,31 @@ client, err := grpc.New(
see example: [examples/grpc](examples/grpc/main.go)

#### Construct a new Websocket client, then use the various options on the client.

For example:

```go
import "github.com/odpf/raccoon/clients/go/ws"
import "github.com/raystack/raccoon/clients/go/ws"
```

```go
client, err := ws.New(
ws.WithUrl("ws://localhost:8080/api/v1/events"),
ws.WithHeader("x-user-id", "123"),
ws.WithHeader("x-user-type", "gojek"))
// default serializer is proto.
```

Reading the message acknowledgements

```go
resp := <-client.EventAcks()
```

see example: [examples/websocket](examples/ws/main.go)

#### Sending the request to raccoon

```go
reqGuid, resp, err := client.Send([]*raccoon.Event{
{
Expand All @@ -76,9 +92,8 @@ reqGuid, resp, err := client.Send([]*raccoon.Event{
})
```



#### Retry Configuration

Default settings, wait = `1 second`, and maximum attempts = `3`. The following options can override it.

```go
Expand All @@ -88,20 +103,24 @@ grpc.WithRetry(time.Second*2, 5)
```

### Custom Logging Configuration

The default logger logs the information to the standard output,
and the default logger can be diabled by the following settings

```go
rest.WithLogger(nil)
grpc.WithLogger(nil)
```

The client provide the logger interface that can be implemented by any logger.

```go
type Logger interface {
Infof(msg string, keysAndValues ...interface{})
Errorf(msg string, keysAndValues ...interface{})
}
```

And cutomer logger can set for the client with the following options.

```go
Expand Down
2 changes: 1 addition & 1 deletion clients/go/doc.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Package raccoon provides grpc, http and websocket client for the raccoon service.
see https://github.com/odpf/raccoon
see https://github.com/raystack/raccoon
*/

package raccoon
6 changes: 3 additions & 3 deletions clients/go/examples/grpc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/google/uuid"
raccoon "github.com/odpf/raccoon/clients/go"
"github.com/odpf/raccoon/clients/go/grpc"
"github.com/odpf/raccoon/clients/go/testdata"
raccoon "github.com/raystack/raccoon/clients/go"
"github.com/raystack/raccoon/clients/go/grpc"
"github.com/raystack/raccoon/clients/go/testdata"
)

func main() {
Expand Down
8 changes: 4 additions & 4 deletions clients/go/examples/rest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/google/uuid"
raccoon "github.com/odpf/raccoon/clients/go"
"github.com/odpf/raccoon/clients/go/rest"
"github.com/odpf/raccoon/clients/go/serializer"
"github.com/odpf/raccoon/clients/go/testdata"
raccoon "github.com/raystack/raccoon/clients/go"
"github.com/raystack/raccoon/clients/go/rest"
"github.com/raystack/raccoon/clients/go/serializer"
"github.com/raystack/raccoon/clients/go/testdata"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions clients/go/examples/ws/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"fmt"
"log"

raccoon "github.com/odpf/raccoon/clients/go"
raccoon "github.com/raystack/raccoon/clients/go"
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/google/uuid"
"github.com/odpf/raccoon/clients/go/testdata"
"github.com/odpf/raccoon/clients/go/ws"
"github.com/raystack/raccoon/clients/go/testdata"
"github.com/raystack/raccoon/clients/go/ws"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions clients/go/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/odpf/raccoon/clients/go
module github.com/raystack/raccoon/clients/go

go 1.16

require (
github.com/stretchr/testify v1.8.0
go.buf.build/odpf/gw/odpf/proton v1.1.131
go.buf.build/raystack/gw/raystack/proton v1.1.131
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616
google.golang.org/grpc v1.49.0
google.golang.org/protobuf v1.28.1
Expand Down
8 changes: 4 additions & 4 deletions clients/go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.buf.build/odpf/gw/envoyproxy/protoc-gen-validate v1.1.7/go.mod h1:Z+auCoGBL8lg1aQQgGe7R3HLnYKf6nbtTawTt0WmFCo=
go.buf.build/odpf/gw/grpc-ecosystem/grpc-gateway v1.1.46/go.mod h1:/LuddrGPi0fwj7ay6Orutt8oFfPz8Y3c8qdBkacJq1A=
go.buf.build/odpf/gw/odpf/proton v1.1.131 h1:ufVq/8R9zkYjLPUq2xKqi/InJPTmh7MjPfNtdb5U8nE=
go.buf.build/odpf/gw/odpf/proton v1.1.131/go.mod h1:/TrDvy+6bIydxZAEliK+Wo3JuMRYFz1L+d9UsYZT44w=
go.buf.build/raystack/gw/envoyproxy/protoc-gen-validate v1.1.7/go.mod h1:Z+auCoGBL8lg1aQQgGe7R3HLnYKf6nbtTawTt0WmFCo=
go.buf.build/raystack/gw/grpc-ecosystem/grpc-gateway v1.1.46/go.mod h1:/LuddrGPi0fwj7ay6Orutt8oFfPz8Y3c8qdBkacJq1A=
go.buf.build/raystack/gw/raystack/proton v1.1.131 h1:ufVq/8R9zkYjLPUq2xKqi/InJPTmh7MjPfNtdb5U8nE=
go.buf.build/raystack/gw/raystack/proton v1.1.131/go.mod h1:/TrDvy+6bIydxZAEliK+Wo3JuMRYFz1L+d9UsYZT44w=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
Expand Down
10 changes: 5 additions & 5 deletions clients/go/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ import (
"context"
"fmt"

"github.com/odpf/raccoon/clients/go/log"
"github.com/raystack/raccoon/clients/go/log"

pb "go.buf.build/odpf/gw/odpf/proton/odpf/raccoon/v1beta1"
pb "go.buf.build/raystack/gw/raystack/proton/raystack/raccoon/v1beta1"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/metadata"
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/google/uuid"
raccoon "github.com/odpf/raccoon/clients/go"
"github.com/odpf/raccoon/clients/go/retry"
"github.com/odpf/raccoon/clients/go/serializer"
raccoon "github.com/raystack/raccoon/clients/go"
"github.com/raystack/raccoon/clients/go/retry"
"github.com/raystack/raccoon/clients/go/serializer"
)

// New creates the new grpc client with provided options.
Expand Down
Loading

0 comments on commit 1177488

Please sign in to comment.