From 600fd5f5b0864eae019e9c2ba78fc5ea5def2ac6 Mon Sep 17 00:00:00 2001 From: Bernd Date: Fri, 27 Feb 2026 09:57:09 +0100 Subject: [PATCH] feat: add RangeKeeper container infrastructure - Add Bicep parameter files for RangeKeeper (dev + prd) - Change containerCPU type from int to string to support decimal values - Add RangeKeeper to deploy.sh instance options - Update README with RangeKeeper documentation --- .../bicep/container-groups/README.md | 6 +- .../bicep/container-groups/deploy.sh | 3 +- .../bicep/container-groups/main.bicep | 4 +- .../modules/containerGroup.bicep | 4 +- .../parameters/dev-hb-deps-usdt.json | 76 +++++++++---------- .../parameters/dev-hb-deuro-usdt.json | 76 +++++++++---------- .../container-groups/parameters/dev-rk.json | 38 ++++++++++ .../parameters/prd-hb-deps-usdt.json | 76 +++++++++---------- .../parameters/prd-hb-deuro-usdt.json | 76 +++++++++---------- .../container-groups/parameters/prd-rk.json | 38 ++++++++++ 10 files changed, 239 insertions(+), 158 deletions(-) mode change 100644 => 100755 infrastructure/bicep/container-groups/deploy.sh create mode 100644 infrastructure/bicep/container-groups/parameters/dev-rk.json create mode 100644 infrastructure/bicep/container-groups/parameters/prd-rk.json diff --git a/infrastructure/bicep/container-groups/README.md b/infrastructure/bicep/container-groups/README.md index f5657828d7..11c498676c 100644 --- a/infrastructure/bicep/container-groups/README.md +++ b/infrastructure/bicep/container-groups/README.md @@ -12,10 +12,14 @@ Container Instances are: - hb-deuro-usdt: Hummingbot (dEURO/USDT) - hb-deps-usdt: Hummingbot (dEPS/USDT) +- rk: RangeKeeper Liquidity Bot ### Fileshare -Each Container Instance uses its own fileshare, which is mounted to `/mnt/hummingbot`. +Each Container Instance uses its own fileshare: + +- Hummingbot instances: mounted to `/mnt/hummingbot` +- RangeKeeper: mounted to `/app/data` (contains `.env` with sensitive config and `state.json` for persistence) ### Entrypoint diff --git a/infrastructure/bicep/container-groups/deploy.sh b/infrastructure/bicep/container-groups/deploy.sh old mode 100644 new mode 100755 index aa7f0b45be..e811415cca --- a/infrastructure/bicep/container-groups/deploy.sh +++ b/infrastructure/bicep/container-groups/deploy.sh @@ -10,7 +10,8 @@ environmentOptions=("loc" "dev" "prd") # "hb-deuro-usdt": Hummingbot (dEURO/USDT) # "hb-deps-usdt": Hummingbot (dEPS/USDT) -instanceNameOptions=("hb-deuro-usdt" "hb-deps-usdt") +# "rk": RangeKeeper Liquidity Bot +instanceNameOptions=("hb-deuro-usdt" "hb-deps-usdt" "rk") # --- ARGUMENTS --- # DOCKER_USERNAME= diff --git a/infrastructure/bicep/container-groups/main.bicep b/infrastructure/bicep/container-groups/main.bicep index 28630d812f..19fd86b3ed 100644 --- a/infrastructure/bicep/container-groups/main.bicep +++ b/infrastructure/bicep/container-groups/main.bicep @@ -20,8 +20,8 @@ param containerEnv array @description('Command of the container') param containerCommand array -@description('Container CPU resource') -param containerCPU int +@description('Container CPU resource (supports decimal, e.g. 0.5)') +param containerCPU string @description('Container memory resource') param containerMemory int diff --git a/infrastructure/bicep/container-groups/modules/containerGroup.bicep b/infrastructure/bicep/container-groups/modules/containerGroup.bicep index 6f24316d2a..3e89e17202 100644 --- a/infrastructure/bicep/container-groups/modules/containerGroup.bicep +++ b/infrastructure/bicep/container-groups/modules/containerGroup.bicep @@ -21,7 +21,7 @@ param containerEnv array param containerCommand array @description('Container CPU resource') -param containerCPU int +param containerCPU string @description('Container memory resource') param containerMemory int @@ -66,7 +66,7 @@ resource containerGroup 'Microsoft.ContainerInstance/containerGroups@2023-05-01' image: containerImage resources: { requests: { - cpu: containerCPU + cpu: json(containerCPU) memoryInGB: containerMemory } } diff --git a/infrastructure/bicep/container-groups/parameters/dev-hb-deps-usdt.json b/infrastructure/bicep/container-groups/parameters/dev-hb-deps-usdt.json index df1dd08608..8a6d68cc45 100644 --- a/infrastructure/bicep/container-groups/parameters/dev-hb-deps-usdt.json +++ b/infrastructure/bicep/container-groups/parameters/dev-hb-deps-usdt.json @@ -1,42 +1,42 @@ { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "fileShareQuota": { - "value": 100 - }, - "containerImage": { - "value": "dfxswiss/hummingbot:beta" - }, - "containerVolumeMounts": { - "value": [ - { - "name": "volume", - "mountPath": "/mnt/hummingbot", - "readOnly": false - } - ] - }, - "containerCPU": { - "value": 0.5 - }, - "containerMemory": { - "value": 1 - }, - "containerEnv": { - "value": [ - { - "name": "BOT_DIR", - "value": "deps-usdt-dev" - }, - { - "name": "STRATEGY_FILE", - "value": "deps-usdt-conf_pure_mm.yml" - } - ] + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "fileShareQuota": { + "value": 100 + }, + "containerImage": { + "value": "dfxswiss/hummingbot:beta" + }, + "containerVolumeMounts": { + "value": [ + { + "name": "volume", + "mountPath": "/mnt/hummingbot", + "readOnly": false + } + ] + }, + "containerCPU": { + "value": "0.5" + }, + "containerMemory": { + "value": 1 + }, + "containerEnv": { + "value": [ + { + "name": "BOT_DIR", + "value": "deps-usdt-dev" }, - "containerCommand": { - "value": [] + { + "name": "STRATEGY_FILE", + "value": "deps-usdt-conf_pure_mm.yml" } + ] + }, + "containerCommand": { + "value": [] } -} \ No newline at end of file + } +} diff --git a/infrastructure/bicep/container-groups/parameters/dev-hb-deuro-usdt.json b/infrastructure/bicep/container-groups/parameters/dev-hb-deuro-usdt.json index 76abcf5d9b..7263618b64 100644 --- a/infrastructure/bicep/container-groups/parameters/dev-hb-deuro-usdt.json +++ b/infrastructure/bicep/container-groups/parameters/dev-hb-deuro-usdt.json @@ -1,42 +1,42 @@ { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "fileShareQuota": { - "value": 100 - }, - "containerImage": { - "value": "dfxswiss/hummingbot:beta" - }, - "containerVolumeMounts": { - "value": [ - { - "name": "volume", - "mountPath": "/mnt/hummingbot", - "readOnly": false - } - ] - }, - "containerCPU": { - "value": 0.5 - }, - "containerMemory": { - "value": 1 - }, - "containerEnv": { - "value": [ - { - "name": "BOT_DIR", - "value": "deuro-usdt-dev" - }, - { - "name": "STRATEGY_FILE", - "value": "deuro-usdt-conf_pure_mm.yml" - } - ] + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "fileShareQuota": { + "value": 100 + }, + "containerImage": { + "value": "dfxswiss/hummingbot:beta" + }, + "containerVolumeMounts": { + "value": [ + { + "name": "volume", + "mountPath": "/mnt/hummingbot", + "readOnly": false + } + ] + }, + "containerCPU": { + "value": "0.5" + }, + "containerMemory": { + "value": 1 + }, + "containerEnv": { + "value": [ + { + "name": "BOT_DIR", + "value": "deuro-usdt-dev" }, - "containerCommand": { - "value": [] + { + "name": "STRATEGY_FILE", + "value": "deuro-usdt-conf_pure_mm.yml" } + ] + }, + "containerCommand": { + "value": [] } -} \ No newline at end of file + } +} diff --git a/infrastructure/bicep/container-groups/parameters/dev-rk.json b/infrastructure/bicep/container-groups/parameters/dev-rk.json new file mode 100644 index 0000000000..09f63e62b4 --- /dev/null +++ b/infrastructure/bicep/container-groups/parameters/dev-rk.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "fileShareQuota": { + "value": 100 + }, + "containerImage": { + "value": "dfxswiss/rangekeeper:beta" + }, + "containerVolumeMounts": { + "value": [ + { + "name": "volume", + "mountPath": "/app/data", + "readOnly": false + } + ] + }, + "containerCPU": { + "value": "0.5" + }, + "containerMemory": { + "value": 1 + }, + "containerEnv": { + "value": [ + { + "name": "DEPLOY_INFO", + "value": "" + } + ] + }, + "containerCommand": { + "value": [] + } + } +} diff --git a/infrastructure/bicep/container-groups/parameters/prd-hb-deps-usdt.json b/infrastructure/bicep/container-groups/parameters/prd-hb-deps-usdt.json index 03ddc278ee..ffc29221c6 100644 --- a/infrastructure/bicep/container-groups/parameters/prd-hb-deps-usdt.json +++ b/infrastructure/bicep/container-groups/parameters/prd-hb-deps-usdt.json @@ -1,42 +1,42 @@ { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "fileShareQuota": { - "value": 100 - }, - "containerImage": { - "value": "dfxswiss/hummingbot:latest" - }, - "containerVolumeMounts": { - "value": [ - { - "name": "volume", - "mountPath": "/mnt/hummingbot", - "readOnly": false - } - ] - }, - "containerCPU": { - "value": 0.5 - }, - "containerMemory": { - "value": 1 - }, - "containerEnv": { - "value": [ - { - "name": "BOT_DIR", - "value": "deps-usdt" - }, - { - "name": "STRATEGY_FILE", - "value": "deps-usdt-conf_pure_mm.yml" - } - ] + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "fileShareQuota": { + "value": 100 + }, + "containerImage": { + "value": "dfxswiss/hummingbot:latest" + }, + "containerVolumeMounts": { + "value": [ + { + "name": "volume", + "mountPath": "/mnt/hummingbot", + "readOnly": false + } + ] + }, + "containerCPU": { + "value": "0.5" + }, + "containerMemory": { + "value": 1 + }, + "containerEnv": { + "value": [ + { + "name": "BOT_DIR", + "value": "deps-usdt" }, - "containerCommand": { - "value": [] + { + "name": "STRATEGY_FILE", + "value": "deps-usdt-conf_pure_mm.yml" } + ] + }, + "containerCommand": { + "value": [] } -} \ No newline at end of file + } +} diff --git a/infrastructure/bicep/container-groups/parameters/prd-hb-deuro-usdt.json b/infrastructure/bicep/container-groups/parameters/prd-hb-deuro-usdt.json index 21bf293349..96f27427ad 100644 --- a/infrastructure/bicep/container-groups/parameters/prd-hb-deuro-usdt.json +++ b/infrastructure/bicep/container-groups/parameters/prd-hb-deuro-usdt.json @@ -1,42 +1,42 @@ { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "fileShareQuota": { - "value": 100 - }, - "containerImage": { - "value": "dfxswiss/hummingbot:latest" - }, - "containerVolumeMounts": { - "value": [ - { - "name": "volume", - "mountPath": "/mnt/hummingbot", - "readOnly": false - } - ] - }, - "containerCPU": { - "value": 0.5 - }, - "containerMemory": { - "value": 1 - }, - "containerEnv": { - "value": [ - { - "name": "BOT_DIR", - "value": "deuro-usdt" - }, - { - "name": "STRATEGY_FILE", - "value": "deuro-usdt-conf_pure_mm.yml" - } - ] + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "fileShareQuota": { + "value": 100 + }, + "containerImage": { + "value": "dfxswiss/hummingbot:latest" + }, + "containerVolumeMounts": { + "value": [ + { + "name": "volume", + "mountPath": "/mnt/hummingbot", + "readOnly": false + } + ] + }, + "containerCPU": { + "value": "0.5" + }, + "containerMemory": { + "value": 1 + }, + "containerEnv": { + "value": [ + { + "name": "BOT_DIR", + "value": "deuro-usdt" }, - "containerCommand": { - "value": [] + { + "name": "STRATEGY_FILE", + "value": "deuro-usdt-conf_pure_mm.yml" } + ] + }, + "containerCommand": { + "value": [] } -} \ No newline at end of file + } +} diff --git a/infrastructure/bicep/container-groups/parameters/prd-rk.json b/infrastructure/bicep/container-groups/parameters/prd-rk.json new file mode 100644 index 0000000000..3caca31ba1 --- /dev/null +++ b/infrastructure/bicep/container-groups/parameters/prd-rk.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "fileShareQuota": { + "value": 100 + }, + "containerImage": { + "value": "dfxswiss/rangekeeper:latest" + }, + "containerVolumeMounts": { + "value": [ + { + "name": "volume", + "mountPath": "/app/data", + "readOnly": false + } + ] + }, + "containerCPU": { + "value": "0.5" + }, + "containerMemory": { + "value": 1 + }, + "containerEnv": { + "value": [ + { + "name": "DEPLOY_INFO", + "value": "" + } + ] + }, + "containerCommand": { + "value": [] + } + } +}