Skip to content

Commit

Permalink
package migration (#1)
Browse files Browse the repository at this point in the history
* goto package migrations

* goto jave client package migrations

* updated the go version

* updated the buf version

* go client package migration

* package name updates

* updating the naming

* update the java client version
  • Loading branch information
AkbaraliShaikh authored Mar 14, 2023
1 parent e504267 commit 3da17d0
Show file tree
Hide file tree
Showing 122 changed files with 2,518 additions and 665 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ jobs:
- name: Setup Go
uses: actions/[email protected]
with:
go-version: '1.14'
- name: Install Protoc
uses: arduino/setup-protoc@v1
go-version: '1.17'
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Project
run: make install-protoc; make setup
run: make setup
- name: Invoking go test
run: make test
- name: Invoking go bench test
Expand All @@ -30,9 +28,7 @@ jobs:
- name: Setup Go
uses: actions/[email protected]
with:
go-version: '1.14'
- name: Install Protoc
uses: arduino/setup-protoc@v1
go-version: '1.17'
- uses: actions/checkout@v2
- name: Build
run: make all
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
run: cd docs && yarn build
- name: Deploy docs
env:
GIT_USER: ravisuhag
GIT_USER: akbaralishaikh
GIT_PASS: ${{ secrets.DOCU_RS_TOKEN }}
DEPLOYMENT_BRANCH: gh-pages
CURRENT_BRANCH: master
working-directory: docs
run: |
git config --global user.email "suhag.ravi@gmail.com"
git config --global user.name "ravisuhag"
git config --global user.email "aashaikh55@gmail.com"
git config --global user.name "akbaralishaikh"
yarn deploy
3 changes: 0 additions & 3 deletions .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ jobs:
steps:
- name: Setup Docker
uses: docker-practice/actions-setup-docker@master
- name: Install Protoc
uses: arduino/setup-protoc@v1
- name: Checkout repo
uses: actions/checkout@v2
- name: Copy integration config
run: cp .env.test .env
- name: Run Raccoon
run: make docker-run
- run: make install-protoc && make generate-proto
- name: Invoking go test
run: INTEGTEST_BOOTSTRAP_SERVER=localhost:9094 INTEGTEST_HOST=localhost:8080 INTEGTEST_TOPIC_FORMAT="clickstream-%s-log" GRPC_SERVER_ADDR="localhost:8081" go test ./integration -v
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Release Raccoon
on:
workflow_dispatch:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*.*.*" # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
push-to-docker-hub:
runs-on: ubuntu-latest
Expand Down 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 }}
gotocompany/raccoon:latest
gotocompany/raccoon:${{ steps.get_version.outputs.version-without-v }}
13 changes: 4 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
FROM golang:1.14
FROM golang:1.17

WORKDIR /app
RUN apt-get update && apt-get install unzip --no-install-recommends --assume-yes
RUN PROTOC_ZIP=protoc-3.17.3-linux-x86_64.zip && \
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/$PROTOC_ZIP && \
unzip -o $PROTOC_ZIP -d /usr/local bin/protoc && \
unzip -o $PROTOC_ZIP -d /usr/local 'include/*' && \
rm -f $PROTOC_ZIP
COPY . .
RUN make install-protoc && make generate-proto && make update-deps && make compile
RUN make update-deps && make compile

FROM debian:buster-slim
FROM debian:bullseye
WORKDIR /app
COPY --from=0 /app/out/raccoon ./raccoon
COPY --from=0 /app/raccoon ./raccoon
COPY . .
CMD ["./raccoon"]
28 changes: 5 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,39 +1,24 @@
.PHONY: all

ALL_PACKAGES=$(shell go list ./... | grep -v "vendor")
APP_EXECUTABLE="out/raccoon"
APP_EXECUTABLE="raccoon"
COVER_FILE="/tmp/coverage.out"

all: install-protoc setup compile
all: setup compile

# Setups
setup: generate-proto copy-config
setup: copy-config
make update-deps

install-protoc:
@echo "> installing dependencies"
go get -u github.com/golang/protobuf/[email protected]
go get -u github.com/golang/protobuf/[email protected]
go get -u google.golang.org/grpc/cmd/[email protected]

update-deps:
go mod tidy -v
go mod vendor

copy-config:
cp .env.sample .env

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=./

# Build Lifecycle
compile:
mkdir -p out/
go build -o $(APP_EXECUTABLE)

build: copy-config update-deps compile
Expand All @@ -44,9 +29,6 @@ install:
start: build
./$(APP_EXECUTABLE)

clean: ## Clean the builds
rm -rf out/

# Utility

fmt:
Expand All @@ -71,7 +53,7 @@ test: lint
test-bench: # run benchmark tests
@go test $(shell go list ./... | grep -v "vendor") -v -bench ./... -run=^Benchmark

test_ci: install-protoc setup test
test_ci: setup test

# Docker Run

Expand All @@ -83,4 +65,4 @@ docker-stop:
docker-compose stop

docker-start:
docker-compose start
docker-compose start
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/goto/raccoon/actions/workflows/build.yaml/badge.svg)
![package workflow](https://github.com/goto/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/goto/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/goto/proton/tree/main/goto/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://goto.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://goto.github.io/raccoon/guides/overview) provides guidance on deployment and client sample.
- [Concepts](https://goto.github.io/raccoon/concepts/architecture) describes all important Raccoon concepts.
- [Reference](https://goto.github.io/raccoon//reference/configurations) contains details about configurations, metrics and other aspects of Raccoon.
- [Contribute](https://goto.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/goto/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 gotocompany/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
gotocompany/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://goto.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/goto/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://goto.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://goto.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/goto/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/goto/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/goto/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/goto/raccoon/collection"
"github.com/goto/raccoon/config"
"github.com/goto/raccoon/logger"
"github.com/goto/raccoon/metrics"
"github.com/goto/raccoon/publisher"
"github.com/goto/raccoon/services"
"github.com/goto/raccoon/worker"
)

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

setup:
@echo "installing the dependencies..."
go get go.buf.build/odpf/gw/odpf/proton
go get buf.build/gen/go/gotocompany/proton/protocolbuffers/go
go get buf.build/gen/go/gotocompany/proton/grpc/go
go get golang.org/x/lint
go get google.golang.org/protobuf
go get github.com/gorilla/websocket
Expand Down
8 changes: 4 additions & 4 deletions clients/go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ go 1.16 or above

## Install
```bash
go get github.com/odpf/raccoon/clients/go
go get github.com/goto/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/goto/raccoon/clients/go/rest"
```
```go
client, err := rest.New(
Expand All @@ -29,7 +29,7 @@ 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/goto/raccoon/clients/go/grpc"
```
```go
client, err := grpc.New(
Expand All @@ -47,7 +47,7 @@ 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/goto/raccoon/clients/go/ws"
```
```go
client, err := ws.New(
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/goto/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/goto/raccoon/clients/go"
"github.com/goto/raccoon/clients/go/grpc"
"github.com/goto/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/goto/raccoon/clients/go"
"github.com/goto/raccoon/clients/go/rest"
"github.com/goto/raccoon/clients/go/serializer"
"github.com/goto/raccoon/clients/go/testdata"
)

func main() {
Expand Down
Loading

0 comments on commit 3da17d0

Please sign in to comment.