Skip to content

Commit 2ba79c5

Browse files
committed
feat: Docker deployment, CI/CD expansion, and codebase cleanup
- Add multi-arch Docker build workflow (linux/amd64 + linux/arm64) with Sigstore signing and provenance attestation (docker-build.yml) - Update Dockerfile: add curl for healthcheck, EXPOSE ports, config copy - Update docker-compose.yml: add daemon/cli/benchmark app services - Expand release.yml: add benchmark_audit + cli for all platforms (Linux x86, macOS arm64, Windows x86) with package override logic - Clean .dockerignore: comprehensive exclusion of dev/test artifacts - Clean .gitignore: remove Cargo.lock exclusion, consolidate patterns - Fix all compilation warnings across 15 crates: - Remove unused imports (SinkExt, OrderSubmitted, Eip712, etc.) - Fix snake_case naming (p0T -> p0_cap_t in Hull-White model) - Suppress dead_code on stub struct fields (InferenceEngine, AlpacaSource, MockSource, CopyTrader, SimpleMomentum, AuditTrail) - Prefix unused variables with underscore (websocket ping handler) - Remove unnecessary files: - scripts/validate_benchmarks.py (replaced by Rust benchmark_audit) - check_env.ps1, run_bot.bat, run_tui.bat (hardcoded local paths) - scripts/run_local_validator.sh (legacy Solana) - BUILD_INSTRUCTIONS.md (Windows SDK fix, dev-local) - data/*.sqlite (runtime artifacts) - Result: zero-warning cargo check across entire workspace
1 parent b732b81 commit 2ba79c5

58 files changed

Lines changed: 9908 additions & 743 deletions

Some content is hidden

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

.dockerignore

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Build artifacts
2+
target/
3+
4+
# VCS & CI
5+
.git/
6+
.github/
7+
.gitignore
8+
9+
# Editor/IDE
10+
.vscode/
11+
.idea/
12+
*.swp
13+
*.swo
14+
*~
15+
16+
# Environment files (secrets)
17+
.env
18+
.env.local
19+
.env.production
20+
21+
# Documentation (not needed in image)
22+
*.md
23+
!README.md
24+
25+
# Test & dev artifacts
26+
logs/
27+
grafana/
28+
infra/
29+
docs/
30+
fuzz/
31+
benches/
32+
benchmarks/
33+
assets/
34+
scripts/
35+
36+
# Windows artifacts
37+
*.pdb
38+
*.bat
39+
*.ps1
40+
check_env.ps1
41+
42+
# Temp files
43+
emoji_report.txt
44+
errors.txt
45+
46+
# Rust tooling config (not needed at runtime)
47+
clippy.toml
48+
deny.toml
49+
cliff.toml
50+
rust-toolchain.toml
51+
.cargo/

.github/workflows/docker-build.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# .github/workflows/docker-build.yml
2+
# Builds multi-arch Docker images and pushes to GitHub Container Registry (ghcr.io)
3+
# Triggered on release tags AND manual dispatch for ad-hoc builds.
4+
5+
name: "Docker Build & Push"
6+
7+
on:
8+
push:
9+
tags: ["v*"]
10+
workflow_dispatch:
11+
inputs:
12+
tag_override:
13+
description: "Image tag override (default: git ref)"
14+
required: false
15+
type: string
16+
17+
permissions: {}
18+
19+
env:
20+
REGISTRY: ghcr.io
21+
IMAGE_NAME: ${{ github.repository }}
22+
23+
jobs:
24+
# ── Build & push multi-arch Docker image ──────────────────────
25+
docker:
26+
name: "Build & Push (${{ matrix.platform }})"
27+
runs-on: ${{ matrix.runner }}
28+
permissions:
29+
contents: read
30+
packages: write
31+
id-token: write # Sigstore keyless signing
32+
attestations: write # GitHub Attestations
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
include:
37+
- platform: linux/amd64
38+
runner: ubuntu-latest
39+
- platform: linux/arm64
40+
runner: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
43+
44+
# Expose platform as env for tagging
45+
- name: Sanitize platform for tag
46+
id: platform
47+
shell: bash
48+
run: echo "pair=$(echo '${{ matrix.platform }}' | tr '/' '-')" >> "$GITHUB_OUTPUT"
49+
50+
# Docker Buildx for multi-platform support
51+
- name: Set up Docker Buildx
52+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
53+
54+
# QEMU for cross-platform emulation (arm64 on amd64 runners)
55+
- name: Set up QEMU
56+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
57+
if: matrix.platform == 'linux/arm64'
58+
59+
# Authenticate to GitHub Container Registry
60+
- name: Log in to GHCR
61+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
62+
with:
63+
registry: ${{ env.REGISTRY }}
64+
username: ${{ github.actor }}
65+
password: ${{ secrets.GITHUB_TOKEN }}
66+
67+
# Extract metadata (tags, labels) for Docker
68+
- name: Extract Docker metadata
69+
id: meta
70+
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
71+
with:
72+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
73+
tags: |
74+
type=semver,pattern={{version}}
75+
type=semver,pattern={{major}}.{{minor}}
76+
type=semver,pattern={{major}}
77+
type=sha,prefix=sha-
78+
type=raw,value=${{ inputs.tag_override }},enable=${{ inputs.tag_override != '' }}
79+
type=raw,value=latest,enable={{is_default_branch}}
80+
81+
# Build and push per-platform image
82+
- name: Build and push by digest
83+
id: build
84+
uses: docker/build-push-action@263435318d21b8e681c14492fe198571cfb76f00 # v6.18.0
85+
with:
86+
context: .
87+
platforms: ${{ matrix.platform }}
88+
push: true
89+
tags: ${{ steps.meta.outputs.tags }}
90+
labels: ${{ steps.meta.outputs.labels }}
91+
cache-from: type=gha
92+
cache-to: type=gha,mode=max
93+
provenance: true
94+
sbom: true
95+
build-args: |
96+
BUILDKIT_INLINE_CACHE=1
97+
98+
# Sigstore keyless signing of the image
99+
- name: Install cosign
100+
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
101+
102+
- name: Sign container image (Sigstore keyless)
103+
shell: bash
104+
env:
105+
DIGEST: ${{ steps.build.outputs.digest }}
106+
run: |
107+
IMAGES="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
108+
cosign sign --yes "${IMAGES}@${DIGEST}"
109+
110+
# GitHub provenance attestation
111+
- name: Attest build provenance
112+
uses: actions/attest-build-provenance@ef244123eb79f2f7a7e75d99086184180e6d0018 # v2.1.0
113+
with:
114+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
115+
subject-digest: ${{ steps.build.outputs.digest }}
116+
push-to-registry: true
117+
118+
# Output digest for downstream verification
119+
- name: Export digest
120+
shell: bash
121+
run: |
122+
echo "## Docker Image Published" >> "$GITHUB_STEP_SUMMARY"
123+
echo "" >> "$GITHUB_STEP_SUMMARY"
124+
echo "| Field | Value |" >> "$GITHUB_STEP_SUMMARY"
125+
echo "|-------|-------|" >> "$GITHUB_STEP_SUMMARY"
126+
echo "| **Registry** | \`${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}\` |" >> "$GITHUB_STEP_SUMMARY"
127+
echo "| **Platform** | \`${{ matrix.platform }}\` |" >> "$GITHUB_STEP_SUMMARY"
128+
echo "| **Digest** | \`${{ steps.build.outputs.digest }}\` |" >> "$GITHUB_STEP_SUMMARY"
129+
echo "| **Signed** | Sigstore keyless |" >> "$GITHUB_STEP_SUMMARY"

.github/workflows/release.yml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
fail-fast: false
4242
matrix:
4343
include:
44+
# ── Linux x86_64 ──────────────────────────────────────
4445
- os: ubuntu-latest
4546
target: x86_64-unknown-linux-gnu
4647
artifact_name: rustforge-daemon-linux-x86_64
@@ -53,6 +54,13 @@ jobs:
5354
target: x86_64-unknown-linux-gnu
5455
artifact_name: rustforge-cli-linux-x86_64
5556
binary: cli
57+
- os: ubuntu-latest
58+
target: x86_64-unknown-linux-gnu
59+
artifact_name: rustforge-benchmark-audit-linux-x86_64
60+
binary: benchmark_audit
61+
package: backtest
62+
63+
# ── macOS arm64 (Apple Silicon) ─────────────────────
5664
- os: macos-latest
5765
target: aarch64-apple-darwin
5866
artifact_name: rustforge-daemon-macos-aarch64
@@ -61,6 +69,17 @@ jobs:
6169
target: aarch64-apple-darwin
6270
artifact_name: rustforge-tui-macos-aarch64
6371
binary: tui
72+
- os: macos-latest
73+
target: aarch64-apple-darwin
74+
artifact_name: rustforge-cli-macos-aarch64
75+
binary: cli
76+
- os: macos-latest
77+
target: aarch64-apple-darwin
78+
artifact_name: rustforge-benchmark-audit-macos-aarch64
79+
binary: benchmark_audit
80+
package: backtest
81+
82+
# ── Windows x86_64 ─────────────────────────────────
6483
- os: windows-latest
6584
target: x86_64-pc-windows-msvc
6685
artifact_name: rustforge-daemon-windows-x86_64.exe
@@ -69,6 +88,15 @@ jobs:
6988
target: x86_64-pc-windows-msvc
7089
artifact_name: rustforge-tui-windows-x86_64.exe
7190
binary: tui
91+
- os: windows-latest
92+
target: x86_64-pc-windows-msvc
93+
artifact_name: rustforge-cli-windows-x86_64.exe
94+
binary: cli
95+
- os: windows-latest
96+
target: x86_64-pc-windows-msvc
97+
artifact_name: rustforge-benchmark-audit-windows-x86_64.exe
98+
binary: benchmark_audit
99+
package: backtest
72100
steps:
73101
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
74102

@@ -85,10 +113,16 @@ jobs:
85113

86114
# Build with embedded SBOM (Cargo.lock baked into binary)
87115
- name: Build release binary with embedded dependency manifest
116+
shell: bash
88117
run: |
118+
PKG="${{ matrix.package || matrix.binary }}"
119+
BIN_FLAG=""
120+
if [[ -n "${{ matrix.package }}" ]]; then
121+
BIN_FLAG="--bin ${{ matrix.binary }}"
122+
fi
89123
cargo auditable build --release \
90124
--target ${{ matrix.target }} \
91-
-p ${{ matrix.binary }}
125+
-p "${PKG}" ${BIN_FLAG}
92126
93127
- name: Rename binary
94128
shell: bash
@@ -157,15 +191,31 @@ jobs:
157191
rustforge-cli-linux-x86_64/rustforge-cli-linux-x86_64
158192
rustforge-cli-linux-x86_64/rustforge-cli-linux-x86_64.sha256
159193
rustforge-cli-linux-x86_64/rustforge-cli-linux-x86_64.sigstore.json
194+
rustforge-benchmark-audit-linux-x86_64/rustforge-benchmark-audit-linux-x86_64
195+
rustforge-benchmark-audit-linux-x86_64/rustforge-benchmark-audit-linux-x86_64.sha256
196+
rustforge-benchmark-audit-linux-x86_64/rustforge-benchmark-audit-linux-x86_64.sigstore.json
160197
rustforge-daemon-macos-aarch64/rustforge-daemon-macos-aarch64
161198
rustforge-daemon-macos-aarch64/rustforge-daemon-macos-aarch64.sha256
162199
rustforge-daemon-macos-aarch64/rustforge-daemon-macos-aarch64.sigstore.json
163200
rustforge-tui-macos-aarch64/rustforge-tui-macos-aarch64
164201
rustforge-tui-macos-aarch64/rustforge-tui-macos-aarch64.sha256
165202
rustforge-tui-macos-aarch64/rustforge-tui-macos-aarch64.sigstore.json
203+
rustforge-cli-macos-aarch64/rustforge-cli-macos-aarch64
204+
rustforge-cli-macos-aarch64/rustforge-cli-macos-aarch64.sha256
205+
rustforge-cli-macos-aarch64/rustforge-cli-macos-aarch64.sigstore.json
206+
rustforge-benchmark-audit-macos-aarch64/rustforge-benchmark-audit-macos-aarch64
207+
rustforge-benchmark-audit-macos-aarch64/rustforge-benchmark-audit-macos-aarch64.sha256
208+
rustforge-benchmark-audit-macos-aarch64/rustforge-benchmark-audit-macos-aarch64.sigstore.json
166209
rustforge-daemon-windows-x86_64.exe/rustforge-daemon-windows-x86_64.exe
167210
rustforge-daemon-windows-x86_64.exe/rustforge-daemon-windows-x86_64.exe.sha256
168211
rustforge-daemon-windows-x86_64.exe/rustforge-daemon-windows-x86_64.exe.sigstore.json
169212
rustforge-tui-windows-x86_64.exe/rustforge-tui-windows-x86_64.exe
170213
rustforge-tui-windows-x86_64.exe/rustforge-tui-windows-x86_64.exe.sha256
171214
rustforge-tui-windows-x86_64.exe/rustforge-tui-windows-x86_64.exe.sigstore.json
215+
rustforge-cli-windows-x86_64.exe/rustforge-cli-windows-x86_64.exe
216+
rustforge-cli-windows-x86_64.exe/rustforge-cli-windows-x86_64.exe.sha256
217+
rustforge-cli-windows-x86_64.exe/rustforge-cli-windows-x86_64.exe.sigstore.json
218+
rustforge-benchmark-audit-windows-x86_64.exe/rustforge-benchmark-audit-windows-x86_64.exe
219+
rustforge-benchmark-audit-windows-x86_64.exe/rustforge-benchmark-audit-windows-x86_64.exe.sha256
220+
rustforge-benchmark-audit-windows-x86_64.exe/rustforge-benchmark-audit-windows-x86_64.exe.sigstore.json
221+

.gitignore

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,37 @@
1-
/target
2-
/C:\rust-target
1+
# Build artifacts
2+
/target/
3+
4+
# Rust backup files
35
**/*.rs.bk
6+
7+
# Environment secrets
48
.env
5-
.idea
6-
.vscode
7-
/Cargo.lock
9+
.env.local
10+
.env.production
11+
12+
# IDE / Editor
13+
.idea/
14+
.vscode/
15+
*.swp
16+
*.swo
17+
*~
818

9-
# Build/debug logs
10-
error.txt
11-
errors.txt
12-
check_output.txt
13-
build.log
14-
daemon_check.log
15-
workspace_check.log
16-
error_log.txt
19+
# Runtime data
20+
data/*.sqlite
21+
data/*.sqlite-shm
22+
data/*.sqlite-wal
23+
data/*.db
24+
logs/
25+
26+
# Build / debug logs
27+
*.log
1728

1829
# OS files
1930
.DS_Store
20-
Thumbs.db
31+
Thumbs.db
32+
33+
# Temporary artifacts
34+
*.pdb
35+
*.tmp
36+
*.bak
37+
emoji_report.txt

BUILD_INSTRUCTIONS.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)