progress
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
.git
|
||||
**/__pycache__
|
||||
.pipenv
|
||||
@@ -0,0 +1,24 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
|
||||
ARG FROM_DIR=docker_dev/trading/executor
|
||||
|
||||
COPY ${FROM_DIR}/requirements.txt /
|
||||
RUN pip install --upgrade pip --root-user-action=ignore
|
||||
RUN pip install -r /requirements.txt --root-user-action=ignore
|
||||
|
||||
COPY cvttpy /cvttpy
|
||||
COPY ${FROM_DIR}/.creds /.creds
|
||||
|
||||
|
||||
COPY ${FROM_DIR}/run_executor.sh /run_executor.sh
|
||||
RUN chmod +x /run_executor.sh
|
||||
|
||||
RUN mkdir /logs
|
||||
|
||||
WORKDIR /
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
ENV PYTHONPATH=/
|
||||
ENTRYPOINT [ "/run_executor.sh" ]
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
aiohttp>=3.7.4.post0
|
||||
redis>=5.0.8
|
||||
nest-asyncio>=1.5.5
|
||||
hjson>=3.1.0
|
||||
sortedcontainers>=2.4.0
|
||||
pandas>=1.5.3
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
|
||||
# runs in container
|
||||
|
||||
|
||||
# runs on host to start container
|
||||
usage() {
|
||||
echo -n "Usage: $0"
|
||||
echo -n " [-c <config (dflt: http://cloud23.cvtt.vpn:6789/apps/cvtt_eqt_alpaca)>]"
|
||||
echo -n " [-e <active_exchanges (ALPACA_SNDBX-MDPORTAL)>]"
|
||||
echo -n " [-a <admin_port (7222)>"]
|
||||
echo -n " [-z (compress log)"]
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
Config=http://cloud23.cvtt.vpn:6789/apps/cvtt_eqt_alpaca
|
||||
ActiveExchanges=ALPACA_SNDBX
|
||||
AdminPort=7222
|
||||
COMPRESS_LOG=false
|
||||
|
||||
while getopts "c:e:a:z" opt; do
|
||||
case ${opt} in
|
||||
c ) Config=$OPTARG ;;
|
||||
e ) ActiveExchanges=$OPTARG ;;
|
||||
a ) AdminPort=$OPTARG ;;
|
||||
z ) COMPRESS_LOG=true ;;
|
||||
\? )
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
usage
|
||||
;;
|
||||
: )
|
||||
echo "Option -$OPTARG requires an argument." >&2
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
Cmd="python3.12"
|
||||
Cmd="${Cmd} /cvttpy/apps/executor_app.py"
|
||||
Cmd="${Cmd} --config=${Config}"
|
||||
Cmd="${Cmd} --credentials_file=/.creds"
|
||||
# Cmd="${Cmd} --allow_dynamic_exch_inst"
|
||||
Cmd="${Cmd} --active_exchanges=${ActiveExchanges}"
|
||||
Cmd="${Cmd} --admin_port=${AdminPort}"
|
||||
Cmd="${Cmd} --log_file=/logs/%T.EXECUTOR_APP.log"
|
||||
if ${COMPRESS_LOG}; then
|
||||
Cmd="${Cmd} --compress_log"
|
||||
fi
|
||||
echo ${Cmd}
|
||||
eval ${Cmd}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user