[jira] [Commented] (YARN-7217) Improve API service usability for updating service spec and state

2017-10-27 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/YARN-7217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16223235#comment-16223235
 ] 

Hadoop QA commented on YARN-7217:
-

| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 15m 
16s{color} | {color:blue} Docker mode activated. {color} |
|| || || || {color:brown} Prechecks {color} ||
| {color:green}+1{color} | {color:green} @author {color} | {color:green}  0m  
0s{color} | {color:green} The patch does not contain any @author tags. {color} |
| {color:green}+1{color} | {color:green} test4tests {color} | {color:green}  0m 
 0s{color} | {color:green} The patch appears to include 34 new or modified test 
files. {color} |
|| || || || {color:brown} yarn-native-services Compile Tests {color} ||
| {color:blue}0{color} | {color:blue} mvndep {color} | {color:blue}  1m 
51s{color} | {color:blue} Maven dependency ordering for branch {color} |
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 18m 
 4s{color} | {color:green} yarn-native-services passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green} 17m 
55s{color} | {color:green} yarn-native-services passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  2m 
 9s{color} | {color:green} yarn-native-services passed {color} |
| {color:green}+1{color} | {color:green} mvnsite {color} | {color:green}  2m 
46s{color} | {color:green} yarn-native-services passed {color} |
| {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 
14m 29s{color} | {color:green} branch has no errors when building and testing 
our client artifacts. {color} |
| {color:blue}0{color} | {color:blue} findbugs {color} | {color:blue}  0m  
0s{color} | {color:blue} Skipped patched modules with no Java source: 
hadoop-project {color} |
| {color:red}-1{color} | {color:red} findbugs {color} | {color:red}  1m 
26s{color} | {color:red} hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api in 
yarn-native-services has 1 extant Findbugs warnings. {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  2m 
21s{color} | {color:green} yarn-native-services passed {color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:blue}0{color} | {color:blue} mvndep {color} | {color:blue}  0m 
59s{color} | {color:blue} Maven dependency ordering for patch {color} |
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  2m 
31s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green} 15m 
54s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green} 15m 
54s{color} | {color:green} the patch passed {color} |
| {color:orange}-0{color} | {color:orange} checkstyle {color} | {color:orange}  
2m 16s{color} | {color:orange} root: The patch generated 10 new + 247 unchanged 
- 9 fixed = 257 total (was 256) {color} |
| {color:green}+1{color} | {color:green} mvnsite {color} | {color:green}  3m 
11s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} whitespace {color} | {color:green}  0m 
 0s{color} | {color:green} The patch has no whitespace issues. {color} |
