Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release version to master #419

Merged
merged 33 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6c3d0d3
Fix dockerignore
ZIMkaRU Sep 10, 2024
6f93c75
Fix Dockerfile.express warning
ZIMkaRU Sep 10, 2024
76dbe53
Fix Dockerfile.grenache-grape warning
ZIMkaRU Sep 10, 2024
5c9621b
Use debian instead of alpine inside Dockerfile.worker for html-pdf
ZIMkaRU Sep 10, 2024
519ca03
Improve docker-compose config
ZIMkaRU Sep 10, 2024
b8fb47b
Update README
ZIMkaRU Sep 10, 2024
a950c39
Improve deploy script
ZIMkaRU Sep 10, 2024
1c0cf75
Improve launch script
ZIMkaRU Sep 10, 2024
82f2a58
Improve setup script
ZIMkaRU Sep 10, 2024
f685a93
Update vpc module to improve default network control
ZIMkaRU Sep 11, 2024
27c2c1c
Update min aws provider version
ZIMkaRU Sep 11, 2024
913a759
Update min terraform version
ZIMkaRU Sep 11, 2024
27f60ec
Update terraform lock file considering new versions
ZIMkaRU Sep 11, 2024
5660ec7
Update ubuntu version for ec2 instance
ZIMkaRU Sep 11, 2024
e5026b4
Ignore changes for aws ssm parameter if name exists
ZIMkaRU Sep 11, 2024
c61daea
Fix deprecation warning for random_password
ZIMkaRU Sep 11, 2024
8ac4a6a
Merge pull request #415 from ZIMkaRU/feature/improve-docker-terraform…
ezewer Sep 13, 2024
60cf480
Fix infrequent case for process.send
ZIMkaRU Sep 13, 2024
2cc4032
Merge pull request #416 from ZIMkaRU/bugfix/fix-infrequent-case-for-p…
ezewer Sep 13, 2024
4243f65
Add extendable translation location
ZIMkaRU Sep 18, 2024
befa87e
Add en translation for pdf in json
ZIMkaRU Sep 18, 2024
73823fe
Add es translation for pdf in json
ZIMkaRU Sep 18, 2024
0c3854e
Add pt translation for pdf in json
ZIMkaRU Sep 18, 2024
8cbd5ea
Add ru translation for pdf in json
ZIMkaRU Sep 18, 2024
b5c159e
Add tr translation for pdf in json
ZIMkaRU Sep 18, 2024
06652d3
Add zh-cn translation for pdf in json
ZIMkaRU Sep 18, 2024
36bab73
Add zh-tw translation for pdf in json
ZIMkaRU Sep 18, 2024
c6d18ef
Inject I18next service to extended PdfWriter
ZIMkaRU Sep 20, 2024
a07923b
Remove redundant pdf translation yaml file
ZIMkaRU Sep 20, 2024
3643af6
Merge pull request #417 from ZIMkaRU/feature/add-logic-to-have-separa…
ezewer Sep 23, 2024
8b5cdcd
Update bfx-report-ui sub-module
ZIMkaRU Sep 23, 2024
dac6bd9
Bump version up to 4.21.0
ZIMkaRU Sep 23, 2024
dfe27b6
Merge pull request #418 from ZIMkaRU/feature/release-version
ezewer Sep 23, 2024
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ test
bfx-report-ui/build
*Dockerfile*
*docker-compose*
terraform
2 changes: 1 addition & 1 deletion Dockerfile.express
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:18.17.1-alpine3.18

ENV BIND_HOST "0.0.0.0"
ENV BIND_HOST="0.0.0.0"

WORKDIR /home/node/bfx-report-express

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.grenache-grape
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:18.17.1-alpine3.18

ENV BIND_HOST "0.0.0.0"
ENV BIND_HOST="0.0.0.0"

WORKDIR /home/node/grenache-grape

Expand Down
34 changes: 8 additions & 26 deletions Dockerfile.worker
Original file line number Diff line number Diff line change
@@ -1,34 +1,16 @@
FROM node:18.17.1-alpine3.18
FROM node:18.17.1-bookworm

