Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Job output transform #548

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Job output transform #548

wants to merge 8 commits into from

Conversation

OlivGruwe
Copy link

@OlivGruwe OlivGruwe commented Aug 8, 2023

fixes #18
fixes #100

Pour les conversions image, si GeoTiff, distinguo fait dans class Tiff

Direct Links in job output +
makefile +
tests
Testing transformer engine added
Remove requirements-trfm
Add to main requirements
Update requirements
Ajout Multi frame Images
@github-actions github-actions bot added ci/doc Issue related to documentation of the package ci/operations Related to CI operations (actions, execution, install, builds, etc.) ci/tests Tests of the package and features feature/oas Issues related to OpenAPI specifications. process/wps3 Issue related to WPS 3.x (REST-JSON) processes support labels Aug 9, 2023
Copy link
Collaborator

@fmigneault fmigneault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a few linting issues that can be resolved automatically using the make fix[...] targets.
Validate as well using make check[...] targets any other flagged issues that might need some manual adjustments. I didn't comment on all of them.

I did not go in depth into the actual implementation of the transform functions.
I think there is a few tests missing to validate that the actual results from each transformation is valid (eg: pixel values from one format to another are properly rendered or expected text from one format to another is properly structured).

@@ -298,6 +298,28 @@ install-npm-remarklint: install-npm ## install remark-lint dependency for 'ch
remark-preset-lint-markdown-style-guide \
)

y.PHONY: install-transform
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

@@ -28,5 +28,5 @@ services:
links:
- mongodb
volumes:
- ../../config/weaver.ini.example:/opt/local/src/weaver/config/weaver.ini
- ../../config/weaver.ini:/opt/local/src/weaver/config/weaver.ini
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this.
We want the example to be tested to ensure it is valid for documentation purpose.

# noqa: E241,E501
(uri_provider_jobs, Visibility.PUBLIC, self.user_admin_id, filter_service(public_jobs)), # noqa: E241,E501

] # type: List[Tuple[str, str, Union[None, int], List[Job]]]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert auto-formating by your IDE here and above.

except Exception as e:
print(cmt + " -> " + wmt + " failed")
assert False, os.path.splitext(f)[1] + " -> " + f + " " + str(e)
pass
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary pass

Comment on lines +94 to +96



Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove extra lines

super(BuiltinProcessJobBase, self).run(runtime_context, **kwargs)
super(BuiltinProcessJobBase, self).process(runtime_context, **kwargs)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this change. Looks like an error. It should refer to the CWL's run method I believe.

Retrieve the possible formats of an output job.
"""
job = get_job(request)
return get_job_possible_output_formats(job)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should do some kind of sd.JobTranformerSchema().deserialize(<body>) check before returning the contents to ensure they match the format of weaver/wps_restapi/examples/job_transformer.json

Comment on lines +198 to +207
def main():
image = Image.open('examples/angular.png').convert('RGBA')
svg_image = rgba_image_to_svg_contiguous(image)
# svg_image = rgba_image_to_svg_pixels(image)
with open("examples/angular.svg", "w") as text_file:
text_file.write(svg_image)


if __name__ == '__main__':
main()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like something that should be removed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add missing docstrings and typings.

self.file_path = file_path
self.cmt = current_media_type.lower()
self.wmt = wanted_media_type.lower()
self.output_path = self.file_path
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output path needs to be modifiable (either from init arg, or modified after before the process/get calls.
More importantly, no additional files should be added under the original WPS outputs sub-directories, because their contents could be critical to the packing/detection of other apps in a workflow chain.
We need to consider the creation of some "sibling" directory next to the WPS-output-ID dir to avoid modifying the output checksums.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/doc Issue related to documentation of the package ci/operations Related to CI operations (actions, execution, install, builds, etc.) ci/tests Tests of the package and features feature/oas Issues related to OpenAPI specifications. process/wps3 Issue related to WPS 3.x (REST-JSON) processes support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support the various formats that can represent a GeoTIFF Support /results/{id} and /outputs/{id} routes
2 participants