Skip to content

Commit

Permalink
Merge pull request #11 from hummingbot/feat/improve_create_hummingbot…
Browse files Browse the repository at this point in the history
…_instance

(feat) adapt create hummingbot instance to manage controllers and con…
  • Loading branch information
cardosofede authored Oct 4, 2023
2 parents 4d151ac + 6ff97c2 commit 5002b85
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docker_manager/docker_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ def create_hummingbot_instance(self, instance_name: str,
config['instance_id'] = instance_name
os_utils.dump_dict_to_yaml(config, conf_file_path)
# TODO: Mount script folder for custom scripts
# TODO: Refactor of this logic that it's a mess now, split between the process that creates the instance from
# the one that copies the files
create_container_command = ["docker", "run", "-it", "-d", "--log-opt", "max-size=10m", "--log-opt",
"max-file=5",
"--name", instance_name,
Expand All @@ -104,11 +106,12 @@ def create_hummingbot_instance(self, instance_name: str,
"-v", f"./{target_conf_folder}/logs:/home/hummingbot/logs",
"-v", f"./{target_conf_folder}/data/:/home/hummingbot/data",
"-v", f"./{target_conf_folder}/scripts:/home/hummingbot/scripts",
"-v", f"./{target_conf_folder}/certs:/home/hummingbot/certs",
"-v", f"./{controllers_folder}:/home/hummingbot/hummingbot/smart_components/controllers",
"-v", f"./{controllers_config_folder}:/home/hummingbot/conf/controllers_config",
"-e", "CONFIG_PASSWORD=a"]

"-v", f"./{target_conf_folder}/certs:/home/hummingbot/certs"]
if controllers_folder:
create_container_command.extend(["-v", f"./{controllers_folder}:/home/hummingbot/hummingbot/smart_components/controllers"])
if controllers_config_folder:
create_container_command.extend(["-v", f"./{controllers_config_folder}:/home/hummingbot/conf/controllers_config"])
create_container_command.extend(["-e", "CONFIG_PASSWORD=a"])
if extra_environment_variables:
create_container_command.extend(extra_environment_variables)
create_container_command.append(image)
Expand Down

0 comments on commit 5002b85

Please sign in to comment.