Skip to content

Commit

Permalink
[LocalNet] Add sequencer block persistence (#277)
Browse files Browse the repository at this point in the history
* add localnet persistance

* bump local-celestia-devnet

* rollback celestia container

* change messages
  • Loading branch information
okdas authored Jan 17, 2024
1 parent 8ae2494 commit af93def
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 6 deletions.
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)

// Block until we receive an interrupt or kill signal (OS-agnostic)
<-sigCh
Expand Down
10 changes: 10 additions & 0 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
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 @@ -77805,12 +77807,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 @@ -78057,12 +78061,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 @@ -78209,6 +78215,7 @@ definitions:
- 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 @@ -78277,6 +78284,7 @@ definitions:
- GRPC: gRPC
- WEBSOCKET: WebSocket
- JSON_RPC: JSON-RPC
- REST: REST
configs:
type: array
items:
Expand Down Expand Up @@ -78335,6 +78343,7 @@ definitions:
- GRPC: gRPC
- WEBSOCKET: WebSocket
- JSON_RPC: JSON-RPC
- REST: REST
configs:
type: array
items:
Expand Down Expand Up @@ -78407,6 +78416,7 @@ definitions:
- 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"

0 comments on commit af93def

Please sign in to comment.