From 2d153c51ef5951f1c05a262814e10aa0f03b1f52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CF=80a?= <76558220+rkdud007@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:25:01 +0900 Subject: [PATCH] chore: update docs, deprecate unused ci --- .github/workflows/docker_build_deploy.yml | 81 ----------------------- README.md | 64 +++++++----------- runner.dockerfile | 23 ------- 3 files changed, 25 insertions(+), 143 deletions(-) delete mode 100644 .github/workflows/docker_build_deploy.yml delete mode 100644 runner.dockerfile diff --git a/.github/workflows/docker_build_deploy.yml b/.github/workflows/docker_build_deploy.yml deleted file mode 100644 index e4ddcfec..00000000 --- a/.github/workflows/docker_build_deploy.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Build and Push Docker Images - -on: - workflow_dispatch: - push: - branches: - - dev - -jobs: - build-and-push-images: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - # - name: Log in to Docker Hub - # uses: docker/login-action@v3 - # with: - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_TOKEN }} - - # - name: Create remote builder certificates - # run: | - # echo "${{ secrets.BUILDKIT_CA_PEM }}" > ${{ github.workspace }}/client-ca.pem - # echo "${{ secrets.BUILDKIT_CERT_PEM }}" > ${{ github.workspace }}/client-cert.pem - # echo "${{ secrets.BUILDKIT_KEY_PEM }}" > ${{ github.workspace }}/client-key.pem - - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v3 - # with: - # driver: remote - # endpoint: "tcp://buildkit.herodotus.dev:5000" - # driver-opts: | - # cacert=${{ github.workspace }}/client-ca.pem - # cert=${{ github.workspace }}/client-cert.pem - # key=${{ github.workspace }}/client-key.pem - # cleanup: true - - name: Log in to Docker Hub - uses: docker/login-action@v3.1.0 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - version: "lab:latest" - driver: cloud - endpoint: "dataprocessor/github" - cleanup: true - - - name: Fetch HDP & Dry Run for Build - run: | - ./script/prepare_image_build.sh - - - name: Bump version and push tag - id: bump_version - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - NEW_VERSION=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[0].version') - echo "Project version is $NEW_VERSION" - echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV - git push --follow-tags - - - name: Build and push Runner Docker image - uses: docker/build-push-action@v5 - with: - context: . - file: runner.dockerfile - push: true - platforms: linux/amd64,linux/arm64 - tags: | - dataprocessor/hdp-runner:latest - dataprocessor/hdp-runner:v${{ env.NEW_VERSION }} - cache-from: | - type=registry,ref=dataprocessor/hdp-runner:buildcache-amd64,platform=linux/amd64 - type=registry,ref=dataprocessor/hdp-runner:buildcache-arm64,platform=linux/arm64 - cache-to: | - type=registry,ref=dataprocessor/hdp-runner:buildcache-amd64,mode=max,platform=linux/amd64 - type=registry,ref=dataprocessor/hdp-runner:buildcache-arm64,mode=max,platform=linux/arm64 diff --git a/README.md b/README.md index f2128c5f..4817af80 100644 --- a/README.md +++ b/README.md @@ -89,8 +89,6 @@ Usage: hdp run [OPTIONS] --request-file --program-input-file Pass request as json file - --rpc-url - The RPC URL to fetch the data --dry-run-cairo-file dry run contract bootloader program. only used for module task -p, --program-input-file @@ -129,35 +127,35 @@ Here is the support matrix indicating which blockchain elements are tested for e | Field Description | SUM | AVG | MIN | MAX | COUNT | | -------------------------------- | --- | --- | --- | --- | ----- | -| `account.nonce` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `account.balance` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `account.nonce` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `account.balance` | ✅ | ✅ | ✅ | ✅ | ✅ | | `account.storage_root` | - | - | - | - | - | | `account.code_hash` | - | - | - | - | - | -| `storage.key` (numeric value) | ✅ | ✅ | ✅ | ✅ | ✅ | +| `storage.key` (numeric value) | ✅ | ✅ | ✅ | ✅ | ✅ | | `storage.key` (hash value) | - | - | - | - | - | -| `header.difficulty` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `header.gas_limit` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `header.gas_used` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `header.timestamp` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `header.base_fee_per_gas` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `header.blob_gas_used` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `header.excess_blob_gas` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `header.nonce` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `header.difficulty` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `header.gas_limit` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `header.gas_used` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `header.timestamp` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `header.base_fee_per_gas` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `header.blob_gas_used` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `header.excess_blob_gas` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `header.nonce` | ✅ | ✅ | ✅ | ✅ | ✅ | | Other `header` elements | - | - | - | - | - | -| `tx.nonce` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `tx.gas_price` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `tx.gas_limit` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `tx.value` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `tx.v` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `tx.r` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `tx.s` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `tx.chain_id` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `tx.max_fee_per_gas` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `tx.max_priority_fee_per_gas` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `tx.max_fee_per_blob_gas` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `tx.nonce` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `tx.gas_price` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `tx.gas_limit` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `tx.value` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `tx.v` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `tx.r` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `tx.s` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `tx.chain_id` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `tx.max_fee_per_gas` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `tx.max_priority_fee_per_gas` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `tx.max_fee_per_blob_gas` | ✅ | ✅ | ✅ | ✅ | ✅ | | Other `tx` elements | - | - | - | - | - | -| `tx_receipt.success` | ✅ | ✅ | ✅ | ✅ | ✅ | -| `tx_receipt.cumulative_gas_used` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `tx_receipt.success` | ✅ | ✅ | ✅ | ✅ | ✅ | +| `tx_receipt.cumulative_gas_used` | ✅ | ✅ | ✅ | ✅ | ✅ | | Other `tx_receipt` elements | - | - | - | - | - | _Note: Fields marked with "-" are not applicable for the specified aggregate functions because they do not contain numeric data or the data type is not suitable for these calculations._ @@ -176,19 +174,7 @@ just run-ci-flow ### Local Run -To run HDP in a stable environment locally, you need to have `cairo-run` installed with the necessary tools in the correct path and locate the compiled Cairo program. If these steps sound tricky to you, just use the Docker image. - -To mount in a container environment, you need to create empty `input.json`, `output.json`, and `cairo.pie` files in the root directory of the host machine before running it. - -And locate `requeset.json` file on root that contains intended request format. - -```sh -docker-compose build - -docker-compose up -``` - -For those looking for an already built Docker image, you can pull it from [here](https://hub.docker.com/r/dataprocessor/hdp-runner). +Full local environment to run, check out this [hdp module template](https://github.com/HerodotusDev/hdp-module-template). ## License diff --git a/runner.dockerfile b/runner.dockerfile deleted file mode 100644 index b79fbe4b..00000000 --- a/runner.dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM dataprocessor/hdp-cairo:v0.0.15 - -# Set shell to bash and define working directory -SHELL ["/bin/bash", "-ci"] -WORKDIR /hdp-runner - -# Install Rust using Rustup -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ - echo 'export PATH="/root/.cargo/bin:$PATH"' >> /root/.bashrc - -# Add Cargo executables to PATH -RUN mkdir -p /root/.local/bin && \ - echo 'export PATH="/root/.local/bin:$PATH"' >> /root/.bashrc - - -# Copy the rest of the application source -COPY . . - -# Install Rust dependencies and build the Rust application -RUN cargo install --path cli - -# Command to run the Rust binary with user-specified parameters -CMD ["bash", "-c", "source /root/.bashrc && hdp run -r /hdp-runner/request.json -p /hdp-runner/input.json -b /hdp-runner/batch.json -c /hdp-runner/cairo.pie"]