ARG GRC_VER="0.7.1"

WORKDIR /home/node/grenache-cli

RUN apk update && apk add --no-cache --virtual \
.gyp \
python3 \
make \
jq \
help2man \
gcc \
musl-dev \
autoconf \
automake \
libtool \
pkgconfig \
file \
patch \
bison \
clang \
flex \
curl \
perl \
perl-dev \
wget \
g++ \
git \
openssh \
bash
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
jq \
xxd \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN wget -c https://github.com/bitfinexcom/grenache-cli/releases/download/${GRC_VER}/grenache-cli-${GRC_VER}.tar.xz \
&& tar -xf grenache-cli-${GRC_VER}.tar.xz \
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ To simplify setup/deploy processes the following bash scripts are provided:

The setup was tested with the following dependencies:

- Docker version 20.10.12
- docker-compose version 1.29.2
- Docker version 27.2.0
- docker-compose version 2.24.6
- git version 2.24.1

### Setup process
Expand Down Expand Up @@ -225,7 +225,7 @@ The infrastructure configuration is located in the `./terraform` directory of th

The setup was tested with the following dependencies:

- Terraform version 1.1.7
- Terraform version 1.9.5

> To use Terraform you will need to install it. [This official tutorial](https://learn.hashicorp.com/tutorials/terraform/install-cli) will be useful to install Terraform.

Expand Down
13 changes: 11 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
version: '3.9'

x-common-variables: &common-variables
API_PORT: "31339"
GRAPE_APH: "30001"
GRAPE_HOST: "grape1"
x-logging: &default-logging
options:
max-size: "10m"
max-file: "10"
driver: json-file

services:
grape1:
Expand All @@ -20,6 +23,7 @@ services:
GRAPE_BN: "20002"
GRAPE_BIND: "grape2"
NODE_ENV: ${NODE_ENV}
logging: *default-logging

grape2:
container_name: grape2
Expand All @@ -39,6 +43,7 @@ services:
GRAPE_BN: "20001"
GRAPE_BIND: "grape1"
NODE_ENV: ${NODE_ENV}
logging: *default-logging

worker:
container_name: worker
Expand Down Expand Up @@ -69,6 +74,7 @@ services:
SCHEDULER_RULE: ${SCHEDULER_RULE} # Non-required
NGINX_AUTOINDEX: ${NGINX_AUTOINDEX} # Required
NODE_ENV: ${NODE_ENV}
logging: *default-logging

express:
container_name: express
Expand All @@ -91,6 +97,7 @@ services:
environment:
<<: *common-variables
NODE_ENV: ${NODE_ENV}
logging: *default-logging

ui-builder:
build:
Expand All @@ -103,6 +110,7 @@ services:
CI_ENVIRONMENT_NAME: ${UI_ENV} # Non-required
NGINX_HOST: ${NGINX_HOST} # Required
NGINX_PORT: ${NGINX_PORT} # Non-required
logging: *default-logging

nginx:
container_name: nginx
Expand Down Expand Up @@ -133,6 +141,7 @@ services:
NGINX_PORT: ${NGINX_PORT} # Non-required
NGINX_ENV: ${NGINX_ENV} # Non-required
NGINX_AUTOINDEX: ${NGINX_AUTOINDEX} # Required
logging: *default-logging

networks:
grapes:
Expand Down
14 changes: 14 additions & 0 deletions locales/en/pdf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"template": {
"startingPositionsSnapshot": "Starting positions snapshot",
"endingPositionsSnapshot": "Ending positions snapshot",
"finalState": "Final state",
"startingPeriodBalances": "Starting period balances",
"movementsDetails": "Movements details",
"endingPeriodBalances": "Ending period balances",
"positions": "Positions",
"wallets": "Wallets",
"positionsTickers": "Positions tickers",
"walletsTickers": "Wallets tickers"
}
}
14 changes: 14 additions & 0 deletions locales/es-EM/pdf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"template": {
"startingPositionsSnapshot": "Captura de las posiciones iniciales",
"endingPositionsSnapshot": "Captura de las posiciones finales",
"finalState": "Estado final",
"startingPeriodBalances": "Balances al inicio del periodo",
"movementsDetails": "Detalles de Movimientos",
"endingPeriodBalances": "Balances al final del periodo",
"positions": "Posiciones",
"wallets": "Carteras",
"positionsTickers": "cotizaciones de las Posiciones",
"walletsTickers": "cotizaciones de las Carteras"
}
}
14 changes: 14 additions & 0 deletions locales/pt-BR/pdf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"template": {
"startingPositionsSnapshot": "Captura das posições iniciais",
"endingPositionsSnapshot": "Captura das posições finais",
"finalState": "Estado final",
"startingPeriodBalances": "Saldos no início do período",
"movementsDetails": "Detalhes das movimentações",
"endingPeriodBalances": "Saldos no final do período",
"positions": "Posições",
"wallets": "Carteiras",
"positionsTickers": "cotações das posições",
"walletsTickers": "cotações das Carteiras"
}
}
14 changes: 14 additions & 0 deletions locales/ru/pdf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"template": {
"startingPositionsSnapshot": "Снимок стартовых позиций",
"endingPositionsSnapshot": "Снимок конечных позиций",
"finalState": "Конечное состояние",
"startingPeriodBalances": "Остатки на начало периода",
"movementsDetails": "Детали движений",
"endingPeriodBalances": "Остатки на конец периода",
"positions": "Позиции",
"wallets": "Кошельки",
"positionsTickers": "Тикеры позиций",
"walletsTickers": "Тикеры кошельков"
}
}
14 changes: 14 additions & 0 deletions locales/tr/pdf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"template": {
"startingPositionsSnapshot": "Pozisyonların Başlangıç Anlık Görüntüsü",
"endingPositionsSnapshot": "Pozisyonların Bitiş Anlık Görüntüsü",
"finalState": "Son Durum",
"startingPeriodBalances": "Başlangıç ​​Dönemi Bakiyeleri",
"movementsDetails": "Hareket Detayları",
"endingPeriodBalances": "Bitiş Dönemi Bakiyeleri",
"positions": "Poziyonlar",
"wallets": "Cüzdanlar",
"positionsTickers": "Pozisyon Tickerları",
"walletsTickers": "Cüzdan Tickerları"
}
}
14 changes: 14 additions & 0 deletions locales/zh-CN/pdf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"template": {
"startingPositionsSnapshot": "仓位期初快照",
"endingPositionsSnapshot": "仓位期末快照",
"finalState": "最后状态",
"startingPeriodBalances": "期初余额",
"movementsDetails": "资金流向明细",
"endingPeriodBalances": "期末余额",
"positions": "仓位",
"wallets": "钱包",
"positionsTickers": "仓位牌价",
"walletsTickers": "钱包牌价"
}
}
14 changes: 14 additions & 0 deletions locales/zh-TW/pdf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"template": {
"startingPositionsSnapshot": "倉位期初快照",
"endingPositionsSnapshot": "倉位期末快照",
"finalState": "最終狀態",
"startingPeriodBalances": "期初餘額",
"movementsDetails": "資金流向明細",
"endingPeriodBalances": "期末餘額",
"positions": "倉位",
"wallets": "錢包",
"positionsTickers": "倉位牌價",
"walletsTickers": "錢包牌價"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bfx-reports-framework",
"version": "4.20.0",
"version": "4.21.0",
"description": "Bitfinex reports framework",
"main": "worker.js",
"license": "Apache-2.0",
Expand Down
5 changes: 4 additions & 1 deletion scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ SCRIPTPATH="$(cd -- "$(dirname "$0")" >/dev/null 2>&1; pwd -P)"
ROOT="$(dirname "$SCRIPTPATH")"
CURRDIR="$PWD"

DOCKER_COMPOSE_CMD=("docker" "compose")
"${DOCKER_COMPOSE_CMD[@]}" version 2>/dev/null || DOCKER_COMPOSE_CMD=("docker-compose")

if [ -n "${1:-}" ] && [[ "$1" =~ ^SECRET_KEY= ]]; then
export SECRET_KEY=$(echo $1| cut -d'=' -f 2)
fi
Expand All @@ -15,7 +18,7 @@ maintenanceFileFlag="$ROOT/scripts/maintenance/maintenance.on"
"$ROOT/scripts/sync-repo.sh" "-a"

cd "$ROOT"
runningServices=$(docker-compose ps --filter "status=running" --services)
runningServices=$("${DOCKER_COMPOSE_CMD[@]}" ps --filter "status=running" --services)
isNginxRunning=$(echo "$runningServices" | { grep 'nginx' || test $? = 1; } | wc -l)

touch "$maintenanceFileFlag"
Expand Down
17 changes: 12 additions & 5 deletions scripts/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ COLOR_GREEN="\033[32m"
COLOR_BLUE="\033[34m"
COLOR_NORMAL="\033[39m"

DOCKER_COMPOSE_CMD=("docker" "compose")
"${DOCKER_COMPOSE_CMD[@]}" version 2>/dev/null || DOCKER_COMPOSE_CMD=("docker-compose")
echo "0-DOCKER_COMPOSE_CMD"
declare -p DOCKER_COMPOSE_CMD

programname=$0

launchAll=0
Expand Down Expand Up @@ -83,11 +88,13 @@ composeCommonFlags="\
--force-recreate \
--remove-orphans \
--timeout 2 \
--timestamps \
--wait-timeout 180
$detachedMode \
"

if [ $launchAll == 1 ]; then
docker-compose up $composeCommonFlags \
"${DOCKER_COMPOSE_CMD[@]}" up $composeCommonFlags \

cd "$CURRDIR"
exit 0
Expand All @@ -101,7 +108,7 @@ if [ $launchGrapes == 1 ]; then
grapesServices="grape1 grape2"
fi
if [ $launchWorker == 1 ]; then
runningServices=$(docker-compose ps --filter "status=running" --services)
runningServices=$("${DOCKER_COMPOSE_CMD[@]}" ps --filter "status=running" --services)
isGrape1Running=$(echo "$runningServices" | { grep 'grape1' || test $? = 1; } | wc -l)
isGrape2Running=$(echo "$runningServices" | { grep 'grape2' || test $? = 1; } | wc -l)

Expand All @@ -123,15 +130,15 @@ if [ $launchGrapes == 1 ] \
|| [ $launchExpress == 1 ]
then
grapesServices="$(echo -e "${grapesServices}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
docker-compose up $composeCommonFlags \
"${DOCKER_COMPOSE_CMD[@]}" up $composeCommonFlags \
$grapesServices $workerService $expressService
fi
if [ $launchNginx == 1 ]; then
docker-compose up $composeCommonFlags --no-deps \
"${DOCKER_COMPOSE_CMD[@]}" up $composeCommonFlags --no-deps \
nginx
fi
if [ $buildUI == 1 ]; then
docker-compose up $composeCommonFlags --no-deps \
"${DOCKER_COMPOSE_CMD[@]}" up $composeCommonFlags --no-deps \
ui-builder
fi

Expand Down
9 changes: 6 additions & 3 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ ${COLOR_NORMAL}" >&2
fi
fi

if ! docker-compose --version; then
DOCKER_COMPOSE_CMD=("docker" "compose")
"${DOCKER_COMPOSE_CMD[@]}" version 2>/dev/null || DOCKER_COMPOSE_CMD=("docker-compose")

if ! "${DOCKER_COMPOSE_CMD[@]}" version; then
echo -e "\
\n${COLOR_RED}Docker-compose has not been found\
${COLOR_NORMAL}" >&2
Expand All @@ -184,11 +187,11 @@ ${COLOR_NORMAL}" >&2
# Install Compose on Linux systems
# https://docs.docker.com/compose/install/#install-compose-on-linux-systems

curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
curl -SL https://github.com/docker/compose/releases/download/v2.29.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose 2>/dev/null

docker-compose --version
docker-compose version
fi
fi

Expand Down
Loading