Coder Social home page Coder Social logo

Comments (27)

JasonWeill avatar JasonWeill commented on July 17, 2024 1

If you have multiple Jupyter Servers open with the Jupyter Scheduler server extension running, that might be related to the behavior you're seeing. If you keep only one such server running, does that fix the problem?

(This may be an enhancement opportunity to run jobs only once, even if multiple servers are running.)

from jupyter-scheduler.

welcome avatar welcome commented on July 17, 2024

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

from jupyter-scheduler.

TallGibbs avatar TallGibbs commented on July 17, 2024

This job ran from its daily schedule and now I received 4 emails and it appears the job executed 4 times today (1 more time than yesterday). Is this going to continue to increase each day by 1?

Here you can see the notebook jobs completed:
image

Here is the current scheduled job:
image

from jupyter-scheduler.

andrii-i avatar andrii-i commented on July 17, 2024

Hi @TallGibbs. Thank you for opening this issue and proactively providing jupyter troubleshoot output, this is very helpful.

Could you please send a screenshot of "Run on a schedule" section of the Create Job screen for the job that this happened/happening with? For the sake of reproduction I'd like to understand if you define the schedule via Interval > Day or Interval > Custom schedule > cron expression option.

Screenshot 2024-01-25 at 11 18 26 AM

from jupyter-scheduler.

TallGibbs avatar TallGibbs commented on July 17, 2024

Here you go!

Creating the schedule:
image

Final output of the scheduled job from the "Job Definition" page:
image

from jupyter-scheduler.

andrii-i avatar andrii-i commented on July 17, 2024

Thank you for the details @TallGibbs. I was not able to reproduce this through clock manipulation, trying to reproduce "organically" by waiting 12 PM.

from jupyter-scheduler.

TallGibbs avatar TallGibbs commented on July 17, 2024

@andrii-i Today the job completed two times. However, yesterday afternoon I re-installed jupyter notebook version 6.5.4 through Anaconda Navigator GUI, then updated (back) to 7.0.6 and then deleted all my jobs in Jupyter lab. Then I scheduled this job again and now it resulted in the job running twice:

image

Here is my scheduled jobs:
image

from jupyter-scheduler.

TallGibbs avatar TallGibbs commented on July 17, 2024

I'm not going to touch anything today on the job scheduler and see what happens on Saturday, Sunday and Monday. It should NOT run on the weekend and then should run again on Monday.

from jupyter-scheduler.

JasonWeill avatar JasonWeill commented on July 17, 2024

I set up a daily job run on my Windows 10 machine that has run exactly once per day, every day, since I first configured it.

If you run jupyter server list on a command prompt in your same Conda environment, how many entries do you see under "Currently running servers"? If you have multiple Jupyter Server instances running, that might be related to this.

from jupyter-scheduler.

TallGibbs avatar TallGibbs commented on July 17, 2024

Here is the update for today: on Saturday and Sunday the job did NOT run (which is a good thing; only scheduled Mon through Fri). Today though (Monday), the job ran 3 times which is once more than what happened on Friday.

Somehow the scheduler is running the job once more each time? Is there any way that my code can be causing this? I'm assuming NO because I see on Jupyter Lab's "Notebook jobs" tab indicating the whole job ran (and not that my code just looped through it).

Here is the job's result from today:
image

from jupyter-scheduler.

TallGibbs avatar TallGibbs commented on July 17, 2024

I'm going to leave everything the same for tomorrow and see if it run 4 times. Then, I'm going to make a new schedule that is NOT at 12:00 PM and see if that is related to the issue. @andrii-i

from jupyter-scheduler.

JasonWeill avatar JasonWeill commented on July 17, 2024

Thanks! For what it's worth, my schedule was at 8:00 am, and the run time typically started within 10 seconds of the hour.

from jupyter-scheduler.

TallGibbs avatar TallGibbs commented on July 17, 2024

I set up a daily job run on my Windows 10 machine that has run exactly once per day, every day, since I first configured it.

If you run jupyter server list on a command prompt in your same Conda environment, how many entries do you see under "Currently running servers"? If you have multiple Jupyter Server instances running, that might be related to this.

