Skip to content

Commit

Permalink
fix: change position of pull docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
Romazes committed Sep 23, 2024
1 parent 55e773d commit 121b456
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lean/commands/backtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ def backtest(project: Path,
project_config = project_config_manager.get_project_config(algorithm_file.parent)
engine_image = cli_config_manager.get_engine_image(image or project_config.get("engine-image", None))

container.update_manager.pull_docker_image_if_necessary(engine_image, update, no_update)

container_module_version = container.docker_manager.get_image_label(engine_image,
CONTAINER_LABEL_LEAN_VERSION_NAME, None)

Expand All @@ -380,8 +382,6 @@ def backtest(project: Path,
if str(engine_image) != DEFAULT_ENGINE_IMAGE:
logger.warn(f'A custom engine image: "{engine_image}" is being used!')

container.update_manager.pull_docker_image_if_necessary(engine_image, update, no_update)

if not output.exists():
output.mkdir(parents=True)

Expand Down
4 changes: 2 additions & 2 deletions lean/commands/live/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ def deploy(project: Path,
project_config = project_config_manager.get_project_config(algorithm_file.parent)
engine_image = cli_config_manager.get_engine_image(image or project_config.get("engine-image", None))

container.update_manager.pull_docker_image_if_necessary(engine_image, update, no_update)

container_module_version = container.docker_manager.get_image_label(engine_image,
CONTAINER_LABEL_LEAN_VERSION_NAME, None)

Expand All @@ -291,8 +293,6 @@ def deploy(project: Path,
raise MoreInfoError(f"The '{environment_name}' is not a live trading environment (live-mode is set to false)",
"https://www.lean.io/docs/v2/lean-cli/live-trading/brokerages/quantconnect-paper-trading")

container.update_manager.pull_docker_image_if_necessary(engine_image, update, no_update)

_start_iqconnect_if_necessary(lean_config, environment_name)

if python_venv is not None and python_venv != "":
Expand Down

0 comments on commit 121b456

Please sign in to comment.