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

Add readiness probe file to disperser-v2 #1110

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
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
19 changes: 18 additions & 1 deletion disperser/cmd/apiserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ var (
version string
gitCommit string
gitDate string

readinessProbePath string = "/tmp/ready"
)

func main() {
Expand Down Expand Up @@ -163,6 +165,11 @@ func RunDisperserServer(ctx *cli.Context) error {
bucketName := config.BlobstoreConfig.BucketName
logger.Info("Blob store", "bucket", bucketName)
if config.DisperserVersion == V2 {
// Clean up readiness file
if err := os.Remove(readinessProbePath); err != nil {
log.Printf("Failed to clean up readiness file: %v at path %v \n", err, readinessProbePath)
}

config.EncodingConfig.LoadG2Points = true
prover, err := prover.NewProver(&config.EncodingConfig, nil)
if err != nil {
Expand All @@ -188,7 +195,17 @@ func RunDisperserServer(ctx *cli.Context) error {
if err != nil {
return err
}
return server.Start(context.Background())

err = server.Start(context.Background())
if err != nil {
return err
}

// Signal readiness
if _, err := os.Create(readinessProbePath); err != nil {
log.Printf("Failed to create readiness file: %v at path %v \n", err, readinessProbePath)
}
return nil
}

blobMetadataStore := blobstore.NewBlobMetadataStore(dynamoClient, logger, config.BlobstoreConfig.TableName, time.Duration((storeDurationBlocks+blockStaleMeasure)*12)*time.Second)
Expand Down
Loading