Closed aledbf closed 8 years ago
@arschles please tell me the name to use for this 2 variables
@aledbf to complete #135, I'd like the timeout and tick durations to be specified as environment variables, instead of hard-coding them as constants here.
Regarding your question, the environment variables could be named OBJECT_STORAGE_WAIT_DURATION
and OBJECT_STORAGE_TICK_DURATION
.
Finally, on startup, the builder should check the values for those env vars to ensure valueOf(OBJECT_STORAGE_TICK_DURATION) < valueOf(OBJECT_STORAGE_WAIT_DURATION)
(that is pseudocode) - otherwise, the git receive hook would always fail.
instead of hard-coding them as constants here
I put that as default if there's no env variables defined. It's that ok?
Yes, that's ok if they're just defaults. In the code, though, I don't see the check for the environment variables.
Also, can you provide a separate set of tick and timeout variables for pod start and polling object storage. For example:
BUILDER_POD_TICK_DURATION
and BUILDER_POD_WAIT_DURATION
for waitForPod
callOBJECT_STORAGE_TICK_DURATION
and OBJECT_STORAGE_WAIT_DURATION
for the storage.ObjectExists
callsAlso, if you put these values into the Config
struct then you can specify the defaults there and the config package will take care of setting them if missing. Example code:
BuilderPodTickDurationMSec int `envconfig:"BUILDER_POD_TICK_DURATION" default:"100"`
BuilderPodWaitDurationMSec int `envconfig:"BUILDER_POD_WAIT_DURATION" default:"300000"` // 5 minutes
ObjectStorageTickDurationMSec int `envconfing:"OBJECT_STORAGE_TICK_DURATION" default:"500"`
ObjectStorageWaitDurationMSec int `envconfig:"OBJECT_STORAGE_WAIT_DURATION" default:"300000"` // 5 minutes
ping @arschles
@aledbf other than my nitpick, LGTM
Is this still in Progress ??
@smothiki good question - @aledbf I've labeled appropriately, since I'm assuming you're ready to go on this.
@arschles yes, ready for review
I was not reviewing it as it said IN progress.
@smothiki can you review now please?
I was just asking as I gave an LGTM and the label says IN Progress. So just wondering If this is still in progress
@smothiki ok - any comments on the code?
@aledbf I took my LGTM out because I left a request for tests
I don't have comments previously. But now you pointed at writing unit tests. Should I remove my LGTM or should the unit tests be a separate PR/issue
I'm ok with you leaving your LGTM on here. I'll review again when ready. Regarding unit tests, I'd prefer them to go into this PR (and, generally speaking, for all future builder PRs - even if it changes code that wasn't previously unit tested)
+1
@arschles tests added
ping @arschles
@aledbf LGTM, thanks for adding tests. @smothiki can you review once more?
closes #135