You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Pradeep Agrawal <pr...@gmail.com> on 2023/09/27 12:26:46 UTC

Review Request 74625: RANGER-4438: Read JAVA_OPTS in ranger db setup python script

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74625/
-----------------------------------------------------------

Review request for ranger, Abhishek  Kumar, bhavik patel, Dhaval Shah, Dineshkumar Yadav, Kishor Gollapalliwar, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.


Bugs: RANGER-4438
    https://issues.apache.org/jira/browse/RANGER-4438


Repository: ranger


Description
-------

**Problem Statement:** Currently db_setup.py file does not accepts or add JAVA_OPTS options in java commands executed from db_setup.py and changepasswordutil.py file. In certain environment user may need these options to execute the java commands successfully.

**Proposed Solution:** 
In the proposed patch, db_setup.py and changepasswordutil.py file can read JAVA_OPTS from environment variable and pass that to java class run command being executed from the same file.
Alternatively user can provide the same in install.propeties via java_opts property. setup.sh shall export the java_opts value as JAVA_OPTS environement variable.


Diffs
-----

  security-admin/scripts/changepasswordutil.py e45dab643 
  security-admin/scripts/db_setup.py 24502f4fb 
  security-admin/scripts/install.properties b8e864e9a 
  security-admin/scripts/setup.sh 750455f08 


Diff: https://reviews.apache.org/r/74625/diff/1/


Testing
-------

Steps:
1. Exported a JAVA_OPTS option '-Xms1g' by running the command export JAVA_OPTS='-Xms1g' on the console.
2. Added debug statement in db_setup.py file to print java class run command which are usually executed when db_setup.py is called.
2. Executed the setup.sh file
3. setup.sh command executed succesfully and can see debug logs with added JAVA_OPTS '-Xms1g'


Thanks,

Pradeep Agrawal


Re: Review Request 74625: RANGER-4438: Read JAVA_OPTS in ranger db setup python script

Posted by Pradeep Agrawal <pr...@gmail.com>.

> On Oct. 13, 2023, 9:36 a.m., bhavik patel wrote:
> > Can you kindly add for ranger-kms?

Please review the updated patch


- Pradeep


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74625/#review225859
-----------------------------------------------------------


On Oct. 25, 2023, 10:10 a.m., Pradeep Agrawal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74625/
> -----------------------------------------------------------
> 
> (Updated Oct. 25, 2023, 10:10 a.m.)
> 
> 
> Review request for ranger, Abhishek  Kumar, bhavik patel, Dhaval Shah, Dineshkumar Yadav, Kishor Gollapalliwar, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-4438
>     https://issues.apache.org/jira/browse/RANGER-4438
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem Statement:** Currently db_setup.py file does not accepts or add JAVA_OPTS options in java commands executed from db_setup.py and changepasswordutil.py file. In certain environment user may need these options to execute the java commands successfully.
> 
> **Proposed Solution:** 
> In the proposed patch, db_setup.py and changepasswordutil.py file can read JAVA_OPTS from environment variable and pass that to java class run command being executed from the same file.
> Alternatively user can provide the same in install.propeties via java_opts property. setup.sh shall export the java_opts value as JAVA_OPTS environement variable.
> 
> 
> Diffs
> -----
> 
>   kms/scripts/db_setup.py d21a6ac75 
>   kms/scripts/install.properties 0e5da3c75 
>   kms/scripts/setup.sh f723e09bb 
>   security-admin/scripts/changepasswordutil.py e45dab643 
>   security-admin/scripts/db_setup.py 24502f4fb 
>   security-admin/scripts/install.properties b8e864e9a 
>   security-admin/scripts/setup.sh 750455f08 
> 
> 
> Diff: https://reviews.apache.org/r/74625/diff/2/
> 
> 
> Testing
> -------
> 
> Steps:
> 1. Exported a JAVA_OPTS option '-Xms1g' by running the command export JAVA_OPTS='-Xms1g' on the console.
> 2. Added debug statement in db_setup.py file to print java class run command which are usually executed when db_setup.py is called.
> 2. Executed the setup.sh file
> 3. setup.sh command executed succesfully and can see debug logs with added JAVA_OPTS '-Xms1g'
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>


Re: Review Request 74625: RANGER-4438: Read JAVA_OPTS in ranger db setup python script

Posted by bhavik patel <bh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74625/#review225859
-----------------------------------------------------------



Can you kindly add for ranger-kms?

- bhavik patel


