-
Notifications
You must be signed in to change notification settings - Fork 82
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
Introduce support for the Jupyter/Elyra 4. #1859
Conversation
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.
Robocop found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
Robot Results
|
${sel} = Set Variable If ${version[0].__eq__('1')} | ||
... ${JLAB1 XP ICONS['${icon}']} | ||
... ${JLAB2 XP ICONS['${icon}']} | ||
[Return] ${sel} |
Check warning
Code scanning / Robocop
'{{ statement_name }}' is deprecated since Robot Framework version {{ version }}, use '{{ alternative }}' instead Warning test
# ${version} = Get JupyterLab Page Info appVersion clear=${clear} | ||
${version} = Get JupyterLab Page Info Custom appVersion clear=${clear} # Edited | ||
${version_info} = Set Variable ${version.split(".")} | ||
[Return] ${version_info} |
Check warning
Code scanning / Robocop
'{{ statement_name }}' is deprecated since Robot Framework version {{ version }}, use '{{ alternative }}' instead Warning test
${sel} = Set Variable If ${version[0].__eq__('1')} | ||
... ${JLAB1 CSS ICONS['${icon}']} | ||
... ${JLAB2 CSS ICONS['${icon}']} | ||
[Return] ${sel} |
Check warning
Code scanning / Robocop
'{{ statement_name }}' is deprecated since Robot Framework version {{ version }}, use '{{ alternative }}' instead Warning test
Add And Run JupyterLab Code Cell 5 In Active Notebook @{code} n=${n} | ||
END | ||
|
||
Add And Run JupyterLab Code Cell 5 In Active Notebook |
Check warning
Code scanning / Robocop
Keyword '{{ keyword_name }}' has too many keywords inside ({{ keyword_count }}/{{ max_allowed_count }}) Warning test
${nb} = Get WebElement xpath://div${JLAB XP NB FRAG}\[${n}] | ||
# ${run btn} = Get WebElement Relative To ${nb} xpath:div${JLAB XP NB TOOLBAR FRAG}//${run icon} | ||
${run btn} = Get WebElement Relative To ${nb} | ||
... xpath://*[@aria-label="notebook actions"]//*[contains(@class, "jp-CommandToolbarButton") and .//${run icon}] # Edited |
Check warning
Code scanning / Robocop
Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test
Run Keyword If ${clear} or not ${pageInfo.__len__()} Update JupyterLab PageInfo Cache Custom # Edited | ||
${pageInfo} = Set Variable ${JLAB PAGEINFO CACHE} | ||
${result} = Set Variable If ${key.__len__()} ${pageInfo.get("${key}")} ${pageInfo} | ||
[Return] ${result} |
Check warning
Code scanning / Robocop
'{{ statement_name }}' is deprecated since Robot Framework version {{ version }}, use '{{ alternative }}' instead Warning test
# ${txt} = JupyterLibrary.Get Element Attribute ${sel} innerHTML | ||
${txt} = Get Element Attribute ${sel} innerHTML # Edited - our fix | ||
${pageInfo} = JSON.Loads ${txt} | ||
Set Suite Variable ${JLAB PAGEINFO CACHE} ${pageInfo} children=${True} |
Check notice
Code scanning / Robocop
{{ set_variable_keyword }} can be replaced with VAR Note test
6a34bed
to
47daa9b
Compare
These changes are required to support the Jupyter/Elyra 4.x IDE version bump which is expected in the OOTB Workbench images 2024.2+. All changes are done so that the backward compatibility with the current Jupyter/Elyra 3.x version is preserved. Note: since the 'default' version of the workbench images still points to 2024a with Jupyter 3, the line with the global env variable update to work with Jupyter 4 is commented out now with a TODO comment. Also, the reason why we are adding some code from the JupyterLibrary is that we're trying to use SeleniumLibrary for the browser opening. This doesn't match with some part of the code of the JupyterLibrary where it is expected that some keywords that are present in both (SeleniumLibrary and JupyterLibrary) are used from the JupyterLibrary. Since to narrow down this discrepancy (using JupyterLibrary explicitly and completely for the JupyterHub testing) would require more changes, I did it via this ughly hack now having part of the source from the JupyterLibrary directly in our codebase. Truth is that JupyterLibrary project seems to be abandonded so we may also think about fork it and handle it by ourselves in case we'll need more changes there.
|
# For Jupyter 4, we need to update global default variable values (images 2024b and newer) | ||
# This calls method from JupyterLibrary Version.resource module | ||
# TODO - shall be uncommented once the 2024b images will land into the product | ||
# IF "${version}"=="default" Update Globals For JupyterLab 4 |
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.
If the workbench pod is already running and you want to know the jupyterlab version you could use keyword Run Command In Container
and run this command oc exec -n ${namespace} ${pod_name} -- jupyter --version | grep jupyterlab | awk '{print $3}'
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.
Thank you Jorge. That is correct. I was a bit lazy to do it that way. I presume that having the check for default
value should be sufficient for now and eventually won't be needed once we move further with another upgrade in 6 months. 🙂
These changes are required to support the Jupyter/Elyra 4.x IDE version
bump which is expected in the OOTB Workbench images 2024.2+. All changes
are done so that the backward compatibility with the current
Jupyter/Elyra 3.x version is preserved.
Note: since the 'default' version of the workbench images still points
to 2024a with Jupyter 3, the line with the global env variable update to
work with Jupyter 4 is commented out now with a TODO comment.
Also, the reason why we are adding some code from the JupyterLibrary is
that we're trying to use SeleniumLibrary for the browser opening. This
doesn't match with some part of the code of the JupyterLibrary where it
is expected that some keywords that are present in both (SeleniumLibrary
and JupyterLibrary) are used from the JupyterLibrary. Since to narrow
down this discrepancy (using JupyterLibrary explicitly and completely
for the JupyterHub testing) would require more changes, I did it via
this ughly hack now having part of the source from the JupyterLibrary
directly in our codebase.
Truth is that JupyterLibrary project seems to be abandonded so we may
also think about fork it and handle it by ourselves in case we'll need
more changes there.
Tested locally so far, Jenkins env is WIP but feel free to overview if you are interested.
CI:
/job/devops/job/rhoai-test-flow/501
- run against 2024a - only 1 failed test due to the expected Jupyter 4 - but the image isn't there yet, updated and that one test re-run in 502 ✅ other failed tests are probably unrelated to changes in this PR/job/devops/job/rhoai-test-flow/503/
✅ no regression by these changes seem to be introduced