You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@twill.apache.org by anwar6953 <gi...@git.apache.org> on 2016/08/26 07:38:48 UTC

[GitHub] twill pull request #7: TWILL-185 Allow user to avoid scheduling the Location...

GitHub user anwar6953 opened a pull request:

    https://github.com/apache/twill/pull/7

    TWILL-185 Allow user to avoid scheduling the LocationSecureStoreUpdater.

    This will allow the use case of user scheduling their own secure store updates.
    As a workaround, for example:
    https://github.com/caskdata/cdap/pull/6380/commits/e77b9ac1fa6c9176a49cb27d6118e2d3065b93cd#diff-832334ca819881b7884d50946c76ce00L332
    
    It will also alleviate some of the issues described in https://issues.apache.org/jira/browse/TWILL-109.
    
    https://issues.apache.org/jira/browse/TWILL-185

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/anwar6953/twill feature/allow-disabling-secure-store-update

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/twill/pull/7.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #7
    
----
commit 12debc95d517561b5a88057c842d4697d87f8fc9
Author: Ali Anwar <an...@berkeley.edu>
Date:   2016-08-26T07:37:14Z

    TWILL-185 Allow user to avoid scheduling the LocationSecureStoreUpdater.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] twill pull request #7: TWILL-185 Allow user to avoid scheduling the Location...

Posted by chtyim <gi...@git.apache.org>.
Github user chtyim commented on a diff in the pull request:

    https://github.com/apache/twill/pull/7#discussion_r76519593
  
    --- Diff: twill-core/src/main/java/org/apache/twill/internal/Configs.java ---
    @@ -31,6 +31,11 @@
          */
         public static final String JAVA_RESERVED_MEMORY_MB = "twill.java.reserved.memory.mb";
     
    +    /**
    +     * Set this to false to disable the secure store updates done by default.
    +     */
    +    public static final String ENABLE_DEFAULT_SECURE_STORE_UPDATE = "twill.enable.default.secure.store.update";
    --- End diff --
    
    I think the common convention is to call it like `twill.secure.store.update.location.enabled` (from widest to narrowest scope, see hadoop-default.xml). Explicitly calling out `location` because that is what get updated by default right now and potentially there can be other secure store gets updated by default.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] twill pull request #7: TWILL-185 Allow user to avoid scheduling the Location...

Posted by anwar6953 <gi...@git.apache.org>.
Github user anwar6953 commented on a diff in the pull request:

    https://github.com/apache/twill/pull/7#discussion_r76726702
  
    --- Diff: twill-core/src/main/java/org/apache/twill/internal/Configs.java ---
    @@ -31,6 +31,11 @@
          */
         public static final String JAVA_RESERVED_MEMORY_MB = "twill.java.reserved.memory.mb";
     
    +    /**
    +     * Set this to false to disable the secure store updates done by default.
    +     */
    +    public static final String ENABLE_DEFAULT_SECURE_STORE_UPDATE = "twill.secure.store.update.location.enabled";
    --- End diff --
    
    Updated and squashed.
    This was the only diff:
    ![image](https://cloud.githubusercontent.com/assets/2440977/18075464/eab7cfa4-6e29-11e6-8373-a70e47fcb620.png)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] twill pull request #7: TWILL-185 Allow user to avoid scheduling the Location...

Posted by chtyim <gi...@git.apache.org>.
Github user chtyim commented on a diff in the pull request:

    https://github.com/apache/twill/pull/7#discussion_r76454915
  
    --- Diff: twill-yarn/src/main/java/org/apache/twill/yarn/YarnTwillRunnerService.java ---
    @@ -157,11 +158,25 @@ public YarnTwillRunnerService(YarnConfiguration config, String zkConnect) {
        * @param locationFactory Factory to create {@link Location} instances that are readable and writable by this service
        */
       public YarnTwillRunnerService(YarnConfiguration config, String zkConnect, LocationFactory locationFactory) {
    +    this(config, zkConnect, locationFactory, true);
    +  }
    +
    +  /**
    +   * Creates an instance.
    +   *
    +   * @param config Configuration of the yarn cluster
    +   * @param zkConnect ZooKeeper connection string
    +   * @param locationFactory Factory to create {@link Location} instances that are readable and writable by this service
    +   * @param enableSecureStoreUpdate Whether to update SecureStore periodically
    +   */
    +  public YarnTwillRunnerService(YarnConfiguration config, String zkConnect, LocationFactory locationFactory,
    +                                boolean enableSecureStoreUpdate) {
         this.yarnConfig = config;
         this.yarnAppClient = new VersionDetectYarnAppClientFactory().create(config);
         this.locationFactory = locationFactory;
         this.zkClientService = getZKClientService(zkConnect);
         this.controllers = HashBasedTable.create();
    +    this.enableSecureStoreUpdate = enableSecureStoreUpdate;
    --- End diff --
    
    Better use a configuration passed in from the `YarnConfiguration`. The keys should be defined in `Configs.Keys` class.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] twill pull request #7: TWILL-185 Allow user to avoid scheduling the Location...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/twill/pull/7


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] twill issue #7: TWILL-185 Allow user to avoid scheduling the LocationSecureS...

Posted by anwar6953 <gi...@git.apache.org>.
Github user anwar6953 commented on the issue:

    https://github.com/apache/twill/pull/7
  
    squashed commits


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] twill pull request #7: TWILL-185 Allow user to avoid scheduling the Location...

