Skip to content

Commit

Permalink
Run dockerhub and ecr together
Browse files Browse the repository at this point in the history
Signed-off-by: Divya Madala <divyaasm@amazon.com>
  • Loading branch information
Divyaasm committed Jun 11, 2024
1 parent 0938295 commit 59be78e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/validation_workflow/validation_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

class ValidationArgs:
SUPPORTED_PLATFORMS = ["linux", "windows"]
DOCKER_SOURCE = ["dockerhub", "ecr"]

def __init__(self) -> None:
parser = argparse.ArgumentParser(
Expand Down Expand Up @@ -74,11 +73,11 @@ def __init__(self) -> None:
)
parser.add_argument(
"--docker-source",
type=str,
nargs='+',
required=False,
choices=self.DOCKER_SOURCE,
help="(optional) Where to pull the docker image from, either DockerHub or ECR\n",
default="dockerhub",
help="(optional) Where to pull the docker image from, either DockerHub or ECR or Both \n",
choices=["dockerhub", "ecr"],
default=["dockerhub"],
)
parser.add_argument(
"-v",
Expand Down
11 changes: 10 additions & 1 deletion src/validation_workflow/validation_test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,13 @@ class ValidationTestRunner:

@classmethod
def dispatch(cls, args: ValidationArgs, dist: str, work_dir: TemporaryDirectory) -> Validation:
return cls.RUNNERS[dist](args, work_dir)
if dist == "docker":
results = []
docker_source = args.docker_source
for source in docker_source:
new_args = args
new_args.docker_source = source
results.append(cls.RUNNERS[dist](new_args, work_dir))
return results
else:
return cls.RUNNERS[dist](args, work_dir)

0 comments on commit 59be78e

Please sign in to comment.