-
Notifications
You must be signed in to change notification settings - Fork 40
Generate api docs for EESSI test suite #319
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
base: main
Are you sure you want to change the base?
Conversation
@casparvl Adjusted the deploy and schedule. This is ready for test |
warning message: The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@93ea575, actions/setup-python@13ae5bb. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
Just to log for myself: to test this, one needs to
|
.github/workflows/test.yml
Outdated
uses: actions/checkout@v4 | ||
with: | ||
repository: eessi/test-suite | ||
path: src |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we just do this without path
, i.e. in the current workdir? It will still clone into a subidr test-suite
by default right? No need to nest that further inside a src
I'd think.
docs/gen_ref_pages.py
Outdated
# need to adjust to the test suite hook | ||
#root = Path(__file__).parent.parent | ||
|
||
TEST_SUITE = "src/test-suite" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, this would then just be `"test-suite"
docs/gen_ref_pages.py
Outdated
|
||
import mkdocs_gen_files | ||
|
||
# need to adjust to the test suite hook |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seem to be quite some comments that are no longer relevant in this gen_ref_pages.py
. Would be good to clean those up.
mkdocs.yml
Outdated
@@ -43,7 +43,6 @@ nav: | |||
- Set up environment: using_eessi/setting_up_environment.md | |||
- Basic commands: using_eessi/basic_commands.md | |||
- Demos: using_eessi/eessi_demos.md | |||
- EESSI in CI: using_eessi/eessi_in_ci.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this was removed here, but this has a conflict with upstream that needs to be resolved anyway. I guess that'll sort this out too.
mkdocs.yml
Outdated
default_handler: python | ||
handlers: | ||
python: | ||
paths: [src/test-suite] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could also be shortened to paths: [test-suite]
, see the above changes.
.github/workflows/deploy.yml
Outdated
uses: actions/checkout@v4 | ||
with: | ||
repository: eessi/test-suite | ||
path: src |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we just do this without path, i.e. in the current workdir? It will still clone into a subidr test-suite by default right? No need to nest that further inside a src I'd think.
.github/workflows/deploy.yml
Outdated
@@ -1,6 +1,9 @@ | |||
# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions | |||
name: deploy documentation (only on push to main branch) | |||
on: | |||
schedule: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I don't think we want this in the regular deploy.yml
. Having a cronjob that directly deploys the API docs means we have no human in the loop to check the changes to the API docs, and whether they make sense. I think the way this was implemented for the software overview in https://github.com/EESSI/docs/blob/main/.github/workflows/update_available_software.yml makes more sense for now: do a build of the docs, then create a PR based on that. It means the auto-generated docs will actually be part of this repo, i.e. the physical *.md files will be files within the EESSI/docs
repo. That'll allow us to do a check on them before they get deployed.
Long term, we might want to do this fully automatically, without human in the loop. But to start with, I think the human in the loop would be a good thing (even if someone needs to keep an eye on those PRs and merge them).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the main change I'd suggest here is to not do the API docs generation as part of the deploy.yml
, but in a way similar to how the update_available_software.yml
workflow works (i.e. copy that workflow, and adapt it to generate the API docs instead of the available software list). This workflow creates a PR to EESSI/docs
every X time (on a cronjob), which allows us to have a human in the loop to check what was generated and if that makes sense.
In the future, we could even see if the workflow could be triggered on push to the main branch of EESSI/test-suite
. It seems something like that should be possible https://medium.com/hostspaceng/triggering-workflows-in-another-repository-with-github-actions-4f581f8e0ceb but that's no priority right now.
… update_testsuite_apidocs
@@ -0,0 +1,50 @@ | |||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should be added to ´scripts/generate_eessi_test-suite_api_docs´ with a README.md
and a seperate requiremnets.txt
file to stay consistent with what we did for the software_overview page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also mentioned this on slack
Yes, but you'll need to create a subdir test-suite, then clone the test suite in there (yes, that gives you a test-suite/test-suite dir...)
Can you also add that to the README.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if we need to create a subdir with test-suite we should also add test-suite
to .gitignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I think there's some misunderstanding here. I'm not doing the same as the software overview page. I was planning to do that, but it turns out that is fundamentally impossible, because the way mkdocs autogenerates API docs is not by creating *.md
files in the source directory (i.e. docs/docs
), but by directly creating files in the site
directory. I.e. those are not (and should not be) part of the sources - they are what you get after you 'build' the docs.
So, integrating the requirements for this into the regular requirements file is completely valid: the API docs are now an integral part of the docs. As soon as you generate the documentation with an mkdocs serve
or similar command, it will create the API docs.
Can you also add that to the README.md
That's actually not a bad idea, but should probably be in the README.md
of the main docs repo.
And if we need to create a subdir with test-suite we should also add test-suite to .gitignore
We could. I wouldn't consider it super essential, since you'd only checkout the test-suite when building the docs - and all of that happens in a CI workflow anyway - but sure, if you'd build it locally and don't want to see the test-suite
if you doe git status
... why not :)
nav = mkdocs_gen_files.Nav() | ||
|
||
# Loop through all python files in test-suite/eessi | ||
for path in sorted(Path(f"{TEST_SUITE}/eessi/").rglob("*.py")): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like some logging and error reporting because I had not added the subdir test-suite and the script was just ran doing nothing. But I believe it should error out when it cannot find the test-suite subdir.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll look at that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like some logging and error reporting because I had not added the subdir test-suite and the script was just ran doing nothing. But I believe it should error out when it cannot find the test-suite subdir.
@casparvl will you still return to this comment? Or should we just merge and leave this for later?
I tried but I'm getting this error
I was running with python 3.9.21 |
My mistake it was working it is just not very intuitive how to navigate the pages right now. Because you have so many empty pages might it be possible to add urls to the empty pages to the pages that are underneat it? |
Ah yeah,
Is actually a bug we had in the test suite (incorrect docstring, because we have the |
Signed-off-by: laraPPr <lara.peeters@ugent.be>
Ok I wanted to get this one over the finish line so made the updates that I wanted.
|
@satishskamath Can you look into those missing docstrings? |
I'll also try to resolve the merge conflicts |
Will take a look into it. |
Signed-off-by: laraPPr <lara.peeters@ugent.be>
This file added for generation of docs. Refer to the following PR: EESSI/docs#319
@laraPPr Created EESSI/test-suite#271 to fix the openfoam ERRORs here. Can you merge it? |
|
||
# If something is an __init__, use the directory name as the name of the python module instead of the filename | ||
parts = list(module_path.parts) | ||
if parts[-1] == "__init__": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the OpenFOAM PATH was not created properly because of this if condition, it does not have an else.
Signed-off-by: laraPPr <lara.peeters@ugent.be>
Signed-off-by: laraPPr <lara.peeters@ugent.be>
Signed-off-by: laraPPr <lara.peeters@ugent.be>
Signed-off-by: laraPPr <lara.peeters@ugent.be>
Signed-off-by: laraPPr <lara.peeters@ugent.be>
Signed-off-by: laraPPr <lara.peeters@ugent.be>
Signed-off-by: laraPPr <lara.peeters@ugent.be>
Signed-off-by: laraPPr <lara.peeters@ugent.be>
…test-suite Signed-off-by: laraPPr <lara.peeters@ugent.be>
…ain branch Signed-off-by: laraPPr <lara.peeters@ugent.be>
@casparvl we are gonna need a new release of the test-suite but than this pr should be ready to merge |
A dependency of this PR is on EESSI/test-suite#192 as PR 192 resolves the build error for API docs