Re: [Discussion] RFC to make Geode's working directory configurable

2020-10-13 Thread Dale Emery
Geode makes nearly 300 references to the JVM working directory. Tests make an 
additional 1200 references.

Implementing this proposal requires changing nearly all of these references so 
that, instead of resolving relative pathnames against the JVM's working 
directory, they resolve against the configured working directory.

There are several ways in which Geode and its tests reference the JVM's working 
directory:

1. Use of the "user.dir" system property.

2. Use of a File or Path with pathname "." or "".

3. Calls to methods that convert a possibly relative pathname to an absolute 
one:
- file.getAbsoluteFile()
- file.getAbsolutePath()
- file.getCanonicalFile()
- file.getCanonicalPath()
- path.toAbsolutePath()
- IOUtils.tryGetCanonicalFileElseGetAbsoluteFile(file)
- IOUtils.tryGetCanonicalPathElseGetAbsolutePath(file)

Changing these references involves varying degress of difficulty, depending on 
whether there is an object is in scope that can identify the configured working 
directory. Some references have ready access to a DistributionConfig, or to a 
cache from which it can retrieve the configuration. Many references are in 
contexts in which no configuration object is readily available.

In a small number of cases, it is appropriate to resolve relative pathnames 
against the JVM's working directory. These few references would not have to 
change.

See the attached PDF file for an inventory of how different modules reference 
the JVM's working directory.

Cheers,
Dale



On 10/6/20, 12:12 PM, "Dale Emery"  wrote:

Hi all,

I have submitted an RFC to make Geode’s working directory configurable: 
https://cwiki.apache.org/confluence/display/GEODE/Make+Geode%27s+Working+Directory+Configurable

Please review it and comment by Oct 26.

Cheers,
Dale







Re: [Discussion] RFC to make Geode's working directory configurable

2020-10-07 Thread Dale Emery
Hi Jake,

Production code will use it.

In my initial (very cursory) scan of current uses of user.dir, it looked as if 
some uses were in places that didn't have ready access to a cache or other good 
source for this property. It may have been hasty for me to leap to a singleton.

I will take a closer look at whether those uses have access to an object that 
can own the working dir, or if they can be given access to an owner object. If 
they do, I'll put the responsibility in an appropriate instance instead of a 
singleton.

Dale

On 10/6/20, 5:24 PM, "Jacob Barrett"  wrote:

Do we expect this to be used by production code or just test code? If this 
is going to be used by production code I am concerned with introducing another 
singleton class into the mix. We really want to be moving towards a 
non-singleton world where I can have more than one Cache in a JVM. For 
production code this value should probably be retrieved from the Cache, 
DistributedSystem or some child of those instances. If this is for test code 
only then ignore me the above concerns.

> On Oct 6, 2020, at 12:12 PM, Dale Emery  wrote:
> 
> Hi all,
> 
> I have submitted an RFC to make Geode’s working directory configurable: 
https://cwiki.apache.org/confluence/display/GEODE/Make+Geode%27s+Working+Directory+Configurable
> 
> Please review it and comment by Oct 26.
> 
> Cheers,
> Dale
> 




Re: [Discussion] RFC to make Geode's working directory configurable

2020-10-07 Thread Anilkumar Gingade
Dale, I have few questions that I have added as comments to the RFC.

On 10/6/20, 5:24 PM, "Jacob Barrett"  wrote:

Do we expect this to be used by production code or just test code? If this 
is going to be used by production code I am concerned with introducing another 
singleton class into the mix. We really want to be moving towards a 
non-singleton world where I can have more than one Cache in a JVM. For 
production code this value should probably be retrieved from the Cache, 
DistributedSystem or some child of those instances. If this is for test code 
only then ignore me the above concerns.

> On Oct 6, 2020, at 12:12 PM, Dale Emery  wrote:
> 
> Hi all,
> 
> I have submitted an RFC to make Geode’s working directory configurable: 
https://cwiki.apache.org/confluence/display/GEODE/Make+Geode%27s+Working+Directory+Configurable
> 
> Please review it and comment by Oct 26.
> 
> Cheers,
> Dale
> 




Re: [Discussion] RFC to make Geode's working directory configurable

2020-10-06 Thread Jacob Barrett
Do we expect this to be used by production code or just test code? If this is 
going to be used by production code I am concerned with introducing another 
singleton class into the mix. We really want to be moving towards a 
non-singleton world where I can have more than one Cache in a JVM. For 
production code this value should probably be retrieved from the Cache, 
DistributedSystem or some child of those instances. If this is for test code 
only then ignore me the above concerns.

> On Oct 6, 2020, at 12:12 PM, Dale Emery  wrote:
> 
> Hi all,
> 
> I have submitted an RFC to make Geode’s working directory configurable: 
> https://cwiki.apache.org/confluence/display/GEODE/Make+Geode%27s+Working+Directory+Configurable
> 
> Please review it and comment by Oct 26.
> 
> Cheers,
> Dale
> 



Re: [Discussion] RFC to make Geode's working directory configurable

2020-10-06 Thread Jacob Barrett
I look for that myself a while back and couldn’t find anything either.

On Oct 6, 2020, at 4:10 PM, Dale Emery 
mailto:dem...@vmware.com>> wrote:

Hi Dan,

I spent more than a week scouring Gradle docs and code for any way to give the 
parallel forks their own working directories. I couldn't find a way. At least, 
not through the public API. And I'm reluctant to rely on internal APIs, the way 
our docker and repeat tests do. If this working-dir idea offers enough 
resistance, I'll take another look at Gradle.

