stalkopat / hummingbot-kubernetes Goto Github PK
View Code? Open in Web Editor NEWRunning hummingbot on kubernetes
Running hummingbot on kubernetes
I set up a k8s cluster using https://k3s.io/ - all seems fine so far, I have run other pods on it successfully.
Downloaded Example-StatefulSet-BTC-USDT.yaml and ran it with
# kubectl apply -f ./Example-StatefulSet-BTC-USDT.yaml
# kubectl get pods
NAME READY STATUS RESTARTS AGE
btc-usdt-0 0/1 CrashLoopBackOff 6 (2m29s ago) 8m22s
and the logs:
# kubectl logs btc-usdt-0
Traceback (most recent call last):
File "bin/hummingbot_quickstart.py", line 152, in <module>
fork_and_start(main)
File "/home/hummingbot/bin/docker_connection.py", line 137, in fork_and_start
main_function()
File "bin/hummingbot_quickstart.py", line 148, in main
asyncio.get_event_loop().run_until_complete(quick_start(args, secrets_manager))
File "/home/hummingbot/miniconda3/envs/hummingbot/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "bin/hummingbot_quickstart.py", line 83, in quick_start
if not Security.login(secrets_manager):
File "/home/hummingbot/hummingbot/client/config/security.py", line 42, in login
if not validate_password(secrets_manager):
File "/home/hummingbot/hummingbot/client/config/config_crypt.py", line 72, in validate_password
with open(PASSWORD_VERIFICATION_PATH, "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/hummingbot/conf/.password_verification'
I have tried updating the example my own password, and with .password_verification before the quickstart.yml:
data:
.password_verification: |
7b226.....0337d
quickstart.yml: |
But then regardless of what I try, the best I can manage is:
:
File "/home/hummingbot/hummingbot/client/config/config_crypt.py", line 75, in validate_password
decrypted_word = secrets_manager.decrypt_secret_value(PASSWORD_VERIFICATION_WORD, encrypted_word)
File "/home/hummingbot/hummingbot/client/config/config_crypt.py", line 59, in decrypt_secret_value
value = binascii.unhexlify(value)
binascii.Error: Odd-length string
I can't get a shell into the pod to check exactly what is being created.
Has something changed with using this image in the 8 months since the example.yaml was posted, or am I doing something wrong here?
Hi stalkopat
I have been working with this for a while, but in order to persist the storage (so that when the pods are restarted for any reason, HB can recover the existing orders), I cannot find the way to build the yaml file.
Example:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ku-pmm-avax-usdt-11-pv-c
namespace: hummingbot
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi
storageClassName: ku-pmm-avax-usdt-11-sc
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: ku-pmm-avax-usdt-11
namespace: hummingbot
spec:
replicas: 1
serviceName: ku-pmm-avax-usdt-11
selector:
matchLabels:
app: ku-pmm-avax-usdt-11-hummingbot
template:
metadata:
labels:
app: ku-pmm-avax-usdt-11-hummingbot
spec:
serviceAccountName: ku-pmm-avax-usdt-11-sa
containers:
- name: ku-pmm-avax-usdt-11
image: bgtcapital/hummingbot_pg:latest
resources:
limits:
cpu: 250m
memory: 512Mi
requests:
cpu: 250m
memory: 512Mi
imagePullPolicy: Always
tty: true
stdin: true
command: [ /bin/bash ]
args:
- -c
- >
cp /readonly-conf/.password_verification /conf; cp /readonly-conf/conf_client.yml /conf ; cp /readonly-conf/conf_fee_overrides.yml /conf ; cp /readonly-conf/hummingbot_logs.yml /conf ; cp /readonly-conf/kucoin.yml /conf/connectors; cp /readonly-conf/ku-pmm-avax-usdt-11.yml /conf/strategies ; cp /readonly-conf/spreads_adjusted_on_volatility_script.py /pmm_scripts ; /home/hummingbot/miniconda3/envs/$(head -1 setup/environment-linux.yml | cut -d' ' -f2)/bin/python3
bin/hummingbot_quickstart.py
-p Whitehole001
-f ku-pmm-avax-usdt-11.yml
--auto-set-permissions
volumeMounts:
- name: hb
mountPath: "/home"
- name: config
mountPath: "/readonly-conf"
volumes:
- name: hb
persistentVolumeClaim:
claimName: ku-pmm-avax-usdt-11-pv-c
readOnly: false
- name: config
configMap:
name: ku-pmm-avax-usdt-11-config
To me it looks as if the mountPath is wrong
volumeMounts:
- name: hb
mountPath: "/home"
Do you have experience adding persistent Volume to the pod, so that orders can be automatically recover ?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.