Posted by hsaputra <gi...@git.apache.org>.
Github user hsaputra commented on a diff in the pull request:

    https://github.com/apache/twill/pull/7#discussion_r76521765
  
    --- Diff: twill-core/src/main/java/org/apache/twill/internal/Configs.java ---
    @@ -31,6 +31,11 @@
          */
         public static final String JAVA_RESERVED_MEMORY_MB = "twill.java.reserved.memory.mb";
     
    +    /**
    +     * Set this to false to disable the secure store updates done by default.
    +     */
    +    public static final String ENABLE_DEFAULT_SECURE_STORE_UPDATE = "twill.enable.default.secure.store.update";
    --- End diff --
    
    +1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] twill pull request #7: TWILL-185 Allow user to avoid scheduling the Location...

Posted by chtyim <gi...@git.apache.org>.
Github user chtyim commented on a diff in the pull request:

    https://github.com/apache/twill/pull/7#discussion_r76710103
  
    --- Diff: twill-core/src/main/java/org/apache/twill/internal/Configs.java ---
    @@ -31,6 +31,11 @@
          */
         public static final String JAVA_RESERVED_MEMORY_MB = "twill.java.reserved.memory.mb";
     
    +    /**
    +     * Set this to false to disable the secure store updates done by default.
    +     */
    +    public static final String ENABLE_DEFAULT_SECURE_STORE_UPDATE = "twill.secure.store.update.location.enabled";
    --- End diff --
    
    It's better to have the constant name matches with the value. E.g. `SECURE_STORE_UPDATE_LOCATION_ENABLED`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] twill pull request #7: TWILL-185 Allow user to avoid scheduling the Location...

Posted by chtyim <gi...@git.apache.org>.
Github user chtyim commented on a diff in the pull request:

    https://github.com/apache/twill/pull/7#discussion_r76454783
  
    --- Diff: twill-yarn/src/main/java/org/apache/twill/yarn/YarnTwillRunnerService.java ---
    @@ -211,7 +226,7 @@ public String getJVMOptions() {
       @Override
       public Cancellable scheduleSecureStoreUpdate(final SecureStoreUpdater updater,
                                                    long initialDelay, long delay, TimeUnit unit) {
    -    if (!UserGroupInformation.isSecurityEnabled()) {
    +    if (!UserGroupInformation.isSecurityEnabled() || !enableSecureStoreUpdate) {
    --- End diff --
    
    You shouldn't disable this one. Otherwise user won't be able to schedule his own update. We should only disable the default one by Twill (the one that update HDFS delegation tokens in `startUp`).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] twill pull request #7: TWILL-185 Allow user to avoid scheduling the Location...

Posted by anwar6953 <gi...@git.apache.org>.
Github user anwar6953 commented on a diff in the pull request:

    https://github.com/apache/twill/pull/7#discussion_r76456007
  
    --- Diff: twill-yarn/src/main/java/org/apache/twill/yarn/YarnTwillRunnerService.java ---
    @@ -211,7 +226,7 @@ public String getJVMOptions() {
       @Override
       public Cancellable scheduleSecureStoreUpdate(final SecureStoreUpdater updater,
                                                    long initialDelay, long delay, TimeUnit unit) {
    -    if (!UserGroupInformation.isSecurityEnabled()) {
    +    if (!UserGroupInformation.isSecurityEnabled() || !enableSecureStoreUpdate) {
    --- End diff --
    
    oh right; good point.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] twill issue #7: TWILL-185 Allow user to avoid scheduling the LocationSecureS...

Posted by chtyim <gi...@git.apache.org>.
Github user chtyim commented on the issue:

    https://github.com/apache/twill/pull/7
  
    LGTM.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] twill pull request #7: TWILL-185 Allow user to avoid scheduling the Location...

Posted by hsaputra <gi...@git.apache.org>.
Github user hsaputra commented on a diff in the pull request:

    https://github.com/apache/twill/pull/7#discussion_r76463039
  
    --- Diff: twill-core/src/main/java/org/apache/twill/internal/Configs.java ---
    @@ -31,6 +31,11 @@
          */
         public static final String JAVA_RESERVED_MEMORY_MB = "twill.java.reserved.memory.mb";
     
    +    /**
    +     *
    +     */
    +    public static final String ENABLE_DEFAULT_SECURE_STORE_UPDATE = "twill.enable.default.secure.store.update";
    --- End diff --
    
    Could you add description what this constant for?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---