Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/issue_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
check-linked-issues:
name: Check if pull request has linked issues
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Get issues
id: get-issues
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: [3.13]
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: [3.13]
Expand All @@ -12,6 +12,7 @@ jobs:
ETH_PRIVATE_KEY: ${{ secrets.ETH_PRIVATE_KEY }}
ENDPOINT: ${{ secrets.ENDPOINT }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
SGX_WALLET_TAG: latest

steps:
- uses: actions/checkout@v5
Expand All @@ -23,6 +24,14 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Enable Yarn
run: corepack enable

- name: Update host dependencies
run: sudo apt-get update --fix-missing

Expand Down
41 changes: 31 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,42 @@
FROM python:3.13.8-slim-trixie AS builder
ARG PYTHON_VERSION=3.13.8

RUN apt update && apt install -y --no-install-recommends build-essential libssl-dev --yes
FROM ubuntu:24.04 AS builder

ARG PYTHON_VERSION
ENV DEBIAN_FRONTEND=noninteractive \
UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy \
UV_MANAGED_PYTHON=1 \
UV_PYTHON_INSTALL_DIR=/opt/python

RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential ca-certificates libssl-dev \
&& rm -rf /var/lib/apt/lists/*

COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

RUN mkdir app
WORKDIR /app

COPY pyproject.toml ./
RUN uv pip install --prerelease=allow --system --no-cache .
RUN uv python install "${PYTHON_VERSION}" --no-bin \
&& uv sync --no-cache --no-dev --no-install-project --python "${PYTHON_VERSION}"


FROM ubuntu:24.04

FROM python:3.13.8-slim-trixie
ENV DEBIAN_FRONTEND=noninteractive \
PATH="/app/.venv/bin:${PATH}" \
PYTHONPATH="/app" \
PYTHONUNBUFFERED=1

RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY --from=builder /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
COPY transaction_manager transaction_manager
COPY --from=builder /opt/python /opt/python
COPY --from=builder /app/.venv /app/.venv
COPY transaction_manager ./transaction_manager

ENV PYTHONPATH="/app"
CMD ["python3", "-m", "transaction_manager.main"]
CMD ["python", "-m", "transaction_manager.main"]
20 changes: 20 additions & 0 deletions scripts/run-test-containers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,25 @@ gen_sgx_key() {
python3 tests/gen_sgx.py
}

wait_for_hnode() {
local retries=60
local rpc_url="http://127.0.0.1:8545"
local rpc_request='{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'

until curl --fail --silent \
--header "Content-Type: application/json" \
--data "$rpc_request" \
"$rpc_url" | grep --quiet '"result"'; do
retries=$((retries - 1))
if [ "$retries" -eq 0 ]; then
echo "Hardhat node did not become ready at $rpc_url" >&2
docker logs hnode --tail 100 >&2
return 1
fi
sleep 1
done
}

deploy_test_contract() {
cd tests/tester-contract/
yarn install
Expand All @@ -79,4 +98,5 @@ else
gen_sgx_key
fi

wait_for_hnode
deploy_test_contract
Loading