Skip to content

Commit

Permalink
Merge pull request #116 from ImperialCollegeLondon/specify-version
Browse files Browse the repository at this point in the history
Specify version
  • Loading branch information
AdrianDAlessandro authored Aug 1, 2024
2 parents 7cac444 + cffa535 commit d1a5be1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def generate_docker_compose(
ip: str,
develop: bool = False,
live_model: bool = False,
version: str = "",
) -> None:
"""Generate the docker-compose.yml file.
Expand All @@ -42,6 +43,7 @@ def generate_docker_compose(
develop: Flag for when running in develop mode (localhost for datahub).
live_model: Flag for when running with a live model. This requires an available
connection to a datahub, either in production or local for develop.
version: The version of the image to use.
Returns:
None
Expand Down Expand Up @@ -92,7 +94,7 @@ def generate_docker_compose(
docker_compose["services"]["dash"]["environment"]["PRODUCTION"] = "true"
docker_compose["services"]["dash"][
"image"
] = "ghcr.io/imperialcollegelondon/gridlington-vis:latest"
] = f"ghcr.io/imperialcollegelondon/gridlington-vis:{version if version else 'latest'}" # noqa: E501

if live_model:
docker_compose["services"]["dash"]["environment"]["LIVE_MODEL"] = "true"
Expand All @@ -116,4 +118,7 @@ def generate_docker_compose(
ip,
develop="develop" in sys.argv,
live_model="live_model" in sys.argv,
version=(
sys.argv[sys.argv.index("version") + 1] if "version" in sys.argv else ""
),
)
2 changes: 2 additions & 0 deletions run_stable.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
python3 configure.py version v0.3.2
docker-compose up -d

0 comments on commit d1a5be1

Please sign in to comment.