-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deployment): create deployment tools for sequencer (#1677)
- Loading branch information
1 parent
b04f2e0
commit 1c8556c
Showing
19 changed files
with
57,679 additions
and
0 deletions.
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,36 @@ | ||
name: Sequencer Deployment Test | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- main-v[0-9].** | ||
tags: | ||
- v[0-9].** | ||
# TODO(Dori, 1/9/2024): Decide when exactly native-blockifier artifacts will be built. Until | ||
# then, keep the 'paths' key empty and build on every push to a release branch / tag. | ||
|
||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- auto_merge_enabled | ||
- edited | ||
paths: | ||
- 'deployments/sequencer/*' | ||
|
||
|
||
jobs: | ||
deployment: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
# Install deps. | ||
npm install -g cdk8s-cli | ||
python3 -m pip install pipenv | ||
# Synthesize the CDK8s Sequencer app. | ||
cd deployments/sequencer | ||
cdk8s synth | ||
diff -au references/sequencer-system.k8s.yaml dist/sequencer-system.k8s.yaml |
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,14 @@ | ||
[[source]] | ||
name = "pypi" | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
|
||
[dev-packages] | ||
|
||
[packages] | ||
cdk8s = "~=2.66.2" | ||
constructs = "~=10.2.70" | ||
jsonschema = "~=4.23.0" | ||
|
||
[requires] | ||
python_version = "3.10" |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# CRD | ||
|
||
Example usage of [`Custom Resources Definitions`](https://cdk8s.io/docs/latest/cli/import/#crds) construct and to define them within a cdk8s application: | ||
|
||
- `App` (Core) | ||
- `Chart` (Core) | ||
- `Certificate` (CRD) |
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,5 @@ | ||
language: python | ||
app: pipenv install && pipenv run python ./main.py | ||
imports: | ||
- k8s@1.26.0 | ||
- resources/crds/backendconfigs_cloud_google_com.yaml |
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,30 @@ | ||
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 | ||
|
||
def get(self): | ||
return self.config | ||
|
||
def validate(self): | ||
pass | ||
|
||
|
||
class SequencerDevConfig(Config): | ||
def __init__(self): | ||
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()) | ||
) | ||
|
||
def validate(self): | ||
jsonschema.validate(self.config, schema=self.schema) |
Oops, something went wrong.