ansible - buildmaster steps to retrieve artifacts from buildslaves
ClosedPublic

Authored by mkrizek on Feb 23 2015, 12:23 PM.

Details

Summary

See T401. Created for @mkrizek.

Test Plan

unknown

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
kparal retitled this revision from to ansible - buildmaster steps to retrieve artifacts from buildslaves.Feb 23 2015, 12:23 PM
kparal updated this object.
kparal edited the test plan for this revision. (Show Details)
kparal added a reviewer: tflink.
kparal added a project: infrastructure.
kparal added a subscriber: mkrizek.
kparal added inline comments.Feb 23 2015, 12:36 PM
roles/taskotron/buildmaster-configure/templates/taskotron.master.cfg.j2
176–177

This will effectively overwrite any artifact called taskotron.log that the task could have created with our own log file.

I'm not saying this approach is unreasonable, I just want to make sure it's expected. An alternative approach would be to create a subdirectory for task-generated artifacts, so that we don't need to deal with file name conflicts for taskotrong.log, stdout/stderr files, etc possibly some future files. That has one additional benefit - if everything is in the same directory, it can be a bit of a mess if the task generates tens or hundreds of artifacts. Separating "our" files from task-generated files would look cleaner.

Of course, we would need to come up with a good name for that subdirectory, which is always difficult :-)

kparal updated this object.Feb 23 2015, 12:37 PM
tflink requested changes to this revision.Feb 23 2015, 1:34 PM

Looks pretty good to start with - some small change requests, though

roles/taskotron/buildmaster-configure/templates/taskotron.master.cfg.j2
165

this requires an execdb-style uuid now, doesn't it? Or are there more changes to trigger that aren't submitted for review yet?

173

I'd prefer to see the output dir rendered from a template instead of hard coded - especially if/when we start using it in more places

176–177

output or debug might work. it'd be a good place to put the stdout/stderr output, too if we get that working. Either way, we should document what we're using and state clearly that anything output into a directory of identical name will either be renamed or overwritten.

This revision now requires changes to proceed.Feb 23 2015, 1:34 PM
tflink added inline comments.Feb 23 2015, 1:46 PM
roles/taskotron/buildmaster-configure/templates/taskotron.master.cfg.j2
176–177

It occurs to me that another solution would be to put all of our output into the root /srv/taskotron/artifacts/<uuid> dir and create something like /srv/taskotron/artifacts/<uuid>/task_output` for the artifacts generated by the task. That way, we don't have to worry about any name collisions.

mkrizek commandeered this revision.Feb 23 2015, 1:54 PM
mkrizek added a reviewer: kparal.
mkrizek added inline comments.Feb 23 2015, 2:03 PM
roles/taskotron/buildmaster-configure/templates/taskotron.master.cfg.j2
165

Yes, changes to trigger are needed.

173

Good point, will do, thanks.

176–177

Let's create task_output directory, acks?

kparal added inline comments.Feb 23 2015, 2:04 PM
roles/taskotron/buildmaster-configure/templates/taskotron.master.cfg.j2
176–177

Yes, that's what I had on mind, just not explained it clearly :-) Like this:

/srv/taskotron/artifacts/<uuid>
/srv/taskotron/artifacts/<uuid>/taskotron.log
/srv/taskotron/artifacts/<uuid>/task.log
/srv/taskotron/artifacts/<uuid>/output/
/srv/taskotron/artifacts/<uuid>/output/NVR1.txt
/srv/taskotron/artifacts/<uuid>/output/report.html

The <uuid>/ root dir would be ours, and everything under <uuid>/output/ would be maintained by task authors. Replace output with your preferred subdir name.

mkrizek updated this revision to Diff 789.Feb 23 2015, 4:28 PM
mkrizek updated this revision to Diff 790.Feb 23 2015, 4:32 PM
tflink requested changes to this revision.Feb 23 2015, 4:56 PM

should have noticed this the first time around, but the playbooks would effectively enable artifacts on dev/stg/prod at the same time (since they're run on a regular basis) and I think we should avoid putting new stuff in prod without testing it first

roles/taskotron/buildmaster-configure/templates/taskotron.master.cfg.j2
188

should have noticed this earlier, but this will effectively enable artifacts storage on dev, stg and prod all at the same time. can you do an if/else block to make sure that the new stuff only shows up on dev?

roles/taskotron/buildmaster/tasks/main.yml
26

same as above, can you add a 'when: deployment_type == "dev"' to these to make sure that the new config doesn't make it to production until we're ready?

This revision now requires changes to proceed.Feb 23 2015, 4:56 PM
mkrizek updated this revision to Diff 795.Feb 24 2015, 7:42 AM
tflink accepted this revision.Feb 25 2015, 6:21 AM

Looks good to me

This revision is now accepted and ready to land.Feb 25 2015, 6:21 AM
mkrizek closed this revision.Feb 27 2015, 8:44 AM