Skip to content
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

Sapling kernel #32

Merged
merged 33 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
.github
.gitignore
.tezos-client
.logs
target
test
*.env
56 changes: 56 additions & 0 deletions .github/workflows/build_sapling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build Sapling operator

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-tezos-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: Sapling operator tags & labels
id: meta-sapling-operator
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/sapling-operator

- name: Sapling operator build & push
uses: docker/build-push-action@v2
with:
context: .
file: build/operator/Dockerfile
build-args: |
OCTEZ_TAG=v17.1
OCTEZ_PROTO=PtNairob
PACKAGE=sapling_kernel
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta-sapling-operator.outputs.tags }}
labels: ${{ steps.meta-sapling-operator.outputs.labels }}
48 changes: 26 additions & 22 deletions .github/workflows/build.yml → .github/workflows/build_tezos.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Build & deploy Tezos operator

on:
push:
Expand All @@ -19,7 +19,7 @@ jobs:
DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE_BASE: ${{ github.repository_owner }}
outputs:
operator: ${{ steps.meta-operator.outputs.tags }}
operator: ${{ steps.meta-tezos-operator.outputs.tags }}
steps:
- name: Check out the repo
uses: actions/checkout@v2
Expand All @@ -34,32 +34,34 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Operator tags & labels
id: meta-operator
- name: Tezos operator tags & labels
id: meta-tezos-operator
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/tz-rollup-operator
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/tezos-operator

- name: Operator build & push
if: ${{ !contains(github.event.head_commit.message, '[skip-build-operator]') }}
- name: Tezos operator build & push
uses: docker/build-push-action@v2
with:
context: .
file: build/operator/Dockerfile
# file: build/operator/Dockerfile.debug
build-args: |
NETWORK=mumbainet
OCTEZ_TAG=v17.1
OCTEZ_PROTO=PtNairob
PACKAGE=tezos_kernel
# TEZOS_BRANCH=ole@wasmer-instance-leak
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta-operator.outputs.tags }}
labels: ${{ steps.meta-operator.outputs.labels }}
tags: ${{ steps.meta-tezos-operator.outputs.tags }}
labels: ${{ steps.meta-tezos-operator.outputs.labels }}

- name: Facade tags & labels
id: meta-facade
- name: Tezos facade tags & labels
id: meta-tezos-facade
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/tz-rollup-facade
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/tezos-facade

- name: Facade build & push
if: ${{ !contains(github.event.head_commit.message, '[skip-build-facade]') }}
Expand All @@ -70,17 +72,19 @@ jobs:
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta-facade.outputs.tags }}
labels: ${{ steps.meta-facade.outputs.labels }}
tags: ${{ steps.meta-tezos-facade.outputs.tags }}
labels: ${{ steps.meta-tezos-facade.outputs.labels }}

deploy:
if: ${{ !contains(github.event.head_commit.message, '[skip-deploy]') }}
name: Deploy rollup to testnet
if: (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || (github.event_name == 'push' && github.ref == 'refs/heads/master')
name: Deploy Tezos 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 OPERATOR_KEY=${{ secrets.OPERATOR_KEY }} ${{ needs.build.outputs.operator }} originate-rollup | tee originate.out
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: |
Expand All @@ -96,7 +100,7 @@ jobs:
comment-author: 'github-actions[bot]'
body: |
<!-- pr-rollup-deployment -->
Deployed at [${{ env.ROLLUP_ADDRESS }}](https://mumbainet.tzkt.io/${{ env.ROLLUP_ADDRESS }})
Deployed at [${{ env.ROLLUP_ADDRESS }}](https://${{ env.NETWORK }}.tzkt.io/${{ env.ROLLUP_ADDRESS }})
edit-mode: replace
reactions: rocket

Expand All @@ -106,13 +110,13 @@ jobs:
id: deployment
with:
token: "${{ github.token }}"
environment: mumbainet
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://mumbainet.tzkt.io/${{ env.ROLLUP_ADDRESS }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
environment_url: https://${{ env.NETWORK }}.tzkt.io/${{ env.ROLLUP_ADDRESS }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.bin
.tezos-client
.ipynb_checkpoints
.python-version
.logs
bin
target
tez_kernel/target
tezos_kernel/target
boot_kernel/target
*.env
.env
Loading
Loading