fix: full docker file #3838
Workflow file for this run
This file contains hidden or 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
| name: CI | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| merge_group: | |
| jobs: | |
| docker-tee-build: | |
| name: "Build MPC Node TEE Docker image" | |
| runs-on: warp-ubuntu-2204-x64-8x | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Build MPC Node binary | |
| run: cargo build -p mpc-node --profile reproducible --locked | |
| - name: Build MPC Docker image | |
| uses: Warpbuilds/build-push-action@8c1f3b8bd22c68607865d99ff650d37a564229a5 # v6.0.7 | |
| with: | |
| context: . | |
| profile-name: "mpc-image-builder" | |
| file: deployment/Dockerfile-node | |
| tags: test_image_tag_ci | |
| load: true | |
| - name: Check Docker image can initialize and start | |
| run: | | |
| touch /tmp/image-digest.bin | |
| # Test container startup - fail if container can't start | |
| # Start container in background and check status after 60 seconds | |
| CONTAINER_ID=$(docker run -d \ | |
| -v /tmp/:/data \ | |
| -e MPC_HOME_DIR="/data" \ | |
| -e MPC_ACCOUNT_ID=test_image.near \ | |
| -e RUST_BACKTRACE="full" \ | |
| -e RUST_LOG="mpc=debug,info" \ | |
| -e MPC_SECRET_STORE_KEY=BD399143F5B3126098B0EAA023A0E730 \ | |
| -e MPC_P2P_PRIVATE_KEY=ed25519:2WBi5gRyJntYA7dCyddiwNV2yNTdr5uZhrP4WX5GNBL5DSVCSR7ESvcXF2DBfY5oPYhzBmHnguPVSXjr6UCi8h1g \ | |
| -e MPC_ACCOUNT_SK=ed25519:6X3Bnghdf89WjHQfHDFYjW2UeNaNqCQ1AUGxX7zgvbJT4KSoeXzuHEdux6A2jsphTZTmS4SUGQRyYqC2ik3UrMP \ | |
| -e NEAR_BOOT_NODES=ed25519:ERguu7jQuYk8pxNsRC6FdezvNsegBPva1GRGqjmtD7i2@10.10.10.10:24567 \ | |
| -e MPC_CONTRACT_ID=v1.signer_test \ | |
| -e MPC_IMAGE_HASH=5ba283860c0efa3d4c3e08a76a2b77fab4725baad4f48504eac858e04af7fd64 \ | |
| -e MPC_LATEST_ALLOWED_HASH_FILE=/tmp/image-digest.bin \ | |
| -e MPC_BACKUP_ENCRYPTION_KEY_HEX=0000000000000000000000000000000000000000000000000000000000000000 \ | |
| -e MPC_ENV=mainnet test_image_tag_ci) | |
| if [ -z "$CONTAINER_ID" ]; then | |
| echo "❌ Failed to start container" | |
| exit 1 | |
| fi | |
| echo "Container started: $CONTAINER_ID" | |
| # Check if container is actually running | |
| sleep 60 | |
| if [ -z "$(docker ps --filter "id=$CONTAINER_ID" --format "{{.ID}}")" ]; then | |
| docker logs "$CONTAINER_ID" 2>&1 | head -50 | |
| echo "❌ Container cannot initialize/start properly" | |
| exit 1 | |
| fi | |
| echo "✅ Container started successfully" | |
| docker-launcher-build-and-verify: | |
| name: "Build MPC Launcher Docker image and verify" | |
| runs-on: warp-ubuntu-2404-x64-2x | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Install skopeo | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y skopeo | |
| - name: Build launcher docker image and verify its hash | |
| shell: bash | |
| run: | | |
| ./scripts/build-and-verify-launcher-docker-image.sh | |
| clippy-mpc-node: | |
| name: "MPC Node: clippy and format" | |
| runs-on: warp-ubuntu-2204-x64-8x | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Initialize submodules | |
| run: git submodule update --init --recursive | |
| - name: Cache Rust dependencies | |
| uses: WarpBuilds/rust-cache@e58c7440f25a26655b3867119bf68a1ba2dcc171 # v2.9.0 | |
| with: | |
| cache-on-failure: true | |
| cache-all-crates: true | |
| - name: Run Clippy fmt | |
| run: | | |
| CARGO_TARGET_DIR="target/clippy" \ | |
| RUSTFLAGS="-D warnings" \ | |
| cargo clippy --all-targets --locked | |
| - name: Run Cargo fmt | |
| run: | | |
| cargo fmt -- --check | |
| clippy-mpc-node-all-features: | |
| name: "MPC Node (all features): clippy and format" | |
| runs-on: warp-ubuntu-2204-x64-8x | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Initialize submodules | |
| run: git submodule update --init --recursive | |
| - name: Cache Rust dependencies | |
| uses: WarpBuilds/rust-cache@e58c7440f25a26655b3867119bf68a1ba2dcc171 # v2.9.0 | |
| with: | |
| cache-on-failure: true | |
| cache-all-crates: true | |
| - name: Run Clippy fmt | |
| run: | | |
| CARGO_TARGET_DIR="target/clippy" \ | |
| RUSTFLAGS="-D warnings" \ | |
| cargo clippy --all-targets --all-features --locked | |
| - name: Run Cargo fmt | |
| run: | | |
| cargo fmt -- --check | |
| mpc-unittests: | |
| name: "Cargo test" | |
| runs-on: warp-ubuntu-2204-x64-8x | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Initialize submodules | |
| run: git submodule update --init --recursive | |
| - name: Cache Rust dependencies | |
| uses: WarpBuilds/rust-cache@e58c7440f25a26655b3867119bf68a1ba2dcc171 # v2.9.0 | |
| with: | |
| cache-on-failure: true | |
| cache-all-crates: true | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@81ee1d48d9194cdcab880cbdc7d36e87d39874cb # v2.62.45 | |
| with: | |
| tool: nextest@0.9.106 | |
| - name: Install cargo-binstall | |
| uses: taiki-e/install-action@81ee1d48d9194cdcab880cbdc7d36e87d39874cb # v2.62.45 | |
| with: | |
| tool: cargo-binstall@1.16.0 | |
| - name: Install cargo-near | |
| run: | | |
| sudo apt-get update && sudo apt-get install --assume-yes libudev-dev | |
| cargo binstall --force --no-confirm --locked cargo-near@0.17.0 --pkg-url="{ repo }/releases/download/{ name }-v{ version }/{ name }-{ target }.{ archive-format }" | |
| - name: Install wasm-opt | |
| run: | | |
| cargo binstall --force --no-confirm --locked wasm-opt@0.116.1 | |
| echo "${HOME}/.cargo/bin" >> $GITHUB_PATH | |
| - name: Run cargo-nextest | |
| run: cargo nextest run --release --locked | |
| mpc-pytests: | |
| name: "MPC Node: pytests" | |
| runs-on: warp-ubuntu-2204-x64-8x | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Initialize submodules | |
| run: git submodule update --init --recursive | |
| - name: Cache Rust dependencies | |
| uses: WarpBuilds/rust-cache@e58c7440f25a26655b3867119bf68a1ba2dcc171 # v2.9.0 | |
| with: | |
| cache-on-failure: true | |
| cache-all-crates: true | |
| - name: Download near core binary from S3 | |
| id: download-neard | |
| continue-on-error: true | |
| run: | | |
| os=$(uname) | |
| arch=$(uname -m) | |
| os_and_arch=${os}-${arch} | |
| cd libs/nearcore | |
| branch_name=$(git branch -r --contains HEAD | grep -o 'origin/[^ ]*' | sed 's|origin/||' | head -n 1 || echo "no-branch") | |
| commit_hash=$(git rev-parse HEAD || echo "no-commit") | |
| url="https://s3.us-west-1.amazonaws.com/build.nearprotocol.com/nearcore/${os_and_arch}/${branch_name}/${commit_hash}/neard" | |
| mkdir -p target/release | |
| status_code=$(curl -v -o target/release/neard -w "%{http_code}" "${url}") | |
| if [ "$status_code" -ne 200 ]; then | |
| echo "curl failed with URL: ${url}, Status Code: ${status_code}" | |
| exit 1 | |
| fi | |
| chmod +x target/release/neard | |
| - name: Build near core as fallback | |
| if: steps.download-neard.outcome != 'success' | |
| run: | | |
| cd libs/nearcore | |
| cargo build -p neard --release | |
| - name: Build mpc node | |
| run: cargo build -p mpc-node --release --features=network-hardship-simulation | |
| - name: Install cargo-binstall | |
| uses: taiki-e/install-action@81ee1d48d9194cdcab880cbdc7d36e87d39874cb # v2.62.45 | |
| with: | |
| tool: cargo-binstall@1.16.0 | |
| - name: Install cargo-near | |
| run: | | |
| sudo apt-get update && sudo apt-get install --assume-yes libudev-dev | |
| cargo binstall --force --no-confirm --locked cargo-near@0.17.0 --pkg-url="{ repo }/releases/download/{ name }-v{ version }/{ name }-{ target }.{ archive-format }" | |
| - name: Install wasm-opt | |
| run: | | |
| cargo binstall --force --no-confirm --locked wasm-opt@0.116.1 | |
| echo "${HOME}/.cargo/bin" >> $GITHUB_PATH | |
| - name: Setup python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Setup virtualenv | |
| run: | | |
| python3 -m venv pytest/venv | |
| source pytest/venv/bin/activate | |
| cd pytest | |
| pip install -r requirements.txt | |
| cd ../ | |
| git submodule foreach --recursive 'git reset --hard && git clean -fd' | |
| - name: Run pytest | |
| run: | | |
| source pytest/venv/bin/activate | |
| cd pytest | |
| pytest -m "not ci_excluded" -s -x | |
| tee-launcher-tests: | |
| name: "TEE Launcher: pytests" | |
| runs-on: warp-ubuntu-2204-x64-8x | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Setup python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Setup virtualenv | |
| run: | | |
| python3 -m venv tee_launcher/venv | |
| source tee_launcher/venv/bin/activate | |
| cd tee_launcher | |
| pip install -r requirements.txt | |
| - name: Run pytest | |
| run: | | |
| source tee_launcher/venv/bin/activate | |
| cd tee_launcher | |
| PYTHONPATH=. pytest -vsx | |
| detect-unused-dependencies: | |
| name: "Detect unused dependencies" | |
| runs-on: warp-ubuntu-2204-x64-2x | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Install cargo-shear | |
| uses: taiki-e/install-action@81ee1d48d9194cdcab880cbdc7d36e87d39874cb # v2.62.45 | |
| with: | |
| tool: cargo-shear@1.6.0 | |
| - run: cargo shear | |
| cargo-sort-check: | |
| name: "Cargo.toml sort check" | |
| runs-on: warp-ubuntu-2204-x64-2x | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Install cargo-sort | |
| uses: taiki-e/install-action@81ee1d48d9194cdcab880cbdc7d36e87d39874cb # v2.62.45 | |
| with: | |
| tool: cargo-sort@2.0.2 | |
| - name: Check Cargo.toml sorting (strict) | |
| run: | | |
| cargo sort --check --check-format --workspace --grouped | |
| zizmor-check: | |
| name: "zizmor github actions check" | |
| runs-on: warp-ubuntu-2204-x64-2x | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Install zizmor | |
| uses: taiki-e/install-action@81ee1d48d9194cdcab880cbdc7d36e87d39874cb # v2.62.45 | |
| with: | |
| tool: zizmor@1.16.2 | |
| - name: Check github actions with zizmor | |
| run: | | |
| zizmor .github/ |