On Sept. 27, 2023, 12:26 p.m., Pradeep Agrawal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74625/
> -----------------------------------------------------------
> 
> (Updated Sept. 27, 2023, 12:26 p.m.)
> 
> 
> Review request for ranger, Abhishek  Kumar, bhavik patel, Dhaval Shah, Dineshkumar Yadav, Kishor Gollapalliwar, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-4438
>     https://issues.apache.org/jira/browse/RANGER-4438
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem Statement:** Currently db_setup.py file does not accepts or add JAVA_OPTS options in java commands executed from db_setup.py and changepasswordutil.py file. In certain environment user may need these options to execute the java commands successfully.
> 
> **Proposed Solution:** 
> In the proposed patch, db_setup.py and changepasswordutil.py file can read JAVA_OPTS from environment variable and pass that to java class run command being executed from the same file.
> Alternatively user can provide the same in install.propeties via java_opts property. setup.sh shall export the java_opts value as JAVA_OPTS environement variable.
> 
> 
> Diffs
> -----
> 
>   security-admin/scripts/changepasswordutil.py e45dab643 
>   security-admin/scripts/db_setup.py 24502f4fb 
>   security-admin/scripts/install.properties b8e864e9a 
>   security-admin/scripts/setup.sh 750455f08 
> 
> 
> Diff: https://reviews.apache.org/r/74625/diff/1/
> 
> 
> Testing
> -------
> 
> Steps:
> 1. Exported a JAVA_OPTS option '-Xms1g' by running the command export JAVA_OPTS='-Xms1g' on the console.
> 2. Added debug statement in db_setup.py file to print java class run command which are usually executed when db_setup.py is called.
> 2. Executed the setup.sh file
> 3. setup.sh command executed succesfully and can see debug logs with added JAVA_OPTS '-Xms1g'
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>


Re: Review Request 74625: RANGER-4438: Read JAVA_OPTS in ranger db setup python script

Posted by Pradeep Agrawal <pr...@gmail.com>.

> On Sept. 29, 2023, 8:16 p.m., Abhishek  Kumar wrote:
> > security-admin/scripts/install.properties
> > Lines 265 (patched)
> > <https://reviews.apache.org/r/74625/diff/1/?file=2280229#file2280229line265>
> >
> >     Please take a look at 
> >     1. dev-support/ranger-docker/scripts/ranger-admin-install-mysql.properties and 
> >     2. dev-support/ranger-docker/scripts/ranger-admin-install-postgres.properties
> >     
> >     to support this in ranger containers.

Created separate ticket to track this for docker : https://issues.apache.org/jira/browse/RANGER-4468


- Pradeep


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74625/#review225800
-----------------------------------------------------------


On Sept. 27, 2023, 12:26 p.m., Pradeep Agrawal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74625/
> -----------------------------------------------------------
> 
> (Updated Sept. 27, 2023, 12:26 p.m.)
> 
> 
> Review request for ranger, Abhishek  Kumar, bhavik patel, Dhaval Shah, Dineshkumar Yadav, Kishor Gollapalliwar, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-4438
>     https://issues.apache.org/jira/browse/RANGER-4438
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem Statement:** Currently db_setup.py file does not accepts or add JAVA_OPTS options in java commands executed from db_setup.py and changepasswordutil.py file. In certain environment user may need these options to execute the java commands successfully.
> 
> **Proposed Solution:** 
> In the proposed patch, db_setup.py and changepasswordutil.py file can read JAVA_OPTS from environment variable and pass that to java class run command being executed from the same file.
> Alternatively user can provide the same in install.propeties via java_opts property. setup.sh shall export the java_opts value as JAVA_OPTS environement variable.
> 
> 
> Diffs
> -----
> 
>   security-admin/scripts/changepasswordutil.py e45dab643 
>   security-admin/scripts/db_setup.py 24502f4fb 
>   security-admin/scripts/install.properties b8e864e9a 
>   security-admin/scripts/setup.sh 750455f08 
> 
> 
> Diff: https://reviews.apache.org/r/74625/diff/1/
> 
> 
> Testing
> -------
> 
> Steps:
> 1. Exported a JAVA_OPTS option '-Xms1g' by running the command export JAVA_OPTS='-Xms1g' on the console.
> 2. Added debug statement in db_setup.py file to print java class run command which are usually executed when db_setup.py is called.
> 2. Executed the setup.sh file
> 3. setup.sh command executed succesfully and can see debug logs with added JAVA_OPTS '-Xms1g'
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>


Re: Review Request 74625: RANGER-4438: Read JAVA_OPTS in ranger db setup python script

Posted by Abhishek Kumar <ab...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74625/#review225800
-----------------------------------------------------------




security-admin/scripts/install.properties
Lines 265 (patched)
<https://reviews.apache.org/r/74625/#comment314229>

    Please take a look at 
    1. dev-support/ranger-docker/scripts/ranger-admin-install-mysql.properties and 
    2. dev-support/ranger-docker/scripts/ranger-admin-install-postgres.properties
    
    to support this in ranger containers.


- Abhishek  Kumar


On Sept. 27, 2023, 12:26 p.m., Pradeep Agrawal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74625/
> -----------------------------------------------------------
> 
> (Updated Sept. 27, 2023, 12:26 p.m.)
> 
> 
> Review request for ranger, Abhishek  Kumar, bhavik patel, Dhaval Shah, Dineshkumar Yadav, Kishor Gollapalliwar, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-4438
>     https://issues.apache.org/jira/browse/RANGER-4438
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem Statement:** Currently db_setup.py file does not accepts or add JAVA_OPTS options in java commands executed from db_setup.py and changepasswordutil.py file. In certain environment user may need these options to execute the java commands successfully.
> 
> **Proposed Solution:** 
> In the proposed patch, db_setup.py and changepasswordutil.py file can read JAVA_OPTS from environment variable and pass that to java class run command being executed from the same file.
> Alternatively user can provide the same in install.propeties via java_opts property. setup.sh shall export the java_opts value as JAVA_OPTS environement variable.
> 
> 
> Diffs
> -----
> 
>   security-admin/scripts/changepasswordutil.py e45dab643 
>   security-admin/scripts/db_setup.py 24502f4fb 
>   security-admin/scripts/install.properties b8e864e9a 
>   security-admin/scripts/setup.sh 750455f08 
> 
> 
> Diff: https://reviews.apache.org/r/74625/diff/1/
> 
> 
> Testing
> -------
> 
> Steps:
> 1. Exported a JAVA_OPTS option '-Xms1g' by running the command export JAVA_OPTS='-Xms1g' on the console.
> 2. Added debug statement in db_setup.py file to print java class run command which are usually executed when db_setup.py is called.
> 2. Executed the setup.sh file
> 3. setup.sh command executed succesfully and can see debug logs with added JAVA_OPTS '-Xms1g'
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>


Re: Review Request 74625: RANGER-4438: Read JAVA_OPTS in ranger db setup python script

Posted by Abhishek Kumar <ab...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74625/#review225787
-----------------------------------------------------------




security-admin/scripts/changepasswordutil.py
Lines 81 (patched)
<https://reviews.apache.org/r/74625/#comment314204>

    Suggestion:
    
    JAVA_OPTS = os.getenv("JAVA_OPTS") or ""



security-admin/scripts/db_setup.py
Lines 42 (patched)
<https://reviews.apache.org/r/74625/#comment314205>

    Suggestion:
    
    JAVA_OPTS = os.getenv("JAVA_OPTS") or ""


- Abhishek  Kumar


On Sept. 27, 2023, 12:26 p.m., Pradeep Agrawal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74625/
> -----------------------------------------------------------
> 
> (Updated Sept. 27, 2023, 12:26 p.m.)
> 
> 
> Review request for ranger, Abhishek  Kumar, bhavik patel, Dhaval Shah, Dineshkumar Yadav, Kishor Gollapalliwar, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-4438
>     https://issues.apache.org/jira/browse/RANGER-4438
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem Statement:** Currently db_setup.py file does not accepts or add JAVA_OPTS options in java commands executed from db_setup.py and changepasswordutil.py file. In certain environment user may need these options to execute the java commands successfully.
> 
> **Proposed Solution:** 
> In the proposed patch, db_setup.py and changepasswordutil.py file can read JAVA_OPTS from environment variable and pass that to java class run command being executed from the same file.
> Alternatively user can provide the same in install.propeties via java_opts property. setup.sh shall export the java_opts value as JAVA_OPTS environement variable.
> 
> 
> Diffs
> -----
> 
>   security-admin/scripts/changepasswordutil.py e45dab643 
>   security-admin/scripts/db_setup.py 24502f4fb 
>   security-admin/scripts/install.properties b8e864e9a 
>   security-admin/scripts/setup.sh 750455f08 
> 
> 
> Diff: https://reviews.apache.org/r/74625/diff/1/
> 
> 
> Testing
> -------
> 
> Steps:
> 1. Exported a JAVA_OPTS option '-Xms1g' by running the command export JAVA_OPTS='-Xms1g' on the console.
> 2. Added debug statement in db_setup.py file to print java class run command which are usually executed when db_setup.py is called.
> 2. Executed the setup.sh file
> 3. setup.sh command executed succesfully and can see debug logs with added JAVA_OPTS '-Xms1g'
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>


