[ https://issues.apache.org/jira/browse/YARN-10219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17074159#comment-17074159 ]
Eric Yang commented on YARN-10219: ---------------------------------- Placement constraint can define AFFINITY and ANTI_AFFINITY based on node label, node attributes, or allocation tag. The syntax used matching node label, and node attributes are different syntax than matching allocation tags. Node attributes, and node label, uses syntax that is documented: {code} PlacementConstraints .targetNodeAttribute(PlacementConstraints.NODE, NodeAttributeOpCode.EQ, PlacementConstraints.PlacementTargets .nodeAttribute("java", "1.8"))) {code} Allocation tag uses syntax: {code} PlacementConstraints .targetIn(yarnServiceConstraint.getScope().getValue(), targetExpressions.toArray(new TargetExpression[0])) .build(); {code} The correct expression of the placement constraint supposed to have separated constraint policies for each use cases, for example: {code:java} "placement_policy": { "constraints": [ { "type": "AFFINITY", "scope": "NODE", "node_partitions": [ "label2" ] }, { "type": "ANTI_AFFINITY", "scope": "NODE", "target_tags": [ "pong" ] } ] }, {code} "pong" containers are spread out on nodes with label2 partitions. The existing documented syntax is self conflicting to cause problem in code logic. > YARN service placement constraints is broken > -------------------------------------------- > > Key: YARN-10219 > URL: https://issues.apache.org/jira/browse/YARN-10219 > Project: Hadoop YARN > Issue Type: Bug > Reporter: Eric Yang > Priority: Major > > YARN service placement constraint does not work with node label nor node > attributes. Example of placement constraints: > {code} > "placement_policy": { > "constraints": [ > { > "type": "AFFINITY", > "scope": "NODE", > "node_attributes": { > "label":["genfile"] > }, > "target_tags": [ > "ping" > ] > } > ] > }, > {code} > Node attribute added: > {code} ./bin/yarn nodeattributes -add "host-3.example.com:label=genfile" > {code} > Scheduling activities shows: > {code} <diagnostic> Node does not match partition or placement constraints, > unsatisfied PC expression="in,node,ping", target-type=ALLOCATION_TAG > </diagnostic> > <count>1</count> > <nodeIds>host-3.example.com:45454</nodeIds>{code} -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org