Skip to content
This repository has been archived by the owner on Mar 10, 2019. It is now read-only.

Create build #2

Open
sdomino opened this issue Dec 2, 2015 · 0 comments
Open

Create build #2

sdomino opened this issue Dec 2, 2015 · 0 comments

Comments

@sdomino
Copy link
Contributor

sdomino commented Dec 2, 2015

A build represents a "Packer run"; the point of a build is the ability to post a build with all necessary information that a Packer run will need, at which point the client disconnects to follow up with the progress of the run.

When a build is posted, validation is needed to ensure that the template being used actually exists in the DB.

builds:
id - UUID generated on create
template_id - ID of base template
state - incomplete, complete, failed
status - installing template, copying template, transforming template, running packer, recording results, cleaning up
last_updated -
transform_payload - payload that will get passed into the transform_script from template
meta_data - return data from [Packer]

build_logs:
id -
build_id -
message -
created_at -

Build process:

  1. Create entry in DB that represents the build
    1.5 At a short interval, update last_updated field (goroutine) because packer run might take time
  2. Install template on local node if not already available ([/var/db/sherpa]/templates/:id)
  3. Copy template into a tmp build folder for duration of build ([/var/db/sherpa]/builds/:build_id)
  4. Run transform script (builds/:build_id/{{transform_script}}) if present, passing transform_payload
  5. Packer run (all output (\n) is a new build_log for that build); update last_updated/state of build throughout process
  6. Record - take packer info and dump it into meta_data
  7. Cleanup - delete build folder
@sdomino sdomino added this to the MVD (Minimum Viable Demo) milestone Dec 2, 2015
@sdomino sdomino changed the title Create build Create/Destroy build Dec 2, 2015
@sdomino sdomino changed the title Create/Destroy build Create build Dec 2, 2015
@sdomino sdomino self-assigned this Dec 2, 2015
@sdomino sdomino removed their assignment Dec 28, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants