diff --git a/distro/src/bin/atlas_config.py b/distro/src/bin/atlas_config.py index 0723b3d..3913c82 100755 --- a/distro/src/bin/atlas_config.py +++ b/distro/src/bin/atlas_config.py @@ -93,8 +93,11 @@ def expandWebApp(dir): if e.errno != errno.EEXIST: raise e pass + atlasWarPath = os.path.join(atlasDir(), "server", "webapp", "atlas.war") + if (isCygwin()): + atlasWarPath = convertCygwinPath(atlasWarPath) os.chdir(webAppMetadataDir) - jar(os.path.join(atlasDir(), "server", "webapp", "atlas.war")) + jar(atlasWarPath) def dirMustExist(dirname): if not os.path.exists(dirname): @@ -337,3 +340,19 @@ def grep(file, value): if re.match(value, line): return line return None + +def isCygwin(): + return platform.system().startswith("CYGWIN") + +# Convert the specified cygwin-style pathname to Windows format, +# using the cygpath utility. By default, path is assumed +# to be a file system pathname. If isClasspath is True, +# then path is treated as a Java classpath string. +def convertCygwinPath(path, isClasspath=False): + if (isClasspath): + cygpathArgs = ["cygpath", "-w", "-p", path] + else: + cygpathArgs = ["cygpath", "-w", path] + windowsPath = subprocess.Popen(cygpathArgs, stdout=subprocess.PIPE).communicate()[0] + windowsPath = windowsPath.strip() + return windowsPath diff --git a/distro/src/bin/atlas_start.py b/distro/src/bin/atlas_start.py index b992b16..946cc31 100755 --- a/distro/src/bin/atlas_start.py +++ b/distro/src/bin/atlas_start.py @@ -34,14 +34,23 @@ def main(): confdir = mc.dirMustExist(mc.confDir(atlas_home)) mc.executeEnvSh(confdir) logdir = mc.dirMustExist(mc.logDir(atlas_home)) + if mc.isCygwin(): + # Pathnames that are passed to JVM must be converted to Windows format. + jvm_atlas_home = mc.convertCygwinPath(atlas_home) + jvm_confdir = mc.convertCygwinPath(confdir) + jvm_logdir = mc.convertCygwinPath(logdir) + else: + jvm_atlas_home = atlas_home + jvm_confdir = confdir + jvm_logdir = logdir #create sys property for conf dirs - jvm_opts_list = (ATLAS_LOG_OPTS % logdir).split() + jvm_opts_list = (ATLAS_LOG_OPTS % jvm_logdir).split() - cmd_opts = (ATLAS_COMMAND_OPTS % atlas_home) + cmd_opts = (ATLAS_COMMAND_OPTS % jvm_atlas_home) jvm_opts_list.extend(cmd_opts.split()) - config_opts = (ATLAS_CONFIG_OPTS % confdir) + config_opts = (ATLAS_CONFIG_OPTS % jvm_confdir) jvm_opts_list.extend(config_opts.split()) default_jvm_opts = DEFAULT_JVM_OPTS @@ -69,8 +78,10 @@ def main(): if storage_backend != None: raise Exception("Could not find hbase-site.xml in %s. Please set env var HBASE_CONF_DIR to the hbase client conf dir", hbase_conf_dir) + if mc.isCygwin(): + atlas_classpath = mc.convertCygwinPath(atlas_classpath, True) + atlas_pid_file = mc.pidFile(atlas_home) - if os.path.isfile(atlas_pid_file): #Check if process listed in atlas.pid file is still running @@ -99,11 +110,13 @@ def main(): mc.server_already_running(pid) - - args = ["-app", os.path.join(web_app_dir, "atlas")] + web_app_path = os.path.join(web_app_dir, "atlas") + if (mc.isCygwin()): + web_app_path = mc.convertCygwinPath(web_app_path) + args = ["-app", web_app_path] args.extend(sys.argv[1:]) - process = mc.java("org.apache.atlas.Atlas", args, atlas_classpath, jvm_opts_list, logdir) + process = mc.java("org.apache.atlas.Atlas", args, atlas_classpath, jvm_opts_list, jvm_logdir) mc.writePid(atlas_pid_file, process) print "Apache Atlas Server started!!!\n" diff --git a/release-log.txt b/release-log.txt index 66ecf9a..0beb28e 100644 --- a/release-log.txt +++ b/release-log.txt @@ -7,6 +7,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags) ALL CHANGES: +ATLAS-426 atlas_start fails on cygwin (dkantor via shwethags) ATLAS-448 Hive IllegalArgumentException with Atlas hook enabled on SHOW TRANSACTIONS AND SHOW COMPACTIONS (shwethags) ATLAS-181 Integrate storm topology metadata into Atlas (svenkat,yhemanth via shwethags) ATLAS-311 UI: Local storage for traits - caching [not cleared on refresh] To be cleared on time lapse for 1hr (Anilg via shwethags)