Cheers,
Dale

On 10/6/20, 3:58 PM, "Dan Smith" 
mailto:dasm...@vmware.com>> wrote:

   +1

   Looks good to me. If this is just for tests, I suspect there is some gradle 
way to make parallel forks use different working directories. But having this 
option in the product doesn't seem like a bad idea.

   -Dan
   
   From: Dale Emery mailto:dem...@vmware.com>>
   Sent: Tuesday, October 6, 2020 12:12 PM
   To: dev@geode.apache.org 
mailto:dev@geode.apache.org>>
   Subject: [Discussion] RFC to make Geode's working directory configurable

   Hi all,

   I have submitted an RFC to make Geode’s working directory configurable: 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcwiki.apache.org%2Fconfluence%2Fdisplay%2FGEODE%2FMake%2BGeode%2527s%2BWorking%2BDirectory%2BConfigurabledata=02%7C01%7Cjabarrett%40vmware.com%7C1554b7957ed04228306708d86a4d1b9d%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637376226697780773sdata=g8ihCaJHH2qmH%2FVg9AMKmfz69D2wLEiUAg80zrD1PSY%3Dreserved=0

   Please review it and comment by Oct 26.

   Cheers,
   Dale



Re: [Discussion] RFC to make Geode's working directory configurable

2020-10-06 Thread Anthony Baker
The plan around backwards compatibility makes sense to me.

Anthony


> On Oct 6, 2020, at 4:10 PM, Dale Emery  wrote:
> 
> Hi Dan,
> 
> I spent more than a week scouring Gradle docs and code for any way to give 
> the parallel forks their own working directories. I couldn't find a way. At 
> least, not through the public API. And I'm reluctant to rely on internal 
> APIs, the way our docker and repeat tests do. If this working-dir idea offers 
> enough resistance, I'll take another look at Gradle.
> 
> Cheers,
> Dale
> 
> On 10/6/20, 3:58 PM, "Dan Smith"  wrote:
> 
>+1
> 
>Looks good to me. If this is just for tests, I suspect there is some 
> gradle way to make parallel forks use different working directories. But 
> having this option in the product doesn't seem like a bad idea.
> 
>-Dan
>
>From: Dale Emery 
>Sent: Tuesday, October 6, 2020 12:12 PM
>To: dev@geode.apache.org 
>Subject: [Discussion] RFC to make Geode's working directory configurable
> 
>Hi all,
> 
>I have submitted an RFC to make Geode’s working directory configurable: 
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcwiki.apache.org%2Fconfluence%2Fdisplay%2FGEODE%2FMake%2BGeode%2527s%2BWorking%2BDirectory%2BConfigurabledata=02%7C01%7Cbakera%40vmware.com%7C568729496bb94bbafe4108d86a4d1eeb%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637376226749652389sdata=EWrxpNf8TocLKEtapZQP3P5lMvFwuzTVrS9abs2gy%2Fs%3Dreserved=0
> 
>Please review it and comment by Oct 26.
> 
>Cheers,
>Dale
> 
> 



Re: [Discussion] RFC to make Geode's working directory configurable

2020-10-06 Thread Dale Emery
Hi Dan,

I spent more than a week scouring Gradle docs and code for any way to give the 
parallel forks their own working directories. I couldn't find a way. At least, 
not through the public API. And I'm reluctant to rely on internal APIs, the way 
our docker and repeat tests do. If this working-dir idea offers enough 
resistance, I'll take another look at Gradle.

Cheers,
Dale

On 10/6/20, 3:58 PM, "Dan Smith"  wrote:

+1

Looks good to me. If this is just for tests, I suspect there is some gradle 
way to make parallel forks use different working directories. But having this 
option in the product doesn't seem like a bad idea.

-Dan

From: Dale Emery 
Sent: Tuesday, October 6, 2020 12:12 PM
To: dev@geode.apache.org 
Subject: [Discussion] RFC to make Geode's working directory configurable

Hi all,

I have submitted an RFC to make Geode’s working directory configurable: 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcwiki.apache.org%2Fconfluence%2Fdisplay%2FGEODE%2FMake%2BGeode%2527s%2BWorking%2BDirectory%2BConfigurabledata=02%7C01%7Cdemery%40vmware.com%7C8d03aba161d24b80071108d86a4b5fe8%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637376219249446597sdata=wF6%2B%2BwsQX32AhndhvslF%2BeeKgA1e7YwVTMZmqoHED5o%3Dreserved=0

Please review it and comment by Oct 26.

Cheers,
Dale




Re: [Discussion] RFC to make Geode's working directory configurable

2020-10-06 Thread Dan Smith
+1

Looks good to me. If this is just for tests, I suspect there is some gradle way 
to make parallel forks use different working directories. But having this 
option in the product doesn't seem like a bad idea.

-Dan

From: Dale Emery 
Sent: Tuesday, October 6, 2020 12:12 PM
To: dev@geode.apache.org 
Subject: [Discussion] RFC to make Geode's working directory configurable

Hi all,

I have submitted an RFC to make Geode’s working directory configurable: 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcwiki.apache.org%2Fconfluence%2Fdisplay%2FGEODE%2FMake%2BGeode%2527s%2BWorking%2BDirectory%2BConfigurabledata=02%7C01%7Cdasmith%40vmware.com%7C9ba9d9e900654fb9ffa308d86a2bca19%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637376083606472413sdata=fcv7206ZXBMWBxR4cA7XHOU58EYY6ovL1DF6woCj0MQ%3Dreserved=0

Please review it and comment by Oct 26.

Cheers,
Dale