treasure-data / digdag

Workload Automation System
https://www.digdag.io/
Apache License 2.0
1.3k stars 221 forks source link

Set next runs at after 24+ hours when set non-UTC timezone #149

Closed uu59 closed 8 years ago

uu59 commented 8 years ago
$ digdag init test
$ cd test

... edit test.dig ...

$ LANG=C date
Wed Jun 29 00:30:29 JST 2016

$ cat test.dig
timezone: Asia/Tokyo

schedule:
  daily>: 03:00:00

_export:
  hello: "Hello, world!"

+step1:
  sh>: tasks/shell_sample.sh

+step2:
  _parallel: true

  +worker1:
    sh>: tasks/repeat_hello.sh

  +worker2:
    sh>: tasks/repeat_hello.sh

+step3:
  # defined at tasks/__init__.py
  py>: tasks.MyWorkflow.step3

$ digdag push sched -c /dev/null 
2016-06-29 00:32:14 +0900: Digdag v0.8.2
Creating .digdag/tmp/archive-3637571230657586954.tar.gz...
  Archiving test.dig
  Archiving tasks/__init__.py
  Archiving tasks/repeat_hello.sh
  Archiving tasks/shell_sample.sh
Workflows:
  test

Uploaded:
  id: 1
  name: sched
  revision: b27d99c4-1984-4d06-9f31-9c8cc86c5760
  archive type: db
  project created at: 2016-06-28T15:32:15Z
  revision updated at: 2016-06-28T15:32:15Z

Use `digdag workflows` to show all workflows.

$ digdag schedules -c /dev/null
2016-06-29 00:32:19 +0900: Digdag v0.8.2
Schedules:
  id: 1
  project: sched
  workflow: test
  next session time: 2016-06-30 00:00:00 +0900
  next runs at: 2016-06-30 03:00:00 +0900 (26h 27m 40s later)

1 entries.
Use `digdag workflows [project-name] [workflow-name]` to show workflow details.

I want to schedule at 2.5 hours later instead of 26.5 hours later.

hiroyuki-sato commented 8 years ago

This issue does not relate timezone. I also test UTC timezone.

Summary

Test code

% ruby -e 'puts Time.new.utc'
2016-07-27 08:44:00 UTC

test.dig

timezone: UTC

schedule:
  daily>: "12:00:00"

+current_date:
  sh>: echo `date`
digdag server -m
% digdag push test
2016-07-27 17:44:29 +0900: Digdag v0.8.5
Creating .digdag/tmp/archive-16238913803939729.tar.gz...
  Archiving tasks/__init__.py
  Archiving tasks/__init__.pyc
  Archiving tasks/repeat_hello.sh
  Archiving tasks/shell_sample.sh
  Archiving test.dig
Workflows:
  test

Uploaded:
  id: 1
  name: test
  revision: 94598b48-8b0d-4d9d-965e-86eb59fedcc8
  archive type: db
  project created at: 2016-07-27T08:44:31Z
  revision updated at: 2016-07-27T08:44:31Z

Use `digdag workflows` to show all workflows.
% digdag schedules
2016-07-27 17:44:39 +0900: Digdag v0.8.5
Schedules:
  id: 1
  project: test
  workflow: test
  next session time: 2016-07-28 00:00:00 +0000
  next runs at: 2016-07-28 21:00:00 +0900 (27h 15m 20s later)

1 entries.
Use `digdag workflows [project-name] [workflow-name]` to show workflow details.
uu59 commented 8 years ago

Fixed at v0.8.6. http://www.digdag.io/releases/release-0.8.6.html

Thanks!