Skip to content

Commit af72cab

Browse files
authored
Release 1.219.0
See release notes.
2 parents f8f2122 + ab457f2 commit af72cab

File tree

724 files changed

+53700
-17724
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

724 files changed

+53700
-17724
lines changed

.docker/DockerfileUbuntu

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Dockerfile to reproduce locally an environment similar to what is run on the github runner
2+
#
3+
# From nautilus project's root folder:
4+
#
5+
# Build the image:
6+
# docker build -f .docker/DockerfileUbuntu -t nautilus-dev .
7+
#
8+
# Run interactively with local directory mounted:
9+
# docker run --rm -itv "$(pwd)":/workspace nautilus-dev bash
10+
#
11+
# Or run the default entrypoint:
12+
# docker run --rm -itv "$(pwd)":/workspace nautilus-dev
13+
#
14+
# Remove the image
15+
# docker image rm nautilus-dev
16+
17+
FROM ubuntu:22.04
18+
19+
# Set environment variables
20+
ENV DEBIAN_FRONTEND=noninteractive
21+
ENV BUILD_MODE=release
22+
ENV RUST_BACKTRACE=1
23+
ENV CARGO_INCREMENTAL=1
24+
ENV CC="clang"
25+
ENV CXX="clang++"
26+
27+
# Install system dependencies
28+
RUN apt-get update && apt-get install -y \
29+
curl \
30+
clang \
31+
git \
32+
pkg-config \
33+
make \
34+
capnproto \
35+
libcapnp-dev \
36+
gcc-aarch64-linux-gnu \
37+
&& rm -rf /var/lib/apt/lists/*
38+
39+
# Install Rust
40+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
41+
ENV PATH="/root/.cargo/bin:${PATH}"
42+
43+
# Install mold linker
44+
RUN curl -L https://github.com/rui314/mold/releases/download/v2.35.1/mold-2.35.1-x86_64-linux.tar.gz | tar -xz -C /usr/local --strip-components=1
45+
46+
# Install uv
47+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
48+
ENV PATH="/root/.cargo/bin:/root/.local/bin:${PATH}"
49+
50+
# Install Python 3.13
51+
RUN uv python install
52+
53+
# Set working directory
54+
WORKDIR /workspace
55+
56+
# Copy only necessary files for dependency setup
57+
# The actual source code will be mounted as a volume
58+
COPY ../scripts/rust-toolchain.sh scripts/
59+
COPY ../Cargo.toml Cargo.lock pyproject.toml rust-toolchain.toml ./
60+
61+
# Set up Rust toolchain based on project requirements
62+
RUN bash scripts/rust-toolchain.sh > /tmp/toolchain.txt && \
63+
TOOLCHAIN=$(cat /tmp/toolchain.txt) && \
64+
rustup toolchain install $TOOLCHAIN && \
65+
rustup default $TOOLCHAIN && \
66+
rustup component add clippy rustfmt
67+
68+
# Copy and set up entrypoint script for interactive development
69+
COPY .docker/entrypoint.sh /entrypoint.sh
70+
RUN chmod +x /entrypoint.sh
71+
72+
ENTRYPOINT ["/entrypoint.sh"]

.docker/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ services:
2525
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
2626
volumes:
2727
- pgadmin:/root/.pgadmin
28+
security_opt:
29+
- no-new-privileges:true
2830
ports:
2931
- "${PGADMIN_PORT:-5051}:80"
3032
networks:

.docker/entrypoint.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
# entrypoint script for DockerfileUbuntu
3+
4+
echo "=== Nautilus Trader Development Environment ==="
5+
echo "Rust version: $(rustc --version)"
6+
echo "UV version: $(uv --version)"
7+
echo "Working directory: $(pwd)"
8+
echo
9+
10+
echo "=== Setting PyO3 environment ==="
11+
export PYO3_PYTHON=/workspace/.venv/bin/python3
12+
echo "PYO3_PYTHON: $PYO3_PYTHON"
13+
echo
14+
15+
echo "=== Development environment ready! ==="
16+
echo "You can now run for example:"
17+
echo " make install-debug # Install nautilus in debug mode"
18+
echo " make cargo-test # Test Rust code"
19+
echo " make pytest # Run Python tests"
20+
echo " uv run python -c \"import nautilus_trader.backtest.engine;\" # Run a Python instruction"
21+
echo
22+
23+
# If no command is provided, check if we have a TTY and start appropriate shell
24+
if [ $# -eq 0 ]; then
25+
if [ -t 0 ]; then
26+
echo "Starting interactive shell..."
27+
exec bash
28+
else
29+
echo "No TTY detected. Use docker run -it for interactive mode."
30+
echo "Container ready for commands. Example:"
31+
echo " docker run --rm -itv \"\$(pwd)\":/workspace nautilus-dev"
32+
fi
33+
else
34+
exec "$@"
35+
fi

.docker/nautilus_trader.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ FROM base AS builder
1616

1717
# Install build deps
1818
RUN apt-get update && \
19-
apt-get install -y curl clang git libssl-dev make pkg-config capnproto libcapnp-dev && \
19+
apt-get install -y curl clang git make pkg-config capnproto libcapnp-dev && \
2020
apt-get clean && \
2121
rm -rf /var/lib/apt/lists/*
2222

.github/OVERVIEW.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ CI/CD, testing, publishing, and automation within the NautilusTrader repository.
4444
- **Code Scanning**: CodeQL is enabled for continuous security analysis.
4545
- **Dependency Pinning**: key tools (pre-commit, Python versions, Rust toolchain,
4646
mold, cargo-nextest) are locked to fixed versions or SHAs.
47+
- **Least-Privilege Tokens**: workflows default the `GITHUB_TOKEN` to
48+
`contents: read, actions: read` and selectively elevate scopes (e.g.
49+
`contents: write`) only for the jobs that need to tag a release or upload
50+
assets. This follows the principle of least privilege and limits blast
51+
radius if a job is compromised.
4752
- **Caching**: caches for sccache, pip/site-packages, pre-commit, and test data
4853
speed up workflows while preserving hermetic builds.
4954

.github/actions/common-setup/action.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ runs:
4040
shell: bash
4141
run: |
4242
sudo apt-get update
43-
sudo apt-get install -y curl clang git libssl-dev make pkg-config
43+
sudo apt-get install -y curl clang git make pkg-config
4444
sudo apt-get install -y python3-dev libpython3-dev
4545
sudo apt-get install -y capnproto libcapnp-dev
4646
@@ -75,8 +75,8 @@ runs:
7575
override: true
7676

7777
- name: Install cargo-nextest
78-
# https://github.com/taiki-e/install-action # v2.50.10
79-
uses: taiki-e/install-action@83254c543806f3224380bf1001d6fac8feaf2d0b
78+
# https://github.com/taiki-e/install-action # v2.53.2
79+
uses: taiki-e/install-action@d12e869b89167df346dd0ff65da342d1fb1202fb
8080
with:
8181
tool: nextest
8282

@@ -86,9 +86,14 @@ runs:
8686
shell: bash
8787
run: |
8888
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
89+
90+
# Based on GitHub Actions runner constraints
91+
# and Nautilus Trader uncompressed package final size (~1 GiB)
92+
echo "SCCACHE_CACHE_SIZE=4G" >> $GITHUB_ENV
8993
echo "SCCACHE_IDLE_TIMEOUT=0" >> $GITHUB_ENV
9094
echo "SCCACHE_DIRECT=true" >> $GITHUB_ENV
9195
echo "SCCACHE_CACHE_MULTIARCH=1" >> $GITHUB_ENV
96+
9297
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
9398
9499
- name: Set sccache env vars (non-Windows)

.github/actions/common-wheel-build/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ runs:
4040
shell: bash
4141
run: |
4242
echo "Building for Linux ARM64"
43+
4344
PYTHON_LIB_DIR=$(python3 -c 'import sysconfig; print(sysconfig.get_config_var("LIBDIR"))')
4445
PYTHON_VERSION=$(python3 -c 'import platform; print(".".join(platform.python_version_tuple()[:2]))')
4546

.github/workflows/build-docs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: build-docs
22

3+
permissions: # Principle of least privilege
4+
contents: read
5+
actions: read
6+
37
on:
48
push:
59
branches: [master, nightly]
@@ -9,7 +13,7 @@ jobs:
913
runs-on: ubuntu-latest
1014
steps:
1115
# https://github.com/step-security/harden-runner
12-
- uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
16+
- uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
1317
with:
1418
egress-policy: audit
1519

0 commit comments

Comments
 (0)