progress
This commit is contained in:
parent
03f14248e9
commit
d915a0dfd4
11
build.sh
11
build.sh
@ -1,11 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
function usage {
|
function usage {
|
||||||
echo "Usage: ${0} <app_path (e.g. market_data/md_recorder_monitor)>"
|
echo "Usage: ${0} <app_path (e.g. market_data/md_recorder_monitor)> <version>"
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
AppPath=${1}
|
AppPath=${1}
|
||||||
|
CvttpyVersion=${2}
|
||||||
|
|
||||||
if [ "${AppPath}" == "" ]
|
if [ "${AppPath}" == "" ]
|
||||||
then
|
then
|
||||||
@ -27,7 +28,7 @@ Version=$(cat ${RootDir}/cvttpy/release_version.txt | awk -F, '{print $1}')
|
|||||||
|
|
||||||
cd ${RootDir}
|
cd ${RootDir}
|
||||||
|
|
||||||
Cmd="docker build -t ${ImageName} -t ${ImageName}:${Version} -f ${DockerDir}/Dockerfile ."
|
Cmd="docker build -t ${ImageName} -t ${ImageName}:latest -t ${ImageName}:${Version} -f ${DockerDir}/Dockerfile ."
|
||||||
echo ${Cmd}
|
echo ${Cmd}
|
||||||
eval ${Cmd}
|
eval ${Cmd}
|
||||||
|
|
||||||
@ -35,7 +36,13 @@ Cmd="docker tag ${ImageName}:latest ${RegistryService}/${ImageName}:latest"
|
|||||||
echo ${Cmd}
|
echo ${Cmd}
|
||||||
eval ${Cmd}
|
eval ${Cmd}
|
||||||
|
|
||||||
|
Cmd="docker tag ${ImageName}:${Version} ${RegistryService}/${ImageName}:${Version}"
|
||||||
|
echo ${Cmd}
|
||||||
|
eval ${Cmd}
|
||||||
|
|
||||||
Cmd="docker push ${RegistryService}/${ImageName}:latest"
|
Cmd="docker push ${RegistryService}/${ImageName}:latest"
|
||||||
echo ${Cmd}
|
echo ${Cmd}
|
||||||
eval ${Cmd}
|
eval ${Cmd}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
67
buildx.sh
Executable file
67
buildx.sh
Executable file
@ -0,0 +1,67 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function usage {
|
||||||
|
echo "Usage: ${0} <app_path (e.g. market_data/md_recorder_monitor)> <version>"
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
AppPath=${1}
|
||||||
|
CvttpyVersion=${2}
|
||||||
|
|
||||||
|
if [ "${AppPath}" == "" ]
|
||||||
|
then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
# --- Settings
|
||||||
|
DockerDir=$(realpath $(dirname ${0})/${AppPath})
|
||||||
|
RootDir=$(realpath $(dirname ${0})/..)
|
||||||
|
RegistryService=cloud21.cvtt.vpn:5500
|
||||||
|
|
||||||
|
AppName=$(basename ${AppPath})
|
||||||
|
|
||||||
|
ImageName=${AppName}
|
||||||
|
ImageDir=${HOME}/docker_images
|
||||||
|
mkdir -p ${ImageDir}
|
||||||
|
|
||||||
|
Version=$(cat ${RootDir}/cvttpy/release_version.txt | awk -F, '{print $1}')
|
||||||
|
|
||||||
|
cd ${RootDir}
|
||||||
|
|
||||||
|
# Create and use a new builder instance
|
||||||
|
Cmd="docker buildx create --use --name ${AppName}_builder"
|
||||||
|
echo ${Cmd}
|
||||||
|
eval ${Cmd}
|
||||||
|
|
||||||
|
# Ensure buildx is bootstrapped
|
||||||
|
Cmd="docker buildx inspect ${AppName}_builder --bootstrap"
|
||||||
|
echo ${Cmd}
|
||||||
|
eval ${Cmd}
|
||||||
|
|
||||||
|
# Build the image using buildx, tagging with both 'latest' and the version number
|
||||||
|
Cmd="docker buildx build --platform linux/amd64,linux/arm64 -t ${ImageName}:latest -t ${ImageName}:${Version} -f ${DockerDir}/Dockerfile . --push"
|
||||||
|
echo ${Cmd}
|
||||||
|
eval ${Cmd}
|
||||||
|
|
||||||
|
# Tagging the images with the registry
|
||||||
|
Cmd="docker tag ${ImageName}:latest ${RegistryService}/${ImageName}:latest"
|
||||||
|
echo ${Cmd}
|
||||||
|
eval ${Cmd}
|
||||||
|
|
||||||
|
Cmd="docker tag ${ImageName}:${Version} ${RegistryService}/${ImageName}:${Version}"
|
||||||
|
echo ${Cmd}
|
||||||
|
eval ${Cmd}
|
||||||
|
|
||||||
|
# Push the images to the registry
|
||||||
|
Cmd="docker push ${RegistryService}/${ImageName}:latest"
|
||||||
|
echo ${Cmd}
|
||||||
|
eval ${Cmd}
|
||||||
|
|
||||||
|
Cmd="docker push ${RegistryService}/${ImageName}:${Version}"
|
||||||
|
echo ${Cmd}
|
||||||
|
eval ${Cmd}
|
||||||
|
|
||||||
|
# Optionally, remove the builder to clean up
|
||||||
|
Cmd="docker buildx rm ${AppName}_builder"
|
||||||
|
echo ${Cmd}
|
||||||
|
eval ${Cmd}
|
||||||
@ -3,12 +3,15 @@ FROM python:3.10-slim
|
|||||||
ARG FROM_DIR=docker_dev/market_data/alpaca_md_day
|
ARG FROM_DIR=docker_dev/market_data/alpaca_md_day
|
||||||
|
|
||||||
# Update the package list and install required packages
|
# Update the package list and install required packages
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y \
|
||||||
apt-utils \
|
apt-utils \
|
||||||
|
libpq-dev \
|
||||||
|
build-essential
|
||||||
|
RUN apt-get update && apt-get install -y rsync openssh-client
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
software-properties-common \
|
software-properties-common \
|
||||||
curl \
|
curl \
|
||||||
rsync \
|
|
||||||
openssh-client \
|
|
||||||
parallel \
|
parallel \
|
||||||
jq
|
jq
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
aiohttp>=3.7.4.post0
|
aiohttp>=3.7.4.post0
|
||||||
nest-asyncio>=1.5.5
|
nest-asyncio>=1.5.5
|
||||||
asyncpg>=0.27.0
|
psycopg>=3.2.1
|
||||||
hjson>=3.1.0
|
hjson>=3.1.0
|
||||||
pandas>=1.5.3
|
pandas>=1.5.3
|
||||||
sortedcontainers>=2.4.0
|
sortedcontainers>=2.4.0
|
||||||
|
|||||||
@ -3,14 +3,19 @@ FROM python:3.10-slim
|
|||||||
ARG FROM_DIR=docker_dev/market_data/crypto_md_day
|
ARG FROM_DIR=docker_dev/market_data/crypto_md_day
|
||||||
|
|
||||||
COPY ${FROM_DIR}/requirements.txt /
|
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 cvttpy /cvttpy
|
||||||
COPY ${FROM_DIR}/.creds /.creds
|
COPY ${FROM_DIR}/.creds /.creds
|
||||||
COPY ${FROM_DIR}/crypto_md_day.sh /crypto_md_day.sh
|
COPY ${FROM_DIR}/crypto_md_day.sh /crypto_md_day.sh
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends rsync openssh-client && rm -rf /var/lib/apt/lists/*
|
RUN pip install --upgrade pip --root-user-action=ignore
|
||||||
|
RUN pip install -r /requirements.txt --root-user-action=ignore
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
libpq-dev \
|
||||||
|
build-essential
|
||||||
|
RUN apt-get update && apt-get install -y rsync openssh-client
|
||||||
|
|
||||||
COPY docker_dev/shared/id_rsa /root/.ssh/id_rsa
|
COPY docker_dev/shared/id_rsa /root/.ssh/id_rsa
|
||||||
COPY docker_dev/shared/id_rsa.pub /root/.ssh/id_rsa.pub
|
COPY docker_dev/shared/id_rsa.pub /root/.ssh/id_rsa.pub
|
||||||
|
|||||||
@ -8,7 +8,8 @@ usage() {
|
|||||||
|
|
||||||
DbHost=""
|
DbHost=""
|
||||||
Date=""
|
Date=""
|
||||||
Schemas=coinbase,bnbspot,bnbfut
|
# Schemas=coinbase,bnbspot,bnbfut
|
||||||
|
Schemas=coinbase,bnbspot
|
||||||
|
|
||||||
while getopts ":h:d:s:" opt; do
|
while getopts ":h:d:s:" opt; do
|
||||||
case ${opt} in
|
case ${opt} in
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
aiohttp>=3.7.4.post0
|
aiohttp>=3.7.4.post0
|
||||||
nest-asyncio>=1.5.5
|
nest-asyncio>=1.5.5
|
||||||
asyncpg>=0.27.0
|
psycopg>=3.2.1
|
||||||
hjson>=3.1.0
|
hjson>=3.1.0
|
||||||
pandas>=1.5.3
|
pandas>=1.5.3
|
||||||
sortedcontainers>=2.4.0
|
sortedcontainers>=2.4.0
|
||||||
@ -2,6 +2,10 @@ FROM python:3.10-slim
|
|||||||
|
|
||||||
ARG FROM_DIR=docker_dev/market_data/md_recorder
|
ARG FROM_DIR=docker_dev/market_data/md_recorder
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
apt-utils \
|
||||||
|
libpq-dev \
|
||||||
|
build-essential
|
||||||
|
|
||||||
COPY ${FROM_DIR}/requirements.txt /
|
COPY ${FROM_DIR}/requirements.txt /
|
||||||
RUN pip install --upgrade pip --root-user-action=ignore
|
RUN pip install --upgrade pip --root-user-action=ignore
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
aiohttp>=3.7.4.post0
|
aiohttp>=3.7.4.post0
|
||||||
nest-asyncio>=1.5.5
|
nest-asyncio>=1.5.5
|
||||||
asyncpg>=0.27.0
|
psycopg>=3.2.1
|
||||||
hjson>=3.1.0
|
hjson>=3.1.0
|
||||||
pandas>=1.5.3
|
pandas>=1.5.3
|
||||||
sortedcontainers>=2.4.0
|
sortedcontainers>=2.4.0
|
||||||
|
|||||||
@ -2,6 +2,11 @@ FROM python:3.10-slim
|
|||||||
|
|
||||||
ARG FROM_DIR=docker_dev/market_data/md_recorder_monitor
|
ARG FROM_DIR=docker_dev/market_data/md_recorder_monitor
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
apt-utils \
|
||||||
|
libpq-dev \
|
||||||
|
build-essential
|
||||||
|
|
||||||
|
|
||||||
COPY ${FROM_DIR}/requirements.txt /
|
COPY ${FROM_DIR}/requirements.txt /
|
||||||
RUN pip install --upgrade pip --root-user-action=ignore
|
RUN pip install --upgrade pip --root-user-action=ignore
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
aiohttp>=3.7.4.post0
|
aiohttp>=3.7.4.post0
|
||||||
nest-asyncio>=1.5.5
|
nest-asyncio>=1.5.5
|
||||||
asyncpg>=0.27.0
|
psycopg>=3.2.1
|
||||||
hjson>=3.1.0
|
hjson>=3.1.0
|
||||||
pandas>=1.5.3
|
pandas>=1.5.3
|
||||||
sortedcontainers>=2.4.0
|
sortedcontainers>=2.4.0
|
||||||
|
|||||||
@ -6,6 +6,11 @@ COPY docker_dev/quant/requirements.txt /
|
|||||||
RUN pip install --upgrade pip
|
RUN pip install --upgrade pip
|
||||||
RUN pip install -r /requirements.txt
|
RUN pip install -r /requirements.txt
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
apt-utils \
|
||||||
|
libpq-dev \
|
||||||
|
build-essential
|
||||||
|
|
||||||
|
|
||||||
COPY cvttpy /cvttpy
|
COPY cvttpy /cvttpy
|
||||||
COPY docker_dev/quant/.creds /.creds
|
COPY docker_dev/quant/.creds /.creds
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
aiohttp>=3.7.4.post0
|
aiohttp>=3.7.4.post0
|
||||||
aioredis>=2.0.1
|
|
||||||
nest-asyncio>=1.5.5
|
nest-asyncio>=1.5.5
|
||||||
hjson>=3.1.0
|
hjson>=3.1.0
|
||||||
sortedcontainers>=2.4.0
|
sortedcontainers>=2.4.0
|
||||||
@ -7,4 +6,6 @@ pandas>=1.5.3
|
|||||||
#
|
#
|
||||||
ta>=0.10.2
|
ta>=0.10.2
|
||||||
tables>=3.9.1
|
tables>=3.9.1
|
||||||
asyncpg>=0.27.0
|
psycopg>=3.2.1
|
||||||
|
#
|
||||||
|
aioredis>=2.0.1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user