Skip to content

Commit

Permalink
chore: mithril
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSchere committed Dec 19, 2024
1 parent 12bbd74 commit 94435e0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
13 changes: 1 addition & 12 deletions .github/image/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@

echo "Starting dolos bootstrap from snapshot"

# Run the bootstrap command and capture the output
BOOTSTRAP_OUTPUT=$(dolos bootstrap snapshot --variant full --config /etc/dolos.toml)
dolos bootstrap mithril --variant full --config /etc/dolos.toml

# Check if the output indicates existing data
if echo "$BOOTSTRAP_OUTPUT" | grep -q "found existing data, skipping bootstrap"; then
echo "Bootstrap skipped due to existing data, skipping ledger removal and rebuild"
else
echo "Removing ledger and rebuilding"
rm -rf /var/data/ledger
dolos doctor rebuild-ledger --config /etc/dolos.toml
fi

# Start the dolos daemon
dolos daemon --config /etc/dolos.toml
8 changes: 4 additions & 4 deletions k8s/sf-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
namespace: dolos
name: dolos-app
spec:
replicas: 0
replicas: 1
selector:
matchLabels:
app: dolos-app
Expand All @@ -24,7 +24,7 @@ spec:
cloud.google.com/machine-family: "c3"
containers:
- name: dolos-container
image: us-central1-docker.pkg.dev/comet-7aaf0/comet-ar/dolos:sha-2fac637
image: us-central1-docker.pkg.dev/comet-7aaf0/comet-ar/dolos:sha-12bbd74
tty: true
stdin: true
ports:
Expand All @@ -37,10 +37,10 @@ spec:

resources:
requests:
memory: "1.5Gi"
memory: "2.5Gi"
cpu: "1"
limits:
memory: "1.5Gi"
memory: "3Gi"
cpu: "1"

volumeClaimTemplates:
Expand Down
9 changes: 9 additions & 0 deletions src/bin/dolos/bootstrap/mithril.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,34 @@ impl mithril_client::feedback::FeedbackReceiver for MithrilFeedback {
size,
..
} => {
debug!(
downloaded_bytes = downloaded_bytes,
size = size,
"downloading snapshot"
);
self.download_pb.set_length(size);
self.download_pb.set_position(downloaded_bytes);
self.download_pb.set_message("downloading Mithril snapshot");
}
mithril_client::feedback::MithrilEvent::SnapshotDownloadCompleted { .. } => {
self.download_pb.set_message("snapshot download completed");
debug!("snapshot download completed");
}
mithril_client::feedback::MithrilEvent::CertificateChainValidationStarted {
..
} => {
self.validate_pb
.set_message("certificate chain validation started");
debug!("certificate chain validation started");
}
mithril_client::feedback::MithrilEvent::CertificateValidated {
certificate_hash: hash,
..
} => {
self.validate_pb
.set_message(format!("validating cert: {hash}"));

debug!("certificate validated: {hash}");
}
mithril_client::feedback::MithrilEvent::CertificateChainValidated { .. } => {
self.validate_pb.set_message("certificate chain validated");
Expand Down

0 comments on commit 94435e0

Please sign in to comment.