Re: Review Request 74625: RANGER-4438: Read JAVA_OPTS in ranger db setup python script

Posted by bhavik patel <bh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74625/#review225967
-----------------------------------------------------------


Ship it!




Ship It!

- bhavik patel


On Oct. 25, 2023, 10:10 a.m., Pradeep Agrawal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74625/
> -----------------------------------------------------------
> 
> (Updated Oct. 25, 2023, 10:10 a.m.)
> 
> 
> Review request for ranger, Abhishek  Kumar, bhavik patel, Dhaval Shah, Dineshkumar Yadav, Kishor Gollapalliwar, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-4438
>     https://issues.apache.org/jira/browse/RANGER-4438
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Problem Statement:** Currently db_setup.py file does not accepts or add JAVA_OPTS options in java commands executed from db_setup.py and changepasswordutil.py file. In certain environment user may need these options to execute the java commands successfully.
> 
> **Proposed Solution:** 
> In the proposed patch, db_setup.py and changepasswordutil.py file can read JAVA_OPTS from environment variable and pass that to java class run command being executed from the same file.
> Alternatively user can provide the same in install.propeties via java_opts property. setup.sh shall export the java_opts value as JAVA_OPTS environement variable.
> 
> 
> Diffs
> -----
> 
>   kms/scripts/db_setup.py d21a6ac75 
>   kms/scripts/install.properties 0e5da3c75 
>   kms/scripts/setup.sh f723e09bb 
>   security-admin/scripts/changepasswordutil.py e45dab643 
>   security-admin/scripts/db_setup.py 24502f4fb 
>   security-admin/scripts/install.properties b8e864e9a 
>   security-admin/scripts/setup.sh 750455f08 
> 
> 
> Diff: https://reviews.apache.org/r/74625/diff/2/
> 
> 
> Testing
> -------
> 
> Steps:
> 1. Exported a JAVA_OPTS option '-Xms1g' by running the command export JAVA_OPTS='-Xms1g' on the console.
> 2. Added debug statement in db_setup.py file to print java class run command which are usually executed when db_setup.py is called.
> 2. Executed the setup.sh file
> 3. setup.sh command executed succesfully and can see debug logs with added JAVA_OPTS '-Xms1g'
> 
> 
> Thanks,
> 
> Pradeep Agrawal
> 
>


Re: Review Request 74625: RANGER-4438: Read JAVA_OPTS in ranger db setup python script

Posted by Pradeep Agrawal <pr...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74625/
-----------------------------------------------------------

(Updated Oct. 25, 2023, 10:10 a.m.)


Review request for ranger, Abhishek  Kumar, bhavik patel, Dhaval Shah, Dineshkumar Yadav, Kishor Gollapalliwar, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.


Changes
-------

Added fix for ranger-kms and addressed the review comment.


Bugs: RANGER-4438
    https://issues.apache.org/jira/browse/RANGER-4438


Repository: ranger


Description
-------

**Problem Statement:** Currently db_setup.py file does not accepts or add JAVA_OPTS options in java commands executed from db_setup.py and changepasswordutil.py file. In certain environment user may need these options to execute the java commands successfully.

**Proposed Solution:** 
In the proposed patch, db_setup.py and changepasswordutil.py file can read JAVA_OPTS from environment variable and pass that to java class run command being executed from the same file.
Alternatively user can provide the same in install.propeties via java_opts property. setup.sh shall export the java_opts value as JAVA_OPTS environement variable.


Diffs (updated)
-----

  kms/scripts/db_setup.py d21a6ac75 
  kms/scripts/install.properties 0e5da3c75 
  kms/scripts/setup.sh f723e09bb 
  security-admin/scripts/changepasswordutil.py e45dab643 
  security-admin/scripts/db_setup.py 24502f4fb 
  security-admin/scripts/install.properties b8e864e9a 
  security-admin/scripts/setup.sh 750455f08 


Diff: https://reviews.apache.org/r/74625/diff/2/

Changes: https://reviews.apache.org/r/74625/diff/1-2/


Testing
-------

Steps:
1. Exported a JAVA_OPTS option '-Xms1g' by running the command export JAVA_OPTS='-Xms1g' on the console.
2. Added debug statement in db_setup.py file to print java class run command which are usually executed when db_setup.py is called.
2. Executed the setup.sh file
3. setup.sh command executed succesfully and can see debug logs with added JAVA_OPTS '-Xms1g'


Thanks,

Pradeep Agrawal