スキップしてコンテンツを表示

SageMaker Studio > Code Editor or Jupyter Notebook > running scheduled scripts

0

In SageMaker Studio, you have to 'run' the Code Editor for it to open. I'm wondering if code that is set to run automatically can still execute even if the Code Editor hasn't been manually opened.

Specifically, I’d like to schedule a script (e.g., for web crawling) to run automatically at certain times within the Code Editor. Is this possible?

質問済み 1年前205ビュー

1回答
0

Yes, you can schedule scripts to run automatically in SageMaker without having to manually open the Code Editor or Jupyter Notebook. This is possible through SageMaker notebook jobs.

SageMaker notebook jobs allow you to create non-interactive jobs that run either on demand or on a schedule. When you set up a notebook job, SageMaker takes a snapshot of your entire notebook, packages its dependencies in a container, builds the necessary infrastructure, runs the notebook as an automated job based on your schedule, and then deprovisions the infrastructure when the job completes.

You have several options to schedule your notebook jobs:

  1. Using the Notebook Jobs widget directly from JupyterLab with an intuitive user interface
  2. Using the SageMaker Python SDK

For your web crawling use case, you could create a notebook containing your web crawling code and schedule it to run at specific times. The notebook will execute automatically according to your schedule without requiring you to manually open the Code Editor.

You can schedule a job in different ways:

  • For a one-time future run at a specific date and time
  • For recurring runs using cron expressions (e.g., running at 10:15am UTC on the last Friday of each month)

After setting up your scheduled notebook job, you can monitor its execution through the SageMaker Notebook Jobs dashboard in the Studio UI.
Sources
ML Compute Instance with Jupyter Notebook - Amazon SageMaker Studio Notebooks - AWS
Machine Learning Service – Amazon SageMaker Studio Notebooks – AWS
Create notebook job with SageMaker AI Python SDK example - Amazon SageMaker AI
Schedule your ML workflows - Amazon SageMaker AI

回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

関連するコンテンツ