-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from Synthetixio/extractors-v2
Extractors Uprade
- Loading branch information
Showing
15 changed files
with
1,257 additions
and
62 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
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 @@ | ||
3.12 |
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,30 +1,25 @@ | ||
# build rust package | ||
FROM rust:1.79.0 as builder | ||
# include rust | ||
FROM rust:1.79.0 AS builder | ||
|
||
RUN apt-get update && apt-get install -y python3-pip python3-venv | ||
|
||
RUN python3 -m venv venv | ||
ENV PATH="/venv/bin:$PATH" | ||
# install wheel package and run | ||
FROM python:3.12 | ||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ | ||
|
||
WORKDIR /usr/src | ||
RUN git clone https://github.com/paradigmxyz/cryo | ||
WORKDIR /usr/src/cryo/crates/python | ||
# Copy Rust and Cargo binaries from the builder stage | ||
COPY --from=builder /usr/local/cargo /usr/local/cargo | ||
COPY --from=builder /usr/local/rustup /usr/local/rustup | ||
COPY --from=builder /usr/local/bin /usr/local/bin | ||
|
||
RUN pip install maturin | ||
RUN maturin build --release | ||
# Ensure the copied binaries are in the PATH | ||
ENV PATH="/usr/local/cargo/bin:/usr/local/rustup/bin:${PATH}" | ||
|
||
# install wheel package and run | ||
FROM python:3.11-slim as runtime | ||
RUN rustup default 1.79.0 | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /usr/src/cryo/target/wheels/*.whl /app/ | ||
|
||
RUN pip install --no-cache-dir /app/*.whl | ||
|
||
COPY requirements.txt . | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
COPY pyproject.toml uv.lock ./ | ||
RUN uv sync --frozen | ||
|
||
COPY . . | ||
|
||
CMD ["python3", "main.py"] | ||
CMD ["uv", "run", "python", "main.py"] |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
network_id: 421614 | ||
protocol: "synthetix" | ||
|
||
blocks: | ||
min_block: "41M" | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[project] | ||
name = "extractors" | ||
version = "0.1.0" | ||
description = "Add your description here" | ||
readme = "README.md" | ||
requires-python = ">=3.12" | ||
dependencies = [ | ||
"cryo==0.3.0", | ||
"duckdb>=1.1.3", | ||
"maturin>=1.7.7", | ||
"numpy>=2.1.3", | ||
"pandas>=2.2.3", | ||
"polars-lts-cpu>=1.16.0", | ||
"pyarrow>=18.1.0", | ||
"python-dotenv>=1.0.1", | ||
"pyyaml>=6.0.2", | ||
"synthetix>=0.1.21", | ||
] |
This file was deleted.
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
Oops, something went wrong.