-
Notifications
You must be signed in to change notification settings - Fork 26
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
Idan/main/add sequencer deployment tools #1856
Closed
Closed
Changes from 14 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a298cf0
chore(deployment): create deployment tools for sequencer
alon-dotan-starkware 9c8cad0
Added healthcheck probes
idan-starkware 1184b01
chore(deployment): create deployment tools for sequencer
alon-dotan-starkware 1f5d072
Healthcheck probe dataclass
idan-starkware 34d315e
Healthcheck probe dataclass refactor
idan-starkware 0b92b1e
Merge branch 'alon.dotan/main/add-sequencer-deployment-tools' into id…
idan-starkware 620ca93
Healthcheck is now optional, added defaults
idan-starkware 638c476
Merge branch 'idan/main/add-sequencer-deployment-tools' of github.com…
idan-starkware 5146f1c
Added ServiceType dataclass, healthcheck is now more flexiable
idan-starkware 94b9e1e
Merge branch 'main' into idan/main/add-sequencer-deployment-tools
idan-starkware ce2ab8a
Added support for volumes, pvc
idan-starkware fb0f2be
Merge branch 'idan/main/add-sequencer-deployment-tools' of github.com…
idan-starkware 698cddd
Added PortMappings dataclass for better type hinting
idan-starkware cfbc596
Added dockerfile for sequencer-node, added option to provide containe…
idan-starkware ccae39a
chore: added ingress and backendconfig
idan-starkware cfabecb
chore: enhanced defaults
idan-starkware File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"chain_id": "0x5", | ||
"eth_fee_token_address": "0x6", | ||
"strk_fee_token_address": "0x7", | ||
"components.batcher.execution_mode": "Disabled", | ||
"components.batcher.local_server_config.#is_none": true, | ||
"components.consensus_manager.execution_mode": "Disabled", | ||
"components.gateway.execution_mode": "Disabled", | ||
"components.http_server.execution_mode": "Disabled", | ||
"components.mempool.execution_mode": "Disabled", | ||
"components.mempool_p2p.execution_mode": "Disabled", | ||
"components.consensus_manager.local_server_config.#is_none": true, | ||
"components.gateway.local_server_config.#is_none": true, | ||
"components.http_server.local_server_config.#is_none": true, | ||
"components.mempool.local_server_config.#is_none": true, | ||
"components.mempool_p2p.local_server_config.#is_none": true, | ||
"components.http_server.remote_server_config.#is_none": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# syntax = devthefuture/dockerfile-x | ||
|
||
INCLUDE deployments/images/base/Dockerfile | ||
|
||
|
||
# Compile the sequencer_node crate in release mode, ensuring dependencies are locked. | ||
FROM base AS builder | ||
COPY . . | ||
RUN cargo build --release --package starknet_sequencer_node | ||
|
||
FROM base AS sequencer | ||
|
||
ENV ID=1000 | ||
WORKDIR /app | ||
COPY --from=builder /target/release/starknet_sequencer_node /app/target/release/starknet_sequencer_node | ||
COPY config/ config/ | ||
|
||
# Create a new user "sequencer". | ||
RUN set -ex; \ | ||
addgroup --gid ${ID} sequencer; \ | ||
adduser --ingroup $(getent group ${ID} | cut -d: -f1) --uid ${ID} --gecos "" --disabled-password --home /app sequencer; \ | ||
chown -R sequencer:sequencer /app | ||
|
||
# Expose RPC and monitoring ports. | ||
EXPOSE 8080 8081 8082 | ||
|
||
# Switch to the new user. | ||
USER ${ID} | ||
|
||
# Set the entrypoint to use tini to manage the process. | ||
ENTRYPOINT ["tini", "--", "/app/target/release/starknet_sequencer_node"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,21 @@ | ||
from typing import Dict, Any | ||
import os | ||
import json | ||
import jsonschema | ||
|
||
ROOT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../') | ||
CONFIG_DIR = os.path.join(ROOT_DIR, 'config/papyrus/') | ||
|
||
|
||
class Config(): | ||
def __init__(self, schema: Dict[Any, Any], config: Dict[Any, Any]): | ||
self.schema = schema | ||
self.config = config | ||
from services.objects import Config | ||
|
||
def get(self): | ||
return self.config | ||
|
||
def validate(self): | ||
pass | ||
ROOT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../') | ||
CONFIG_DIR = os.path.join(ROOT_DIR, 'config/papyrus/') | ||
|
||
|
||
class SequencerDevConfig(Config): | ||
def __init__(self): | ||
def __init__(self, mount_path: str): | ||
super().__init__( | ||
schema=json.loads(open(os.path.join(CONFIG_DIR, 'default_config.json'), 'r').read()), | ||
config=json.loads(open(os.path.join(CONFIG_DIR, 'presets', 'sepolia_testnet.json'), 'r').read()) | ||
) | ||
config=json.loads(open(os.path.join(CONFIG_DIR, 'presets', 'sepolia_testnet.json'), 'r').read()), | ||
mount_path = mount_path | ||
) | ||
|
||
def validate(self): | ||
jsonschema.validate(self.config, schema=self.schema) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
config
parameter is marked as required inSequencerNode
's implementation but is being passed asNone
here. This will cause runtime errors sinceSequencerNode
uses the config object without null checks. Either make the parameter optional inSequencerNode
and add appropriate null handling, or pass a valid config object at instantiation.Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.