| {color:green}+1{color} | {color:green} xml {color} | {color:green}  0m 
14s{color} | {color:green} The patch has no ill-formed XML file. {color} |
| {color:green}+1{color} | {color:green} shadedclient {color} | {color:green}  
9m 53s{color} | {color:green} patch has no errors when building and testing our 
client artifacts. {color} |
| {color:blue}0{color} | {color:blue} findbugs {color} | {color:blue}  0m  
0s{color} | {color:blue} Skipped patched modules with no Java source: 
hadoop-project {color} |
| {color:green}+1{color} | {color:green} findbugs {color} | {color:green}  5m 
35s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  2m 
26s{color} | {color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  0m 
14s{color} | {color:green} hadoop-project in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  0m 
43s{color} | {color:green} hadoop-yarn-api in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  3m  
9s{color} | {color:green} hadoop-yarn-common in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  2m 
36s{color} | {color:green} hadoop-yarn-services-core in the patch passed. 
{color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  1m  
9s{color} | {color:green} hadoop-yarn-services-api 

[jira] [Commented] (YARN-7217) Improve API service usability for updating service spec and state

2017-10-26 Thread Eric Yang (JIRA)

[ 
https://issues.apache.org/jira/browse/YARN-7217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16221142#comment-16221142
 ] 

Eric Yang commented on YARN-7217:
-

I opened YARN-7399 as storage improvement for YARN service metadata.

> Improve API service usability for updating service spec and state
> -
>
> Key: YARN-7217
> URL: https://issues.apache.org/jira/browse/YARN-7217
> Project: Hadoop YARN
>  Issue Type: Task
>  Components: api, applications
>Reporter: Eric Yang
>Assignee: Eric Yang
> Attachments: YARN-7217.yarn-native-services.001.patch, 
> YARN-7217.yarn-native-services.002.patch, 
> YARN-7217.yarn-native-services.003.patch, 
> YARN-7217.yarn-native-services.004.patch, 
> YARN-7217.yarn-native-services.005.patch
>
>
> API service for deploy, and manage YARN services have several limitations.
> {{updateService}} API provides multiple functions:
> # Stopping a service.
> # Start a service.
> # Increase or decrease number of containers.  (This was removed in YARN-7323).
> The overloading is buggy depending on how the configuration should be applied.
> h4. Scenario 1
> A user retrieves Service object from getService call, and the Service object 
> contains state: STARTED.  The user would like to increase number of 
> containers for the deployed service.  The JSON has been updated to increase 
> container count.  The PUT method does not actually increase container count.
> h4. Scenario 2
> A user retrieves Service object from getService call, and the Service object 
> contains state: STOPPED.  The user would like to make a environment 
> configuration change.  The configuration does not get updated after PUT 
> method.
> This is possible to address by rearranging the logic of START/STOP after 
> configuration update.  However, there are other potential combinations that 
> can break PUT method.  For example, user like to make configuration changes, 
> but not yet restart the service until a later time.
> h4. Scenario 3
> There is no API to list all deployed applications by the same user.
> h4. Scenario 4
> Desired state (spec) and current state are represented by the same Service 
> object.  There is no easy way to identify "state" is desired state to reach 
> or, the current state of the service.  It would be nice to have ability to 
> retrieve both desired state, and current state with separated entry points.  
> By implementing /spec and /state, it can resolve this problem.
> h4. Scenario 5
> List all services deploy by the same user can trigger a directory listing 
> operation on namenode if hdfs is used as storage for metadata.  When hundred 
> of users use Service UI to view or deploy applications, this will trigger 
> denial of services attack on namenode.  The sparse small metadata files also 
> reduce efficiency of Namenode memory usage.  Hence, a cache layer for storing 
> service metadata can reduce namenode stress.
> h3. Proposed change
> ApiService can separate the PUT method into two PUT methods for configuration 
> changes vs operation changes.  New API could look like:
> {code}
> @PUT
> /ws/v1/services/[service_name]/spec
> Request Data:
> {
>   "name": "amp",
>   "components": [
> {
>   "name": "mysql",
>   "number_of_containers": 2,
>   "artifact": {
> "id": "centos/mysql-57-centos7:latest",
> "type": "DOCKER"
>   },
>   "run_privileged_container": false,
>   "launch_command": "",
>   "resource": {
> "cpus": 1,
> "memory": "2048"
>   },
>   "configuration": {
> "env": {
>   "MYSQL_USER":"${USER}",
>   "MYSQL_PASSWORD":"password"
> }
>   }
>  }
>   ],
>   "quicklinks": {
> "Apache Document Root": 
> "http://httpd.${SERVICE_NAME}.${USER}.${DOMAIN}:8080/;,
> "PHP MyAdmin": "http://phpmyadmin.${SERVICE_NAME}.${USER}.${DOMAIN}:8080/;
>   }
> }
> {code}
> {code}
> @PUT
> /ws/v1/services/[service_name]/state
> Request data:
> {
>   "name": "amp",
>   "components": [
> {
>   "name": "mysql",
>   "state": "STOPPED"
>  }
>   ]
> }
> {code}
> SOLR can be used to cache Yarnfile to improve lookup performance and reduce 
> stress of namenode small file problems and high frequency lookup.  SOLR is 
> chosen for caching metadata because its indexing feature can be used to build 
> full text search for application catalog as well.
> For service that requires configuration changes to increase or decrease node 
> count.  The calling sequence is:
> {code}
> # GET /ws/v1/services/{service_name}/spec
> # Change number_of_containers to desired number.
> # PUT /ws/v1/services/{service_name}/spec to update the spec.
> # PUT /ws/v1/services/{service_name}/state to stop existing service.
> # PUT /ws/v1/services/{service_name}/state to start service.
> {code}
> 

[jira] [Commented] (YARN-7217) Improve API service usability for updating service spec and state

2017-10-26 Thread Eric Yang (JIRA)

[ 
https://issues.apache.org/jira/browse/YARN-7217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16221127#comment-16221127
 ] 

Eric Yang commented on YARN-7217:
-

[~jianhe] . Thank you for reviewing the patch, and here are the answers:

{quote}
- should solr and fs be a pluggable implementation of a common interface ? 
Basically, should it be either fs or solr back-end. Right now it's both there.
{quote}

This JIRA is a transition phase.  Solr is used as alternate storage mechanism 
to bridge the gap that current HDFS storage mechanism can not achieve for 
listing applications for all users.  Let's leave the storage change to another 
JIRA.

{quote}
- getServicesList: it assumes solr is enabled, if not, it will throw NPE. I 
think we should conditionally check if solr is enabled, if not, throw exception 
saying only solr backend is supported for this endpoint.
{quote}

getServicesList never throw NPE.  Ysc is initialized at constructor.  If Solr 
is disabled, it will throw SERVICE_UNAVAILABLE http code.  This is verified in 
testGetServicesList in TestApiServer test case.

{quote}
- similarly for getServiceSpec endpoint, it will throw NPE because ysc is null, 
if solr is not enabled.
{quote}

Same problem as above, ysc is never null because it is initialized in the 
constructor.  If ysc is not initialized when Solr is disabled per suggestion, 
then NPE situation can occur.  I agree that the coding style can be more 
consistent on how SOLR is enabled, and revise code accordingly.

{quote}
- similarly TestYarnNativeServices#testChangeSpec, as discussed, we won't need 
to restart the entire service to update the spec ? what's the use case for this 
?
{quote}

Per discussion this morning, it is best to keep configuration change and 
restart operation as two separate calls.  This allows configuration to be 
updated and hold off on deployment until suitable time window becomes 
available, then restart the service.  This gives system administrator more fine 
grind control to persist desired configuration change, then choose to restart 
service or choose to add more nodes without restart.

{quote}
- Should it be if solr is enabled, create the solrClient ? if solr is not 
enabled, there's no point creating the solrClient
{quote}

Solr enabled flag is persisted in YarnSolrClient object to keep its internal 
state atomic instead of tracking the flag in ServiceClient.  I can add if 
statement to skip initialization of yarn solr client.  However, it seems 
redundant to have to deal with NPE in if statements, if YarnSolrClient skipped 
initialization.  Hence, I will not make change here.

{quote}
- updateComponent api should also update the spec in solr ?
- the username parameter is not used in findAppEntry API at all, but the 
deployApp inserts the username, then why is the username required in the first 
place ?
- similarly, username is not used in deleteApp, then why do we need to get the 
username in caller in the first place
{quote}

I will fix these bugs.

{quote}
All services configs are currently in YarnServiceConf class, I think we can put 
the new configs there to not mix with the core YarnConfigurations, until the 
feature and config namings are stable, we can merge them back to 
YarnConfiguration.
{quote}

We should avoid to introduce sub configuration without expose them to upper 
level.  The chance of someone else introduce duplicate hierarchy is high, then 
it becomes painful to merge.  I recommend to upstream the configuration knobs 
to upper level to avoid doing the same thing over and over.  This is difference 
in philosophy of how to handle changes, since we are already on a branch, there 
is no risk to introduce to yarh-common directly.  I will not make a change here.

{quote}
could you explain below logic ? looks like it tries to look for all entries 
with "id:appName" and the while loop continues until the last one is find, and 
return the last one . Presumbaly there's only 1 entry, then why is a while loop 
required? If there are multiple entries, why returning the last one ?
{quote}

There will only be one match because this is a single entry query.  However, 
Solr doesn't have a single entry lookup interface, and I just use common 
Iterator interface provided by Solr.  This is the reason that it is in a while 
loop.  I can change it to if .. else to make it more readable.

Thanks for the suggestions, I will make the improvements and upload another 
patch.  Let me know if there is any doubts in my comments.  Thanks

> Improve API service usability for updating service spec and state
> -
>
> Key: YARN-7217
> URL: https://issues.apache.org/jira/browse/YARN-7217
> Project: Hadoop YARN
>  Issue Type: Task
>  Components: api, applications
>Reporter: Eric Yang
>Assignee: Eric Yang
> 

[jira] [Commented] (YARN-7217) Improve API service usability for updating service spec and state

2017-10-25 Thread Jian He (JIRA)

[ 
https://issues.apache.org/jira/browse/YARN-7217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16219725#comment-16219725
 ] 

Jian He commented on YARN-7217:
---

Meta questions as Billie mentioned:
- should solr and fs be a pluggable implementation of a common interface ? 
Basically, should it be either fs or solr back-end. Right now it's both there.

Code comments:
- For below, one constructor can call another to avoid code duplication
{code}
public ApiServer() {
  YARN_CONFIG = new YarnConfiguration();
  try {
if (SERVICE_CLIENT==null) {
  SERVICE_CLIENT = new ServiceClient();
  SERVICE_CLIENT.init(YARN_CONFIG);
  SERVICE_CLIENT.start();
}
  } catch (Exception e) {
LOG.error("Fail to initialize ServiceClient, ApiServer is unavailable.");
  }
}

/**
 * Constructor used by ResourceManager.
 *
 * @param conf
 */
@Inject
public ApiServer(Configuration conf) {
  YARN_CONFIG = conf;
  try {
if (SERVICE_CLIENT==null) {
  SERVICE_CLIENT = new ServiceClient();
  SERVICE_CLIENT.init(YARN_CONFIG);
  SERVICE_CLIENT.start();
}
  } catch (Exception e) {
LOG.error("Fail to initialize ServiceClient, ApiServer is unavailable.");
  }
}

{code}
- getServicesList: it assumes solr is enabled, if not, it will throw NPE. I 
think we should conditionally check if solr is enabled, if not, throw exception 
saying only solr backend is supported for this endpoint.
- similarly for getServiceSpec endpoint, it will throw NPE because ysc is null, 
if solr is not enabled. 
- updateServiceSpec: it only updates the spec in hdfs and solr, what's the use 
case of this api ? 
- similarly TestYarnNativeServices#testChangeSpec, as discussed, we won't need 
to restart the entire service to update the spec ? what's the use case for this 
?
- {{/services/{service_name}/state}} : call it status  ? IMHO, state is like 
STOPPED or STARTED, status is more like a group of information
- Should it be if solr is enabled, create the solrClient ? if solr is not 
enabled, there's no point creating the solrClient
{code}
 addService(yarnClient);
  + createYarnSolrClient(configuration);
 super.serviceInit(configuration);
{code}
- The entire code can be inside the isEnabled block, similarly for other places
{code}
if (UserGroupInformation.isSecurityEnabled()) {
  try {
userName = UserGroupInformation.getCurrentUser().getUserName();
  } catch(KerberosAuthException e) {
userName = null;
  }
}
if (ysc.isEnabled()) {
  try {
ysc.deployApp(service, userName);
  } catch (ServiceUnavailableException e) {
throw new YarnException("Fail to persist service spec.");
  }
}
{code}
- we can create a common method for this, since it is used in so many places
{code}
if (UserGroupInformation.isSecurityEnabled()) {
  try {
userName = UserGroupInformation.getCurrentUser().getUserName();
  } catch(KerberosAuthException e) {
userName = null;
  }
}
{code}
- updateComponent api should also update the spec in solr ?
- All services configs are currently in YarnServiceConf class, I think we can 
put the new configs there to not mix with the core YarnConfigurations, until 
the feature and config namings are stable, we can merge them back to 
YarnConfiguration.
- ApiServerTest class is not used, remove?
- ServiceClientTest: createYarnSolrClient and serviceInit are the same as in 
the parent class, no need to override ?
- the username parameter is not used in findAppEntry API at all, but the 
deployApp inserts the username,  then why is the username required  in the 
first place ?
- similarly, username is not used in deleteApp, then why do we need to get the 
username in caller in the first place
- could you explain below logic ? looks like it tries to look for all entries 
with "id:appName" and the while loop continues until the last one is find, and 
return the last one . Presumbaly  there's only 1 entry, then why is a while 
loop required? If there are multiple entries, why returning the last one ? 
{code}
QueryResponse response;
try {
  response = solr.query(query);
  Iterator appList = response.getResults()
  .listIterator();
  while (appList.hasNext()) {
SolrDocument d = appList.next();
entry = mapper.readValue(d.get("yarnfile_s").toString(),
Service.class);
found = true;
  }
  if (!found) {
throw new ApplicationNotFoundException("Application entry is " +
"not found: " + appName);
  }
} catch (SolrServerException | IOException e) {
  LOG.error("Error in finding deployed application: " + appName, e);
}
return entry;
{code}
- YarnSolrClient#getEnabled is duplicated with isEnabled method. 
- YarnSolrClient#check, if the caller is only invoking the solrClient API if 
solr is enabled, then it won't enter this method in the first place, so the 
check is not 

[jira] [Commented] (YARN-7217) Improve API service usability for updating service spec and state

2017-10-20 Thread Eric Yang (JIRA)

[ 
https://issues.apache.org/jira/browse/YARN-7217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16213538#comment-16213538
 ] 

Eric Yang commented on YARN-7217:
-

The findbugs warning is not introduced by this JIRA.  [~billie.rinaldi] 
[~jianhe] . Would you mind to take another pass on patch 5?  Thank you

> Improve API service usability for updating service spec and state
> -
>
> Key: YARN-7217
> URL: https://issues.apache.org/jira/browse/YARN-7217
> Project: Hadoop YARN
>  Issue Type: Task
>  Components: api, applications
>Reporter: Eric Yang
>Assignee: Eric Yang
> Attachments: YARN-7217.yarn-native-services.001.patch, 
> YARN-7217.yarn-native-services.002.patch, 
> YARN-7217.yarn-native-services.003.patch, 
> YARN-7217.yarn-native-services.004.patch, 
> YARN-7217.yarn-native-services.005.patch
>
>
> API service for deploy, and manage YARN services have several limitations.
> {{updateService}} API provides multiple functions:
> # Stopping a service.
> # Start a service.
> # Increase or decrease number of containers.  (This was removed in YARN-7323).
> The overloading is buggy depending on how the configuration should be applied.
> h4. Scenario 1
> A user retrieves Service object from getService call, and the Service object 
> contains state: STARTED.  The user would like to increase number of 
> containers for the deployed service.  The JSON has been updated to increase 
> container count.  The PUT method does not actually increase container count.
> h4. Scenario 2
> A user retrieves Service object from getService call, and the Service object 
> contains state: STOPPED.  The user would like to make a environment 
> configuration change.  The configuration does not get updated after PUT 
> method.
> This is possible to address by rearranging the logic of START/STOP after 
> configuration update.  However, there are other potential combinations that 
> can break PUT method.  For example, user like to make configuration changes, 
> but not yet restart the service until a later time.
> h4. Scenario 3
> There is no API to list all deployed applications by the same user.
> h4. Scenario 4
> Desired state (spec) and current state are represented by the same Service 
> object.  There is no easy way to identify "state" is desired state to reach 
> or, the current state of the service.  It would be nice to have ability to 
> retrieve both desired state, and current state with separated entry points.  
> By implementing /spec and /state, it can resolve this problem.
> h4. Scenario 5
> List all services deploy by the same user can trigger a directory listing 
> operation on namenode if hdfs is used as storage for metadata.  When hundred 
> of users use Service UI to view or deploy applications, this will trigger 
> denial of services attack on namenode.  The sparse small metadata files also 
> reduce efficiency of Namenode memory usage.  Hence, a cache layer for storing 
> service metadata can reduce namenode stress.
> h3. Proposed change
> ApiService can separate the PUT method into two PUT methods for configuration 
> changes vs operation changes.  New API could look like:
> {code}
> @PUT
> /ws/v1/services/[service_name]/spec
> Request Data:
> {
>   "name": "amp",
>   "components": [
> {
>   "name": "mysql",
>   "number_of_containers": 2,
>   "artifact": {
> "id": "centos/mysql-57-centos7:latest",
> "type": "DOCKER"
>   },
>   "run_privileged_container": false,
>   "launch_command": "",
>   "resource": {
> "cpus": 1,
> "memory": "2048"
>   },
>   "configuration": {
> "env": {
>   "MYSQL_USER":"${USER}",
>   "MYSQL_PASSWORD":"password"
> }
>   }
>  }
>   ],
>   "quicklinks": {
> "Apache Document Root": 
> "http://httpd.${SERVICE_NAME}.${USER}.${DOMAIN}:8080/;,
> "PHP MyAdmin": "http://phpmyadmin.${SERVICE_NAME}.${USER}.${DOMAIN}:8080/;
>   }
> }
> {code}
> {code}
> @PUT
> /ws/v1/services/[service_name]/state
> Request data:
> {
>   "name": "amp",
>   "components": [
> {
>   "name": "mysql",
>   "state": "STOPPED"
>  }
>   ]
> }
> {code}
> SOLR can be used to cache Yarnfile to improve lookup performance and reduce 
> stress of namenode small file problems and high frequency lookup.  SOLR is 
> chosen for caching metadata because its indexing feature can be used to build 
> full text search for application catalog as well.
> For service that requires configuration changes to increase or decrease node 
> count.  The calling sequence is:
> {code}
> # GET /ws/v1/services/{service_name}/spec
> # Change number_of_containers to desired number.
> # PUT /ws/v1/services/{service_name}/spec to update the spec.
> # PUT /ws/v1/services/{service_name}/state to stop existing 

[jira] [Commented] (YARN-7217) Improve API service usability for updating service spec and state

2017-10-20 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/YARN-7217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16213442#comment-16213442
 ] 

Hadoop QA commented on YARN-7217:
-

| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 16m 
33s{color} | {color:blue} Docker mode activated. {color} |
|| || || || {color:brown} Prechecks {color} ||
| {color:green}+1{color} | {color:green} @author {color} | {color:green}  0m  
0s{color} | {color:green} The patch does not contain any @author tags. {color} |
| {color:green}+1{color} | {color:green} test4tests {color} | {color:green}  0m 
 0s{color} | {color:green} The patch appears to include 34 new or modified test 
files. {color} |
|| || || || {color:brown} yarn-native-services Compile Tests {color} ||
| {color:blue}0{color} | {color:blue} mvndep {color} | {color:blue}  1m 
56s{color} | {color:blue} Maven dependency ordering for branch {color} |
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 15m 
58s{color} | {color:green} yarn-native-services passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green} 17m 
13s{color} | {color:green} yarn-native-services passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  2m 
22s{color} | {color:green} yarn-native-services passed {color} |
| {color:green}+1{color} | {color:green} mvnsite {color} | {color:green}  2m 
41s{color} | {color:green} yarn-native-services passed {color} |
| {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 
16m 43s{color} | {color:green} branch has no errors when building and testing 
our client artifacts. {color} |
| {color:blue}0{color} | {color:blue} findbugs {color} | {color:blue}  0m  
0s{color} | {color:blue} Skipped patched modules with no Java source: 
hadoop-project {color} |
| {color:red}-1{color} | {color:red} findbugs {color} | {color:red}  1m 
18s{color} | {color:red} hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api in 
yarn-native-services has 1 extant Findbugs warnings. {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  2m 
13s{color} | {color:green} yarn-native-services passed {color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:blue}0{color} | {color:blue} mvndep {color} | {color:blue}  1m  
4s{color} | {color:blue} Maven dependency ordering for patch {color} |
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  2m 
 6s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green} 14m 
31s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green} 14m 
31s{color} | {color:green} the patch passed {color} |
| {color:orange}-0{color} | {color:orange} checkstyle {color} | {color:orange}  
2m 40s{color} | {color:orange} root: The patch generated 10 new + 247 unchanged 
- 9 fixed = 257 total (was 256) {color} |
| {color:green}+1{color} | {color:green} mvnsite {color} | {color:green}  3m 
34s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} whitespace {color} | {color:green}  0m 
 1s{color} | {color:green} The patch has no whitespace issues. {color} |
