Skip to content

Commit

Permalink
add AI worker option to not use managed containers
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-astra-video committed May 7, 2024
1 parent 959ae10 commit 2504355
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 76 deletions.
1 change: 1 addition & 0 deletions cmd/livepeer/livepeer.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func parseLivepeerConfig() starter.LivepeerConfig {
cfg.AIWorker = flag.Bool("aiWorker", *cfg.AIWorker, "Set to true to run an AI worker")
cfg.AIModels = flag.String("aiModels", *cfg.AIModels, "Set models (pipeline:model_id) for AI worker to load upon initialization")
cfg.AIModelsDir = flag.String("aiModelsDir", *cfg.AIModelsDir, "Set directory where AI model weights are stored")
cfg.AIWorkerNoManagedContainers = flag.Bool("aiWorkerNoManagedContainers", *cfg.AIWorkerNoManagedContainers, "set to true if want to no use managed containers with AI worker")

// Onchain:
cfg.EthAcctAddr = flag.String("ethAcctAddr", *cfg.EthAcctAddr, "Existing Eth account address. For use when multiple ETH accounts exist in the keystore directory")
Expand Down
155 changes: 79 additions & 76 deletions cmd/livepeer/starter/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,78 +77,79 @@ const (
)

type LivepeerConfig struct {
Network *string
RtmpAddr *string
CliAddr *string
HttpAddr *string
ServiceAddr *string
OrchAddr *string
VerifierURL *string
EthController *string
VerifierPath *string
LocalVerify *bool
HttpIngest *bool
Orchestrator *bool
Transcoder *bool
AIWorker *bool
Broadcaster *bool
OrchSecret *string
TranscodingOptions *string
AIModels *string
MaxAttempts *int
SelectRandWeight *float64
SelectStakeWeight *float64
SelectPriceWeight *float64
SelectPriceExpFactor *float64
OrchPerfStatsURL *string
Region *string
MaxPricePerUnit *int
MinPerfScore *float64
MaxSessions *string
CurrentManifest *bool
Nvidia *string
Netint *string
TestTranscoder *bool
EthAcctAddr *string
EthPassword *string
EthKeystorePath *string
EthOrchAddr *string
EthUrl *string
TxTimeout *time.Duration
MaxTxReplacements *int
GasLimit *int
MinGasPrice *int64
MaxGasPrice *int
InitializeRound *bool
TicketEV *string
MaxFaceValue *string
MaxTicketEV *string
MaxTotalEV *string
DepositMultiplier *int
PricePerUnit *int
PixelsPerUnit *int
AutoAdjustPrice *bool
PricePerBroadcaster *string
BlockPollingInterval *int
Redeemer *bool
RedeemerAddr *string
Reward *bool
Monitor *bool
MetricsPerStream *bool
MetricsExposeClientIP *bool
MetadataQueueUri *string
MetadataAmqpExchange *string
MetadataPublishTimeout *time.Duration
Datadir *string
AIModelsDir *string
Objectstore *string
Recordstore *string
FVfailGsBucket *string
FVfailGsKey *string
AuthWebhookURL *string
OrchWebhookURL *string
OrchBlacklist *string
TestOrchAvail *bool
Network *string
RtmpAddr *string
CliAddr *string
HttpAddr *string
ServiceAddr *string
OrchAddr *string
VerifierURL *string
EthController *string
VerifierPath *string
LocalVerify *bool
HttpIngest *bool
Orchestrator *bool
Transcoder *bool
AIWorker *bool
Broadcaster *bool
OrchSecret *string
TranscodingOptions *string
AIModels *string
AIWorkerNoManagedContainers *bool
MaxAttempts *int
SelectRandWeight *float64
SelectStakeWeight *float64
SelectPriceWeight *float64
SelectPriceExpFactor *float64
OrchPerfStatsURL *string
Region *string
MaxPricePerUnit *int
MinPerfScore *float64
MaxSessions *string
CurrentManifest *bool
Nvidia *string
Netint *string
TestTranscoder *bool
EthAcctAddr *string
EthPassword *string
EthKeystorePath *string
EthOrchAddr *string
EthUrl *string
TxTimeout *time.Duration
MaxTxReplacements *int
GasLimit *int
MinGasPrice *int64
MaxGasPrice *int
InitializeRound *bool
TicketEV *string
MaxFaceValue *string
MaxTicketEV *string
MaxTotalEV *string
DepositMultiplier *int
PricePerUnit *int
PixelsPerUnit *int
AutoAdjustPrice *bool
PricePerBroadcaster *string
BlockPollingInterval *int
Redeemer *bool
RedeemerAddr *string
Reward *bool
Monitor *bool
MetricsPerStream *bool
MetricsExposeClientIP *bool
MetadataQueueUri *string
MetadataAmqpExchange *string
MetadataPublishTimeout *time.Duration
Datadir *string
AIModelsDir *string
Objectstore *string
Recordstore *string
FVfailGsBucket *string
FVfailGsKey *string
AuthWebhookURL *string
OrchWebhookURL *string
OrchBlacklist *string
TestOrchAvail *bool
}

// DefaultLivepeerConfig creates LivepeerConfig exactly the same as when no flags are passed to the livepeer process.
Expand Down Expand Up @@ -187,6 +188,7 @@ func DefaultLivepeerConfig() LivepeerConfig {
defaultAIWorker := false
defaultAIModels := ""
defaultAIModelsDir := ""
defaultAIWorkerNoManagedContainers := false

// Onchain:
defaultEthAcctAddr := ""
Expand Down Expand Up @@ -273,9 +275,10 @@ func DefaultLivepeerConfig() LivepeerConfig {
TestTranscoder: &defaultTestTranscoder,

// AI:
AIWorker: &defaultAIWorker,
AIModels: &defaultAIModels,
AIModelsDir: &defaultAIModelsDir,
AIWorker: &defaultAIWorker,
AIModels: &defaultAIModels,
AIModelsDir: &defaultAIModelsDir,
AIWorkerNoManagedContainers: &defaultAIWorkerNoManagedContainers,

// Onchain:
EthAcctAddr: &defaultEthAcctAddr,
Expand Down Expand Up @@ -525,7 +528,7 @@ func StartLivepeer(ctx context.Context, cfg LivepeerConfig) {
return
}

n.AIWorker, err = worker.NewWorker(aiWorkerContainerImageID, gpus, modelsDir)
n.AIWorker, err = worker.NewWorker(aiWorkerContainerImageID, gpus, modelsDir, *cfg.AIWorkerNoManagedContainers)

Check failure on line 531 in cmd/livepeer/starter/starter.go

View workflow job for this annotation

GitHub Actions / Build binaries for linux-cpu-amd64

too many arguments in call to worker.NewWorker

Check failure on line 531 in cmd/livepeer/starter/starter.go

View workflow job for this annotation

GitHub Actions / Build binaries for darwin-arm64

too many arguments in call to worker.NewWorker

Check failure on line 531 in cmd/livepeer/starter/starter.go

View workflow job for this annotation

GitHub Actions / Build binaries for linux-gpu-amd64

too many arguments in call to worker.NewWorker
if err != nil {
glog.Errorf("Error starting AI worker: %v", err)
return
Expand Down

0 comments on commit 2504355

Please sign in to comment.