Skip to content

Commit

Permalink
Changed the tags so arca and python versions are included
Browse files Browse the repository at this point in the history
  • Loading branch information
mikicz committed May 8, 2018
1 parent a355605 commit bda9390
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions arca/backend/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,7 @@ def get_image_name(self, requirements_file: Optional[Path], dependencies: Option
""" Returns the name for images with installed requirements and dependencies.
"""
if self.inherit_image is None:
return "arca_{arca_version}_{python_version}".format(
arca_version=str(arca.__version__),
python_version=self.get_python_version()
)
return self.get_arca_base_name()
else:
name, tag = str(self.inherit_image).split(":")

Expand Down Expand Up @@ -209,13 +206,20 @@ def get_image_tag(self, requirements_file: Optional[Path], dependencies: Optiona
* From Arca base image:
* `ase` – no requirements and no dependencies
* `asd_<hash(dependencies)>` – only dependencies
* `are_<hash(requirements)>` – only requirements
* `ard_<hash(hash(dependencies) + hash(requirements))>` – both requirements and dependencies
* `<Arca version>_<Python version>_ase` – no requirements and no dependencies
* `<Arca version>_<Python version>_asd_<hash(dependencies)>` – only dependencies
* `<Arca version>_<Python version>_are_<hash(requirements)>` – only requirements
* `<Arca version>_<Python version>_ard_<hash(hash(dependencies) + hash(requirements))>`
– both requirements and dependencies
"""

prefix = "i" if self.inherit_image is not None else "a"
prefix = ""

if self.inherit_image is None:
prefix = "{}_{}_".format(arca.__version__, self.get_python_version())

prefix += "i" if self.inherit_image is not None else "a"
prefix += "r" if requirements_file is not None else "s"
prefix += "d" if dependencies is not None else "e"

Expand Down

0 comments on commit bda9390

Please sign in to comment.