-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/6238: Keeper runs #4210
Conversation
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
978b0f5
to
40b0a3c
Compare
40b0a3c
to
dd5f5fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a few questions and minor verbiage changes
var runID int64 | ||
|
||
// Keeper jobs are special in that they do not have a task graph. | ||
if jb.Type == job.Keeper { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chainlink.Application#RunJobV2
is only used by the web interface to initiate one-off jobs. Seems inapplicable to Keeper jobs, especially given that there's no TaskDAG of any kind, just an insertion of a DB row. What's the thinking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its actually not used by the UI at all - @DeividasK added it to help with debugging. I also just used it to be able to create local keeper runs to test. I made the debugging nature of it explicit with the CHAINLINK_DEV check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't mean the UI specifically. Was thinking-- wouldn't this be useful for the web
job type? So probably good to avoid the DEV var
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah for sure, when we add the web v2 jobs I'd imagine they could use the same logic. Maybe when that happens we'd want to break out a non-dev function/endpoint though
core/services/keeper/delegate.go
Outdated
@@ -53,6 +57,12 @@ func (d *Delegate) ServicesForSpec(spec job.Job) (services []job.Service, err er | |||
return nil, errors.Wrap(err, "unable to create keeper registry contract wrapper") | |||
} | |||
|
|||
// Make sure we can read the contract |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this cause the job to fail and stop attempting to execute if the ETH node is inaccessible briefly on startup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it would. I was thinking you could just delete and add, but thats not great. I'll move the spec_error creation to the GetConfig call in newRegistryFromChain and make it non-blocking
@@ -266,6 +266,28 @@ func NewConfigWithWSServer(t testing.TB, url string, wsserver *httptest.Server) | |||
return config | |||
} | |||
|
|||
type JobPipelineV2TestHelper struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably use this pattern more in our tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I think it'll just be a slow migration
if err != nil { | ||
return errors.Wrap(err, "transmitter failed to get RowsAffected on eth_tx insert") | ||
if etx.ID == 0 { | ||
return etx, errors.New("a keeper eth_tx with insufficient eth is present, not creating a new eth_tx") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually any tx with insufficient eth, but this message is probably ok.
We want to show runs to indicate progress on the keeper jobs as well as spec errors in the case of the contract not existing at the address specified.
Run:
![image](https://user-images.githubusercontent.com/5782319/114613736-b8c3a880-9c71-11eb-818f-91583613b607.png)
Spec Error:
![image](https://user-images.githubusercontent.com/5782319/114613769-c4af6a80-9c71-11eb-86ad-e002746a6813.png)