| {color:green}+1{color} | {color:green} xml {color} | {color:green}  0m 
14s{color} | {color:green} The patch has no ill-formed XML file. {color} |
| {color:green}+1{color} | {color:green} shadedclient {color} | {color:green} 
11m 32s{color} | {color:green} patch has no errors when building and testing 
our client artifacts. {color} |
| {color:blue}0{color} | {color:blue} findbugs {color} | {color:blue}  0m  
0s{color} | {color:blue} Skipped patched modules with no Java source: 
hadoop-project {color} |
| {color:green}+1{color} | {color:green} findbugs {color} | {color:green}  5m 
28s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  2m 
47s{color} | {color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  0m 
23s{color} | {color:green} hadoop-project in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  0m 
49s{color} | {color:green} hadoop-yarn-api in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  3m 
20s{color} | {color:green} hadoop-yarn-common in the patch passed. {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  2m 
50s{color} | {color:green} hadoop-yarn-services-core in the patch passed. 
{color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  1m 
12s{color} | {color:green} hadoop-yarn-services-api 

[jira] [Commented] (YARN-7217) Improve API service usability for updating service spec and state

2017-10-19 Thread Eric Yang (JIRA)

[ 
https://issues.apache.org/jira/browse/YARN-7217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16211832#comment-16211832
 ] 

Eric Yang commented on YARN-7217:
-

Hi [~billie.rinaldi], thank you for the review.

# Does YARN resource manager have privileges to all users's home directory?  In 
non-secure cluster, the answer is yes.  However, this might not be true in 
secure cluster.  This is one of the reasons that I did not implement 
getServicesList on fs.  If we want getServiceList on fs implemented for 
non-secure cluster, it can be included.
# actionBuild is validating and persist application on HDFS.  There is no 
external caller to actionBuild from REST API.  Perhaps, make actionBuild a 
private method?  actionCreate is the API that external callers uses.
# I think it's best to add configuration to YarnCommon, there are unit tests 
that valid the configuration addition, and reduce chance of using duplicated 
names.
# I will fix Solr version to hadoop-project/pom.xml
# YARN-7193 includes definition for global application definition in your last 
point.  It provides a set of API to register Yarnfile with additional metadata 
like organization, description, icon, and download into Solr.  I couldn't get 
anyone to review that JIRA, hence, I break down the functionality into small 
bits that can be consumed.  The first step is to offload storing of Yarnfile 
from HDFS to SOLR as improvement for this issue.  Application catalog can be 
built on top of what is proposed here.  Once application catalog is built, then 
we can start to think about how the money and software exchange take place for 
appstore.  Appstore idea might not get traction in Apache because its a 
non-profit organization.  We can think about that idea later.

> Improve API service usability for updating service spec and state
> -
>
> Key: YARN-7217
> URL: https://issues.apache.org/jira/browse/YARN-7217
> Project: Hadoop YARN
>  Issue Type: Task
>  Components: api, applications
>Reporter: Eric Yang
>Assignee: Eric Yang
> Attachments: YARN-7217.yarn-native-services.001.patch, 
> YARN-7217.yarn-native-services.002.patch, 
> YARN-7217.yarn-native-services.003.patch, 
> YARN-7217.yarn-native-services.004.patch
>
>
> API service for deploy, and manage YARN services have several limitations.
> {{updateService}} API provides multiple functions:
> # Stopping a service.
> # Start a service.
> # Increase or decrease number of containers.  (This was removed in YARN-7323).
> The overloading is buggy depending on how the configuration should be applied.
> h4. Scenario 1
> A user retrieves Service object from getService call, and the Service object 
> contains state: STARTED.  The user would like to increase number of 
> containers for the deployed service.  The JSON has been updated to increase 
> container count.  The PUT method does not actually increase container count.
> h4. Scenario 2
> A user retrieves Service object from getService call, and the Service object 
> contains state: STOPPED.  The user would like to make a environment 
> configuration change.  The configuration does not get updated after PUT 
> method.
> This is possible to address by rearranging the logic of START/STOP after 
> configuration update.  However, there are other potential combinations that 
> can break PUT method.  For example, user like to make configuration changes, 
> but not yet restart the service until a later time.
> h4. Scenario 3
> There is no API to list all deployed applications by the same user.
> h4. Scenario 4
> Desired state (spec) and current state are represented by the same Service 
> object.  There is no easy way to identify "state" is desired state to reach 
> or, the current state of the service.  It would be nice to have ability to 
> retrieve both desired state, and current state with separated entry points.  
> By implementing /spec and /state, it can resolve this problem.
> h4. Scenario 5
> List all services deploy by the same user can trigger a directory listing 
> operation on namenode if hdfs is used as storage for metadata.  When hundred 
> of users use Service UI to view or deploy applications, this will trigger 
> denial of services attack on namenode.  The sparse small metadata files also 
> reduce efficiency of Namenode memory usage.  Hence, a cache layer for storing 
> service metadata can reduce namenode stress.
> h3. Proposed change
> ApiService can separate the PUT method into two PUT methods for configuration 
> changes vs operation changes.  New API could look like:
> {code}
> @PUT
> /ws/v1/services/[service_name]/spec
> Request Data:
> {
>   "name": "amp",
>   "components": [
> {
>   "name": "mysql",
>   "number_of_containers": 2,
>   "artifact": {
> "id": "centos/mysql-57-centos7:latest",
> 

[jira] [Commented] (YARN-7217) Improve API service usability for updating service spec and state

2017-10-19 Thread Billie Rinaldi (JIRA)

[ 
https://issues.apache.org/jira/browse/YARN-7217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16211730#comment-16211730
 ] 

Billie Rinaldi commented on YARN-7217:
--

Some comments on patch 004:
* fs / solr implemention should be different implementations of a pluggable 
interface (unless we change how the solr instance is being used, as discussed 
below)
* related: getServicesList has no fs implementation
* actionBuild needs a solr implementation
* we have been putting service configuration properties in YarnServiceConf, not 
in YarnConfiguration
* solr version should not be specified in services poms; instead all 
dependencies should be added to hadoop-project/pom.xml
* flexing issue mentioned previously
* the user handling is confusing. Yarn solr client appears to ignore the user 
for some methods such as findAppEntry and deleteApp, but not others. With this 
implementation, can different users use the same app from the app store 
(assuming this solr instance is meant to be the app store)? Also, a user 
updating their own instance of an app should probably not change the app spec 
in the app store. I’m not sure apps should be stored per-user (or per-instance) 
in the solr store. Maybe there should be a global version of an app spec, and a 
normal user can create an instance of that global version and make changes to 
their instance but not to the global version. We should have a way to create an 
app instance from an app spec stored in the app store, as well. Basically, I 
don’t think the app specs in the app store should represent instances. It would 
probably be more useful to store specs, and then a list of instances 
(user/appName pairs) that are currently running (or stopped) that were started 
from that spec.

> Improve API service usability for updating service spec and state
> -
>
> Key: YARN-7217
> URL: https://issues.apache.org/jira/browse/YARN-7217
> Project: Hadoop YARN
>  Issue Type: Task
>  Components: api, applications
>Reporter: Eric Yang
>Assignee: Eric Yang
> Attachments: YARN-7217.yarn-native-services.001.patch, 
> YARN-7217.yarn-native-services.002.patch, 
> YARN-7217.yarn-native-services.003.patch, 
> YARN-7217.yarn-native-services.004.patch
>
>
> API service for deploy, and manage YARN services have several limitations.
> The update service API provides multiple functions:
> # Stopping a service.
> # Start a service.
> # Increase or decrease number of containers.
> The overloading is buggy depending on how the configuration should be applied.
> Scenario 1
> A user retrieves Service object from getService call, and the Service object 
> contains state: STARTED.  The user would like to increase number of 
> containers for the deployed service.  The JSON has been updated to increase 
> container count.  The PUT method does not actually increase container count.
> Scenario 2
> A user retrieves Service object from getService call, and the Service object 
> contains state: STOPPED.  The user would like to make a environment 
> configuration change.  The configuration does not get updated after PUT 
> method.
> This is possible to address by rearranging the logic of START/STOP after 
> configuration update.  However, there are other potential combinations that 
> can break PUT method.  For example, user like to make configuration changes, 
> but not yet restart the service until a later time.
> The alternative is to separate the PUT method into PUT method for 
> configuration vs status.  This increase the number of action that can be 
> performed.  New API could look like:
> {code}
> @PUT
> /ws/v1/services/[service_name]/spec
> Request Data:
> {
>   "name":"[service_name]",
>   "number_of_containers": 5
> }
> {code}
> {code}
> @PUT
> /ws/v1/services/[service_name]/state
> Request data:
> {
>   "name": "[service_name]",
>   "state": "STOPPED|STARTED"
> }
> {code}
> Scenario 3
> There is no API to list all deployed applications by the same user.
> Scenario 4
> Desired state (spec) and current state are represented by the same Service 
> object.  There is no easy way to identify "state" is desired state to reach 
> or, the current state of the service.  It would be nice to have ability to 
> retrieve both desired state, and current state with separated entry points.  
> By implementing /spec and /state, it can resolve this problem.
> Scenario 5
> List all services deploy by the same user can trigger a directory listing 
> operation on namenode if hdfs is used as storage for metadata.  When hundred 
> of users use Service UI to view or deploy applications, this will trigger 
> denial of services attack on namenode.  The sparse small metadata files also 
> reduce efficiency of Namenode memory usage.  Hence, a cache layer for storing 
> service metadata would be nice.




[jira] [Commented] (YARN-7217) Improve API service usability for updating service spec and state

2017-10-19 Thread Jian He (JIRA)

[ 
https://issues.apache.org/jira/browse/YARN-7217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16211440#comment-16211440
 ] 

Jian He commented on YARN-7217:
---

In description: 
bq. The update service API provides multiple functions:
bq. Stopping a service.
bq. Start a service.
bq. Increase or decrease number of containers.
I meant there are only stop and start in current code,  Increase or decrease  
is already removed.  anyway, I can check the code what it does exactly. 

> Improve API service usability for updating service spec and state
> -
>
> Key: YARN-7217
> URL: https://issues.apache.org/jira/browse/YARN-7217
> Project: Hadoop YARN
>  Issue Type: Task
>  Components: api, applications
>Reporter: Eric Yang
>Assignee: Eric Yang
> Attachments: YARN-7217.yarn-native-services.001.patch, 
> YARN-7217.yarn-native-services.002.patch, 
> YARN-7217.yarn-native-services.003.patch, 
> YARN-7217.yarn-native-services.004.patch
>
>
> API service for deploy, and manage YARN services have several limitations.
> The update service API provides multiple functions:
> # Stopping a service.
> # Start a service.
> # Increase or decrease number of containers.
> The overloading is buggy depending on how the configuration should be applied.
> Scenario 1
> A user retrieves Service object from getService call, and the Service object 
> contains state: STARTED.  The user would like to increase number of 
> containers for the deployed service.  The JSON has been updated to increase 
> container count.  The PUT method does not actually increase container count.
> Scenario 2
> A user retrieves Service object from getService call, and the Service object 
> contains state: STOPPED.  The user would like to make a environment 
> configuration change.  The configuration does not get updated after PUT 
> method.
> This is possible to address by rearranging the logic of START/STOP after 
> configuration update.  However, there are other potential combinations that 
> can break PUT method.  For example, user like to make configuration changes, 
> but not yet restart the service until a later time.
> The alternative is to separate the PUT method into PUT method for 
> configuration vs status.  This increase the number of action that can be 
> performed.  New API could look like:
> {code}
> @PUT
> /ws/v1/services/[service_name]/spec
> Request Data:
> {
>   "name":"[service_name]",
>   "number_of_containers": 5
> }
> {code}
> {code}
> @PUT
> /ws/v1/services/[service_name]/state
> Request data:
> {
>   "name": "[service_name]",
>   "state": "STOPPED|STARTED"
> }
> {code}
> Scenario 3
> There is no API to list all deployed applications by the same user.
> Scenario 4
> Desired state (spec) and current state are represented by the same Service 
> object.  There is no easy way to identify "state" is desired state to reach 
> or, the current state of the service.  It would be nice to have ability to 
> retrieve both desired state, and current state with separated entry points.  
> By implementing /spec and /state, it can resolve this problem.
> Scenario 5
> List all services deploy by the same user can trigger a directory listing 
> operation on namenode if hdfs is used as storage for metadata.  When hundred 
> of users use Service UI to view or deploy applications, this will trigger 
> denial of services attack on namenode.  The sparse small metadata files also 
> reduce efficiency of Namenode memory usage.  Hence, a cache layer for storing 
> service metadata would be nice.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

-
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org



[jira] [Commented] (YARN-7217) Improve API service usability for updating service spec and state

2017-10-19 Thread Eric Yang (JIRA)

[ 
https://issues.apache.org/jira/browse/YARN-7217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16211271#comment-16211271
 ] 

Eric Yang commented on YARN-7217:
-

[~jianhe] The title has been updated.  Description is also updated.  Flex 
functionality is in "/ws/v1/services/[service_name]/state".  However, the 
proper method to ensure flex operation persist upon service restart is to call 
"/ws/v1/services/[service_name]/spec" to update container numbers, then call 
"/ws/v1/services/[services_name]/state" to trigger the flex operation.

> Improve API service usability for updating service spec and state
> -
>
> Key: YARN-7217
> URL: https://issues.apache.org/jira/browse/YARN-7217
> Project: Hadoop YARN
>  Issue Type: Task
>  Components: api, applications
>Reporter: Eric Yang
>Assignee: Eric Yang
> Attachments: YARN-7217.yarn-native-services.001.patch, 
> YARN-7217.yarn-native-services.002.patch, 
> YARN-7217.yarn-native-services.003.patch, 
> YARN-7217.yarn-native-services.004.patch
>
>
> API service for deploy, and manage YARN services have several limitations.
> The update service API provides multiple functions:
> # Stopping a service.
> # Start a service.
> # Increase or decrease number of containers.
> The overloading is buggy depending on how the configuration should be applied.
> Scenario 1
> A user retrieves Service object from getService call, and the Service object 
> contains state: STARTED.  The user would like to increase number of 
> containers for the deployed service.  The JSON has been updated to increase 
> container count.  The PUT method does not actually increase container count.
> Scenario 2
> A user retrieves Service object from getService call, and the Service object 
> contains state: STOPPED.  The user would like to make a environment 
> configuration change.  The configuration does not get updated after PUT 
> method.
> This is possible to address by rearranging the logic of START/STOP after 
> configuration update.  However, there are other potential combinations that 
> can break PUT method.  For example, user like to make configuration changes, 
> but not yet restart the service until a later time.
> The alternative is to separate the PUT method into PUT method for 
> configuration vs status.  This increase the number of action that can be 
> performed.  New API could look like:
> {code}
> @PUT
> /ws/v1/services/[service_name]/spec
> Request Data:
> {
>   "name":"[service_name]",
>   "number_of_containers": 5
> }
> {code}
> {code}
> @PUT
> /ws/v1/services/[service_name]/state
> Request data:
> {
>   "name": "[service_name]",
>   "state": "STOPPED|STARTED"
> }
> {code}
> Scenario 3
> There is no API to list all deployed applications by the same user.
> Scenario 4
> Desired state (spec) and current state are represented by the same Service 
> object.  There is no easy way to identify "state" is desired state to reach 
> or, the current state of the service.  It would be nice to have ability to 
> retrieve both desired state, and current state with separated entry points.  
> By implementing /spec and /state, it can resolve this problem.
> Scenario 5
> List all services deploy by the same user will trigger a directory listing 
> operation on namenode.  When hundred of users use Service UI to view or 
> deploy applications, this will trigger denial of services attack on namenode. 
>  Recommendation is to have a cache layer for storing service metadata.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

-
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org