-
-
Notifications
You must be signed in to change notification settings - Fork 878
Closed
Description
Proposed changes
- Rename
inandoutscripts togetandput. These are confusingly named something different because a long time ago jobs just had _in_puts and _out_puts. - Run
./check,./get, and./put, and./info(see next point) rather than/opt/resource/X. Having them in/optis a bit Linux-specific and assumes containers have their ownchroot, which is not the case on Darwin or Windows. - Add a
infoscript which prints the resource's API version, e.g.{"version":"2.0"}. This will start at2.0. If/infodoes not exist we'll execute today's resource interface behavior. - Change
getto not emit the version or metadata. This was from whenindidn't know what it was fetching until it was done. It should now be an error if it can't fetch the requested version. We'll also move all metadata collection tocheck(see point 8). - Add a
deleteaction, which looks likeput(can be given files and params to determine what to delete) but returns the set of versions that it deleted. This is to support bulk deletes, e.g. to garbage collect intermediate artifacts after a final build is shipped. - Remove the
sourceanddestinationarguments passed togetandput- just make it the working directory. - Give
checkan official scratch space, which is the current working directory. No real semantics change here, just consistency withgetandput, and potential for future behavior like reusing the scratch space but not reusingcheckcontainers for extended periods. Note: we've introduced/scratchrecently so this change may just mean making that the work-dir. - Move all metadata emitting to
check, so that it's always present. The original thought was that metadata collection may be expensive, but so far we haven't seen that to be the case. - Change
putto emit an array of versions, rather than just one, and without metadata. Technically thegitresource may push many commits, so this is necessary to track them all as outputs of a build. This could also support batch creation. Notably, the versions emitted byputare ordered chronologically, so that the dependentgetknows to fetch the latest version. We would save them internally, along with an association with the build, and rely oncheckto determine the final ordering and metadata, being careful to not leave gaps in the version history (i.e. other commits pushed slightly before theputregistered the build's). - Change
putto write to a specified file, rather thanstdout, so that we don't have to be attached to process its response. This is one of the few ways a build can error after the ATC reattaches (unexpected end of JSON). With it written to a file, we can just try to read the file when we re-attach after seeing that the process exited. This also frees up stdout/stderr for normal logging, which has been an occasional pitfall during resource development/debugging. - Remove the distinction between
sourceandparams; resources will receive a singleconfig. The distinction will remain in the pipeline. This makes it easier to implement a resource without planning ahead for interesting dynamic vs. static usage patterns, and will get more powerful with Dynamic build plan generation #684.
Reactions are currently unavailable