Chris Roth
04/21/2020, 3:18 PMprha
04/21/2020, 3:19 PMcrontab -l
?Chris Roth
04/21/2020, 3:22 PM0 3 * * * /opt/dagster/dagster_home/schedules/scripts/pipeline_repository.staging_daily_esri.sh # dagster-schedule: pipeline_repository.staging_daily_esri
prha
04/21/2020, 3:23 PMstaging_daily_esri
link, you see no tick attempts?Chris Roth
04/21/2020, 3:24 PMprha
04/21/2020, 3:24 PMChris Roth
04/21/2020, 3:24 PMprha
04/21/2020, 3:25 PMChris Roth
04/21/2020, 3:25 PM/var/log/syslog
prha
04/21/2020, 3:25 PMstaging_daily_esri.sh
file exist?* * * * * date -u >> /opt/dagster/dagster_home/test_cron_log
Chris Roth
04/21/2020, 3:40 PMsashank
04/21/2020, 3:52 PMmax
04/21/2020, 4:47 PMsashank
04/21/2020, 5:05 PMChris Roth
04/21/2020, 5:07 PMsashank
04/21/2020, 5:07 PMusr/local/bin
, even pythonChris Roth
04/21/2020, 5:07 PMsashank
04/21/2020, 5:07 PMdagster-graphql
fails to runRes Dev
04/21/2020, 8:22 PMsashank
04/21/2020, 8:23 PMRes Dev
04/21/2020, 8:26 PM#!/bin/sh
# This block may be omitted if not packaging a repository with cron schedules
####################################################################################################
# see: https://unix.stackexchange.com/a/453053 - fixes inflated hard link count
touch /etc/crontab /etc/cron./
service cron start
export DAGSTER_HOME=/opt/dagster/dagster_home
# Add all schedules
dagster schedule up
# Restart previously running schedules
dagster schedule restart --restart-all-running
####################################################################################################
DAGSTER_HOME=/opt/dagster/dagster_home dagit -h 0.0.0.0 -p 3000FROM continuumio/miniconda3:latest
sashank
04/21/2020, 8:43 PMRes Dev
04/21/2020, 8:44 PMChris Roth
04/27/2020, 4:42 PMsashank
04/27/2020, 7:26 PMcrontab -e
and edit your schedule like so:* * * * * /dagter_home/schedules/scripts/my_<http://repo.my|repo.my>_pipeline.sh >> debug_file.txt 2>&1 # dagster-schedule: my_<http://repo.my|repo.my>_pipeline
truncated…
File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pipelines'
repos.py
, add this to the top:
SCRIPT_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(SCRIPT_PATH)
Chris Roth
05/18/2020, 8:53 PMdagster-graphql
is actually in /usr/local/bin/dagster-graphql
(local)ln -s /usr/local/bin/dagster-graphql /usr/bin/dagster-graphql
No module named 'repos'
{
"data": {
"startScheduledExecution": {
"__typename": "PythonError",
"cause": null,
"message": "UnboundLocalError: local variable 'execution_plan_index' referenced before assignment\n",
"stack": [
" File \"/usr/local/lib/python3.8/dist-packages/dagster_graphql/implementation/utils.py\", line 14, in _fn\n return fn(*args, **kwargs)\n",
" File \"/usr/local/lib/python3.8/dist-packages/dagster_graphql/implementation/execution/scheduled_execution.py\", line 138, in start_scheduled_execution\n raise exc\n",
" File \"/usr/local/lib/python3.8/dist-packages/dagster_graphql/implementation/execution/scheduled_execution.py\", line 123, in start_scheduled_execution\n run, result = _execute_schedule(graphene_info, external_pipeline, execution_params, errors)\n",
" File \"/usr/local/lib/python3.8/dist-packages/dagster_graphql/implementation/execution/scheduled_execution.py\", line 169, in _execute_schedule\n execution_plan_snapshot=execution_plan_index.execution_plan_snapshot,\n"
]
}
}
}
sashank
05/18/2020, 9:24 PMChris Roth
05/18/2020, 9:29 PMsashank
05/18/2020, 9:31 PM*/2 * * * * /opt/dagster/dagster_home/schedules/scripts/my_<http://repo.my|repo.my>_pipeline.sh >> ~/log.txt 2>&1 # dagster-schedule: my_<http://repo.my|repo.my>_pipeline
>> ~/log.txt 2>&1
at the endChris Roth
05/18/2020, 9:32 PMENV PYTHONPATH="$PYTHONPATH:/opt/dagster/app"
/opt/dagster/dagster_home/schedules/scripts/pipeline_repository.test_scheduler.sh
from the root home directory, but it still isn't running on its ownsashank
05/18/2020, 9:33 PMUnboundLocalError: local variable 'execution_plan_index' referenced before assignment
Chris Roth
05/18/2020, 10:40 PMscheduler.yaml
?sashank
05/18/2020, 10:41 PMChris Roth
05/18/2020, 10:41 PMsashank
05/18/2020, 10:41 PMChris Roth
05/18/2020, 10:42 PMschedule_defs
sashank
05/18/2020, 10:43 PMschedule_defs
Chris Roth
05/18/2020, 10:44 PMsashank
05/18/2020, 10:44 PMChris Roth
05/18/2020, 10:44 PMrepository:
file: repos.py
fn: pipeline_repository
scheduler:
file: repos.py
fn: define_schedules
sashank
05/18/2020, 10:46 PMChris Roth
05/18/2020, 10:46 PMrepository:
module: repos
fn: define_repo
schedule_defs=[
ScheduleDefinition(
name='staging_daily_esri',
mode='staging',
cron_schedule='0 3 * * *',
pipeline_name='esri_pipeline_all',
environment_dict={},
),
ScheduleDefinition(
name='test_scheduler',
mode='staging',
cron_schedule='* * * * *',
pipeline_name='reseed_geoserver_pipeline',
environment_dict={},
),
],
sashank
05/18/2020, 10:46 PMChris Roth
05/18/2020, 10:47 PMsashank
05/18/2020, 10:47 PMChris Roth
05/18/2020, 10:47 PMsashank
05/18/2020, 10:50 PMChris Roth
05/18/2020, 11:32 PM/opt/dagster/dagster_home/schedules/scripts/pipeline_repository.test_scheduler.sh
from the home directory - you were right that there was an environment errorsashank
05/18/2020, 11:33 PMChris Roth
05/18/2020, 11:34 PM* * * * * /opt/dagster/dagster_home/schedules/scripts/pipeline_repository.test_scheduler.sh > ~/wtf.log # dagster-schedule: pipeline_repository.test_scheduler
sashank
05/18/2020, 11:35 PMChris Roth
05/18/2020, 11:35 PMsashank
05/18/2020, 11:35 PM>> ~/log.txt 2>&1
Chris Roth
05/18/2020, 11:57 PMsashank
05/18/2020, 11:57 PMChris Roth
05/19/2020, 12:06 AMsashank
05/19/2020, 12:28 AMChris Roth
05/19/2020, 12:28 AMsashank
05/19/2020, 12:29 AMdagster schedule debug
and see if it shows you anythingChris Roth
05/19/2020, 12:29 AM