-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michael Zaikin
committed
Jan 4, 2024
1 parent
0ed24d9
commit 1fad9c1
Showing
15 changed files
with
216 additions
and
139 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 |
---|---|---|
@@ -1 +1,6 @@ | ||
target/ | ||
target/ | ||
benchmark/ | ||
bin/ | ||
.tezos-client/ | ||
.db/ | ||
.git/ |
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,101 @@ | ||
name: Build & deploy DSN kernel | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
tags: | ||
- '*.*.*' | ||
pull_request: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
build: | ||
name: Build and push docker images | ||
runs-on: ubuntu-latest | ||
env: | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
DOCKER_REGISTRY: ghcr.io | ||
DOCKER_IMAGE_BASE: ${{ github.repository_owner }} | ||
outputs: | ||
operator: ${{ steps.meta-dsn-operator.outputs.tags }} | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log in to the registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.DOCKER_REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: DSN operator tags & labels | ||
id: meta-dsn-operator | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/operator | ||
|
||
- name: DSN operator build & push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: build/kernel/Dockerfile | ||
build-args: | | ||
OCTEZ_TAG=v17.1 | ||
OCTEZ_PROTO=PtNairob | ||
push: true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
tags: ${{ steps.meta-dsn-operator.outputs.tags }} | ||
labels: ${{ steps.meta-dsn-operator.outputs.labels }} | ||
|
||
deploy: | ||
if: (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || (github.event_name == 'push' && github.ref == 'refs/heads/master') | ||
name: Deploy DSN kernel to testnet | ||
needs: build | ||
runs-on: ubuntu-latest | ||
env: | ||
NETWORK: nairobinet | ||
steps: | ||
- name: Deploy rollup | ||
run: docker run -v "/var/run/docker.sock":"/var/run/docker.sock" -e NETWORK=${{ env.NETWORK }} -e OPERATOR_KEY=${{ secrets.OPERATOR_KEY }} ${{ needs.build.outputs.operator }} deploy_rollup | tee originate.out | ||
|
||
- name: Extract rollup address | ||
run: | | ||
ROLLUP_ADDRESS=$(cat originate.out | grep -oE "sr1[a-zA-Z0-9]{33}" | uniq | tr -d '\n') | ||
echo "ROLLUP_ADDRESS=$ROLLUP_ADDRESS" >> $GITHUB_ENV | ||
- name: Update PR with the deployment link | ||
if: github.event_name == 'pull_request' | ||
uses: edumserrano/find-create-or-update-comment@v1 | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body-includes: '<!-- pr-rollup-deployment -->' | ||
comment-author: 'github-actions[bot]' | ||
body: | | ||
<!-- pr-rollup-deployment --> | ||
Deployed at [${{ env.ROLLUP_ADDRESS }}](https://${{ env.NETWORK }}.tzkt.io/${{ env.ROLLUP_ADDRESS }}) | ||
edit-mode: replace | ||
reactions: rocket | ||
|
||
- name: Create GitHub deployment | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
uses: altinukshini/deployment-action@releases/v1 | ||
id: deployment | ||
with: | ||
token: "${{ github.token }}" | ||
environment: ${{ env.NETWORK }} | ||
|
||
- name: Update deployment status | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
uses: altinukshini/deployment-status@releases/v1 | ||
with: | ||
token: "${{ github.token }}" | ||
state: "success" | ||
environment_url: https://${{ env.NETWORK }}.tzkt.io/${{ env.ROLLUP_ADDRESS }} | ||
deployment_id: ${{ steps.deployment.outputs.deployment_id }} |
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,50 @@ | ||
name: Build DSN nodes | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
tags: | ||
- '*.*.*' | ||
pull_request: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
build: | ||
name: Build and push docker images | ||
runs-on: ubuntu-latest | ||
env: | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
DOCKER_REGISTRY: ghcr.io | ||
DOCKER_IMAGE_BASE: ${{ github.repository_owner }} | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log in to the registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.DOCKER_REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: DSN image tags & labels | ||
id: meta-sequencer | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/sequencer | ||
|
||
- name: DSN image build & push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: build/sequencer/Dockerfile | ||
push: true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
tags: ${{ steps.meta-sequencer.outputs.tags }} | ||
labels: ${{ steps.meta-sequencer.outputs.labels }} |
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 |
---|---|---|
|
@@ -18,7 +18,6 @@ members = [ | |
"crates/worker", | ||
"crates/pre-block", | ||
|
||
"executor", | ||
"launcher", | ||
"playground", | ||
"kernel", | ||
|
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
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,19 @@ | ||
FROM rust:1.73-bullseye AS builder | ||
ARG PROFILE=release | ||
WORKDIR /build | ||
RUN apt-get update && apt-get install -y cmake clang | ||
COPY . ./ | ||
RUN cargo build --profile ${PROFILE} --bin narwhal-node | ||
RUN cargo build --profile ${PROFILE} --bin sequencer | ||
|
||
FROM debian:bullseye-slim AS runtime | ||
# Use jemalloc as memory allocator | ||
RUN apt-get update && apt-get install -y libjemalloc-dev | ||
ENV LD_PRELOAD /usr/lib/x86_64-linux-gnu/libjemalloc.so | ||
ARG PROFILE=release | ||
COPY --from=builder build/target/${PROFILE}/narwhal-node /usr/bin/narwhal-node | ||
COPY --from=builder build/target/${PROFILE}/sequencer /usr/bin/sequencer | ||
COPY ./launcher/defaults/* /narwhal/ | ||
COPY ./docker/sequencer/entrypoint.sh . | ||
RUN chmod +x entrypoint.sh && ln ./entrypoint.sh /usr/bin/narwhal | ||
ENTRYPOINT [ "./entrypoint.sh" ] |
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 @@ | ||
#!/bin/bash | ||
|
||
# SPDX-FileCopyrightText: 2023 Baking Bad <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
set -e | ||
|
||
NARWHAL_NODE_BIN="/usr/bin/narwhal-node" | ||
|
||
if [ -z "$VALIDATOR_ID" ]; then | ||
echo "VALIDATOR_ID is not set" | ||
exit 1 | ||
fi | ||
|
||
LOG_LEVEL=${LOG_LEVEL:="-v"} | ||
PRIMARY_KEYS_PATH=${KEYS_PATH:="/narwhal/primary-$VALIDATOR_ID.key"} | ||
PRIMARY_NETWORK_KEYS_PATH=${KEYS_PATH:="/narwhal/primary-network-$VALIDATOR_ID.key"} | ||
WORKER_NETWORK_KEYS_PATH=${KEYS_PATH:="/narwhal/worker-network-$VALIDATOR_ID.key"} | ||
COMMITTEE_PATH=${COMMITTEE_PATH:="/narwhal/committee.json"} | ||
WORKERS_PATH=${WORKERS_PATH:="/narwhal/workers.json"} | ||
DATA_PATH=${DATA_PATH:="/data"} | ||
|
||
$NARWHAL_NODE_BIN $LOG_LEVEL run-comb \ | ||
--primary-keys $PRIMARY_KEYS_PATH \ | ||
--primary-network-keys $PRIMARY_NETWORK_KEYS_PATH \ | ||
--worker-keys $WORKER_NETWORK_KEYS_PATH \ | ||
--committee $COMMITTEE_PATH \ | ||
--workers $WORKERS_PATH \ | ||
--primary-store "$DATA_PATH/primary-store-$VALIDATOR_ID" \ | ||
--worker-store "$DATA_PATH/worker-store-$VALIDATOR_ID" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.