Skip to content

Commit

Permalink
Plug consensus gRPC interface into sequencer (#7)
Browse files Browse the repository at this point in the history
* Build DSN docker images

* Update docker paths

* protobuf compiler

* Use different builder image for kernel

* Connect sequencer to worker and primary gRPC

* Pre-blocks forwarded to DA
  • Loading branch information
m-kus authored Jan 5, 2024
1 parent 0ed24d9 commit 61e7f08
Show file tree
Hide file tree
Showing 55 changed files with 1,017 additions and 1,748 deletions.
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
target/
target/
benchmark/
.db/
.git/
101 changes: 101 additions & 0 deletions .github/workflows/kernel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: DSN operator

on:
push:
branches:
- 'master'
tags:
- '*.*.*'
pull_request:
branches:
- 'master'

jobs:
build:
name: Build and push docker image
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: Tag and label image
id: meta-dsn-operator
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/operator

- name: Build and push image
uses: docker/build-push-action@v2
with:
context: .
file: docker/operator/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 mockup rollup 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 }}
50 changes: 50 additions & 0 deletions .github/workflows/sequencer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: DSN sequencer

on:
push:
branches:
- 'master'
tags:
- '*.*.*'
pull_request:
branches:
- 'master'

jobs:
build:
name: Build and push docker image
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: Tags and label image
id: meta-sequencer
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/sequencer

- name: Build and push image
uses: docker/build-push-action@v2
with:
context: .
file: docker/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 }}
Loading

0 comments on commit 61e7f08

Please sign in to comment.