Пример #1
0
 def _can_run(self, manifest):
     try:
         return appcfg.AppType(
             manifest['type']) in (appcfg.AppType.NATIVE, appcfg.AppType.TAR
                                   # TODO: Add support for DOCKER
                                   )
     except ValueError:
         return False
Пример #2
0
def get_image(tm_env, manifest):
    """Gets am image from the given manifest."""
    app_type = appcfg.AppType(manifest.get('type'))
    image_repo = get_image_repo(tm_env, app_type)

    if image_repo is None:
        raise Exception(
            'There is no repository for app with type {0}.'.format(app_type))

    img_impl = image_repo.get(manifest.get('image'))

    if img_impl is None:
        raise Exception('There is no image {0} for app with type {1}.'.format(
            manifest.get('image'), app_type))

    return img_impl
Пример #3
0
 def _can_run(self, manifest):
     try:
         return appcfg.AppType(manifest['type']) is appcfg.AppType.DOCKER
     except ValueError:
         return False
Пример #4
0
 def _can_run(self, manifest):
     try:
         # TODO: Add support for TAR (and maybe DOCKER)
         return appcfg.AppType(manifest['type']) is appcfg.AppType.NATIVE
     except ValueError:
         return False
Пример #5
0
    def run_timeout(self, manifest):
        if appcfg.AppType(manifest['type']) is appcfg.AppType.NATIVE:
            return '60s'

        # Inflated to allow time to download and extract the image.
        return '5m'