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

[LocalNet] Add sequencer block persistence #277

Merged
merged 6 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions .github/label-actions.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# When `devnet-test-e2e` is added, also assign `devnet` to the PR.
# When `devnet-test-e2e` is added, also assign `devnet` and `push-image` to the PR.
devnet-test-e2e:
prs:
comment: The CI will now also run the e2e tests on devnet, which increases the time it takes to complete all CI checks.
comment: The CI will now also run the e2e tests on devnet, which increases the time it takes to complete all CI checks. If you just created a pull request, you might need to push another commit to produce a container image DevNet can utilize to spin up infrastructure. You can use `make trigger_ci` to push an empty commit.
label:
- devnet
- push-image
Expand All @@ -27,7 +27,7 @@ devnet:
# Let the developer know that they need to push another commit after attaching the label to PR.
push-image:
prs:
comment: The image is going to be pushed after the next commit. If you want to run an e2e test, it is necessary to push another commit. You can use `make trigger_ci` to push an empty commit.
comment: The image is going to be pushed after the next commit. You can use `make trigger_ci` to push an empty commit. If you also want to run an E2E test, please add `devnet-test-e2e` label.

# When `push-image` is removed, also delete `devnet` from the PR.
-push-image:
Expand Down
9 changes: 7 additions & 2 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ hot_reload_dirs = ["app", "cmd", "tools", "x", "pkg"]
# Create a localnet config file from defaults, and if a default configuration doesn't exist, populate it with default values
localnet_config_path = "localnet_config.yaml"
localnet_config_defaults = {
"sequencer": {"cleanupBeforeEachStart": True},
"relayminers": {"count": 1},
"gateways": {"count": 1},
"appgateservers": {"count": 1},
Expand Down Expand Up @@ -109,14 +110,18 @@ WORKDIR /

# Run celestia and anvil nodes
k8s_yaml(
["localnet/kubernetes/celestia-rollkit.yaml", "localnet/kubernetes/anvil.yaml"]
["localnet/kubernetes/celestia-rollkit.yaml", "localnet/kubernetes/anvil.yaml", "localnet/kubernetes/sequencer-volume.yaml"]
)

# Run pocket-specific nodes (sequencer, relayminers, etc...)
helm_resource(
"sequencer",
chart_prefix + "poktroll-sequencer",
flags=["--values=./localnet/kubernetes/values-common.yaml"],
flags=[
"--values=./localnet/kubernetes/values-common.yaml",
"--values=./localnet/kubernetes/values-sequencer.yaml",
"--set=persistence.cleanupBeforeEachStart=" + str(localnet_config["sequencer"]["cleanupBeforeEachStart"]),
],
image_deps=["poktrolld"],
image_keys=[("image.repository", "image.tag")],
)
Expand Down
3 changes: 2 additions & 1 deletion cmd/signals/on_exit.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package signals
import (
"os"
"os/signal"
"syscall"
)

// GoOnExitSignal calls the given callback when the process receives an interrupt
Expand All @@ -12,7 +13,7 @@ func GoOnExitSignal(onInterrupt func()) {
// Set up sigCh to receive when this process receives an interrupt or
// kill signal.
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, os.Interrupt, os.Kill)
signal.Notify(sigCh, os.Interrupt, syscall.SIGTERM)
Copy link
Member Author

@okdas okdas Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bryanchriswhite I was troubleshooting sequencer hot reloading issues, and ran into that: https://staticcheck.dev/docs/checks/#SA1016.

I only later realized this code is not used by the sequencer, so I can roll this change back.


// Block until we receive an interrupt or kill signal (OS-agnostic)
<-sigCh
Expand Down
38 changes: 30 additions & 8 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47176,7 +47176,7 @@ paths:
service:
title: >-
The Service for which the application is
configured for
configured
type: object
properties:
id:
Expand Down Expand Up @@ -47243,7 +47243,7 @@ paths:
service:
title: >-
The Service for which the supplier is
configured for
configured
type: object
properties:
id:
Expand Down Expand Up @@ -47279,12 +47279,14 @@ paths:
- GRPC
- WEBSOCKET
- JSON_RPC
- REST
default: UNKNOWN_RPC
description: |-
- UNKNOWN_RPC: Undefined RPC type
- GRPC: gRPC
- WEBSOCKET: WebSocket
- JSON_RPC: JSON-RPC
- REST: REST
configs:
type: array
items:
Expand Down Expand Up @@ -47931,12 +47933,14 @@ paths:
- GRPC
- WEBSOCKET
- JSON_RPC
- REST
default: UNKNOWN_RPC
description: |-
- UNKNOWN_RPC: Undefined RPC type
- GRPC: gRPC
- WEBSOCKET: WebSocket
- JSON_RPC: JSON-RPC
- REST: REST
configs:
type: array
items:
Expand Down Expand Up @@ -48080,12 +48084,14 @@ paths:
- GRPC
- WEBSOCKET
- JSON_RPC
- REST
default: UNKNOWN_RPC
description: |-
- UNKNOWN_RPC: Undefined RPC type
- GRPC: gRPC
- WEBSOCKET: WebSocket
- JSON_RPC: JSON-RPC
- REST: REST
configs:
type: array
items:
Expand Down Expand Up @@ -77536,7 +77542,7 @@ definitions:
type: object
properties:
service:
title: The Service for which the application is configured for
title: The Service for which the application is configured
type: object
properties:
id:
Expand Down Expand Up @@ -77600,7 +77606,7 @@ definitions:
type: object
properties:
service:
title: The Service for which the supplier is configured for
title: The Service for which the supplier is configured
type: object
properties:
id:
Expand Down Expand Up @@ -77635,12 +77641,14 @@ definitions:
- GRPC
- WEBSOCKET
- JSON_RPC
- REST
default: UNKNOWN_RPC
description: |-
- UNKNOWN_RPC: Undefined RPC type
- GRPC: gRPC
- WEBSOCKET: WebSocket
- JSON_RPC: JSON-RPC
- REST: REST
configs:
type: array
items:
Expand Down Expand Up @@ -77790,7 +77798,7 @@ definitions:
type: object
properties:
service:
title: The Service for which the application is configured for
title: The Service for which the application is configured
type: object
properties:
id:
Expand Down Expand Up @@ -77852,7 +77860,7 @@ definitions:
type: object
properties:
service:
title: The Service for which the supplier is configured for
title: The Service for which the supplier is configured
type: object
properties:
id:
Expand Down Expand Up @@ -77887,12 +77895,14 @@ definitions:
- GRPC
- WEBSOCKET
- JSON_RPC
- REST
default: UNKNOWN_RPC
description: |-
- UNKNOWN_RPC: Undefined RPC type
- GRPC: gRPC
- WEBSOCKET: WebSocket
- JSON_RPC: JSON-RPC
- REST: REST
configs:
type: array
items:
Expand Down Expand Up @@ -78032,12 +78042,14 @@ definitions:
- GRPC
- WEBSOCKET
- JSON_RPC
- REST
default: UNKNOWN_RPC
description: |-
- UNKNOWN_RPC: Undefined RPC type
- GRPC: gRPC
- WEBSOCKET: WebSocket
- JSON_RPC: JSON-RPC
- REST: REST
title: Enum to define RPC types
pocket.shared.Supplier:
type: object
Expand Down Expand Up @@ -78066,7 +78078,7 @@ definitions:
type: object
properties:
service:
title: The Service for which the supplier is configured for
title: The Service for which the supplier is configured
type: object
properties:
id:
Expand Down Expand Up @@ -78099,12 +78111,14 @@ definitions:
- GRPC
- WEBSOCKET
- JSON_RPC
- REST
default: UNKNOWN_RPC
description: |-
- UNKNOWN_RPC: Undefined RPC type
- GRPC: gRPC
- WEBSOCKET: WebSocket
- JSON_RPC: JSON-RPC
- REST: REST
configs:
type: array
items:
Expand Down Expand Up @@ -78156,12 +78170,14 @@ definitions:
- GRPC
- WEBSOCKET
- JSON_RPC
- REST
default: UNKNOWN_RPC
description: |-
- UNKNOWN_RPC: Undefined RPC type
- GRPC: gRPC
- WEBSOCKET: WebSocket
- JSON_RPC: JSON-RPC
- REST: REST
configs:
type: array
items:
Expand Down Expand Up @@ -78195,7 +78211,7 @@ definitions:
type: object
properties:
service:
title: The Service for which the supplier is configured for
title: The Service for which the supplier is configured
type: object
properties:
id:
Expand Down Expand Up @@ -78227,12 +78243,14 @@ definitions:
- GRPC
- WEBSOCKET
- JSON_RPC
- REST
default: UNKNOWN_RPC
description: |-
- UNKNOWN_RPC: Undefined RPC type
- GRPC: gRPC
- WEBSOCKET: WebSocket
- JSON_RPC: JSON-RPC
- REST: REST
configs:
type: array
items:
Expand Down Expand Up @@ -78481,12 +78499,14 @@ definitions:
- GRPC
- WEBSOCKET
- JSON_RPC
- REST
default: UNKNOWN_RPC
description: |-
- UNKNOWN_RPC: Undefined RPC type
- GRPC: gRPC
- WEBSOCKET: WebSocket
- JSON_RPC: JSON-RPC
- REST: REST
configs:
type: array
items:
Expand Down Expand Up @@ -78661,12 +78681,14 @@ definitions:
- GRPC
- WEBSOCKET
- JSON_RPC
- REST
default: UNKNOWN_RPC
description: |-
- UNKNOWN_RPC: Undefined RPC type
- GRPC: gRPC
- WEBSOCKET: WebSocket
- JSON_RPC: JSON-RPC
- REST: REST
configs:
type: array
items:
Expand Down
10 changes: 10 additions & 0 deletions localnet/kubernetes/sequencer-volume.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: "sequencer-data-volume"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
2 changes: 2 additions & 0 deletions localnet/kubernetes/values-sequencer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
persistence:
existingClaim: "sequencer-data-volume"
Loading