Skip to content

Commit

Permalink
Merge pull request #90 from MathisBurger/feature/executor-grpc-callback
Browse files Browse the repository at this point in the history
Tasky GRPC status update
  • Loading branch information
MathisBurger authored Oct 29, 2024
2 parents 3afde28 + 4ca7ff4 commit 51f2d28
Show file tree
Hide file tree
Showing 23 changed files with 824 additions and 56 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
run: |
ln ./usernator/api.proto ./tasky/api.proto
ln ./tasky/tasky.proto ./usernator/tasky.proto
ln ./tasky/tasky.proto ./executor/tasky.proto
- name: set up buildx
uses: docker/setup-buildx-action@v1
- name: log in to ghcr
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
run: |
ln ./usernator/api.proto ./tasky/api.proto
ln ./tasky/tasky.proto ./usernator/tasky.proto
ln ./tasky/tasky.proto ./executor/tasky.proto
- name: Install docker-compose
run: |
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ services:
- MONGODB_PASSWORD=executor
- MONGODB_HOST=mongodb:27017
- MONGODB_DATABASE=executor_files
- TASKY_GRPC_ADDR=tasky:3001
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
Expand Down
3 changes: 2 additions & 1 deletion executor/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
.docker-conf
config.toml
config.toml
tasky.proto
13 changes: 13 additions & 0 deletions executor/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ import (
"executor/internal"
"executor/internal/global"
"executor/internal/handler"
"executor/tasky_grpc"
"fmt"
"github.com/runabol/tork/cli"
"github.com/runabol/tork/conf"
"github.com/runabol/tork/datastore"
"github.com/runabol/tork/engine"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"os"
"time"
)

func main() {
Expand All @@ -26,6 +30,15 @@ func main() {
appConfig := internal.LoadConfig()
internal.InitMongoDB(appConfig)

time.Sleep(time.Second * 8)
conn, err := grpc.NewClient(appConfig.TaskyGrpcAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
panic(err.Error())
}
client := tasky_grpc.NewTaskyApiClient(conn)

global.Tasky = &client

engine.RegisterEndpoint("POST", "/execute", handler.ExecuteHandler)
// Start the Tork CLI
app := cli.New()
Expand Down
3 changes: 2 additions & 1 deletion executor/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"password": "executor",
"host": "localhost:27017",
"database": "executor_files"
}
},
"tasky_grpc_addr": "localhost:3006"
}
38 changes: 27 additions & 11 deletions executor/go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
module executor

go 1.21
go 1.22

toolchain go1.22.8

require (
github.com/knadh/koanf/maps v0.1.1
github.com/runabol/tork v0.1.97
github.com/sethvargo/go-envconfig v1.1.0
go.mongodb.org/mongo-driver v1.17.1
google.golang.org/grpc v1.67.1
google.golang.org/protobuf v1.35.1
)

require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/cli v26.1.5+incompatible // indirect
Expand All @@ -15,7 +28,7 @@ require (
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-playground/locales v0.14.1 // indirect
Expand All @@ -28,11 +41,11 @@ require (
github.com/google/uuid v1.6.0 // indirect
github.com/jmoiron/sqlx v1.3.5 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/knadh/koanf/parsers/toml v0.1.0 // indirect
github.com/knadh/koanf/providers/env v0.1.0 // indirect
github.com/knadh/koanf/providers/file v0.1.0 // indirect
github.com/knadh/koanf/v2 v2.1.1 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/labstack/echo/v4 v4.12.0 // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
Expand All @@ -51,10 +64,9 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/rabbitmq/amqp091-go v1.10.0 // indirect
github.com/rogpeppe/go-internal v1.13.1 // indirect
github.com/rs/zerolog v1.32.0 // indirect
github.com/runabol/tork v0.1.97 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sethvargo/go-envconfig v1.1.0 // indirect
github.com/shirou/gopsutil/v3 v3.24.3 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
Expand All @@ -69,17 +81,21 @@ require (
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.mongodb.org/mongo-driver v1.17.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 // indirect
go.opentelemetry.io/otel v1.26.0 // indirect
go.opentelemetry.io/otel/metric v1.26.0 // indirect
go.opentelemetry.io/otel/trace v1.26.0 // indirect
go.opentelemetry.io/otel v1.31.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 // indirect
go.opentelemetry.io/otel/metric v1.31.0 // indirect
go.opentelemetry.io/otel/sdk v1.31.0 // indirect
go.opentelemetry.io/otel/trace v1.31.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 51f2d28

Please sign in to comment.