Skip to content

Commit

Permalink
Release 1.179.0
Browse files Browse the repository at this point in the history
See release notes.
  • Loading branch information
cjdsellers authored Oct 22, 2023
2 parents ef75e5f + 8015f70 commit ef4d72e
Show file tree
Hide file tree
Showing 578 changed files with 33,397 additions and 19,058 deletions.
2 changes: 1 addition & 1 deletion .docker/jupyterlab.dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG GIT_TAG
FROM ghcr.io/nautechsystems/nautilus_trader:$GIT_TAG
COPY --from=ghcr.io/nautechsystems/nautilus_data:main /opt/pysetup/catalog /catalog
RUN pip install jupyterlab
RUN pip install jupyterlab datafusion
ENV NAUTILUS_PATH="/"
CMD ["python", "-m", "jupyterlab", "--port=8888", "--no-browser", "--ip=0.0.0.0", "--allow-root", "-NotebookApp.token=''", "--NotebookApp.password=''", "examples/notebooks"]
16 changes: 9 additions & 7 deletions .docker/nautilus_trader.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ WORKDIR $PYSETUP_PATH
FROM base as builder

# Install build deps
RUN apt-get update && apt-get install -y curl clang git libssl-dev make pkg-config
RUN apt-get update && \
apt-get install -y curl clang git libssl-dev make pkg-config && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install Rust stable
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y

# Install poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
# Install Rust stable and poetry
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
curl -sSL https://install.python-poetry.org | python3 -

# Install package requirements (split step and with --no-root to enable caching)
COPY poetry.lock pyproject.toml build.py ./
Expand All @@ -36,10 +37,11 @@ COPY nautilus_trader ./nautilus_trader
COPY README.md ./
RUN poetry install --only main --all-extras
RUN poetry build -f wheel
RUN python -m pip install ./dist/*whl --force
RUN python -m pip install ./dist/*whl --force --no-deps
RUN find /usr/local/lib/python3.11/site-packages -name "*.pyc" -exec rm -f {} \;

# Final application image
FROM base as application

COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY examples ./examples
84 changes: 84 additions & 0 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: build-wheels

# Build Linux wheels on successful completion of the `coverage` workflow on the `develop` branch
# Temporarily build wheels on every push to `develop` branch

on:
push:
branches: [develop]

jobs:
build-wheels:
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
arch: [x64]
os: [ubuntu-latest]
python-version: ["3.11"]
name: build - Python ${{ matrix.python-version }} (${{ matrix.arch }} ${{ matrix.os }})
runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Get Rust version from rust-toolchain.toml
id: rust-version
run: |
version=$(awk -F\" '/version/ {print $2}' nautilus_core/rust-toolchain.toml)
echo "Rust toolchain version $version"
echo "RUST_VERSION=$version" >> $GITHUB_ENV
working-directory: ${{ github.workspace }}

- name: Set up Rust tool-chain (stable)
uses: actions-rust-lang/[email protected]
with:
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt, clippy

- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Get Poetry version from poetry-version
run: |
version=$(cat poetry-version)
echo "POETRY_VERSION=$version" >> $GITHUB_ENV
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}

- name: Install build dependencies
run: python -m pip install --upgrade pip setuptools wheel msgspec

- name: Set poetry cache-dir
run: echo "POETRY_CACHE_DIR=$(poetry config cache-dir)" >> $GITHUB_ENV

- name: Poetry cache
id: cached-poetry
uses: actions/cache@v3
with:
path: ${{ env.POETRY_CACHE_DIR }}
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('**/poetry.lock') }}

