Skip to content

Commit

Permalink
removed specialy dockerfile parser in favor of simpler io read for do…
Browse files Browse the repository at this point in the history
…ckerfile check
  • Loading branch information
neonwatty committed Jun 2, 2023
1 parent 12bccc2 commit c3c9e94
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 23 deletions.
1 change: 0 additions & 1 deletion quick_batch/utilities/manage_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from .manage_dockerfile import check_requirements_copy_and_install
from utilities import log_exceptions
import subprocess
import sys


# create client for docker
Expand Down
3 changes: 0 additions & 3 deletions quick_batch/utilities/manage_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ def setup_client(config):
# check processor
check_processor(processor)

# check dockerfile - seems to save a copy local to the project - not using for now
# check_dockerfile(dockerfile_path)

# create docker client
client = create_client()

Expand Down
19 changes: 0 additions & 19 deletions quick_batch/utilities/param_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os
import ast
import yaml
from dockerfile_parse import DockerfileParser
from utilities import log_exceptions
from utilities.manage_loggers import Logger

Expand Down Expand Up @@ -127,21 +126,3 @@ def check_processor(processor):
else:
print("FAILURE: module does not contain a function named 'processor'")
sys.exit(1)


# check dockerfile validity
@log_exceptions
def check_dockerfile(dockerfile):
def validate_dockerfile(dockerfile_path):
try:
parser = DockerfileParser()
with open(dockerfile_path, 'r') as file:
parser.content = file.read()
return True
except Exception:
return False

if validate_dockerfile(dockerfile):
print("INFO: Dockerfile is valid!")
else:
print("INFO: Dockerfile is NOT valid.")

0 comments on commit c3c9e94

Please sign in to comment.