Skip to content

Commit

Permalink
Upgrade IB Gateway version to 10.19.2p (#111)
Browse files Browse the repository at this point in the history
* fix: update README if new version detected

* Update README.template

* Update README.template

fix typo

* Update to `10.19.2p` (#110)

* Update to `10.19.2p`

* Update README.md

* Update README.md

---------

Co-authored-by: github-actions <[email protected]>
Co-authored-by: Andrew <[email protected]>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
3 people authored Sep 21, 2024
1 parent 1c00bce commit 9e295a7
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
CUR_IB_GATEWAY_VER=10.19.2o
CUR_IB_GATEWAY_VER=10.19.2p
CUR_IBC_VER=3.20.0
2 changes: 1 addition & 1 deletion .github/workflows/detect-new-ver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Update files with new version
if: steps.check-update.outputs.has_update == 'true'
run: |
sed -i -E -e 's/(IB Gateway\]*\()([^)]+)(\))/\1${{steps.check-update.outputs.ib-gateway-ver}}\3/' -e 's/(IBC.*\()([^)]+)(\))/\1${{steps.check-update.outputs.ibc-ver}}\3/' README.md
sed -e 's/###IB_GATEWAY_VER###/${{steps.check-update.outputs.ib-gateway-ver}}/' -e 's/###IBC_VER###/${{steps.check-update.outputs.ibc-ver}}/' README.template > README.md
- name: Create PR
if: ${{ steps.check-update.outputs.has_update == 'true' }}
env:
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ It's just pure `IB Gateway` and don't include any VNC service (for security reas

This docker image just installed:

- [IB Gateway](https://www.interactivebrokers.com/en/index.php?f=16457) (10.19.2o)
- [IB Gateway](https://www.interactivebrokers.com/en/index.php?f=16457) (10.19.2p)

- [IBC](https://github.com/IbcAlpha/IBC) (3.20.0)

Expand Down Expand Up @@ -86,7 +86,6 @@ services:
retries: 3
start_period: 60s
```
### CLI
Execute `healthcheck` to detect IB gateway haelth status

Expand Down
72 changes: 71 additions & 1 deletion README.template
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ docker run -d \
--env IB_ACCOUNT= \ #YOUR_USER_ID
--env IB_PASSWORD= \ #YOUR_PASSWORD
--env TRADING_MODE= \ #paper or live
--p 4002:4002 \ #brige IB gateway port to your local port 4002
-p 4002:4002 \ #brige IB gateway port to your local port 4002
manhinhang/ib-gateway-docker
```

Expand All @@ -53,6 +53,76 @@ ib-gateway-docker
| - | - | - |
| ib_insync | [examples/ib_insync](./examples/ib_insync) | This example demonstrated how to connect `IB Gateway`


## Health check container

### API

Healthcheck via api call `http://localhost:8080/healthcheck`

Config `HEALTHCHECK_API_ENABLE=true` in environment variable to enable API

```bash
curl -f http://localhost:8080/healthcheck
```

- Docker compose example

```yaml
services:
ib-gateway:
image: manhinhang/ib-gateway-docker
ports:
- 4002:4002
environment:
- IB_ACCOUNT=$IB_ACCOUNT
- IB_PASSWORD=$IB_PASSWORD
- TRADING_MODE=$TRADING_MODE
- HEALTHCHECK_API_ENABLE=true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/healthcheck"]
interval: 60s
timeout: 30s
retries: 3
start_period: 60s
```
### CLI
Execute `healthcheck` to detect IB gateway haelth status

```bash
healthcheck
# output: Ping IB Gateway successful
echo $?
# output: 0
```

```bash
healthcheck
# output: Can not connect to IB Gateway
echo $?
# output: 1
```

- Docker compose example

```yaml
services:
ib-gateway:
image: manhinhang/ib-gateway-docker
ports:
- 4002:4002
environment:
- IB_ACCOUNT=$IB_ACCOUNT
- IB_PASSWORD=$IB_PASSWORD
- TRADING_MODE=$TRADING_MODE
healthcheck:
test: /healthcheck/bin/healthcheck
interval: 60s
timeout: 30s
retries: 3
start_period: 60s
```

# Tests

The [test cases](test/test_ib_gateway.py) written with testinfra.
Expand Down

0 comments on commit 9e295a7

Please sign in to comment.