Page MenuHomePhabricator

[drydock/core] Support custom attributes on all blueprints
AbandonedPublic

Authored by hach-que on Aug 24 2015, 6:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 2:36 PM
Unknown Object (File)
Fri, Nov 15, 6:50 PM
Unknown Object (File)
Tue, Nov 12, 8:58 AM
Unknown Object (File)
Thu, Nov 7, 3:47 AM
Unknown Object (File)
Wed, Nov 6, 3:38 PM
Unknown Object (File)
Wed, Nov 6, 3:38 PM
Unknown Object (File)
Oct 11 2024, 10:26 PM
Unknown Object (File)
Oct 9 2024, 2:26 AM

Details

Reviewers
epriestley
chad
Group Reviewers
Blessed Reviewers
Maniphest Tasks
T2015: Implement Drydock
Summary

Ref T2015. Depends on D10304. This allows Drydock to support custom attributes on all blueprints.

Test Plan

Set a custom attribute of test=host onto a preallocated host blueprint and ran:

june-linux-laptop:~/Projects/Phabricator/phabricator> bin/drydock lease --type host --attributes platform=linux,attr_test=abc
[2015-08-24 05:21:08] EXCEPTION: (Exception) Lease has been broken! at [<phabricator>/src/applications/drydock/storage/DrydockLease.php:172]
arcanist(head=master, ref.master=9b8c9d280ea4), phabricator(head=hachque-reconstructed, ref.master=e0faa66772ed, ref.hachque-reconstructed=8aac04eb678f), phutil(head=hachque-master, ref.master=81eed10bea57, ref.hachque-master=fd52935292b9)
  #0 DrydockLease::waitForLeases(array) called at [<phabricator>/src/applications/drydock/storage/DrydockLease.php:198]
  #1 DrydockLease::waitUntilActive() called at [<phabricator>/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php:61]
  #2 DrydockManagementLeaseWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:406]
  #3 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:301]
  #4 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/drydock/drydock_control.php:21]
june-linux-laptop:~/Projects/Phabricator/phabricator> bin/drydock lease --type host --attributes platform=linux,attr_test=host
Acquired Lease 418

Diff Detail

Repository
rP Phabricator
Branch
hachque-reconstructed
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 7753
Build 8538: [Placeholder Plan] Wait for 30 Seconds
Build 8537: arc lint + arc unit

Event Timeline

hach-que retitled this revision from to [drydock/core] Support custom attributes on all blueprints.
hach-que updated this object.
hach-que edited the test plan for this revision. (Show Details)
hach-que added a reviewer: epriestley.
epriestley edited edge metadata.

I don't know what problem this solves.

This revision now requires changes to proceed.Aug 24 2015, 6:18 PM

Let's say you have two Linux blueprints, one that is configured to have GCC with a C++ compiler installed, and another that is configured to have the Java compiler. When acquiring hosts in Harbormaster, you need to some way of requiring certain features on the hosts that are obtained. Custom attributes allow blueprints to indicate that their resources have certain features.

In actual real world scenarios, this is used for:

  • Making sure deployment commands run on machines in the appropriate network
  • Making sure that large build processes use hosts with more computing power and memory than light weight builds
  • Making sure that builds run under a correct environment

Alright. This isn't a problem I want to include in the scope of Drydock v1, so I'm going to wait until we're ready to solve this problem in the upstream before looking at this.

I've found that explicit authorization pretty much covers 90% of the stuff here anyway.