Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ on:

jobs:
docker:
strategy:
matrix:
test: ["eth_getBalance", "eth_getBlockByNumber"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v2
- run: docker build --tag paradigmxyz/flood:latest .
- run: docker run --rm paradigmxyz/flood:latest version
- run: |
- name: ${{ matrix.test }}
run: |
docker run --rm paradigmxyz/flood:latest \
eth_getBlockByNumber \
${{ matrix.test }} \
node1=https://eth.llamarpc.com \
node2=https://eth.llamarpc.com \
--duration 3 --rate 1
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://github.com/paradigmxyz/flood/pkgs/container/flood

# Stage 1: Install flood
FROM python:3.11.3-slim AS flood-builder
FROM python:3.11-slim AS flood-builder
ENV USERNAME="flood"
ENV PATH="${PATH}:/home/${USERNAME}/.local/bin"
RUN adduser $USERNAME
Expand All @@ -14,23 +14,26 @@ RUN pip install --user --no-cache-dir ./

# Stage 2: Install vegeta
FROM debian:stable-slim AS vegeta-builder
ENV VEGETA_VERSION=12.8.4
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /vegeta
WORKDIR /vegeta
RUN wget https://github.com/tsenart/vegeta/releases/download/v12.8.4/vegeta_12.8.4_linux_amd64.tar.gz \
&& tar xzf vegeta_12.8.4_linux_amd64.tar.gz \
&& rm vegeta_12.8.4_linux_amd64.tar.gz
RUN wget https://github.com/tsenart/vegeta/releases/download/v${VEGETA_VERSION}/vegeta_${VEGETA_VERSION}_linux_amd64.tar.gz \
&& tar xzf vegeta_${VEGETA_VERSION}_linux_amd64.tar.gz \
&& rm vegeta_${VEGETA_VERSION}_linux_amd64.tar.gz

# Final stage: Combine flood and vegeta
FROM python:3.11.3-slim
FROM python:3.11-slim
ENV USERNAME="flood"
ENV PATH="${PATH}:/home/${USERNAME}/.local/bin"
RUN adduser $USERNAME
USER $USERNAME

RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/*
COPY --from=flood-builder /home/$USERNAME/.local /home/$USERNAME/.local
COPY --from=vegeta-builder /vegeta/vegeta /home/$USERNAME/.local/bin/vegeta

USER $USERNAME
WORKDIR /home/$USERNAME
ENTRYPOINT ["python", "-m", "flood"]
Loading