I just ran that code on my activated environment and I see 5 servers running (I'm not sure if it is safe to post screenshot of full server addresses). It may be confusing though because I also currently have Jupyter Notebook open with some code I am working on, while also running Jupyter Lab.

I'm guessing a better test it to close everything down, then open just an Anaconda Prompt and run that code (after activating my environment)?

from jupyter-scheduler.

TallGibbs avatar TallGibbs commented on July 17, 2024

If you have multiple Jupyter Servers open with the Jupyter Scheduler server extension running, that might be related to the behavior you're seeing. If you keep only one such server running, does that fix the problem?

(This may be an enhancement opportunity to run jobs only once, even if multiple servers are running.)

What do you think is most valuable for testing/documentation purposes? I see 3 options I could do right now.

Option 1 = Do nothing, and see if script runs 1 additional time tomorrow at noon.
Option 2 = Close all jupyter servers, then proceed with essentially option 1 (let scheduled job run at Noon).
Option 3 = Close all jupyter servers, make a new scheduled job that runs today at 3:00 PM and see what happens

from jupyter-scheduler.

andrii-i avatar andrii-i commented on July 17, 2024

@TallGibbs please try option 2. Please make sure you have only 1 instance of the jupyter server with jupyter_scheduler extension installed running and see if the duplication goes away. I would expect this to solve the problem. I tried the same schedule on windows with 1 instance of the jupyter server running and every job is created only once:
no_duplicates

from jupyter-scheduler.

TallGibbs avatar TallGibbs commented on July 17, 2024

@andrii-i Ok, I physically closed all open tabs with anything Jupyter related and then opened an Anaconda Prompt and ran the command: jupyter server list

Here are the results from that:
image

It appears there are 3 servers still running even though I do not physically have any open browsers related to Jupyter. So, to try and shut them down I ran this command: jupyter notebook stop 8888

image

I get the response "Could not stop server on 8888" within my Anaconda Prompt. Same response for all 3 servers when I try the different ports. It makes me think there is some conflicts between my currently installed Anaconda prompt and previous versions? I had to uninstall and reinstall several times in the past few weeks due to some package conflicts.

from jupyter-scheduler.

TallGibbs avatar TallGibbs commented on July 17, 2024

@andrii-i sorry for the additional post: it looks like I had to completely close Anaconda Navigator and now I show 0 servers running.

image

from jupyter-scheduler.

TallGibbs avatar TallGibbs commented on July 17, 2024

Today's update: with all the servers shutdown the scheduled job did not run at all. Is that the expected response? Is there a way to execute a scheduled job without a server running?

Now that we verified no job ran, with no servers running, I'm going to schedule the file to run this afternoon and see what happens.

from jupyter-scheduler.

TallGibbs avatar TallGibbs commented on July 17, 2024

Looks good today, job ran successfully and only ran 1 time. Now, I will leave it untouched through tomorrow's scheduled job and verify it still only runs once.

image

from jupyter-scheduler.

andrii-i avatar andrii-i commented on July 17, 2024

@TallGibbs thank you for testing and confirming that there is no duplication when single server is running.

Today's update: with all the servers shutdown the scheduled job did not run at all. Is that the expected response? Is there a way to execute a scheduled job without a server running?

It is an expected response. Jupyter Scheduler is composed of jupyter_scheduler server extension and @jupyterlab/scheduler lab extension. jupyter_scheduler server extension owns and manages job execution. So with no instances of server running there would be no jobs created, with multiple instances of the server running there would be multiple jobs created.

Looks good today, job ran successfully and only ran 1 time. Now, I will leave it untouched through tomorrow's scheduled job and verify it still only runs once.

Sounds good. Please let us know if problem goes away.

from jupyter-scheduler.

dlqqq avatar dlqqq commented on July 17, 2024

It seems like your issue has been resolved, so I'll close this for now. Feel free to continue discussion if needed however! 👋

from jupyter-scheduler.

TallGibbs avatar TallGibbs commented on July 17, 2024

Thank you everyone for all the help.

I'm not sure this is directly the right place for this question, but thought I would ask anyways even if just for a redirect: is there a way for me to have a jupyter server session running without Anaconda Navigator open? We are trying to find a replacement for Alteryx Server running scheduled jobs (at my company) and I'm hoping I can find a way with Jupyter where a schedule job can run even when my work computer is shutdown. I'm not an expert in computer networks/servers (clearly), so I am kind of figuring this out as I go...

from jupyter-scheduler.

JasonWeill avatar JasonWeill commented on July 17, 2024

I run JupyterLab by running jupyter lab from an Anaconda-enabled command prompt, and I haven't run Anaconda Navigator at all. You'll need to have a server running all the time, ideally something running in a data center or in a hosted environment (disclosure: I work for AWS), that stays up so that jobs get rerun.

from jupyter-scheduler.

TallGibbs avatar TallGibbs commented on July 17, 2024

@JasonWeill awesome info, thank you that is helpful and gives me some ideas.

from jupyter-scheduler.

TallGibbs avatar TallGibbs commented on July 17, 2024

Another follow-up closely related to this issue. Is this normal that using the command "jupyter server stop 8888" gives back the response "Could not stop server on 8888" but then when you run "jupyter server list" the server on port 8888 no longer shows running? Seems like a flaw in the code when it tells me "could not stop server on 8888."

Here is my screenshot of this exact sequence:
image

from jupyter-scheduler.

JasonWeill avatar JasonWeill commented on July 17, 2024

Jupyter Server has a separate issue queue: https://github.com/jupyter-server/jupyter_server/issues

from jupyter-scheduler.

andrii-i avatar andrii-i commented on July 17, 2024

@TallGibbs below are some good places to ask questions if you don't want to create an issue:

from jupyter-scheduler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.