-
Notifications
You must be signed in to change notification settings - Fork 1
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
Parsing dependencies design #232
Comments
Changes in progress can be found here. IntroductionHere is information regarding the generic implementation side of this idea. The implementation might need to change based on how we decide to approach the service feature. Below are three main requirements that are needed.
Here is an example of data provided by this code:
StatusI've determined the needs listed above with a few scraps of Python code that have been very useful! I'll include those here. Currently, this idea still needs to have the generic Repository/VersionInfo fleshed out. I have not implemented the source file idea for this yet, but it should be a similar JSON format to the repository format listed above. I'm very open to any ideas on how to accomplish this, however, as I think this will be the project's largest challenge. Final thoughtsI wanted to get all of these initial ideas down today, so there might be some excluded details, so let me know if you need any clarification! Unfortunately, my commitment to NIH is starting to take over most of my time, so I'm not sure how much effort I will be able to put into this idea. If at any time you have questions, I can definitely make myself available for answers, input, or rubber-ducking 😄 Edited by @mscottford on Thursday, October 7, 2021 to fix link to the branch that contains work-in-progres |
My preference for this is to define a small HTTP/REST API to query the information. The API would receive the text of a dependency manifest, and then it would parse that manifest, and look-up the information that's required for the Freshli library to do its calculations. The Freshli library would then be configured with the URLs that it needs to communicate with to get the information for a particular manifest file. This creates some choice around how to implement each of those REST APIs. One approach would be to host those APIs on the public internet. Another would be to launch them via Docker containers before the library is asked to do it's work. For either hosting approach, we'd also have a choice in how we build out the REST API. We could stick with .NET Core for the API creation, and then call a small command line application that's written in the supported language ecosystem. That command line application would then become a dependency of that REST API. If we make the output of each command line application consistent, then we could use a single REST API codebase to handle these requests. For packaging and delivery, the REST API plus supported command-line applications could be packaged as Docker containers so that people can run them locally. For ease of use, then freshli-cli project could have the responsibility for spinning up the containers that are needed, so that consumers of the CLI project would not need to worry about the availability of the an API. Assumptions:
Edit: Adds assupmtions |
This responsibility now lives in Freshli-CLI. CycloneDX has been selected as a consistent intermediate file format. |
This design ticket was spawned from our discussion on how to implement #215 (Create Python Micro-Service for Python Resource Parsing). Writing custom code to parse some dependency files is relatively easy while other languages, like Python, it can be difficult. Languages already have the logic to parse their respective dependency files and it would be great if we could reuse that.
The design problem we need to solve is how does do custom dependency parsers get hooked into Freshli Core? How would Freshli Core, written in .NET, initiate a function in another language (Python, Rust, etc) and get the dependencies back?
Which is easier to implement and maintain? Duplicating the dependency parsing code or having mini-services/libs/containers?
The first step we decided on is to figure out the common format that Freshli needs to for dependencies. For example, the package name, version, etc. Once that is decided we can do some experiments. Some ideas we could try:
Some things to consider when running the experiments:
To sum up, currently we have two tasks:
The actual implementation of our design decisions will be implemented in another issue. This issue will be kept for design decisions.
The text was updated successfully, but these errors were encountered: