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

Jupyter Lab is not installed, still test.py in FRI showing {"message":"Successfuly opened Jupyter"} #62

Open
shivangvijay opened this issue Mar 12, 2023 · 14 comments
Labels
bug Something isn't working

Comments

@shivangvijay
Copy link
Contributor

To replicate this issue:- uninstalled Jupter Lab (pip3 uninstall jupyterlab)

Now run

$ cd conore/fri

$ cd server

$ python3 main.py

and

$ cd ..

$ python3 test.py

Expected Result:- Should throw an error.

Actual Result:- showing {"message":"Successfuly opened Jupyter"}

@Rahuljagwani
Copy link
Contributor

Hello @shivangvijay
I am not able to replicate this issue. Its giving error when jupyter is uninstalled.
Below is the error log.

127.0.0.1 - - [12/Mar/2023 21:48:21] "POST /openJupyter HTTP/1.1" 308 -
[2023-03-12 21:48:21,501] ERROR in app: Exception on /openJupyter/ [POST]
Traceback (most recent call last):
File "/home/rahuljagwani/.local/lib/python3.10/site-packages/flask/app.py", line 2528, in wsgi_app
response = self.full_dispatch_request()
File "/home/rahuljagwani/.local/lib/python3.10/site-packages/flask/app.py", line 1825, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/rahuljagwani/.local/lib/python3.10/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/rahuljagwani/.local/lib/python3.10/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/home/rahuljagwani/.local/lib/python3.10/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/home/rahuljagwani/concore-main/fri/server/main.py", line 218, in openJupyter
proc = subprocess.Popen(['jupyter', 'lab'], shell=False, stdout=subprocess.PIPE, cwd=concore_path)
File "/usr/lib/python3.10/subprocess.py", line 969, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)

@shivangvijay
Copy link
Contributor Author

Hello @Rahuljagwani, Which OS are you using?

@Rahuljagwani
Copy link
Contributor

Hello @Rahuljagwani, Which OS are you using?

Ubuntu

@shivangvijay
Copy link
Contributor Author

I am getting below prints:-
In Python3 main.py
Screenshot from 2023-03-12 02-53-05

In Python3 test.py
Screenshot from 2023-03-12 10-04-55

My OS is Ubuntu 18.

@Rahuljagwani
Copy link
Contributor

I guess this is relevant issue. Even though I am getting error, I believe it is related to something else as you can see I am getting success code 308 in first line of my log.

127.0.0.1 - - [12/Mar/2023 21:48:21] "POST /openJupyter HTTP/1.1" 308 -

@pradeeban
Copy link
Member

We have not tested the JupyterLab integration adequately. No wonder if it has some bugs.

@pradeeban pradeeban added the bug Something isn't working label Mar 15, 2023
@shivangvijay
Copy link
Contributor Author

shivangvijay commented Mar 29, 2023

I spend lot of time to resolve this issue but didn't able to crack perfect solution with suprocess.
There is one way to raise uninstall error code through subprocess:-

     try:
        proc = subprocess.run("jupyter lab", shell=True, check=True, capture_output=True)
    except subprocess.CalledProcessError as e:
        print(e)

In documentation of subprocess.run, they mentioned "If check is True and the exit code was non-zero, it raises a
CalledProcessError. The CalledProcessError object will have the return code
in the returncode attribute, and output & stderr attributes if those streams
were captured." So check=True helps us.

But there is one issue with this code, when jupyter lab is install, the code (subprocess.run) wait to finish the process but it not happen, so no response goes to test.py.

Same we can do with subprocess.popen using communicate function. I explored other subprocess.check_call etc... nothing helping me.

@shivangvijay
Copy link
Contributor Author

I found one more issue:-
I commented all the functions other than jupyter notebook.

Screenshot from 2023-03-29 15-34-55

then run the main.py and test.py

In main.py terminal I am getting two times success code.

127.0.0.1 - - [29/Mar/2023 15:33:24] "POST /openJupyter HTTP/1.1" 308 -
127.0.0.1 - - [29/Mar/2023 15:33:24] "POST /openJupyter/ HTTP/1.1" 308 -

@pradeeban
Copy link
Member

Thanks, @shivangvijay, for your findings.

I am honestly wondering whether we should get rid of Jupyter. It is just there installed. No one used it, and not properly tested.

Perhaps, proper integration and testing of Jupyter for concore (not merely installing - but using it to construct and run concore programs effectively, somewhat replacing the concore-editor's program editor) can be a GSoC 2024 project.

@pradeeban
Copy link
Member

Created a separate issue to contemplate what to do with Jupyter in the long run - #66.

@Deeppjp116
Copy link

Deeppjp116 commented May 29, 2023

Hello,
I'm Deep.

I'm interested in working on this issue. Could you please explain the problem and guide me on setting up the repository on my computer? I'm eager to contribute and give my best effort to resolve this. This will be my first valuable contribution. Thank you for giving me this opportunity.

@harshal-rembhotkar
Copy link

harshal-rembhotkar commented Mar 28, 2024

hi @pradeeban , can i work on this issue ?

@pradeeban
Copy link
Member

@harshal-rembhotkar, we are not sure how to proceed with this issue (if you read the discussions above, you will find that as well).

So, it may not be the right time to work on this issue.

@harshal-rembhotkar
Copy link

Okay

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

5 participants