Skip to content

Commit 977af2f

Browse files
committed
[test] Use dual store in deployment
1 parent 5bbd3f0 commit 977af2f

File tree

9 files changed

+49
-9
lines changed

9 files changed

+49
-9
lines changed

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ RUN cargo build ${build_flag:+"$build_flag"} \
6969
--bin linera \
7070
--bin linera-proxy \
7171
--bin linera-server \
72-
--features scylladb,metrics
72+
--features scylladb,rocksdb,metrics
7373

7474
RUN mv \
7575
target/"$target"/"$build_folder"/linera \

docker/server-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
ORDINAL="${HOSTNAME##*-}"
55

66
exec ./linera-server run \
7-
--storage scylladb:tcp:scylla-client.scylla.svc.cluster.local:9042 \
7+
--storage dualrocksdbscylladb:/mnt/stateful_partition/kube-ephemeral-ssd/linera.db:spawn_blocking:tcp:scylla-client.scylla.svc.cluster.local:9042 \
88
--server /config/server.json \
99
--shard $ORDINAL \
1010
--genesis /config/genesis.json

docker/server-init.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
while true; do
4-
./linera storage check-existence --storage "scylladb:tcp:scylla-client.scylla.svc.cluster.local:9042"
4+
./linera storage check-existence --storage "dualrocksdbscylladb:/mnt/stateful_partition/kube-ephemeral-ssd/linera.db:spawn_blocking:tcp:scylla-client.scylla.svc.cluster.local:9042"
55
status=$?
66

77
if [ $status -eq 0 ]; then
@@ -10,7 +10,7 @@ while true; do
1010
elif [ $status -eq 1 ]; then
1111
echo "Database does not exist, attempting to initialize..."
1212
if ./linera-server initialize \
13-
--storage scylladb:tcp:scylla-client.scylla.svc.cluster.local:9042 \
13+
--storage dualrocksdbscylladb:/mnt/stateful_partition/kube-ephemeral-ssd/linera.db:spawn_blocking:tcp:scylla-client.scylla.svc.cluster.local:9042 \
1414
--genesis /config/genesis.json; then
1515
echo "Initialization successful."
1616
exit 0

kubernetes/linera-validator/helmfile.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ releases:
3434
- name: crds.enabled
3535
value: "true"
3636
- name: scylla
37-
version: v1.13.0
37+
version: v1.16.0
3838
namespace: scylla
3939
chart: scylla/scylla
4040
timeout: 900
@@ -44,7 +44,7 @@ releases:
4444
values:
4545
- {{ env "LINERA_HELMFILE_VALUES_SCYLLA" | default "scylla.values.yaml" }}
4646
- name: scylla-manager
47-
version: v1.13.0
47+
version: v1.16.0
4848
namespace: scylla-manager
4949
chart: scylla/scylla-manager
5050
timeout: 900
@@ -53,7 +53,7 @@ releases:
5353
values:
5454
- {{ env "LINERA_HELMFILE_VALUES_SCYLLA_MANAGER" | default "scylla-manager.values.yaml" }}
5555
- name: scylla-operator
56-
version: v1.13.0
56+
version: v1.16.0
5757
namespace: scylla-operator
5858
chart: scylla/scylla-operator
5959
timeout: 900
@@ -62,7 +62,7 @@ releases:
6262
values:
6363
- {{ env "LINERA_HELMFILE_VALUES_SCYLLA_OPERATOR" | default "scylla-operator.values.yaml" }}
6464
- name: cert-manager
65-
version: v1.15.3
65+
version: v1.17.0
6666
namespace: cert-manager
6767
chart: jetstack/cert-manager
6868
timeout: 900

kubernetes/linera-validator/scylla.values.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,24 @@ racks:
1515
requests:
1616
cpu: 1
1717
memory: 2Gi
18+
initContainers:
19+
- name: prepare-ssd
20+
image: busybox
21+
command: ["/bin/sh", "-c"]
22+
args:
23+
- |
24+
mkdir -p /mnt/stateful_partition/kube-ephemeral-ssd/scylla/data
25+
mkdir -p /mnt/stateful_partition/kube-ephemeral-ssd/scylla/commitlog
26+
mkdir -p /mnt/stateful_partition/kube-ephemeral-ssd/scylla/saved_caches
27+
chown -R 999:999 /mnt/stateful_partition/kube-ephemeral-ssd/scylla
28+
volumeMounts:
29+
- name: local-ssd
30+
mountPath: /mnt/stateful_partition/kube-ephemeral-ssd
31+
volumeMounts:
32+
- name: local-ssd
33+
mountPath: /mnt/stateful_partition/kube-ephemeral-ssd/scylla
34+
volumes:
35+
- name: local-ssd
36+
hostPath:
37+
path: /mnt/stateful_partition/kube-ephemeral-ssd/scylla
38+
type: DirectoryOrCreate

kubernetes/linera-validator/templates/scylla-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@ metadata:
66
data:
77
scylla.yaml: |
88
query_tombstone_page_limit: 200000
9+
10+
# Add storage locations pointing to local SSD
11+
data_file_directories:
12+
- /mnt/stateful_partition/kube-ephemeral-ssd/scylla/data
13+
commitlog_directory: /mnt/stateful_partition/kube-ephemeral-ssd/scylla/commitlog
14+
saved_caches_directory: /mnt/stateful_partition/kube-ephemeral-ssd/scylla/saved_caches

kubernetes/linera-validator/templates/shards.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ spec:
4545
- name: config
4646
mountPath: "/config"
4747
readOnly: true
48+
- name: linera-db
49+
mountPath: "/mnt/stateful_partition/kube-ephemeral-ssd/linera.db"
4850
containers:
4951
- name: linera-server
5052
image: {{ .Values.lineraImage }}
@@ -57,6 +59,8 @@ spec:
5759
- name: config
5860
mountPath: "/config"
5961
readOnly: true
62+
- name: linera-db
63+
mountPath: "/mnt/stateful_partition/kube-ephemeral-ssd/linera.db"
6064
volumes:
6165
- name: config
6266
configMap:
@@ -66,3 +70,11 @@ spec:
6670
path: server.json
6771
- key: genesisConfig
6872
path: genesis.json
73+
volumeClaimTemplates:
74+
- metadata:
75+
name: linera-db
76+
spec:
77+
accessModes: ["ReadWriteOnce"]
78+
resources:
79+
requests:
80+
storage: {{ .Values.rocksdbStorageSize }}

kubernetes/linera-validator/values-local.yaml.gotmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
lineraImage: {{ env "LINERA_HELMFILE_LINERA_IMAGE" | default "linera:latest" }}
55
lineraImagePullPolicy: Never
66
logLevel: "debug"
7+
rocksdbStorageSize: 2Gi
78
proxyPort: 19100
89
metricsPort: 21100
910
numShards: {{ env "LINERA_HELMFILE_SET_NUM_SHARDS" | default 10 }}

linera-views/src/backends/scylla_db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ impl AdminKeyValueStore for ScyllaDbStoreInternal {
813813
// Create a keyspace if it doesn't exist
814814
let query = "CREATE KEYSPACE IF NOT EXISTS kv WITH REPLICATION = { \
815815
'class' : 'SimpleStrategy', \
816-
'replication_factor' : 1 \
816+
'replication_factor' : 3 \
817817
}";
818818

819819
// Execute the query

0 commit comments

Comments
 (0)