AWS | How To Automate Jupyter Notebooks

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ก.ย. 2024

ความคิดเห็น • 66

  • @ProgrammerError
    @ProgrammerError  3 ปีที่แล้ว

    Did you run into any bugs? Feel free to drop a comment below if you have any questions!

    • @psalmist2226
      @psalmist2226 3 ปีที่แล้ว +2

      Thanks for the video. i follow the steps and ran into this error( "errorMessage": "module 'botocore.vendored.requests' has no attribute 'Session'",) please kindly look into it and help with a fix.

    • @ProgrammerError
      @ProgrammerError  2 ปีที่แล้ว

      @@psalmist2226 At which step did you get this error? Doesn't seem to be an issue with jupyter themes.

    • @abhilashop5530
      @abhilashop5530 2 ปีที่แล้ว +1

      Handshake status 500 Internal Server Error while trying to create connection. Terminal is getting started & then this error is coming in the lambda. Please help..

    • @nancyandrew9755
      @nancyandrew9755 2 ปีที่แล้ว

      Thanks for the video. I implemented the same solution and it was working fine, but from last few days I get error WebSocketBadStatusException: Handshake status 500 from Lambda. Could you please guide me if there are any solutions to automate the sagemaker notebook instance (I have also tried life cycle configuration but that's not the suitable solution in my case) . Thanks

    • @ProgrammerError
      @ProgrammerError  2 ปีที่แล้ว

      @@nancyandrew9755 Sorry Nancy, I've not run into this issue before so can't really give much specific advice. Are there more details in the error message?

  • @sambaker2611
    @sambaker2611 9 หลายเดือนก่อน +2

    Hi - fantastic tutorial thanks for uploading! Quick question - is there anyway to pass environment variables to the notebook. My notebook is a sagemaker processing job and I would like to dynamically pass an s3 location to the notebook as this s3 location will be where the raw data is stored. Is it possible to pass this in the post request to the API gateway and then pass it into the notebook? Thanks in advance :)

  • @iamtopey
    @iamtopey 3 ปีที่แล้ว

    Great video!

  • @arshan8292
    @arshan8292 2 ปีที่แล้ว

    Everything works for me EXCEPT: I don't know if others have noticed this but when executing in the Jupyter notebook when it runs a block of many code lines, it doesn't execute? If your first code line is print('This works') it will execute that perfectly, but if you have import over 10 - 20 lines different packages, it doesn't execute it at all - why does it do that?

    • @ProgrammerError
      @ProgrammerError  2 ปีที่แล้ว

      Do all imports not get executed, or is it only specific ones? Maybe you could try inserting print statements between the import statements?

  • @whit3b3ard
    @whit3b3ard ปีที่แล้ว

    any idea how many notebook instances can run concurrently on aws?

  • @prekshashah8656
    @prekshashah8656 2 ปีที่แล้ว

    Thanks for the video. Have you tried doing this with sagemaker studio?

    • @ProgrammerError
      @ProgrammerError  2 ปีที่แล้ว

      Nope, unfortunately. I believe it should be similar though?

  • @sebtaciak
    @sebtaciak 2 ปีที่แล้ว

    thx for the video! I would like to create a trigger that runs notebook every morning (at specified time) could you do a video on how to modify your example to do that?

    • @ProgrammerError
      @ProgrammerError  2 ปีที่แล้ว

      Hi sebtac, will definitely take note of this and make a video if I can. But from a quick search, maybe one of the solutions here might be a good place to start: filipstollar.medium.com/how-to-schedule-a-jupyter-notebook-to-run-every-day-week-or-month-ae3f992f3afc

  • @amitarora8215
    @amitarora8215 ปีที่แล้ว

    Thanks for Sharing,
    I have 1 question, If my notebook takes 20-30 minutes to complete processing, will it fine to call it directly from lambda function?

    • @anitdude
      @anitdude ปีที่แล้ว

      Hi Amit, did you by anychance get error code 200 handshakeerror? I am getting that and not able to fix it.

  • @joaoluismontenengro1033
    @joaoluismontenengro1033 2 ปีที่แล้ว +1

    Thank you for sharing! I am receiving a Handshake error (Handshake status 500 Internal Server Error), do you have any idea about this? Thanks again

    • @611heming
      @611heming 2 ปีที่แล้ว +1

      having the same issue here.

    • @sinaamininiaki3995
      @sinaamininiaki3995 2 ปีที่แล้ว +1

      Having the same issue. Any solution?

    • @ProgrammerError
      @ProgrammerError  2 ปีที่แล้ว

      Hi Joao! Can you provide more details on the error? I've not run into that before, but will try and help if I think of something.

    • @CuriouslyWatching
      @CuriouslyWatching 2 ปีที่แล้ว +3

      Hi, I know this response is late, but for anybody facing this issue in the future. The Handshake error is caused by websocket.create_connection. Replace that part of the code with this instead . As you can see, he was using the botocore.vendored import requests but this was removed from botocore by AWS. Instead you use import requests instead
      ws = websocket.create_connection(
      "wss://{}/terminals/websocket/5".format(http_hn),
      cookie=cookies,
      host=http_hn,
      origin=http_proto + "//" + http_hn,
      header = [
      "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"
      ]
      )
      Be careful with the indentation (TH-cam messed the order). Much love to everyone

    • @djibrilniane6899
      @djibrilniane6899 2 ปีที่แล้ว

      @@CuriouslyWatching Hello, i was able to fix the problem with this solution, thank you. Now, my Lambda Function is working fine without any error but the notebook isn't running. Do you have any idea ?

  • @datexland
    @datexland 2 ปีที่แล้ว

    Thanks for sharing! , I've got a question, How can I execute several Jupiter notebooks automatically into an EMR cluster (Not transient ) daily? I need to reduce execution time, for this reason, aws glue is not my ideal option.

    • @ProgrammerError
      @ProgrammerError  2 ปีที่แล้ว

      I've not done something like before, but I've heard of tools such as nbconvert and Papermill (papermill.readthedocs.io/en/latest/). Maybe there's a way to integrate such tools into your workflow?

  • @aiknowledge8855
    @aiknowledge8855 2 ปีที่แล้ว +1

    Not able to use one of the OpenCV command cv2.imshow to view the video in was Aws juypter notebook. It shows error kernel dead please restart the kernal. Please help.

    • @ProgrammerError
      @ProgrammerError  2 ปีที่แล้ว +1

      I've not tried using cv2 in AWS jupyter notebook, but perhaps you can try opening a terminal instance and checking if the package is installed? For example, you could open up the Python interpreter in the directory you want and try running the same command as what you have in your notebook to see if it works.
      Let me know if this helps!

    • @aiknowledge8855
      @aiknowledge8855 2 ปีที่แล้ว

      @@ProgrammerError other command of this cv2 is running. As this line cv2.imshow create a new window in which the output is shown doesn't works on the AWS juypter notebook

    • @ProgrammerError
      @ProgrammerError  2 ปีที่แล้ว +1

      @@aiknowledge8855 Maybe you could check that you have installed all the required libraries correctly. Not sure what else could be the issue

    • @aiknowledge8855
      @aiknowledge8855 2 ปีที่แล้ว

      @@ProgrammerError Thanks friend for the help. I just had a call with the AWS support team they said it doesn't allow a new window to pop up. So cv2.imshow won't work on AWS Juypter notebook.

    • @ProgrammerError
      @ProgrammerError  2 ปีที่แล้ว +1

      @@aiknowledge8855 Ah I see. Maybe there’s a way to save the image to a file so you can view it later? Sorry I’m not too familiar with OpenCV

  • @harsiddhitamboli
    @harsiddhitamboli 2 ปีที่แล้ว

    Hi... Thanks for the video. I have 2 questions, one is requests package is not available via vendor anymore so I installed it separately and then tried running but the get method was throwing error. Second because of this I am not able to get the cookie for the url and hence not passing that to websocket connection and then websocket connection throws an error saying https scheme is invalid. Any inputs?

    • @ProgrammerError
      @ProgrammerError  2 ปีที่แล้ว

      Hi Harsiddhi, let's try fixing the first issue first. Are you importing Python's requests or the requests from botocore.vendored?

  • @orikane1
    @orikane1 ปีที่แล้ว

    Hi, I am getting "errorMessage": "Handshake status 200 OK",
    "errorType": "WebSocketBadStatusException" regarding the "websocket.create_connection()" call. This was working for me a week ago, made no changes to the code, and am now stuck getting this error.

    • @ProgrammerError
      @ProgrammerError  ปีที่แล้ว

      Hi Orkan, that's strange that the error is coming up all of a sudden. Perhaps something might have changed on AWS?

  • @joaquincastanon8704
    @joaquincastanon8704 2 ปีที่แล้ว

    well, i try this solution, but I got this error: 'Handshake status 500 Internal Server Error" when I tested

    • @ProgrammerError
      @ProgrammerError  2 ปีที่แล้ว

      Hi Joaquin, do you have an idea which step might be causing this?

    • @ashishkamboj1274
      @ashishkamboj1274 2 ปีที่แล้ว

      @@ProgrammerError Getting while calling the websocket.create_connection function
      but when we change wss: to ws: then the timeout error came

  • @csoham96
    @csoham96 2 ปีที่แล้ว

    I am getting an error that 500 internal error I dont know what to do I just followed whatever you told

    • @ProgrammerError
      @ProgrammerError  2 ปีที่แล้ว

      Which step are you getting this? Are you getting any other information about the error?

    • @csoham96
      @csoham96 2 ปีที่แล้ว

      @@ProgrammerError this WebSocket client method is obsolete I had a chat with one of the AWS guys as you cant directly push into url

    • @raghavgurbaxani1251
      @raghavgurbaxani1251 2 ปีที่แล้ว

      @@csoham96 how did you resolve this error ? any tips from the AWS folks ?

    • @csoham96
      @csoham96 2 ปีที่แล้ว

      @@raghavgurbaxani1251 yes go into cloud watch logs and you can see the error logs in the folder of your lambda functions name.
      Also this method is depreciated its better to use an ec2 instance and upload your files in that instance and run the scheduler through crontab

    • @打直走的螃蟹
      @打直走的螃蟹 2 ปีที่แล้ว

      @@csoham96 Hi, may i know more details about it? like use ec2 to upload the zip file into what instance?

  • @ARBazroon
    @ARBazroon ปีที่แล้ว

    This video need an update.

    • @ProgrammerError
      @ProgrammerError  ปีที่แล้ว

      Hi, which part are you having an issue with?

    • @ARBazroon
      @ARBazroon ปีที่แล้ว

      Ws = websocket.createconnection()
      WebSocketBadStatusException: Handshake status 200 OK
      I believe because AWS dropped support for Python 3.6

    • @ProgrammerError
      @ProgrammerError  ปีที่แล้ว +1

      @@ARBazroon I see, thank you for sharing!

  • @smartemitra7594
    @smartemitra7594 2 ปีที่แล้ว

    hi sir i am getting this error:
    errorMessage": "module 'botocore.vendored.requests' has no attribute 'Session
    any idea how to solve this error

    • @ashishkamboj1274
      @ashishkamboj1274 2 ปีที่แล้ว

      import requests instead of botocore.vendored.requests

    • @ProgrammerError
      @ProgrammerError  2 ปีที่แล้ว

      Thank Ashish! @SMART EMITRA You can try `import requests` instead as suggested by Ashish.

    • @ashishkamboj1274
      @ashishkamboj1274 2 ปีที่แล้ว

      @@ProgrammerError Actually botocore.vendored.request works fine with Python3.6