Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote ai worker rebased #6

Open
wants to merge 91 commits into
base: ai-video
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
ef5d789
eth,eth/watcher: Create Chainlink price feed watcher (#2972)
victorges Mar 27, 2024
706ec33
cmd/livepeer: Use price feed watcher for dynamic pricePerPixel (#2981)
victorges Mar 27, 2024
2572d97
Release 0.7.3 (#2988)
leszko Mar 29, 2024
8c243ab
Revert "Bump ffmpeg version and nv-codec-headers" (#2989)
thomshutt Apr 2, 2024
f55d605
Bump LPMS (#2992)
thomshutt Apr 2, 2024
85bea86
release v0.7.4 (#2993)
leszko Apr 2, 2024
07fed97
server: Skip redundant maxPrice check in ongoing session (#2994)
victorges Apr 3, 2024
119f346
server: Allow Os price to increase up to 2x mid-session (#2995)
victorges Apr 3, 2024
eb25467
server,discovery: Allow B to use any O in case none match maxPrice (#…
victorges Apr 5, 2024
52186d7
Fix transcoding price metrics (#3001)
leszko Apr 10, 2024
44c95d0
ci(ai): add AI issue templates
rickstaa Apr 13, 2024
c822b13
ci(ai): add AI pull request labeler
rickstaa Apr 13, 2024
25c3cd2
ci(ai): add AI issue templates and pull request labeler
rickstaa Apr 15, 2024
8d378fd
ci: change issue template order and add PR labeler config (#3006)
rickstaa Apr 15, 2024
bc726a8
ci(ai): fix incorrect labels (#3012)
rickstaa Apr 16, 2024
9305333
ci(ai): fix pull request config warning (#3018) (#3019)
rickstaa Apr 19, 2024
e9cbadb
Initialize round by any B/O who has the initializeRound flag set to t…
leszko Apr 24, 2024
b1b2c03
Fix CI Darwin Build (#3049)
leszko May 8, 2024
6e49ae2
chore: fix function names (#3040)
kevincatty May 9, 2024
133ca8b
Create option to filter Os by min livepeer version used (#3050)
leszko May 13, 2024
5f8bc55
Update LPMS with the mobile transcoding fix (#3003)
leszko May 13, 2024
7599f7f
Release 0.7.5 (#3051)
leszko May 14, 2024
19f1cf6
refactor: add -gateway and deprecate -broadcaster (#3053)
rickstaa May 16, 2024
304e47f
refactor(census): rename Broadcaster metrics to Gateway (#3055)
rickstaa May 16, 2024
b739f35
refactor: add -pricePerGateway and deprecate -pricePerBroadcaster (#3…
rickstaa May 19, 2024
6cfaf1e
ci: protect Docker 'stable' tag (#3062)
rickstaa May 21, 2024
fbb393e
Return appropriate errors when auth fails, not just 5xx (#3065)
thomshutt May 28, 2024
29732e7
ci: fix syntax error in Docker action tags (#3068)
rickstaa May 29, 2024
e8f079e
chore: fix some comments (#3070)
linghuying Jun 1, 2024
65f501a
Add logging to selection_algorithm.go (#3076)
leszko Jun 11, 2024
df4c106
Fix typo in logs (#3079)
leszko Jun 13, 2024
b62c60c
Add ctx to logging for selection algorithm (#3080)
leszko Jun 14, 2024
0dd670f
chore: make function comment match function name (#3081)
tongjicoder Jun 16, 2024
20e81fb
refactor: rename internal references from Broadcaster to Gateway (#3060)
rickstaa Jun 18, 2024
3dcdf3d
Add logging to the session refresh (#3083)
leszko Jun 21, 2024
e6a712b
Add `/healthz` endpoint (#3095)
leszko Jul 15, 2024
1624694
Update LPMS to ffmpeg 7 (#3096)
j0sh Jul 24, 2024
498eb76
Merge branch 'master' into ai-video-rebase
rickstaa Jul 25, 2024
a5cdcc6
release v0.7.6
j0sh Jul 24, 2024
c00361a
Merge branch 'master' into ai-video-rebase
rickstaa Jul 27, 2024
21f98a5
chore(ai): ensure ai-video-rebased ffmpeg file is used
rickstaa Jul 27, 2024
280b4a5
chore(ai): remove local go module dependency
rickstaa Jul 27, 2024
01fc75b
test: fix broadcast test
rickstaa Jul 29, 2024
6292df1
feat(ai): add dynamic pricePerUnit feature to AI pricing
rickstaa Jul 29, 2024
29f93ee
[net,server]: RemoteAIWorker gRPC
kyriediculous Jun 12, 2024
4b211a4
[cmd,core]: initial RemoteAIWorkerManager setup
kyriediculous Jun 12, 2024
8b69168
[core,server]: add ai results route and registerAiworker route for or…
kyriediculous Jun 12, 2024
26ba3e9
cmd: start transcoder with full capabilities (ai + transcoder)
kyriediculous Jun 12, 2024
738c3e0
[core,server]: Orchestrator.ServeRemoteAIWorker
kyriediculous Jun 12, 2024
329f6d5
[core,net]: RemoteAIWorkerManager task management
kyriediculous Jun 12, 2024
56a4797
[core,server]: hander remote AI worker job results on orchestrator
kyriediculous Jun 12, 2024
8107959
[core,net]: example remote AI request handling
kyriediculous Jun 12, 2024
3fbdc9a
server: add aiResults route to server
kyriediculous Jun 12, 2024
d2822e1
[server,core]: fix RegisterAIWorker interface implementaiton
kyriediculous Jun 13, 2024
ba40ec9
temporary models config in remote AI manager mode
kyriediculous Jun 21, 2024
28b347f
[core]: fix nil map error for task channels on remotee transcoder man…
kyriediculous Jun 21, 2024
8c99895
cmd: set transcoding capabilties in remote AI mode without needing tr…
kyriediculous Jun 21, 2024
88f8cb4
wip: log received AI job on transcoder
kyriediculous Jun 27, 2024
69fe1fe
wip: handle ai job on transcoder
kyriediculous Jun 27, 2024
75d57f3
wip: temp disable ai worker
kyriediculous Jun 27, 2024
9bbbe1a
wip: log ai result on orchestrator
kyriediculous Jun 27, 2024
2067044
fix: post ai results to correct route
kyriediculous Jun 27, 2024
a8ccc5c
server: image-to-image remote worker
reubenr0d Jun 28, 2024
7810cd4
server: handle remote upscale job
reubenr0d Jul 1, 2024
bb86030
server: handlers for image-to-image + upscale
reubenr0d Jul 1, 2024
e656a31
server: advertise ai capabilities to remote O
reubenr0d Jul 2, 2024
417d6b7
fix: uncomment running actual ai worker jobs
kyriediculous Jul 2, 2024
cfca2b7
fix: remove mock ai responses
kyriediculous Jul 2, 2024
cd3f4f4
wip: rotate remote ai workers by model
reubenr0d Jul 5, 2024
ee6bbc6
ai: map remote workers by pipeline
reubenr0d Jul 6, 2024
f0c6902
core,server: improve remote AI worker code, clean up
kyriediculous Jul 24, 2024
b1df7a4
fix: remote transcoder selection bug fixes
kyriediculous Jul 25, 2024
0fbf3f0
fix: improve CheckAICapacity to have no breaking changes
kyriediculous Jul 26, 2024
e2961a0
fix: improve ot_rpc remote ai worker error handling
kyriediculous Jul 27, 2024
64e1f5e
fix: propagate remote AI result error properly
kyriediculous Jul 27, 2024
aab34cb
fix: aiErr unmarshal to json
kyriediculous Jul 27, 2024
37873b2
feat: rotate workers until timeout, success, or all fail
kyriediculous Jul 27, 2024
df648f2
feat: add image to video for remote worker
kyriediculous Jul 27, 2024
7da8324
feat: add audio-to-text
kyriediculous Jul 27, 2024
bdfe3a3
fix nil pointer on error from RemoteAIResult
kyriediculous Jul 28, 2024
0410787
resolve merge conflicts
kyriediculous Jul 30, 2024
fefd30c
cmd: set ai pricePerPixel outside of config loop
kyriediculous Jul 30, 2024
3d78637
go mod: remove replacement for lpms
kyriediculous Jul 30, 2024
600b62b
change lpms version
kyriediculous Jul 30, 2024
6d18a8c
chore: go mod tidy
kyriediculous Jul 30, 2024
82fcaf5
change lpms version
kyriediculous Jul 30, 2024
59a2fd3
change lpms version
kyriediculous Jul 30, 2024
ffc8ca0
core: remote ai worker manager tests
kyriediculous Jul 30, 2024
8b1e4ee
udpate ffmpeg
kyriediculous Jul 30, 2024
ff3fa3b
aiResults route tests
kyriediculous Jul 30, 2024
8c07ba9
core: improve remote ai worker tests
kyriediculous Jul 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:
target:
- GOOS: darwin
GOARCH: amd64
runner: macos-latest
runner: macos-14-large

- GOOS: darwin
GOARCH: arm64
Expand Down
130 changes: 129 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,133 @@
# Changelog

## v0.7.6

- [#3055](https://github.com/livepeer/go-livepeer/pull/3055) census: Rename broadcaster metrics to gateway metrics
- [#3053](https://github.com/livepeer/go-livepeer/pull/3053) cli: add `-gateway` flag and deprecate `-broadcaster` flag.
- [#3056](https://github.com/livepeer/go-livepeer/pull/3056) cli: add `-pricePerGateway` flag and deprecate `-pricePerBroadcaster` flag.
- [#3060](https://github.com/livepeer/go-livepeer/pull/3060) refactor: rename internal references from Broadcaster to Gateway

### Breaking Changes 🚨🚨

### Features ⚒

#### General

#### Broadcaster

#### Orchestrator

#### Transcoder

### Bug Fixes 🐞

#### CLI

#### General

#### Broadcaster

#### Orchestrator

#### Transcoder

## v0.7.5

### Breaking Changes 🚨🚨

### Features ⚒

#### General

- [#3050](https://github.com/livepeer/go-livepeer/pull/3050) Create option to filter Os by min livepeer version used (@leszko)
- [#3029](https://github.com/livepeer/go-livepeer/pull/3029) Initialize round by any B/O who has the initializeRound flag set to true (@leszko)
- [#3040](https://github.com/livepeer/go-livepeer/pull/3040) Fix function names (@kevincatty)

#### Broadcaster

- [#2995](https://github.com/livepeer/go-livepeer/pull/2995) server: Allow Os price to increase up to 2x mid-session (@victorges)
- [#2999](https://github.com/livepeer/go-livepeer/pull/2999) server,discovery: Allow B to use any O in case none match maxPrice (@victorges)

#### Orchestrator

#### Transcoder

### Bug Fixes 🐞

#### CLI

#### General

#### Broadcaster

- [#2994](https://github.com/livepeer/go-livepeer/pull/2994) server: Skip redundant maxPrice check in ongoing session (@victorges)

#### Orchestrator

- [#3001](https://github.com/livepeer/go-livepeer/pull/3001) Fix transcoding price metrics (@leszko)

#### Transcoder

- [#3003](https://github.com/livepeer/go-livepeer/pull/3003) Fix issue in the transcoding layer for WebRTC input (@j0sh)

## v0.7.4

### Breaking Changes 🚨🚨

### Features ⚒

#### General

- [#2989](https://github.com/livepeer/go-livepeer/pull/2989) Revert "Update ffmpeg version" (@thomshutt)

#### Broadcaster

#### Orchestrator

#### Transcoder

### Bug Fixes 🐞

#### CLI

#### General

#### Broadcaster

#### Orchestrator

#### Transcoder

## v0.7.3

### Breaking Changes 🚨🚨

### Features ⚒

#### General

- [#2978](https://github.com/livepeer/go-livepeer/pull/2978) Update CUDA version from 11.x to 12.x (@leszko)
- [#2973](https://github.com/livepeer/go-livepeer/pull/2973) Update ffmpeg version (@thomshutt)
- [#2981](https://github.com/livepeer/go-livepeer/pull/2981) Add support for prices in custom currencies like USD (@victorges)

#### Broadcaster

#### Orchestrator

#### Transcoder

### Bug Fixes 🐞

#### CLI

#### General

#### Broadcaster

#### Orchestrator

#### Transcoder

## v0.7.2

### Breaking Changes 🚨🚨
Expand Down Expand Up @@ -562,7 +690,7 @@ Additional highlights of this release:
- Support for EIP-1559 (otherwise known as type 2) Ethereum transactions which results in more predictable transaction confirmation times, reduces the chance of stuck pending transactions and avoids overpaying in gas fees. If you are interested in additional details on the implications of EIP-1559 transactions refer to this [resource](https://hackmd.io/@timbeiko/1559-resources).
- An improvement in ticket parameter generation for orchestrators to prevent short lived gas price spikes on the Ethereum network from disrupting streams.
- The node will automatically detect if the GPU enters an unrecoverable state and crash. The reason for crashing upon detecting an unrecoverable GPU state is that no transcoding will
be possible in this scenario until the node is restarted. We recommend node operators to setup a process for monitoring if their node is still up and starting the node if it has crashed. For reference, a bash script similar to [this one](https://gist.github.com/jailuthra/03c3d65d0bbff457cae8f9a14b4c04b7) can be used to automate restarts of the node in the event of a crash.
be possible in this scenario until the node is restarted. We recommend node operators to setup a process for monitoring if their node is still up and starting the node if it has crashed. For reference, a bash script similar to [this one](https://gist.github.com/jailuthra/03c3d65d0bbff457cae8f9a14b4c04b7) can be used to automate restarts of the node in the event of a crash.

Thanks to everyone that submitted bug reports and assisted in testing!

Expand Down
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ SHELL=/bin/bash
GO_BUILD_DIR?="./"

MOCKGEN=go run github.com/golang/mock/mockgen
ABIGEN=go run github.com/ethereum/go-ethereum/cmd/abigen

all: net/lp_rpc.pb.go net/redeemer.pb.go net/redeemer_mock.pb.go core/test_segment.go livepeer livepeer_cli livepeer_router livepeer_bench
all: net/lp_rpc.pb.go net/redeemer.pb.go net/redeemer_mock.pb.go core/test_segment.go eth/contracts/chainlink/AggregatorV3Interface.go livepeer livepeer_cli livepeer_router livepeer_bench

net/lp_rpc.pb.go: net/lp_rpc.proto
protoc -I=. --go_out=. --go-grpc_out=. $^
Expand All @@ -18,6 +19,15 @@ net/redeemer_mock.pb.go net/redeemer_grpc_mock.pb.go: net/redeemer.pb.go net/red
core/test_segment.go:
core/test_segment.sh core/test_segment.go

eth/contracts/chainlink/AggregatorV3Interface.go:
solc --version | grep 0.7.6+commit.7338295f
@set -ex; \
for sol_file in eth/contracts/chainlink/*.sol; do \
contract_name=$$(basename "$$sol_file" .sol); \
solc --abi --optimize --overwrite -o $$(dirname "$$sol_file") $$sol_file; \
$(ABIGEN) --abi=$${sol_file%.sol}.abi --pkg=chainlink --type=$$contract_name --out=$${sol_file%.sol}.go; \
done

version=$(shell cat VERSION)

ldflags := -X github.com/livepeer/go-livepeer/core.LivepeerVersion=$(shell ./print_version.sh)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.2
0.7.6
2 changes: 1 addition & 1 deletion cmd/devtool/devtool.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func main() {
if !goodToGo {
fmt.Println(`
Usage: go run cmd/devtool/devtool.go setup broadcaster|transcoder [nodeIndex]
It will create initilize eth account (on private testnet) to be used for broadcaster or transcoder
It will create initialize eth account (on private testnet) to be used for broadcaster or transcoder
and will create shell script (run_broadcaster_ETHACC.sh or run_transcoder_ETHACC.sh) to run it.
Node index indicates how much to offset node's port. Orchestrator node's index by default is 1.
For example:
Expand Down
15 changes: 9 additions & 6 deletions cmd/livepeer/livepeer.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,14 @@ func parseLivepeerConfig() starter.LivepeerConfig {
cfg.OrchAddr = flag.String("orchAddr", *cfg.OrchAddr, "Comma-separated list of orchestrators to connect to")
cfg.OrchWebhookURL = flag.String("orchWebhookUrl", *cfg.OrchWebhookURL, "Orchestrator discovery callback URL")
cfg.OrchBlacklist = flag.String("orchBlocklist", "", "Comma-separated list of blocklisted orchestrators")
cfg.OrchMinLivepeerVersion = flag.String("orchMinLivepeerVersion", *cfg.OrchMinLivepeerVersion, "Minimal go-livepeer version orchestrator should have to be selected")
cfg.SelectRandWeight = flag.Float64("selectRandFreq", *cfg.SelectRandWeight, "Weight of the random factor in the orchestrator selection algorithm")
cfg.SelectStakeWeight = flag.Float64("selectStakeWeight", *cfg.SelectStakeWeight, "Weight of the stake factor in the orchestrator selection algorithm")
cfg.SelectPriceWeight = flag.Float64("selectPriceWeight", *cfg.SelectPriceWeight, "Weight of the price factor in the orchestrator selection algorithm")
cfg.SelectPriceExpFactor = flag.Float64("selectPriceExpFactor", *cfg.SelectPriceExpFactor, "Expresses how significant a small change of price is for the selection algorithm; default 100")
cfg.OrchPerfStatsURL = flag.String("orchPerfStatsUrl", *cfg.OrchPerfStatsURL, "URL of Orchestrator Performance Stream Tester")
cfg.Region = flag.String("region", *cfg.Region, "Region in which a broadcaster is deployed; used to select the region while using the orchestrator's performance stats")
cfg.MaxPricePerUnit = flag.Int("maxPricePerUnit", *cfg.MaxPricePerUnit, "The maximum transcoding price (in wei) per 'pixelsPerUnit' a broadcaster is willing to accept. If not set explicitly, broadcaster is willing to accept ANY price")
cfg.MaxPricePerUnit = flag.String("maxPricePerUnit", *cfg.MaxPricePerUnit, "The maximum transcoding price per 'pixelsPerUnit' a broadcaster is willing to accept. If not set explicitly, broadcaster is willing to accept ANY price. Can be specified in wei or a custom currency in the format <price><currency> (e.g. 0.50USD). When using a custom currency, a corresponding price feed must be configured with -priceFeedAddr")
cfg.MinPerfScore = flag.Float64("minPerfScore", *cfg.MinPerfScore, "The minimum orchestrator's performance score a broadcaster is willing to accept")

// Transcoding:
Expand Down Expand Up @@ -169,6 +170,7 @@ func parseLivepeerConfig() starter.LivepeerConfig {
cfg.MaxGasPrice = flag.Int("maxGasPrice", *cfg.MaxGasPrice, "Maximum gas price (priority fee + base fee) for ETH transactions in wei, 40 Gwei = 40000000000")
cfg.EthController = flag.String("ethController", *cfg.EthController, "Protocol smart contract address")
cfg.InitializeRound = flag.Bool("initializeRound", *cfg.InitializeRound, "Set to true if running as a transcoder and the node should automatically initialize new rounds")
cfg.InitializeRoundMaxDelay = flag.Duration("initializeRoundMaxDelay", *cfg.InitializeRoundMaxDelay, "Maximum delay to wait before initializing a round")
cfg.TicketEV = flag.String("ticketEV", *cfg.TicketEV, "The expected value for PM tickets")
cfg.MaxFaceValue = flag.String("maxFaceValue", *cfg.MaxFaceValue, "set max ticket face value in WEI")
// Broadcaster max acceptable ticket EV
Expand All @@ -178,12 +180,13 @@ func parseLivepeerConfig() starter.LivepeerConfig {
// Broadcaster deposit multiplier to determine max acceptable ticket faceValue
cfg.DepositMultiplier = flag.Int("depositMultiplier", *cfg.DepositMultiplier, "The deposit multiplier used to determine max acceptable faceValue for PM tickets")
// Orchestrator base pricing info
cfg.PricePerUnit = flag.Int("pricePerUnit", 0, "The price per 'pixelsPerUnit' amount pixels")
// Unit of pixels for both O's basePriceInfo and B's MaxBroadcastPrice
cfg.PixelsPerUnit = flag.Int("pixelsPerUnit", *cfg.PixelsPerUnit, "Amount of pixels per unit. Set to '> 1' to have smaller price granularity than 1 wei / pixel")
cfg.PricePerUnit = flag.String("pricePerUnit", "0", "The price per 'pixelsPerUnit' amount pixels. Can be specified in wei or a custom currency in the format <price><currency> (e.g. 0.50USD). When using a custom currency, a corresponding price feed must be configured with -priceFeedAddr")
// Unit of pixels for both O's pricePerUnit and B's maxPricePerUnit
cfg.PixelsPerUnit = flag.String("pixelsPerUnit", *cfg.PixelsPerUnit, "Amount of pixels per unit. Set to '> 1' to have smaller price granularity than 1 wei / pixel")
cfg.PriceFeedAddr = flag.String("priceFeedAddr", *cfg.PriceFeedAddr, "ETH address of the Chainlink price feed contract. Used for custom currencies conversion on -pricePerUnit or -maxPricePerUnit")
cfg.AutoAdjustPrice = flag.Bool("autoAdjustPrice", *cfg.AutoAdjustPrice, "Enable/disable automatic price adjustments based on the overhead for redeeming tickets")
cfg.PricePerGateway = flag.String("pricePerGateway", *cfg.PricePerGateway, `json list of price per gateway or path to json config file. Example: {"gateways":[{"ethaddress":"address1","priceperunit":1000,"pixelsperunit":1},{"ethaddress":"address2","priceperunit":1200,"pixelsperunit":1}]}`)
cfg.PricePerBroadcaster = flag.String("pricePerBroadcaster", *cfg.PricePerBroadcaster, `json list of price per broadcaster or path to json config file. Example: {"broadcasters":[{"ethaddress":"address1","priceperunit":1000,"pixelsperunit":1},{"ethaddress":"address2","priceperunit":1200,"pixelsperunit":1}]}`)
cfg.PricePerGateway = flag.String("pricePerGateway", *cfg.PricePerGateway, `json list of price per gateway or path to json config file. Example: {"gateways":[{"ethaddress":"address1","priceperunit":0.5,"currency":"USD","pixelsperunit":1000000000000},{"ethaddress":"address2","priceperunit":0.3,"currency":"USD","pixelsperunit":1000000000000}]}`)
cfg.PricePerBroadcaster = flag.String("pricePerBroadcaster", *cfg.PricePerBroadcaster, `json list of price per broadcaster or path to json config file. Example: {"broadcasters":[{"ethaddress":"address1","priceperunit":0.5,"currency":"USD","pixelsperunit":1000000000000},{"ethaddress":"address2","priceperunit":0.3,"currency":"USD","pixelsperunit":1000000000000}]}`)
// Interval to poll for blocks
cfg.BlockPollingInterval = flag.Int("blockPollingInterval", *cfg.BlockPollingInterval, "Interval in seconds at which different blockchain event services poll for blocks")
// Redemption service
Expand Down
Loading