diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ddf6a18..6271660 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,24 +10,24 @@ updates: schedule: interval: daily reviewers: - - "48d90782" + - "rustatian" assignees: - - "48d90782" + - "rustatian" - package-ecosystem: "github-actions" directory: "/" schedule: interval: weekly reviewers: - - "48d90782" + - "rustatian" assignees: - - "48d90782" + - "rustatian" - package-ecosystem: "docker" directory: "/" schedule: interval: daily reviewers: - - "48d90782" + - "rustatian" assignees: - - "48d90782" + - "rustatian" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2ed667a..468be6a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,7 +36,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16.4 + go-version: 1.16.6 - name: Check out code uses: actions/checkout@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2fdefe0..b6d566c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,7 +31,7 @@ jobs: run: npm install -g ajv-cli # Package page: - name: Run linter - run: ajv validate --all-errors --verbose -s ./schemas/config/2.0.schema.json -d ./.rr*.y*ml + run: ajv validate --all-errors --verbose -s ./schemas/config/2.0.schema.json -d ./.rr.yaml golangci-lint: name: Golang-CI (lint) @@ -43,7 +43,7 @@ jobs: - name: Run linter uses: golangci/golangci-lint-action@v2 # Action page: with: - version: v1.38 # without patch version + version: v1.41 # without patch version only-new-issues: false # show only new issues if it's a pull request args: --timeout=10m @@ -54,7 +54,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16.4 + go-version: 1.16.6 - name: Check out code uses: actions/checkout@v2 @@ -92,7 +92,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 # action page: with: - go-version: 1.16.4 + go-version: 1.16.6 - name: Check out code uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index c2686a0..a4dc5ea 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ dir1 coverage /rr rr.exe +.rr-sample-bench.yaml diff --git a/.rr-sample-bench.yaml b/.rr-sample-bench.yaml new file mode 100644 index 0000000..d5ada86 --- /dev/null +++ b/.rr-sample-bench.yaml @@ -0,0 +1,22 @@ +rpc: + listen: unix:///tmp/rr.sock + +server: + command: "php ../roadrunner/tests/psr-worker-bench.php" + relay: "pipes" + relay_timeout: "20s" + +http: + address: 127.0.0.1:15395 + max_request_size: 1024 + middleware: [ ] + trusted_subnets: [ "10.0.0.0/8", "127.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "::1/128", "fc00::/7", "fe80::/10" ] + pool: + num_workers: 10 + max_jobs: 0 + allocate_timeout: 60s + destroy_timeout: 60s + +logs: + mode: production + level: error diff --git a/.rr.yaml b/.rr.yaml index 10c8071..c1ddb9c 100644 --- a/.rr.yaml +++ b/.rr.yaml @@ -26,7 +26,7 @@ server: # This option is required. command: "php psr-worker.php" - # User name (not UID) for the worker processes. An empty value means to use the RR process user. + # Username (not UID) for the worker processes. An empty value means to use the RR process user. # # Default: "" user: "" @@ -717,6 +717,208 @@ reload: # Default: [] patterns: [ ".php", ".go", ".md" ] +# AMQP jobs driver +# +# This option is required to use AMQP driver +amqp: + # AMQP Uri to connect to the rabbitmq server https://www.rabbitmq.com/uri-spec.html + # + # This option is required for the production. Default: amqp://guest:guest@127.0.0.1:5672 + addr: amqp://guest:guest@127.0.0.1:5672/ + +# Beanstalk jobs driver +# +# This option is required to use Beanstalk driver +beanstalk: + # Beanstalk address + # + # This option is required for the production. Default: tcp://127.0.0.1:11300 + addr: tcp://127.0.0.1:11300 + + # Beanstalk connect timeout. + # + # Default: 30s + timeout: 10s + +# SQS jobs driver (https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html) +# +# This option is required to use SQS driver +sqs: + # AccessKey ID + # + # This option is required for the production. Default: empty + key: api-key + + # Secret access key + # + # This option is required for the production. Default: empty + secret: api-secret + + # AWS region + # + # This option is required for the production. Default: empty + region: us-west-1 + + # AWS session token + # + # This option is required for the production. Default: empty + session_token: test + + # AWS SQS endpoint to connect + # + # This option is required for the production. Default: http://127.0.0.1:9324 + endpoint: http://127.0.0.1:9324 + +jobs: + # Number of threads which will try to obtain the job from the priority queue + # + # Default: number of the logical CPU cores + num_pollers: 32 + + # Size of the internal priority queue + # + # Default: 1_000_000 + pipeline_size: 100000 + + # worker pool configuration + pool: + num_workers: 10 + max_jobs: 0 + allocate_timeout: 60s + destroy_timeout: 60s + + # List of broker pipelines associated with the drivers. + # + # This option is not required since you can declare pipelines in the runtime. Pipeline driver should exist. + pipelines: + # Pipeline name + # + # This option is required when defining pipelines via configuration. + test-local: + # Driver associated with the pipeline + # + # This option is required. Possible values: amqp, ephemeral, sqs, beanstalk + driver: ephemeral + # Pipeline priority + # + # If the job has priority set to 0, it will inherit the pipeline's priority. Default: 10. + priority: 10 + # Number of job to prefetch from the driver. + # + # Default: 100_000. + prefetch: 10000 + + test-local-2: + # Driver name + # + # This option is required. + driver: amqp + # QoS - prefetch. + # + # Default: 10 + prefetch: 10 + # Queue name + # + # Default: default + queue: test-1-queue + # Pipeline jobs priority, 1 - highest + # + # Default: 10 + priority: 1 + # Exchange name + # + # Default: amqp.default + exchange: default + # Exchange type + # + # Default: direct. + exchange_type: direct + # Routing key for the queue + # + # Default: empty. + routing_key: test + # Declare a queue exclusive at the exchange + # + # Default: false + exclusive: false + # When multiple is true, this delivery and all prior unacknowledged deliveries + # on the same channel will be acknowledged. This is useful for batch processing + # of deliveries + # + # Default:false + multiple_ack: false + # When multiple is true, this delivery and all prior unacknowledged deliveries + # on the same channel will be acknowledged. This is useful for batch processing + # of deliveries + # + # Default: false + requeue_on_fail: false + + + test-local-3: + # Driver name + # + # This option is required. + driver: beanstalk + # Pipeline jobs priority, 1 - highest + # + # Default: 10 + priority: 11 + # Beanstalk internal tube priority + # + # Default: 1 + tube_priority: 1 + # Tube name + # + # Default: default + tube: default-1 + # If no job is available before this timeout has passed, Reserve returns a ConnError recording ErrTimeout. + # + # Default: 5s + reserve_timeout: 10s + + test-local-4: + # Driver name + # + # This option is required. + driver: sqs + # Number of jobs to prefetch from the SQS. mazon SQS never returns more messages than this value + # (however, fewer messages might be returned). Valid values: 1 to 10. + # + # Default: 10 + prefetch: 10 + # The duration (in seconds) that the received messages are hidden from subsequent + # retrieve requests after being retrieved by a ReceiveMessage request + # + # Default: 0 + visibility_timeout: 0 + # The duration (in seconds) for which the call waits for a message to arrive + # in the queue before returning. If a message is available, the call returns + # sooner than WaitTimeSeconds. If no messages are available and the wait time + # expires, the call returns successfully with an empty list of messages. + # + # Default: 0 + wait_time_seconds: 0 + # Queue name. + # + # Default: default + queue: default + # List of the AWS SQS attributes https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SetQueueAttributes.html. + attributes: + DelaySeconds: 0 + MaximumMessageSize: 262144 + MessageRetentionPeriod: 345600 + ReceiveMessageWaitTimeSeconds: 0 + VisibilityTimeout: 30 + # Tags don't have any semantic meaning. Amazon SQS interprets tags as character + # strings. + tags: + test: "tag" + + + # list of pipelines to be consumed by the server, keep empty if you want to start consuming manually + consume: [ "test-local", "test-local-2", "test-local-3", "test-local-4" ] + ## RoadRunner internal container configuration (docs: https://github.com/spiral/endure). endure: # How long to wait for stopping. diff --git a/CHANGELOG.md b/CHANGELOG.md index cce03cd..828d5e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,30 @@ CHANGELOG ========= + v2.4.0 (-.08.2021) ------------------- +## 💔 Internal BC: + +- 🔨 Pool, worker interfaces: payload now passed and returned by pointer. + +## 👀 New: + +- ✏️ Long awaited, reworked `Jobs` plugin with pluggable drivers. Now you can allocate/destroy pipelines in the runtime. + Drivers included in the initial release: `RabbitMQ (0-9-1)`, `SQS v2`, `beanstalk`, `ephemeral` + . [PR](https://github.com/spiral/roadrunner/pull/726) + ## 🩹 Fixes: - 🐛 Fix: add `debug` pool config key to the `.rr.yaml` configuration [reference](https://github.com/spiral/roadrunner-binary/issues/79). +- 🐛 Fix: fixed bug with waiting goroutines on the internal worker's container channel. + +## 📦 Packages: + +- 📦 Update goridge to `v3.2.0` +- 📦 Update temporal to `v1.0.9` +- 📦 Update RR to `v2.4.0` ## 📈 Summary: diff --git a/go.mod b/go.mod index 9991b26..b2a4de0 100644 --- a/go.mod +++ b/go.mod @@ -14,10 +14,10 @@ require ( // SPIRAL ------------ github.com/spiral/endure v1.0.2 github.com/spiral/errors v1.0.11 - github.com/spiral/goridge/v3 v3.1.4 - github.com/spiral/roadrunner/v2 v2.3.2 + github.com/spiral/goridge/v3 v3.2.0 + github.com/spiral/roadrunner/v2 v2.4.0-alpha.1 // --------------------- github.com/stretchr/testify v1.7.0 - github.com/temporalio/roadrunner-temporal v1.0.8 + github.com/temporalio/roadrunner-temporal v1.0.9-alpha.1 github.com/vbauerster/mpb/v5 v5.4.0 ) diff --git a/go.sum b/go.sum index d084908..8074486 100644 --- a/go.sum +++ b/go.sum @@ -45,6 +45,30 @@ github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6l github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/aws/aws-sdk-go-v2 v1.7.0 h1:UYGnoIPIzed+ycmgw8Snb/0HK+KlMD+SndLTneG8ncE= +github.com/aws/aws-sdk-go-v2 v1.7.0/go.mod h1:tb9wi5s61kTDA5qCkcDbt3KRVV74GGslQkl/DRdX/P4= +github.com/aws/aws-sdk-go-v2/config v1.4.1 h1:PcGp9Kf+1dHJmP3EIDZJmAmWfGABFTU0obuvYQNzWH8= +github.com/aws/aws-sdk-go-v2/config v1.4.1/go.mod h1:HCDWZ/oeY59TPtXslxlbkCqLQBsVu6b09kiG43tdP+I= +github.com/aws/aws-sdk-go-v2/credentials v1.3.0 h1:vXxTINCsHn6LKhR043jwSLd6CsL7KOEU7b1woMr1K1A= +github.com/aws/aws-sdk-go-v2/credentials v1.3.0/go.mod h1:tOcv+qDZ0O+6Jk2beMl5JnZX6N0H7O8fw9UsD3bP7GI= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.2.0 h1:ucExzYCoAiL9GpKOsKkQLsa43wTT23tcdP4cDTSbZqY= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.2.0/go.mod h1:XvzoGzuS0kKPzCQtJCC22Xh/mMgVAzfGo/0V+mk/Cu0= +github.com/aws/aws-sdk-go-v2/internal/ini v1.1.0 h1:DJq/vXXF+LAFaa/kQX9C6arlf4xX4uaaqGWIyAKOCpM= +github.com/aws/aws-sdk-go-v2/internal/ini v1.1.0/go.mod h1:qGQ/9IfkZonRNSNLE99/yBJ7EPA/h8jlWEqtJCcaj+Q= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.2.0 h1:g2npzssI/6XsoQaPYCxliMFeC5iNKKvO0aC+/wWOE0A= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.2.0/go.mod h1:a7XLWNKuVgOxjssEF019IiHPv35k8KHBaWv/wJAfi2A= +github.com/aws/aws-sdk-go-v2/service/sqs v1.6.0 h1:45YlPhQ/U5v8QnzJFD1bWlTT4IA2NQ9tQ2D/AfyIX3Q= +github.com/aws/aws-sdk-go-v2/service/sqs v1.6.0/go.mod h1:8iLn005F6ASRIXmp6U4hfRAk8EHAtRPrx1oHyxxz2xg= +github.com/aws/aws-sdk-go-v2/service/sso v1.3.0 h1:DMi9w+TpUam7eJ8ksL7svfzpqpqem2MkDAJKW8+I2/k= +github.com/aws/aws-sdk-go-v2/service/sso v1.3.0/go.mod h1:qWR+TUuvfji9udM79e4CPe87C5+SjMEb2TFXkZaI0Vc= +github.com/aws/aws-sdk-go-v2/service/sts v1.5.0 h1:Y1K9dHE2CYOWOvaJSIITq4mJfLX43iziThTvqs5FqOg= +github.com/aws/aws-sdk-go-v2/service/sts v1.5.0/go.mod h1:HjDKUmissf6Mlut+WzG2r35r6LeTKmLEDJ6p9NryzLg= +github.com/aws/smithy-go v1.5.0 h1:2grDq7LxZlo8BZUDeqRfQnQWLZpInmh2TLPPkJku3YM= +github.com/aws/smithy-go v1.5.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/beanstalkd/go-beanstalk v0.1.0 h1:IiNwYbAoVBDs5xEOmleGoX+DRD3Moz99EpATbl8672w= +github.com/beanstalkd/go-beanstalk v0.1.0/go.mod h1:/G8YTyChOtpOArwLTQPY1CHB+i212+av35bkPXXj56Y= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -240,6 +264,8 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -397,6 +423,8 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rabbitmq/amqp091-go v0.0.0-20210714180937-de74e8a7d0e0 h1:D5EMs8zL77qXFJ60vl7x5xRxtezkXsmr8mwypRk5Pe4= +github.com/rabbitmq/amqp091-go v0.0.0-20210714180937-de74e8a7d0e0/go.mod h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= @@ -445,11 +473,10 @@ github.com/spiral/endure v1.0.2/go.mod h1:/mnduq57eBKgKCwpuLgUp8Fn/c3h6JgWybG+0h github.com/spiral/errors v1.0.10/go.mod h1:SwMSZVdZkkJVgXNNafccqOaxWg0XPzVU/dEdUEInE0o= github.com/spiral/errors v1.0.11 h1:TGG+t3mNouLuRW54Ph7nHo4X3u4WhbxqEQmnIybi7Go= github.com/spiral/errors v1.0.11/go.mod h1:SwMSZVdZkkJVgXNNafccqOaxWg0XPzVU/dEdUEInE0o= -github.com/spiral/goridge/v3 v3.1.4 h1:5egVVTfaD1PO4MRgzU0yyog86pAh+JIOk7xhe7BtG40= -github.com/spiral/goridge/v3 v3.1.4/go.mod h1:swcWZW7nP+KU9rgyRf6w7CfNDCWRC/vePE2+AKtoqjk= -github.com/spiral/roadrunner/v2 v2.3.1/go.mod h1:QRF2csDhQA8Qw6tTQKSOWQSjMxKgq7WxfuqQIyH+Egg= -github.com/spiral/roadrunner/v2 v2.3.2 h1:uYJja4xQ8Y32c1yXWTuhbi91/L15MW3sFe0IkHGlnaE= -github.com/spiral/roadrunner/v2 v2.3.2/go.mod h1:QRF2csDhQA8Qw6tTQKSOWQSjMxKgq7WxfuqQIyH+Egg= +github.com/spiral/goridge/v3 v3.2.0 h1:JS0zcOgp1hxMzu2Uc6feKalt78hBLTufGEbtEXdWW2E= +github.com/spiral/goridge/v3 v3.2.0/go.mod h1:ekGaQYwbWOPVDwIrVxIY9Mwq2/+X/xt5sPsuC+t85Oo= +github.com/spiral/roadrunner/v2 v2.4.0-alpha.1 h1:JaHej1qtBCnneCkxzjitbNZfXtcBwxAa0NEPjs7NQO4= +github.com/spiral/roadrunner/v2 v2.4.0-alpha.1/go.mod h1:XBPtzcCAWoP/5V1gSedANS2Zij+eRadX4oir0N4MzMw= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= @@ -465,8 +492,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/temporalio/roadrunner-temporal v1.0.8 h1:ufZLy59zY3Rz8EkAM+KyYcxd+0yrdplujw1OXwwdBg8= -github.com/temporalio/roadrunner-temporal v1.0.8/go.mod h1:mLElTUdzKLBJnQSCf2n6UR683+dyNcC3oFeN35ZPPAI= +github.com/temporalio/roadrunner-temporal v1.0.9-alpha.1 h1:ICORRfSmKI9+qPgeL4V5uyBYxDZFqOpFXxVw4WbNEXk= +github.com/temporalio/roadrunner-temporal v1.0.9-alpha.1/go.mod h1:nNA4mim/ddwF9T3HbSjLxnInIFtagb4vpy1hk536dEM= github.com/tklauser/go-sysconf v0.3.6 h1:oc1sJWvKkmvIxhDHeKWvZS4f6AW+YcoguSfRF2/Hmo4= github.com/tklauser/go-sysconf v0.3.6/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= @@ -518,14 +545,16 @@ go.opentelemetry.io/otel/trace v0.20.0 h1:1DL6EXUdcg95gukhuRRvLDO/4X5THh/5dIV52l go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= go.temporal.io/api v1.4.1-0.20210420220407-6f00f7f98373 h1:BKYGL/ieaZ9mjh2pqeWXAg6zUb3bQMg43RbbtDhiwVU= go.temporal.io/api v1.4.1-0.20210420220407-6f00f7f98373/go.mod h1:Xtk6uRDheAVQr4fgcfo5ZDEkIGMLGJrNkswxZNpqpG0= -go.temporal.io/sdk v1.7.0 h1:uVJPkUHYu1k23Hn7F2mYso1p3wHnPbVwWobSPVYmW0I= -go.temporal.io/sdk v1.7.0/go.mod h1:SGEzYshamm994VrqsONO/ON4RcPkdqsGHsRhtiOjcd8= +go.temporal.io/sdk v1.9.0 h1:CtU9q9q3FAJtIB6XOAL7+YTSxDAoIhdAJdhzmBNHJYw= +go.temporal.io/sdk v1.9.0/go.mod h1:RRzjuVqqcD53uPxLZWYNWHDz+Jr/dqY/DHJf8tirJhg= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= @@ -534,8 +563,9 @@ go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95a go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/zap v1.19.0 h1:mZQZefskPPCMIBCSEH0v2/iUqqLrYtaeqwD6FUGUnFE= +go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -559,6 +589,7 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -701,6 +732,7 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200908211811-12e1bf57a112/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -762,8 +794,9 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/cli/workers/render.go b/internal/cli/workers/render.go index e3abf0a..af86630 100644 --- a/internal/cli/workers/render.go +++ b/internal/cli/workers/render.go @@ -12,7 +12,7 @@ import ( ) // WorkerTable renders table with information about rr server workers. -func WorkerTable(writer io.Writer, workers []process.State) *tablewriter.Table { +func WorkerTable(writer io.Writer, workers []*process.State) *tablewriter.Table { tw := tablewriter.NewWriter(writer) tw.SetHeader([]string{"PID", "Status", "Execs", "Memory", "CPU%", "Created"}) tw.SetColMinWidth(0, 7) @@ -37,7 +37,7 @@ func WorkerTable(writer io.Writer, workers []process.State) *tablewriter.Table { } // ServiceWorkerTable renders table with information about rr server workers. -func ServiceWorkerTable(writer io.Writer, workers []process.State) *tablewriter.Table { +func ServiceWorkerTable(writer io.Writer, workers []*process.State) *tablewriter.Table { tw := tablewriter.NewWriter(writer) tw.SetAutoWrapText(false) tw.SetHeader([]string{"PID", "Memory", "CPU%", "Command"}) diff --git a/internal/container/plugins.go b/internal/container/plugins.go index 8cbd19b..b89351f 100644 --- a/internal/container/plugins.go +++ b/internal/container/plugins.go @@ -6,6 +6,11 @@ import ( "github.com/spiral/roadrunner/v2/plugins/headers" httpPlugin "github.com/spiral/roadrunner/v2/plugins/http" "github.com/spiral/roadrunner/v2/plugins/informer" + "github.com/spiral/roadrunner/v2/plugins/jobs" + "github.com/spiral/roadrunner/v2/plugins/jobs/drivers/amqp" + "github.com/spiral/roadrunner/v2/plugins/jobs/drivers/beanstalk" + "github.com/spiral/roadrunner/v2/plugins/jobs/drivers/ephemeral" + "github.com/spiral/roadrunner/v2/plugins/jobs/drivers/sqs" "github.com/spiral/roadrunner/v2/plugins/kv" "github.com/spiral/roadrunner/v2/plugins/kv/drivers/boltdb" "github.com/spiral/roadrunner/v2/plugins/kv/drivers/memcached" @@ -48,6 +53,14 @@ func Plugins() []interface{} { // service plugin &service.Plugin{}, + // ========= JOBS bundle + &jobs.Plugin{}, + &amqp.Plugin{}, + &sqs.Plugin{}, + &beanstalk.Plugin{}, + &ephemeral.Plugin{}, + // ========= + // kv + ws plugin &memory.Plugin{},