Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 8 additions & 1 deletion .github/workflows/argo-build-and-backtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ jobs:
sudo microk8s kubectl get ns "${{ needs.resolve-context.outputs.namespace }}" || \
sudo microk8s kubectl create ns "${{ needs.resolve-context.outputs.namespace }}"

- name: Ensure Argo service account exists
run: |
sudo microk8s kubectl create serviceaccount argo-workflow-sa \
-n "${{ needs.resolve-context.outputs.namespace }}" \
--dry-run=client -o yaml | \
sudo microk8s kubectl apply -f -

- name: Apply GHCR credentials
run: |
sudo microk8s kubectl -n "${{ needs.resolve-context.outputs.namespace }}" create secret docker-registry ghcr-secret \
Expand Down Expand Up @@ -133,6 +140,6 @@ jobs:
export IMAGE_TAG="${GITHUB_SHA}"

envsubst < argo/run-backtest.yaml | \
sudo microk8s kubectl -n "${{ needs.resolve-context.outputs.namespace }}" apply -f -
sudo microk8s kubectl -n "${{ needs.resolve-context.outputs.namespace }}" create -f -

echo "Submitted backtest workflow in namespace: ${{ needs.resolve-context.outputs.namespace }}"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FROM python:3.11.14-slim-trixie AS build
ARG TRADING_RUNTIME_COMMIT

ENV TRADING_RUNTIME_COMMIT=${TRADING_RUNTIME_COMMIT}
ENV PATH="/install/bin:${PATH}"
ENV PATH="/install/bin:/install-dev/bin:${PATH}"
ENV PYTHONPATH="/install/lib/python3.11/site-packages"

WORKDIR /workspaces/trading-runtime
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ tests/data/results/

---

## ⚙️ Infrastructure Requirements

The Argo-based workflows require:

- A self-hosted GitHub Actions runner
- microk8s Kubernetes distribution (with sudo access)
- Argo Workflows installed in the cluster
- GitHub Container Registry access (GHCR_TOKEN secret)

GitHub-hosted runners are only used for unit tests.
All Kubernetes orchestration runs on self-hosted infrastructure.

---

## ☸ Kubernetes & Argo Workflows

This runtime is designed for Kubernetes-native execution using Argo Workflows.
Expand Down
10 changes: 7 additions & 3 deletions argo/workflowtemplate-backtest-fanout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ metadata:
spec:
entrypoint: backtest

securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000

parallelism: 4

arguments:
Expand Down Expand Up @@ -297,6 +302,5 @@ spec:

volumes:
- name: scratch
hostPath:
path: /mnt/scratch
type: Directory
persistentVolumeClaim:
claimName: scratch-pvc