Add container tag setup

This commit is contained in:
Aurelien Vaillant
2022-04-15 11:37:34 +02:00
parent 12b0039d2a
commit 18488da8d5
2 changed files with 12 additions and 6 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ from utils.properties import ContainerObject
class Container(enum.Enum):
"""Enumerate about the Geometry node"""
BLENDER = ContainerObject(name='Blender', image='stilobique/blender')
BLENDER = ContainerObject(name='Blender', image='stilobique/blender', tag='3.1.2')
def launch_unit_test(test: [str] = None):
+11 -5
View File
@@ -6,22 +6,28 @@ from pathlib import PurePosixPath
class ContainerObject(object):
"""All data request to launch one dedicated container"""
def __init__(self, name: str, image: str):
def __init__(self, name: str, image: str, tag: str = None):
self.label: str = name.lower()
self.image: str = image
self.tag: str = self.set_tag()
self.tag: str = self.set_tag(tag)
self.local_folder: str = ''
self.volumes: list[str] = self.set_volumes()
self.environments: list[str] = self.set_environments()
self.commands: list[str] = self.set_commands()
self.ref = f'{self.image}:{self.tag}'
def set_tag(self):
def set_tag(self, tag):
"""Determine the tag use with the docker image call"""
if 'blender' in self.label:
return 'latest'
if tag is not None:
return tag
else:
return 'latest'
elif 'unreal' in self.label:
return 'dev-slim-4.27.2'
if tag is not None:
return tag
else:
return 'dev-slim-4.27.2'
else:
return None