- name: Install / Build
run: |
poetry install
poetry build --format wheel
- name: Set release output
id: vars
run: |
echo "ASSET_PATH=$(find ./dist -mindepth 1 -print -quit)" >> $GITHUB_ENV
cd dist
echo "ASSET_NAME=$(printf '%s\0' * | awk 'BEGIN{RS="\0"} {print; exit}')" >> $GITHUB_ENV
- name: Upload wheel artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ASSET_NAME }}
path: ${{ env.ASSET_PATH }}
40 changes: 28 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
arch: [x64]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11"]
defaults:
run:
shell: bash
name: build - Python ${{ matrix.python-version }} (${{ matrix.arch }} ${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
Expand All @@ -24,21 +27,29 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get Rust version from rust-toolchain.toml
id: rust-version
run: |
version=$(awk -F\" '/version/ {print $2}' nautilus_core/rust-toolchain.toml)
echo "Rust toolchain version $version"
echo "RUST_VERSION=$version" >> $GITHUB_ENV
working-directory: ${{ github.workspace }}

- name: Set up Rust tool-chain (Linux, Windows) stable
if: (runner.os == 'Linux') || (runner.os == 'Windows')
uses: actions-rust-lang/[email protected]
with:
toolchain: stable
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt, clippy

# Work around as actions-rust-lang does not seem to work on macOS yet
- name: Set up Rust tool-chain (macOS) stable
if: runner.os == 'macOS'
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: ${{ env.RUST_VERSION }}
override: true
components: rustfmt, clippy

Expand All @@ -47,8 +58,18 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Get Poetry version from poetry-version
run: |
version=$(cat poetry-version)
echo "POETRY_VERSION=$version" >> $GITHUB_ENV
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}

- name: Install build dependencies
run: python -m pip install --upgrade pip setuptools wheel pre-commit poetry==1.6.1 msgspec
run: python -m pip install --upgrade pip setuptools wheel pre-commit msgspec

- name: Setup cached pre-commit
id: cached-pre-commit
Expand All @@ -57,19 +78,14 @@ jobs:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-${{ matrix.python-version }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Setup poetry output (Linux, macOS)
if: (runner.os == 'Linux') || (runner.os == 'macOS')
run: echo "dir=$(poetry config cache-dir)" >> $GITHUB_ENV

- name: Setup poetry output (Windows)
if: runner.os == 'Windows'
run: echo "dir=$(poetry config cache-dir)" | Out-File -FilePath $env:GITHUB_ENV -Append >> $GITHUB_ENV
- name: Set poetry cache-dir
run: echo "POETRY_CACHE_DIR=$(poetry config cache-dir)" >> $GITHUB_ENV

- name: Poetry cache
id: cached-poetry
uses: actions/cache@v3
with:
path: ${{ env.dir }}
path: ${{ env.POETRY_CACHE_DIR }}
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('**/poetry.lock') }}

- name: Run pre-commit
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
Expand Down
33 changes: 26 additions & 7 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,40 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Rust tool-chain (stable)
- name: Get Rust version from rust-toolchain.toml
id: rust-version
run: |
version=$(awk -F\" '/version/ {print $2}' nautilus_core/rust-toolchain.toml)
echo "Rust toolchain version $version"
echo "RUST_VERSION=$version" >> $GITHUB_ENV
working-directory: ${{ github.workspace }}

- name: Set up Rust tool-chain (Linux, Windows) stable
if: (runner.os == 'Linux') || (runner.os == 'Windows')
uses: actions-rust-lang/[email protected]
with:
toolchain: stable
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt, clippy

- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Get Poetry version from poetry-version
run: |
version=$(cat poetry-version)
echo "POETRY_VERSION=$version" >> $GITHUB_ENV
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}

- name: Install build dependencies
run: python -m pip install --upgrade pip setuptools wheel pre-commit poetry==1.6.1 msgspec
run: python -m pip install --upgrade pip setuptools wheel pre-commit msgspec

- name: Setup cached pre-commit
id: cached-pre-commit
Expand All @@ -45,14 +64,14 @@ jobs:
- name: Run pre-commit
run: pre-commit run --all-files

- name: Set poetry output
run: echo "dir=$(poetry config cache-dir)" >> $GITHUB_ENV
- name: Set poetry cache-dir
run: echo "POETRY_CACHE_DIR=$(poetry config cache-dir)" >> $GITHUB_ENV

- name: Poetry cache
id: cached-poetry
uses: actions/cache@v3
with:
path: ${{ env.dir }}
path: ${{ env.POETRY_CACHE_DIR }}
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('**/poetry.lock') }}

- name: Install Redis
Expand Down
29 changes: 21 additions & 8 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,29 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: false
dotnet: false
haskell: false
large-packages: true
docker-images: true
swap-storage: true

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand All @@ -37,7 +50,7 @@ jobs:
- name: Build nautilus_trader image (develop)
if: ${{ steps.branch-name.outputs.current_branch == 'develop' }}
id: docker_build_trader_develop
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
file: ".docker/nautilus_trader.dockerfile"
push: true
Expand All @@ -50,7 +63,7 @@ jobs:
- name: Build nautilus_trader image (latest)
if: ${{ steps.branch-name.outputs.current_branch == 'master' }}
id: docker_build_trader_latest
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
file: ".docker/nautilus_trader.dockerfile"
push: true
Expand All @@ -63,7 +76,7 @@ jobs:
- name: Build jupyterlab image (develop)
if: ${{ steps.branch-name.outputs.current_branch == 'develop' }}
id: docker_build_jupyterlab_develop
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
file: ".docker/jupyterlab.dockerfile"
push: true
Expand All @@ -78,7 +91,7 @@ jobs:
- name: Build jupyterlab image (latest)
if: ${{ steps.branch-name.outputs.current_branch == 'master' }}
id: docker_build_jupyterlab_latest
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
file: ".docker/jupyterlab.dockerfile"
push: true
Expand Down
Loading

0 comments on commit ef4d72e

Please sign in to comment.