dagu
dagu copied to clipboard
can I extend dagu and use in my company?
I want to add some internal executors
Hi @kimkit, I think your idea sounds really interesting! I'd love to hear more about it. Can you let me know what kind of executor you need? If you're looking for an internal executor, you may need to build the code yourself for now.
Could you please provide more information of the executors that you would like to create?
We can consider to use Starlark language to allow users to implement their original executor. Please let us know your thoughts on it.
@yohamta sorry for the delay. dagu put all packages in internal directory, so I can't create new binary based on this repo. We have one cron service written by golang which pull scripts (lua, run with gopher-lua) from data center (eg: consul) and run these scripts scheduled (use github.com/robfig/cron/v3). I want to extend dagu to execute scripts directly.
Hi @kimkit , I was thinking that you might be able to call the binary in a workflow like this:
steps:
- name: run-script
command: lua-runner
script: |
<...lua script...>
If you need to pull the script from a data source, the http executor could be helpful:
steps:
- name: read-script
command: GET http://get/some/script
executor:
type: http
headers:
Authorization: "Bearer $TOKEN"
config:
silent: true
output: SCRIPT
- name: run-script
command: lua-runner
script: $SCRIPT
Is the reason you want to extend the executor to avoid repetition in writing this kind of script? If that's the case, we're working on implementing user-defined functions to tackle repetitive definitions: #429 What are your thoughts on this?
user-defined functions is a good idea. thanks.
Great to hear that. Thanks.