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

Azure Fix Notebook Tester Action #87

Open
zbyosufzai opened this issue Apr 5, 2024 · 5 comments
Open

Azure Fix Notebook Tester Action #87

zbyosufzai opened this issue Apr 5, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@zbyosufzai
Copy link
Collaborator

zbyosufzai commented Apr 5, 2024

Possible issue may be due to not finding jupyter kernel

https://github.com/STRIDES/NIHCloudLabAzure/blob/main/.github/workflows/check-jupyter.yml

@zbyosufzai zbyosufzai added the bug Something isn't working label Apr 5, 2024
@furniturewalatkNIH
Copy link
Contributor

Not sure if this workflow was ever running successfully ?
Checked the very first one too ( logs no more there) and its been failing.
The last one where the logs are there so far is the run # 8 from Jan/18/2024.

@furniturewalatkNIH
Copy link
Contributor

Tried to have the ir kernel installed, but running into issues still - its not recognizing r too.

@furniturewalatkNIH
Copy link
Contributor

Whilst looking into this further, I took a step back to check if the other notebooks could be verified ( besides the one which was failing which needed IR). I saw more failures for other kernels.

Below is the list of all the different kernels needed in the various notebooks we have here so far:

find tutorials/notebooks/* -name '*.ipynb' -exec grep -A 1 '
kernel_info' {} ;
"kernel_info": {
"name": "ir"
"kernel_info": {
"name": "python310-sdkv2"
"kernel_info": {
"name": "python38-azureml"
"kernel_info": {
"name": "python38-azureml"
"kernel_info": {
"name": "python310-sdkv2"
"kernel_info": {
"name": "python310-sdkv2"
"kernel_info": {
"name": "python3"

Thus do we need to make sure these are installed too??

Do we need to re-think/design this for handling all possible kernel types?

@zbyosufzai @kyleoconnell-NIH

@furniturewalatkNIH
Copy link
Contributor

As per discussion in the meeting:

This workflow was created to validate the notebooks, as over time the required dependencies in them, may break them ( and have it unusable)

@antNIH may have used a package/option with jupyter which we can try to see if it works better in validating.

Otherwise, need to check if there is any way (option) to ignore the kernel checks. As per @zbyosufzai the kernels named/needed (ie python310-sdkv2, python38-azureml) are not 'necessarily' needed.
Most of these notebooks should just run with regular python.

There was a mention about updating the notebook code and removing references to these ( if we are sure they are not needed), but then there is concern, if the notebooks would still work the same if we remove it.

@furniturewalatkNIH
Copy link
Contributor

Thanks @zbyosufzai for the pointer to nbmake package and this writeup - https://dev.to/semaphore/how-to-test-jupyter-notebooks-with-pytest-and-nbmake-fl3

https://github.com/treebeardtech/nbmake

It looks promising : however below are my findings/issues so far -

pytest --nbmake --nbmake-kernel=python3 tutorials/notebooks /GenAI/notebooks/AzureAIStudio_index_structured_notebook.ipynb

The above execute's the notebook and all the 'source' code parts of it. The above fails due to file not found error.

FileNotFoundError Traceback (most recent call last) Cell In[3], line 5 2 import numpy as np 3 # reading the csv file using read_csv 4 # storing the data frame in variable called df ----> 5 df = pd.read_csv('ds_salaries.csv')

I did not try running any more ( aassuming they too may have run time errors) .

Next I tried to check only for import errors

pytest --nbmake --nbmake-kernel=python3 --nbmake-find-import-errors tutorials/notebooks/

This took a long time to run ( for all 10 notebooks) and came back with errors for 3 of them.

=============================================== short test summary info ================================================ FAILED tutorials/notebooks/GenAI/notebooks/AzureAIStudio_sql_chatbot.ipynb:: - ModuleNotFoundError: No module named 'pyodbc' FAILED tutorials/notebooks/GenAI/notebooks/AzureOpenAI_embeddings.ipynb:: - ModuleNotFoundError: No module named 'openai.embeddings_utils' FAILED tutorials/notebooks/SRADownload/SRA-Download.ipynb:: - ModuleNotFoundError: No module named 'pyathena' FAILED tutorials/notebooks/pangolin/pangolin_pipeline.ipynb:: - ModuleNotFoundError: No module named 'ipyrad' ================================= 4 failed, 6 passed, 4 warnings in 684.90s (0:11:24) ==================================

Are these known or do we need to fix them ?

Is it ok to just check for import errors ?

@kyleoconnell-NIH what do we exactly mean by 'dependency' issues ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants