Skip to content

Commit

Permalink
fix dockerfile publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD committed Sep 28, 2024
1 parent b119181 commit 6bd2999
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: docker/build-push-action@v5
with:
push: true # Push is a shorthand for --output=type=registry
tags: ghcr.io/catalystneuro/neuroconv:yaml_variable
tags: ghcr.io/catalystneuro/neuroconv_yaml_variable:latest
context: .
file: dockerfiles/neuroconv_latest_yaml_variable
provenance: false
2 changes: 1 addition & 1 deletion dockerfiles/neuroconv_latest_yaml_variable
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/catalystneuro/neuroconv:latest
LABEL org.opencontainers.image.source=https://github.com/catalystneuro/neuroconv
LABEL org.opencontainers.image.description="A docker image for the most recent official release of the NeuroConv package. Modified to take in environment variables for the YAML conversion specification and other command line arguments."
CMD echo "$NEUROCONV_YAML" > run.yml && python -m neuroconv run.yml --data-folder-path "$NEUROCONV_DATA_PATH" --output-folder-path "$NEUROCONV_OUTPUT_PATH" --overwrite
CMD printf "$NEUROCONV_YAML" > ./run.yml && python -m neuroconv run.yml --data-folder-path "$NEUROCONV_DATA_PATH" --output-folder-path "$NEUROCONV_OUTPUT_PATH" --overwrite
4 changes: 3 additions & 1 deletion src/neuroconv/tools/aws/_deploy_neuroconv_batch_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def deploy_neuroconv_batch_job(
message = f"Unable to create EFS volume '{efs_volume_name}' after {max_iterations} attempts!"
raise ValueError(message)

docker_image = "ghcr.io/catalystneuro/neuroconv_latest_yaml_variable:latest"
docker_image = "ghcr.io/catalystneuro/neuroconv_yaml_variable:latest"

with open(file=yaml_specification_file_path, mode="r") as io:
yaml_specification_file_stream = io.read()
Expand All @@ -147,6 +147,8 @@ def deploy_neuroconv_batch_job(
docker_image=docker_image,
environment_variables={
"NEUROCONV_YAML": yaml_specification_file_stream,
# TODO: would prefer this to use subfolders for source and output, but need logic for YAML
# related code to create them if missing (hard to send EFS this command directly)
"NEUROCONV_DATA_PATH": "/mnt/efs/source",
"NEUROCONV_OUTPUT_PATH": "/mnt/efs/output",
},
Expand Down
2 changes: 1 addition & 1 deletion src/neuroconv/tools/aws/_submit_aws_batch_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ def _ensure_job_definition_exists_and_get_arn(
},
},
]
mountPoints = [{"containerPath": "/mnt/efs/", "readOnly": False, "sourceVolume": "neuroconv_batch_efs_mounted"}]
mountPoints = [{"containerPath": "/mnt/efs", "readOnly": False, "sourceVolume": "neuroconv_batch_efs_mounted"}]

# batch_client.register_job_definition is not synchronous and so we need to wait a bit afterwards
batch_client.register_job_definition(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,16 @@ def run_conversion_from_yaml(

if data_folder_path is None:
data_folder_path = Path(specification_file_path).parent
else:
data_folder_path = Path(data_folder_path)
data_folder_path.mkdir(exist_ok=True)

if output_folder_path is None:
output_folder_path = Path(specification_file_path).parent
output_folder_path = specification_file_path.parent
else:
output_folder_path = Path(output_folder_path)
output_folder_path.mkdir(exist_ok=True)

specification = load_dict_from_file(file_path=specification_file_path)
schema_folder = Path(__file__).parent.parent.parent / "schemas"
specification_schema = load_dict_from_file(file_path=schema_folder / "yaml_conversion_specification_schema.json")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def test_deploy_neuroconv_batch_job(self):
self.efs_id = efs_volume["FileSystemId"]

# Check normal job completion
assert job["jobName"] == job_name
assert job["jobName"] == f"{job_name}_neuroconv_deployment"
assert "neuroconv_batch_queue" in job["jobQueue"]
assert "fs-" in job["jobDefinition"]
assert job["status"] == "SUCCEEDED"
Expand Down

0 comments on commit 6bd2999

Please sign in to comment.