Skip to content

Update to IB Gateway 978.2b and updates to deploy to Kubernetes using a Helm 3 chart #24

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

Open
wants to merge 102 commits into
base: master
Choose a base branch
from

Conversation

forhire
Copy link

@forhire forhire commented Jul 28, 2020

I have created this update to download and install the current stable release of Interactive Brokers Gateway v978.2b. I have also updated the runscript to get rid of socat and use the IB Gateway port directly to reduce overhead and to enable deploying this image to Kubernetes with TCP port monitoring and automatic restart when the port is unavailable.

I also created a Helm 3 chart to deploy to Kubernetes at https://github.com/forhire/ibgw to make Kubernetes deployment easy, using Kubernetes secrets to store credentials.

@leebailey88
Copy link

I personally don't need kubernetes, but the main problem I'm trying to solve is make the container more stable / auto restart on exceptions. Right now, I have to kill and remove the docker container and recreate it at least once every day, sometimes more often. Will these changes fix this? Is there a smaller subset of these changes that would fix it, ie. the few lines changed in the runscript.sh alone? Thanks very much!

@forhire
Copy link
Author

forhire commented Feb 2, 2021

I'm trying to refactor further to not need socat to redirect to localhost. Socat redirect seems to be resulting in some performance slowdowns and disconnects. Updating the ibg.xml to allow connections not just from localhost should do this, but ibg.xml gets placed in the directory that is created after startup. https://github.com/ajpierce/ib_tws_docker is another Dockerization of IBG that tries to use ibg.xml, but it seems to be currently set up for their specific user, and they create that by starting, killing, and then restarting IBGW which seems very inefficient.

I have been using Kubernetes to monitor and restart IBGW, but there's more refinement that can be done, such as watching for the timestamp, account information, or tick data to ensure it is fully active.

The allowOnlyLocalhost value below is what needs to be changed.

    <ApiSettings varName="api" dde="false" readOnlyApi="false" allowOnlyLocalhost="false" socketClient="true" autoOpenOrdDonwload="true" port="4001" includeFxPositions="true" includeContinuousUpdateChanges="true" sendMessagesInEnglish="false" sendMessagesTranslated="true" logLevel="2" useNegativeAutoRange="true" overridePrecautionaryConstraints="false" bypassBondWarning="false" bypassYtwWarning="false" bypassCalledBondWarning="false" masterClientID="-1" acceptLargeSize="false" showApiMsg="false" includeMktData="false" createApiMsgLogFile="false" showIBGConsole="false" aPINotAllowedShownAfterDenyAPI="false" slowBufferTimeout="30" syncAccounts="false" multichartNetDoNotShowTime="0" multichartDoNotShowTime="0" verifiedAppPortRangeStart="7000" verifiedAppPortRangeEnd="8000" timeOfVerifiedAppShutdown="0" portOfVerifiedAppShutdown="0">

@krumware
Copy link
Collaborator

I'm still watching! Feel free to ping me when you think this is at a stopping point

@forhire
Copy link
Author

forhire commented Mar 16, 2023

Thanks, I'm still working on a lot of little quirks and issues. It seems like xvfb-run is not reliably starting, so I'm going to try changing to tigervnc-standalone-server. IBGW has stopped responding to API requests, until I change to another port and back, then it starts working again. I want this to be very stable, so it can be used for reliable trading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants