-
Notifications
You must be signed in to change notification settings - Fork 0
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
Improving get_metadata()
#9
Comments
Yes, it has for me. I would rather try to put all from metadata in pyproject.toml using different sections such However I suppose is a matter of taste?
I know by the template it should match at the creation of the project, but if a user changes something, they should find out that they have to do it at both places. If I understand correclty it should be enough to parse yaml -> dict and then return with Two steps to keep in mind:
|
Two possibilities:
Yes.
Not sure of what you mean by available models. Can you point me to an example in code? |
Sure, I will also add a bit more of context. Returns a field "models_remote" and "models_local" with the values that the inference can accept: |
I see. Is this method capable of detecting a newly avaialable model, created after deepaas was launched? |
Yes, that is the thing, it is possible to do it without restart.
For example the method |
btw, I see we have now |
I have been working on this, the main inconvenient I have found when using "ai4-metadata.yaml" is the installation and testing via Do you have any suggestion to bypass this? I only see 3 "correct" options:
The last one, defines a script which extends the installation egg_info metadata. Also, this is again product of the issue of using half way for installation. Sometimes we treat the modules as installable, and other times not. |
We are in the process of migrating from JSON to YAML. When Dashboard is ready to only show YAML, we can remove JSON from the template.
Not possible. PAPI needs to know where the metadata file is located. And PAPI only knows module repo url, not the package name. In addition, aesthetically, I don't find it very nice to have the metadata together with the code.
But then this would mean having the metadata duplicated right? Having the same information both in the TOML and the YAML. This can lead to inconsistencies, because people update the YAML, not the TOML.
Well, this does not look too bad, it is our usecase right? The main issue I see is that the metadata would freeze to their values at the time of the installation right? Correct me if I'm wrong. That's why I was initially saying to dynamically load the YAML in
Well the issue says it's on the roadmap. Given this and the fact the the issue is not super-urgent, maybe we can leave this on hold until DEEPaaS improves. However, I would prefer to solve this issue now because I don't know when Álvaro will have time to keep working on DEEPaaS 3.0. So if we can solve it without relying on DEEPaaS, that's better. |
What about the folloing till v3.0? Ignore the metadata comming from package ( The reason whay I do not recommend to use the "installation path" is because we will have same problem with |
Sound fine to me! |
ok, I will prepare a PR for this |
Some fields are redundant: {
"id": "temp2",
"name": "temp2",
"links": {
"ai4_template": "ai4-template/2.1.5",
"source_code": "https://github.com/ai4os-hub/temp2",
"docker_image": "ai4oshub/temp2"
},
"Metadata-Version": "2.1",
"Name": "temp2",
"Version": "0.0.1",
"Summary": "Some temp project",
"Author-email": "Borja <[email protected]>",
"License": "MIT",
"Project-URL": "Homepage, https://github.com/ai4os-hub/temp2",
"Classifier": "Intended Audience :: Information Technology",
"Requires-Python": ">=3.8",
"Description-Content-Type": "text/markdown",
"License-File": "LICENSE",
"Requires-Dist": "webargs ~=5.5.3",
"Description": "# temp2\n[![Build Status](https://jenkins.services.ai4os.eu/buildStatus/icon?job=AI4OS-hub/temp2/main)](https://jenkins.services.ai4os.eu/job/AI4OS-hub/job/temp2/job/main/)\n\nSome temp project\n\nTo launch it, first install the package then run [deepaas](https://github.com/ai4os/DEEPaaS):\n```bash\ngit clone https://github.com/ai4os-hub/temp2\ncd temp2\npip install -e .\ndeepaas-run --listen-ip 0.0.0.0\n```\n\n## Project structure\n```\n│\n├── Dockerfile <- Describes main steps on integration of DEEPaaS API and\n│ temp2 application in one Docker image\n│\n├── Jenkinsfile <- Describes basic Jenkins CI/CD pipeline (see .sqa/)\n│\n├── LICENSE <- License file\n│\n├── README.md <- The top-level README for developers using this project.\n│\n├── VERSION <- temp2 version file\n│\n├── .sqa/ <- CI/CD configuration files\n│\n├── temp2 <- Source code for use in this project.\n│ │\n│ ├── __init__.py <- Makes temp2 a Python module\n│ │\n│ ├── api.py <- Main script for the integration with DEEPaaS API\n│ |\n│ ├── config.py <- Configuration file to define Constants used across temp2\n│ │\n│ └── misc.py <- Misc functions that were helpful accross projects\n│\n├── data/ <- Folder to store the data\n│\n├── models/ <- Folder to store models\n│ \n├── tests/ <- Scripts to perfrom code testing\n|\n├── metadata.json <- Metadata information propagated to the AI4OS Hub\n│\n├── pyproject.toml <- a configuration file used by packaging tools, so temp2\n│ can be imported or installed with `pip install -e .` \n│\n├── requirements.txt <- The requirements file for reproducing the analysis environment, i.e.\n│ contains a list of packages needed to make temp2 work\n│\n├── requirements-test.txt <- The requirements file for running code tests (see tests/ directory)\n│\n└── tox.ini <- Configuration file for the tox tool used for testing (see .sqa/)\n```\n",
"Author-emails": {
"Borja": "[email protected]"
},
"Authors": [
"Borja"
],
"metadata_version": "2.0.0",
"title": "temp2",
"summary": "Some temp project",
"description": "temp2 is an application using the DEEPaaS API.\nSome temp project",
"dates": {
"created": "2024-10-01",
"updated": "2024-10-01"
}
} |
Here is the list of fields need to rework:
I vote for 1 |
metadata "date" is giving problems but I see you are fixing it in the other PR |
@BorjaEst , @IgnacioHeredia
b) return exactly the same metadata as before, but add one more field:
|
ok, I can fix it that way. |
This would be the output, please confirm before I merge: {
"id": "temp1",
"name": "temp1",
"links": [
{
"rel": "self",
"href": "/v2/models/temp1"
}
],
"Metadata-Version": "2.1",
"Name": "temp1",
"Version": "0.0.1",
"Summary": "asdfsdf",
"Author-email": "asdf <[email protected]>",
"License": "MIT",
"Project-URL": "Homepage, https://github.com/ai4os-hub/temp1",
"Classifier": "Intended Audience :: Information Technology",
"Requires-Python": ">=3.8",
"Description-Content-Type": "text/markdown",
"License-File": "LICENSE",
"Requires-Dist": "webargs ~=5.5.3",
"Description": "# temp1\n[![Build Status](https://jenkins.services.ai4os.eu/buildStatus/icon?job=AI4OS-hub/temp1/main)](https://jenkins.services.ai4os.eu/job/AI4OS-hub/job/temp1/job/main/)\n\nasdfsdf\n\nTo launch it, first install the package then run [deepaas](https://github.com/ai4os/DEEPaaS):\n```bash\ngit clone https://github.com/ai4os-hub/temp1\ncd temp1\npip install -e .\ndeepaas-run --listen-ip 0.0.0.0\n```\n\n## Project structure\n```\n│\n├── Dockerfile <- Describes main steps on integration of DEEPaaS API and\n│ temp1 application in one Docker image\n│\n├── Jenkinsfile <- Describes basic Jenkins CI/CD pipeline (see .sqa/)\n│\n├── LICENSE <- License file\n│\n├── README.md <- The top-level README for developers using this project.\n│\n├── VERSION <- temp1 version file\n│\n├── .sqa/ <- CI/CD configuration files\n│\n├── temp1 <- Source code for use in this project.\n│ │\n│ ├── __init__.py <- Makes temp1 a Python module\n│ │\n│ ├── api.py <- Main script for the integration with DEEPaaS API\n│ |\n│ ├── config.py <- Configuration file to define Constants used across temp1\n│ │\n│ └── misc.py <- Misc functions that were helpful accross projects\n│\n├── data/ <- Folder to store the data\n│\n├── models/ <- Folder to store models\n│ \n├── tests/ <- Scripts to perfrom code testing\n|\n├── metadata.json <- Metadata information propagated to the AI4OS Hub\n│\n├── pyproject.toml <- a configuration file used by packaging tools, so temp1\n│ can be imported or installed with `pip install -e .` \n│\n├── requirements.txt <- The requirements file for reproducing the analysis environment, i.e.\n│ contains a list of packages needed to make temp1 work\n│\n├── requirements-test.txt <- The requirements file for running code tests (see tests/ directory)\n│\n└── tox.ini <- Configuration file for the tox tool used for testing (see .sqa/)\n```\n",
"Author-emails": {
"asdf": "[email protected]"
},
"Authors": [
"asdf"
],
"AI4-Metadata": {
"metadata_version": "2.0.0",
"title": "temp1",
"summary": "asdfsdf",
"description": "temp1 is an application using the DEEPaaS API.\nasdfsdf",
"dates": {
"created": "2024-10-09",
"updated": "2024-10-09"
},
"links": {
"ai4_template": "ai4-template/2.1.5",
"source_code": "https://github.com/ai4os-hub/temp1",
"docker_image": "ai4oshub/temp1"
}
}
} Note the following: "id": "temp1",
"name": "temp1",
"links": [
{
"rel": "self",
"href": "/v2/models/temp1"
}
], Are added by DEEPaaS, not by importlib, but I suppose it really does not matter as we are also modifying the authors and emails format. Some of fields are capital and other are not. |
@vykozlov I agree with your points:
That's why initially we discussed including the AI4 metadata in a separate key, just as Borja shows in the previous comment. As a dict, not as a link to Github link. Because otherwise you need internet connection to read the metadata. If the output is messy it's because our workflow can be messy and the same info can be repeated both in TOML and YAML, sometimes becoming unsynced if you change one but not the other.
Confirmed, from my side. |
❗ I am moving discussion to our internal emails ❗ maybe to be clear, I find the approach of including already existing toml|yml files messy. Think of:
The suggestion was to have "current metadata + ai4-metadata link" E.g.
but maybe even "ai4-metadata.yml" URL is a bit redundant, as just GitHub repo link should be enough |
Solved for |
@BorjaEst @vykozlov
Wouldn't it make sense to add the user metadata (
ai4-metadata.yml
) to the functionget_metadata()
in addition to the distribution metadata? To avoid breaking backward compatibility we can return them in a specific field (eg.user metadata
?)The text was updated successfully, but these errors were encountered: