Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
591 commits
Select commit Hold shift + click to select a range
d0e5bef
Merge pull request #77 from hummingbot/fix/pandas-issue
david-hummingbot Sep 12, 2025
68367ab
update environment.yml
david-hummingbot Sep 16, 2025
ba64227
(feat) adapt connector initialization
cardosofede Sep 16, 2025
bcda91c
Merge pull request #79 from hummingbot/fix-pandas
cardosofede Sep 16, 2025
8dd6625
(feat) replate reference to non trading connectors
cardosofede Sep 16, 2025
758eba6
fix environment issue
david-hummingbot Sep 17, 2025
54c0c6b
Merge branch 'main' into feat/adapt_hummingbot_api_to_library
david-hummingbot Sep 17, 2025
f1c4d5e
Merge pull request #82 from hummingbot/feat/adapt_hummingbot_api_to_l…
david-hummingbot Sep 17, 2025
a47a3d1
(feat) remove refs to certs
cardosofede Sep 23, 2025
b4a5ff6
(feat) add controller docs
cardosofede Sep 23, 2025
5fcc741
Merge pull request #84 from hummingbot/feat/certs_path
rapcmia Sep 23, 2025
abf770e
feat / add multi_grid_strike controller
rapcmia Oct 3, 2025
8758343
Merge pull request #85 from hummingbot/add-multi_grid_strike
cardosofede Oct 3, 2025
b3ca232
(feat) add controller docs
cardosofede Oct 7, 2025
da80e55
(feat) ignore gateway files
cardosofede Oct 7, 2025
5ca7d25
(feat) add passphrase for gateway in env
cardosofede Oct 7, 2025
15bd8e1
(feat) add gatewya models
cardosofede Oct 7, 2025
13bd8e5
(feat) add gateway service
cardosofede Oct 7, 2025
fad0995
(feat) add deps and include router
cardosofede Oct 7, 2025
81e3d8b
matching PR for #7796
david-hummingbot Oct 8, 2025
8990839
(feat) add gateway func
cardosofede Oct 8, 2025
c74f0e1
(feat) add gateway router
cardosofede Oct 8, 2025
e9e00a7
(feat) add gateway models
cardosofede Oct 8, 2025
5482674
(feat) adapt routers to include gateway
cardosofede Oct 8, 2025
c44d415
(feat) add gateway models and client
cardosofede Oct 8, 2025
5eb9eb1
(feat) remove not necessary endpoint
cardosofede Oct 9, 2025
1955798
(feat) improve models
cardosofede Oct 10, 2025
9907eb8
(feat) improve gateway service
cardosofede Oct 10, 2025
ff5d5f8
(feat) merge network chain
cardosofede Oct 10, 2025
3f00099
(feat) unify on network chain
cardosofede Oct 10, 2025
7b4fe36
(feat) add gateway trading
cardosofede Oct 10, 2025
f316c94
(feat) remove dex trading
cardosofede Oct 13, 2025
b5f63ad
(feat) add gateway trading
cardosofede Oct 13, 2025
00e0237
(feat) add gateway trading models
cardosofede Oct 15, 2025
e5b04d8
(feat) add unique instance ts
cardosofede Oct 15, 2025
832e7b1
Modify environment.yml to update dependencies
david-hummingbot Oct 16, 2025
57cc733
(feat) adapting models
cardosofede Oct 16, 2025
140c53b
(feat) improve gateway config and trading
cardosofede Oct 16, 2025
c5be1c2
(feat) last gateway improvements
cardosofede Oct 17, 2025
f80ff91
(feat) improve db failures
cardosofede Oct 20, 2025
49f5c84
(feat) update contorllers
cardosofede Oct 20, 2025
b213ae0
(feat) add gateway repositories
cardosofede Oct 21, 2025
ef9ba81
(feat) include in the init
cardosofede Oct 21, 2025
36bfe36
(feat) add db cache in gateway trading
cardosofede Oct 21, 2025
736656f
(feat) add gateway tx poller to accounts service
cardosofede Oct 21, 2025
7676c29
(feat) add restart endpoint
cardosofede Oct 21, 2025
c3528a0
(feat) add gateway tx poller
cardosofede Oct 21, 2025
a43b3e5
(feat) git push
cardosofede Oct 21, 2025
92c5ac5
(feat) improve balance query
cardosofede Oct 23, 2025
19f0be5
(feat) add better error handling
cardosofede Oct 23, 2025
4dc7280
(feat) fix tx polling
cardosofede Oct 23, 2025
78dcd46
(feat) re-order routes
cardosofede Oct 24, 2025
f1ea46f
Merge pull request #86 from hummingbot/feat/TA-Lib-implementation
rapcmia Oct 27, 2025
aebe12a
(feat) abstract swap in a different router
cardosofede Oct 27, 2025
4623875
(feat) add clmm router
cardosofede Oct 27, 2025
00ac6c7
(feat) add utils to gateway client
cardosofede Oct 27, 2025
1910be6
(feat) expose clmm and swap routers
cardosofede Oct 27, 2025
f12cafb
(feat) add status parsing
cardosofede Oct 28, 2025
f6a934c
(feat) add position rent
cardosofede Oct 28, 2025
4c1d59a
(feat) improve db models
cardosofede Oct 28, 2025
6b247cf
(feat) add position poll interval
cardosofede Oct 28, 2025
2c04afd
(feat) fix endpoint
cardosofede Oct 28, 2025
d49eb24
(feat) add gateway config settings
cardosofede Oct 28, 2025
e0291a2
(feat) pass gateway config
cardosofede Oct 28, 2025
fc02bc1
(feat) add to the env for local deploy
cardosofede Oct 28, 2025
369997c
(feat) override gateway url when deploying in docker
cardosofede Oct 28, 2025
a85f98d
(feat) improve response snake case
cardosofede Oct 29, 2025
4bd4d04
(feat) add exceprtion
cardosofede Oct 29, 2025
d13c34a
(feat) improve logic for docker deployment
cardosofede Oct 29, 2025
dac5b15
(feat) make host docker internal
cardosofede Oct 29, 2025
7de39e6
(feat) add handling for gateway not able to execute
cardosofede Oct 29, 2025
9dbcdf7
(feat) max limits bins optional
cardosofede Oct 29, 2025
f249adb
(feat) add info of general clmm pools
cardosofede Oct 29, 2025
6d9eb65
(feat) add query func
cardosofede Oct 29, 2025
73f0b68
(feat) remove import
cardosofede Oct 29, 2025
2f96762
(feat) exclude add and remove liquidity features
cardosofede Oct 29, 2025
5f1827f
(feat) move pct to positions
cardosofede Oct 29, 2025
31bac96
(feat) calculate percentage
cardosofede Oct 29, 2025
6a0b9dc
(feat) add management of failing position
cardosofede Oct 31, 2025
c2919d0
(feat) improve pools reponse
cardosofede Oct 31, 2025
019100d
(feat) add fee collection when closing positions
cardosofede Oct 31, 2025
ff69886
(feat) reduce poll interval
cardosofede Oct 31, 2025
9d3e48f
(feat) add support for linux
cardosofede Oct 31, 2025
438f4c3
Merge pull request #89 from hummingbot/feat/gateway_integration
cardosofede Nov 3, 2025
f1c8cd2
Make Hummingbot API the main entry point with optional MCP and Dashboard
fengtality Nov 4, 2025
53c3925
Add Gateway setup instructions to README
fengtality Nov 4, 2025
3371fb0
Fix: Correct sed commands to properly uncomment services on Linux
fengtality Nov 4, 2025
ad27291
Fix critical Dashboard bug and add comprehensive AI assistant integra…
fengtality Nov 4, 2025
8bc3c6d
Remove credentials from MCP and use standalone Docker volumes
fengtality Nov 4, 2025
21638ff
Simplify MCP setup using docker exec instead of standalone containers
fengtality Nov 4, 2025
aa46d7b
Fix MCP setup: Add commented service with proper configuration
fengtality Nov 4, 2025
ac48142
MAJOR FIX: Switch to docker run approach for MCP (much simpler!)
fengtality Nov 4, 2025
783930a
Fix volume mount: Use hummingbot_mcp volume instead of docker.sock
fengtality Nov 4, 2025
bf72260
Update setup.sh to feature Claude Code instead of Claude Desktop
fengtality Nov 4, 2025
33ad6b2
Docs: Add Gateway management workflows to AI assistant integration gu…
fengtality Nov 4, 2025
2bb376d
Fix: Update Claude Code setup to use docker run instead of docker exec
fengtality Nov 4, 2025
8a3679c
Fix PostgreSQL initialization to use hbot user consistently
fengtality Nov 4, 2025
b37934e
Docs: Add MCP connection troubleshooting and best practices
fengtality Nov 4, 2025
dc2ebf3
Fix: Database initialization error during setup
fengtality Nov 4, 2025
21e8d1c
Docs: Complete rewrite of API_REFERENCE.md for AI assistants
fengtality Nov 4, 2025
eb0c457
Docs: Replace chain endpoints with comprehensive Gateway docs
fengtality Nov 4, 2025
cb1e98e
Docs: Update README with MCP setup_connector workflow and Gateway tro…
fengtality Nov 4, 2025
ed2c7e1
Merge pull request #92 from hummingbot/feat/optional-mcp-dashboard-setup
fengtality Nov 5, 2025
63897d3
(feat) remove specific agents md not related to repo
cardosofede Nov 19, 2025
e73a81d
(feat) add interval resample to portfolio history route
cardosofede Nov 20, 2025
5f7e415
(feat) remove dashboard from compose
cardosofede Nov 20, 2025
a1a611f
(feat) fix order status
cardosofede Nov 21, 2025
3115395
(feat) improve gateway price query
cardosofede Nov 25, 2025
59627df
(feat) initialize singleton with gateway config
cardosofede Nov 25, 2025
62ec057
(feat) improve async tasks
cardosofede Nov 26, 2025
6c09578
(feat) fix order id
cardosofede Nov 26, 2025
fb42d47
(feat) fix fee collection
cardosofede Nov 26, 2025
20732b7
(feat) add delete pool
cardosofede Nov 27, 2025
ccca2c5
(feat) remove stale gateway balances
cardosofede Nov 28, 2025
623598d
(feat) fix gateway response management
cardosofede Nov 28, 2025
e22c355
(feat) update adding pool request
cardosofede Nov 28, 2025
82b2ae0
(feat) fix raydium pools
cardosofede Nov 30, 2025
e90a9dc
(feat) add optional params
cardosofede Dec 1, 2025
60a8329
(feat) fix orphan keys connected
cardosofede Dec 4, 2025
3a70ebf
(feat) add skip gateway for state
cardosofede Dec 4, 2025
1ccc183
(feat) improve position model and register
cardosofede Dec 4, 2025
f7ad477
(feat) fix gateway tx poller
cardosofede Dec 4, 2025
d8c96dd
Merge pull request #93 from hummingbot/feat/improve_portfolio_history…
cardosofede Dec 8, 2025
7ea190a
(feat) prioritize sell tokens
cardosofede Dec 9, 2025
0269f94
(feat) remove dead code
cardosofede Dec 9, 2025
0e0800d
(feat) improve portfolio query by connector name
cardosofede Dec 10, 2025
b69877a
(feat) replace Dashboard with Condor Telegram bot in setup
fengtality Dec 11, 2025
d14e724
Merge pull request #98 from hummingbot/feat/replace-dashboard-with-co…
cardosofede Dec 12, 2025
c61ed23
Merge pull request #97 from hummingbot/feat/adapt_gateway_upgrade
cardosofede Dec 12, 2025
362c230
(feat) clean up environment
cardosofede Dec 12, 2025
fa8ffa4
(feat) update readme
cardosofede Dec 15, 2025
5a050be
(feat) improve clmm position lifecycle
cardosofede Dec 15, 2025
6bd72f4
Merge pull request #99 from hummingbot/feat/clean_up_env_setup
cardosofede Dec 16, 2025
d9b553b
(feat) add coerce tp to step
cardosofede Dec 17, 2025
f992bc5
(feat) access proper _non_trading_connectors instead of rate sources
cardosofede Dec 18, 2025
4adea51
Update Makefile for Conda integration and commands
david-hummingbot Dec 18, 2025
03be927
Merge pull request #101 from hummingbot/feat/normalize_repo
cardosofede Dec 19, 2025
6d8ea39
Fix API routes for Mintlify docs compatibility
fengtality Dec 20, 2025
1ef674a
Revert "Fix API routes for Mintlify docs compatibility"
fengtality Dec 20, 2025
d4e5cc8
(feat) add create wallet, show private key and send models
cardosofede Jan 2, 2026
e2a6f9f
(feat) add create wallet, show private key and send endpoints
cardosofede Jan 2, 2026
38c9ad5
(feat) add new wallet gateway features
cardosofede Jan 2, 2026
8f6aa20
(feat) collect controller custom info and expose it
cardosofede Jan 2, 2026
0d8b97b
(feat) add new v2 with controllers version
cardosofede Jan 3, 2026
608cccd
(feat) add compatibility with previous version
cardosofede Jan 3, 2026
2a61752
(feat) add open order type
cardosofede Jan 3, 2026
fdf35f5
(feat) capture bot last status before stopping
cardosofede Jan 3, 2026
cde9c31
Merge pull request #104 from hummingbot/feat/add_custom_controller_da…
cardosofede Jan 5, 2026
dbca1fe
(feat) improve order polling
cardosofede Jan 7, 2026
d7505c3
(feat) expose more info of the config
cardosofede Jan 7, 2026
8bb327a
(feat) improve errorhandling
cardosofede Jan 9, 2026
36c87a6
(feat) add rate oracle router
cardosofede Jan 9, 2026
dae36a2
(feat) add rate oracle models
cardosofede Jan 9, 2026
fc13c42
Update Makefile
david-hummingbot Jan 9, 2026
08c8a50
Add .env file existence check in setup script
david-hummingbot Jan 9, 2026
eeb547c
Add setup target to execute setup.sh
david-hummingbot Jan 9, 2026
014a457
(feat) add validation error
cardosofede Jan 9, 2026
0491b74
(feat) remove executors
cardosofede Jan 9, 2026
1618319
(feat) remove executors service
cardosofede Jan 9, 2026
0c553f4
add dependencies
david-hummingbot Jan 11, 2026
877841f
reduce output and add logging instead
david-hummingbot Jan 11, 2026
d0fb938
add sentinel file
david-hummingbot Jan 12, 2026
2f05257
add sentinel
david-hummingbot Jan 12, 2026
c554d7c
Merge pull request #107 from hummingbot/fix/install
cardosofede Jan 12, 2026
f5ad32f
(feat) exclude executors router
cardosofede Jan 13, 2026
df3d769
(feat) exclude executors service
cardosofede Jan 13, 2026
0de438e
(feat) remove from app
cardosofede Jan 13, 2026
3f2cded
Merge pull request #106 from hummingbot/feat/improve_order_polling_an…
rapcmia Jan 15, 2026
9f79733
Add gateway proxy router and ignore bots/conf directory
fengtality Jan 13, 2026
f83d389
add verbose logging
david-hummingbot Jan 20, 2026
ebf2300
Merge pull request #109 from hummingbot/fix/install-script
rapcmia Jan 20, 2026
e662e24
(feat) add executors repository
cardosofede Jan 20, 2026
03cee63
(feat) add order book tracking registry and removal
cardosofede Jan 20, 2026
5c2670b
(feat) add executors model
cardosofede Jan 20, 2026
29389d7
(feat) add executors repositor
cardosofede Jan 20, 2026
0af64f5
(feat) remove filter
cardosofede Jan 20, 2026
d1b8f8f
(feat) re-engineer market data servivce
cardosofede Jan 20, 2026
78d68ec
(feat) simplify accounts service
cardosofede Jan 20, 2026
c533ed1
(feat) crete unified connector service replacing utils
cardosofede Jan 20, 2026
1befbe0
(feat) add trading service
cardosofede Jan 20, 2026
87a30e3
(feat) add executor service and router
cardosofede Jan 20, 2026
ae3fb50
(feat) update imports
cardosofede Jan 20, 2026
0f92b33
Fix DELETE requests not forwarding request body to Gateway
fengtality Jan 21, 2026
dab73ec
(feat) fix ob start
cardosofede Jan 21, 2026
2052405
(feat) restart ob tracker and state
cardosofede Jan 21, 2026
bca4928
Add g++ and build-essential to Dockerfile
david-hummingbot Jan 21, 2026
63f4fba
Merge pull request #111 from hummingbot/fix/docker-build-issue
rapcmia Jan 22, 2026
98cf59e
(feat) add position hold
cardosofede Jan 22, 2026
9f8ee26
(feat) clean up code
cardosofede Jan 22, 2026
8e7ac76
(feat) add position hold
cardosofede Jan 22, 2026
57be279
(feat) clean up connector code
cardosofede Jan 22, 2026
fd7a503
Refactor setup.sh to improve installation process
david-hummingbot Jan 23, 2026
9ec2c5d
Merge pull request #112 from hummingbot/fix-install
david-hummingbot Jan 23, 2026
f19533c
(feat) add position hold recovery from database on startup
cardosofede Jan 23, 2026
8b4102e
(feat) initialize connectors for db
cardosofede Jan 23, 2026
fc6eaf6
(feat) prevent double initialization
cardosofede Jan 26, 2026
0442224
Merge pull request #110 from hummingbot/feat/add_executors_and_refact…
david-hummingbot Jan 27, 2026
d164618
Update setup script to prompt for API credentials
david-hummingbot Jan 27, 2026
5fbe7e2
(feat) improve executor lifecycle
cardosofede Jan 27, 2026
d43d95b
(feat) remove delete routes
cardosofede Jan 27, 2026
e01b64a
(feat) update models
cardosofede Jan 27, 2026
033b463
(feat) remove total completed
cardosofede Jan 28, 2026
2b4dcae
(feat) improve executor db dump
cardosofede Jan 28, 2026
0f7b6f2
Merge pull request #114 from hummingbot/feat/improve_executors_route
rapcmia Jan 29, 2026
16b4b88
(feat) improve price query with rate oracle
cardosofede Jan 29, 2026
644d00c
Merge pull request #116 from hummingbot/feat/improve_price_conversion
cardosofede Jan 29, 2026
46f427e
(feat) add rate oracle warm up
cardosofede Jan 29, 2026
3ec21e3
Merge pull request #117 from hummingbot/feat/rate_oracle_warm_up
cardosofede Jan 29, 2026
640d700
(feat) re-orginze imports
cardosofede Jan 29, 2026
b11655c
(feat) add rate_oracle warmup in lifespan
cardosofede Jan 29, 2026
b5b704a
(feat) use market data to quote position
cardosofede Jan 30, 2026
31960d9
Merge pull request #118 from hummingbot/feat/fix_position_hold_unreal…
rapcmia Feb 2, 2026
47d25c0
(feat) add validation to candles intiialization
cardosofede Feb 3, 2026
8dbe899
feat: add LP executor support
fengtality Feb 4, 2026
0742f81
feat: only query Gateway balances for defaultWallet on defaultNetworks
fengtality Feb 4, 2026
1abaeb0
fix: skip same-token USDC/USDC price fetching
fengtality Feb 4, 2026
74cf581
fix: use WETH price for ETH on ethereum networks
fengtality Feb 5, 2026
f8801a1
Merge pull request #119 from hummingbot/feat/improve_candles_polling_…
cardosofede Feb 6, 2026
b639d62
(feat) update controllers
cardosofede Feb 18, 2026
e0ad5c0
(feat) clean up executors
cardosofede Feb 18, 2026
4af0699
(feat) clean up executors
cardosofede Feb 18, 2026
2edbdd5
(feat) add to main
cardosofede Feb 18, 2026
e2caf8b
(feat) add executor logs
cardosofede Feb 18, 2026
caee7c3
(feat) add executor logs
cardosofede Feb 18, 2026
a299744
(feat) update deploy to new hummingbot version
cardosofede Feb 19, 2026
9cb71b4
(feat) add executor log capture
cardosofede Feb 19, 2026
9681033
(feat) update method usage
cardosofede Feb 23, 2026
5850ec1
Merge feat/update_hummingbot into feat/lp-executor
fengtality Feb 24, 2026
fb04f81
feat: update LP executor router and schema with latest configs
fengtality Feb 24, 2026
207dbdd
feat: add lp_rebalancer controller from hummingbot
fengtality Feb 24, 2026
ddb4f96
fix: use absolute import for lp_rebalancer to match hummingbot structure
fengtality Feb 24, 2026
a1d4e17
feat: support package-style controllers and remove stale lp_manager
fengtality Feb 24, 2026
dbcef3d
Merge pull request #128 from hummingbot/feat/update_hummingbot
rapcmia Feb 25, 2026
ca8dea2
refactor: align LP executor config with other executors
fengtality Feb 25, 2026
d10856c
docs: add comprehensive DEVELOPERS.md for custom branch testing
fengtality Feb 27, 2026
4b9c9d7
fix: use separate Dockerfile.dev for custom wheel builds
fengtality Feb 27, 2026
d92ce05
feat: add docker-compose.dev.yml for development deployments
fengtality Feb 27, 2026
db9dcfc
docs: add bot deployment with development images section
fengtality Feb 27, 2026
a48404f
merge: pull in gateway-proxy PR #108 and resolve conflicts
fengtality Feb 28, 2026
32e9aa5
fix: support gateway connectors and remove breaking script config fields
fengtality Mar 3, 2026
b3554c1
test: add gateway LP executor tests
fengtality Mar 3, 2026
3ae1824
Merge pull request #120 from hummingbot/feat/lp-executor
rapcmia Mar 4, 2026
3c61fe7
fix: skip placeholder wallet addresses in Gateway balance polling
fengtality Mar 11, 2026
8762a8a
Add function to pull Hummingbot Docker image
david-hummingbot Mar 11, 2026
3edec1f
Merge pull request #134 from hummingbot/fix/pull-client-image
david-hummingbot Mar 11, 2026
5048918
(feat) add controller id to executors
cardosofede Mar 16, 2026
d49b71b
feat: add controller ID support to executors
cardosofede Mar 21, 2026
432604f
(feat) update method usage
cardosofede Mar 23, 2026
7ed0b99
Merge pull request #138 from hummingbot/feat/add_controllerid
cardosofede Mar 23, 2026
2090eed
fix: initialize active order timestamps in api trading flows
marcuspocus Apr 6, 2026
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
63 changes: 62 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,62 @@
.env
# Python cache
__pycache__/
*.py[cod]
*$py.class
*.so
.Python

# Virtual environments
venv/
ENV/
env/
.venv

# IDEs
.idea/
.vscode/
*.swp
*.swo
*~

# OS files
.DS_Store
Thumbs.db

# Git
.git/
.gitignore

# Documentation
*.md
docs/

# Tests
test/
tests/
pytest_cache/
.coverage
.pytest_cache/

# Development files
.env
.env.local
*.log

# Build artifacts
build/
dist/
*.egg-info/

# Docker files (don't copy themselves)
Dockerfile*
docker-compose*.yml
.dockerignore

# Bot data that should be mounted as volumes
bots/instances/*
bots/data/*
bots/credentials/*
!bots/credentials/master_account/

# Archives
bots/archived/
61 changes: 12 additions & 49 deletions .github/workflows/docker_buildx_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,24 @@
name: Backend-API Docker Buildx Workflow
name: Hummingbot-API Docker Buildx Workflow

on:
pull_request:
types: [closed]
branches:
- main
- development
release:
types: [published, edited]

jobs:
build_pr:
if: github.event_name == 'pull_request' && github.event.pull_request.merged == true
build_and_push:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.1.0

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Development Image
if: github.base_ref == 'development'
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: hummingbot/backend-api:development

- name: Build and push Latest Image
if: github.base_ref == 'main'
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: hummingbot/backend-api:latest

build_release:
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
- name: Extract version from main.py
id: get_version
run: |
VERSION=$(grep -E '^VERSION *= *' main.py | head -1 | sed -E 's/^VERSION *= *["\x27]?([^"\x27]*)["\x27]?/\1/')
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -67,14 +32,12 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract tag name
id: get_tag
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}

- name: Build and push
- name: Build and push Docker images (latest and versioned)
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: hummingbot/backend-api:${{ steps.get_tag.outputs.VERSION }}
tags: |
hummingbot/hummingbot-api:latest
hummingbot/hummingbot-api:${{ steps.get_version.outputs.VERSION }}
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ instance/
# Scrapy stuff:
.scrapy

# Setup sentinel
.setup-complete

# Sphinx documentation
docs/_build/

Expand Down Expand Up @@ -158,3 +161,21 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Hummingbot Gateway files
gateway-files/

# Hummingbot wheel files (for local Docker builds)
*.whl

# Hummingbot credentials and local data
bots/credentials/
bots/instances/
bots/conf/

# Local MCP configuration (project-specific overrides)
.mcp.json

# IDE files
.vscode/
.idea/
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ repos:
args: [--settings-path=pyproject.toml]

- repo: https://github.com/pycqa/flake8
rev: 3.9.2
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies: ['flake8']
args: [--max-line-length=130]
62 changes: 48 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,56 @@
# Start from a base image with Miniconda installed
FROM continuumio/miniconda3
# Stage 1: Builder stage
FROM continuumio/miniconda3 AS builder

# Install system dependencies
# Install build dependencies
RUN apt-get update && \
apt-get install -y sudo libusb-1.0 python3-dev gcc && \
apt-get install -y python3-dev gcc g++ build-essential && \
rm -rf /var/lib/apt/lists/*

# Set the working directory in the container
WORKDIR /backend-api
# Set working directory
WORKDIR /build

# Copy only the environment file first (for better layer caching)
COPY environment.yml .

# Create the conda environment
RUN conda env create -f environment.yml && \
conda clean -afy && \
rm -rf /root/.cache/pip/*

# Stage 2: Runtime stage
FROM continuumio/miniconda3

# Install only runtime dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libusb-1.0-0 \
&& rm -rf /var/lib/apt/lists/*

# Copy the conda environment from builder
COPY --from=builder /opt/conda/envs/hummingbot-api /opt/conda/envs/hummingbot-api

# Set the working directory
WORKDIR /hummingbot-api

# Copy only necessary application files
COPY main.py config.py deps.py ./
COPY models ./models
COPY routers ./routers
COPY services ./services
COPY utils ./utils
COPY database ./database
COPY bots/controllers ./bots/controllers
COPY bots/scripts ./bots/scripts

# Copy the current directory contents and the Conda environment file into the container
COPY . .
# Create necessary directories
RUN mkdir -p bots/instances bots/conf bots/credentials bots/data bots/archived

# Create the environment from the environment.yml file
RUN conda env create -f environment.yml
# Expose port
EXPOSE 8000

# Make RUN commands use the new environment
SHELL ["conda", "run", "-n", "backend-api", "/bin/bash", "-c"]
# Set environment variables to ensure conda env is used
ENV PATH="/opt/conda/envs/hummingbot-api/bin:$PATH"
ENV CONDA_DEFAULT_ENV=hummingbot-api

# The code to run when container is started
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "backend-api", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
# Run the application
ENTRYPOINT ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
75 changes: 37 additions & 38 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,49 +1,48 @@
.ONESHELL:
.SHELLFLAGS := -c

.PHONY: run
.PHONY: uninstall
.PHONY: install
.PHONY: install-pre-commit
.PHONY: docker_build
.PHONY: docker_run


detect_conda_bin := $(shell bash -c 'if [ "${CONDA_EXE} " == " " ]; then \
CONDA_EXE=$$((find /opt/conda/bin/conda || find ~/anaconda3/bin/conda || \
find /usr/local/anaconda3/bin/conda || find ~/miniconda3/bin/conda || \
find /root/miniconda/bin/conda || find ~/Anaconda3/Scripts/conda || \
find $$CONDA/bin/conda) 2>/dev/null); fi; \
if [ "${CONDA_EXE}_" == "_" ]; then \
echo "Please install Anaconda w/ Python 3.10+ first"; \
echo "See: https://www.anaconda.com/distribution/"; \
exit 1; fi; \
echo $$(dirname $${CONDA_EXE})')

CONDA_BIN := $(detect_conda_bin)
.PHONY: setup run deploy stop install uninstall build install-pre-commit

SETUP_SENTINEL := .setup-complete

setup: $(SETUP_SENTINEL)

$(SETUP_SENTINEL):
chmod +x setup.sh
./setup.sh

# Run locally (dev mode)
run:
uvicorn main:app --reload
docker compose up emqx postgres -d
conda run --no-capture-output -n hummingbot-api uvicorn main:app --reload

uninstall:
conda env remove -n backend-api
# Deploy with Docker
deploy: $(SETUP_SENTINEL)
docker compose up -d

# Stop all services
stop:
docker compose down

# Install conda environment
install:
if conda env list | grep -q '^backend-api '; then \
echo "Environment already exists."; \
@if ! command -v conda >/dev/null 2>&1; then \
echo "Error: Conda is not found in PATH. Please install Conda or add it to your PATH."; \
exit 1; \
fi
@if conda env list | grep -q '^hummingbot-api '; then \
echo "Environment already exists."; \
else \
conda env create -f environment.yml; \
conda env create -f environment.yml; \
fi
$(MAKE) install-pre-commit
$(MAKE) setup

install-pre-commit:
/bin/bash -c 'source "${CONDA_BIN}/activate" backend-api && \
if ! conda list pre-commit | grep pre-commit &> /dev/null; then \
pip install pre-commit; \
fi && pre-commit install'
uninstall:
conda env remove -n hummingbot-api -y
rm -f $(SETUP_SENTINEL)

docker_build:
docker build -t hummingbot/backend-api:latest .
install-pre-commit:
conda run -n hummingbot-api pip install pre-commit
conda run -n hummingbot-api pre-commit install

docker_run:
docker compose up -d
# Build Docker image
build:
docker build -t hummingbot/hummingbot-api:latest .
Loading