-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: docker & k8s Signed-off-by: Thomas Chataigner <[email protected]> * feat: wip docker * feat: wip docker flexible lc * feat: simplify k8s conf * feat: refactor aptos proof server to one bin * feat: one server bin eth + k8s aptos * feat: ethereum client configuration * chore: lint * ci: revise docker publish * refactor: base review integrated * chore: lint * refactor: router for proof server + health check * refactor: ethereum health check * refactor: probes * refactor: multiple routes eth proof server * refactor: fix compilation * refactor: accept octet stream * refactor: change handling request proof server * refactor: all routes working * refactor: not using serde json * refactor: only one request * refactor: health does not count as increment * fix: fix middleware * refactor: working aptos proof_server * chore: use let-else more effectively (#197) * refactor: replicas --------- Signed-off-by: Thomas Chataigner <[email protected]> Co-authored-by: François Garillot <[email protected]>
- Loading branch information
1 parent
b2ba63a
commit da581a5
Showing
45 changed files
with
1,634 additions
and
803 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,82 @@ | ||
# Source: https://raw.githubusercontent.com/foundry-rs/foundry/master/.github/workflows/docker-publish.yml | ||
name: docker | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
light-client: | ||
description: 'aptos or ethereum' | ||
type: choice | ||
options: | ||
- aptos | ||
- ethereum | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
jobs: | ||
container: | ||
runs-on: ubuntu-latest | ||
# https://docs.github.com/en/actions/reference/authentication-in-a-workflow | ||
permissions: | ||
id-token: write | ||
packages: write | ||
contents: read | ||
timeout-minutes: 120 | ||
steps: | ||
- name: Checkout repository | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Docker BuildX | ||
uses: docker/setup-buildx-action@v2 | ||
id: buildx | ||
with: | ||
install: true | ||
|
||
# Login against a Docker registry except on PR | ||
# https://github.com/docker/login-action | ||
- name: Log into registry ${{ env.REGISTRY }} | ||
# Ensure this doesn't trigger on PR's | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.REPO_TOKEN }} | ||
|
||
# Extract metadata (tags, labels) for Docker | ||
# https://github.com/docker/metadata-action | ||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: "argumentcomputer/${{ inputs.light-client }}" | ||
|
||
# Creates an additional 'latest' | ||
- name: Finalize Docker Metadata | ||
id: docker_tagging | ||
run: | | ||
echo "Neither scheduled nor manual release from main branch. Just tagging as branch name" | ||
echo "docker_tags=argumentcomputer/${{ inputs.light-client }}:${GITHUB_REF##*/}" >> $GITHUB_OUTPUT | ||
# Log docker metadata to explicitly know what is being pushed | ||
- name: Inspect Docker Metadata | ||
run: | | ||
echo "TAGS -> ${{ steps.docker_tagging.outputs.docker_tags }}" | ||
echo "LABELS -> ${{ steps.meta.outputs.labels }}" | ||
# Build and push Docker image | ||
# https://github.com/docker/build-push-action | ||
# https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: ./docker/Dockerfile | ||
push: true | ||
tags: ${{ steps.docker_tagging.outputs.docker_tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
build-args: | | ||
LIGHT_CLIENT=${{ inputs.light-client }} |
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,6 +1,16 @@ | ||
# Rust assets | ||
**/target | ||
Cargo.lock | ||
|
||
# IDE config | ||
.idea | ||
|
||
# Secrets | ||
*secret* | ||
*.env | ||
!.example.env | ||
|
||
# Contract assets | ||
ethereum/move/build/* | ||
ethereum/move/gas-profiling/* | ||
|
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
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 |
---|---|---|
|
@@ -38,7 +38,7 @@ Now that our deployment machine is properly configured, we can run the secondary | |
```bash | ||
git clone [email protected]:argumentcomputer/zk-light-clients.git && \ | ||
cd zk-light-clients/aptos/proof-server && \ | ||
SHARD_BATCH_SIZE=0 RUSTFLAGS="-C target-cpu=native --cfg tokio_unstable -C opt-level=3" cargo run --release --bin server_secondary -- -a <NETWORK_ADDRESS> | ||
SHARD_BATCH_SIZE=0 RUSTFLAGS="-C target-cpu=native --cfg tokio_unstable -C opt-level=3" cargo run --release --bin proof_server -- --mode "single" -a <NETWORK_ADDRESS> | ||
``` | ||
|
||
## Deploy the primary server | ||
|
@@ -48,5 +48,5 @@ Finally, once the primary server is configured in the same fashion, run it: | |
```bash | ||
git clone [email protected]:argumentcomputer/zk-light-clients.git && \ | ||
cd zk-light-clients/aptos/proof-server && \ | ||
SHARD_BATCH_SIZE=0 RUSTFLAGS="-C target-cpu=native --cfg tokio_unstable -C opt-level=3" cargo run --release --bin server_primary -- -a <NETWORK_ADDESS> --snd-addr <SECONDARY_SERVER_ADDRESS> | ||
SHARD_BATCH_SIZE=0 RUSTFLAGS="-C target-cpu=native --cfg tokio_unstable -C opt-level=3" cargo run --release --bin proof_server -- --mode "split" -a <NETWORK_ADDESS> --snd-addr <SECONDARY_SERVER_ADDRESS> | ||
``` |
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
Oops, something went wrong.