[ 
https://issues.apache.org/jira/browse/AURORA-558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14047960#comment-14047960
 ] 

Jay Buffington commented on AURORA-558:
---------------------------------------

I'm talking about include(), not import.

If what you said were true this would work:

{code}
$ cat hello.aurora
include('hello_port.aurora')

$ head ~/aurora-config/hello_port.aurora
hello = Process(
  name = 'hello',
  cmdline = """
    while true; do
      echo hello {{thermos.ports[hello]}}  My task id is  {{thermos.task_id}}
      sleep 10
    done
  """)

task = SequentialTask(

$ export PYTHONPATH=~/aurora-config/

$ aurora create  cp0/jaybuff/prod/hello_port hello.aurora
Traceback (most recent call last):
  File 
"/Users/jaybuff/.pex/install/twitter.common.app-0.3.0-py2-none-any.whl.307269ecd6cc4d73fd2a8089c7f589dc8fbdf160/twitter.common.app-0.3.0-py2-none-any.whl/twitter/common/app/application.py",
 line 738, in _wrap_method
    return_code = method()
  File 
"/Users/jaybuff/.pex/install/twitter.common.app-0.3.0-py2-none-any.whl.307269ecd6cc4d73fd2a8089c7f589dc8fbdf160/twitter.common.app-0.3.0-py2-none-any.whl/twitter/common/app/application.py",
 line 760, in <lambda>
    main = lambda: main_method(*args, **kwargs)
  File "/usr/bin/aurora/apache/aurora/client/base.py", line 81, in 
wrapped_function
    return fn(*args)
  File "/usr/bin/aurora/apache/aurora/client/commands/core.py", line 148, in 
create
    config = get_job_config(job_spec, config_file, options)
  File "/usr/bin/aurora/apache/aurora/client/commands/core.py", line 96, in 
get_job_config
    select_env=select_env)
  File "/usr/bin/aurora/apache/aurora/client/config.py", line 261, in get_config
    select_env=select_env)
  File "/usr/bin/aurora/apache/aurora/config/__init__.py", line 117, in load
    env = AuroraConfigLoader.load(filename)
  File "/usr/bin/aurora/apache/aurora/config/loader.py", line 60, in load
    return cls.load_raw(loadable).environment
  File "/usr/bin/aurora/apache/aurora/config/loader.py", line 64, in load_raw
    return cls(loadable)
  File 
"/Users/jaybuff/.pex/install/pystachio-0.7.2-py2-none-any.whl.e5dddb66aee457ea98cc4dc757c760eb19718766/pystachio-0.7.2-py2-none-any.whl/pystachio/config.py",
 line 165, in __init__
    root_executor(initial_config, context)
  File 
"/Users/jaybuff/.pex/install/pystachio-0.7.2-py2-none-any.whl.e5dddb66aee457ea98cc4dc757c760eb19718766/pystachio-0.7.2-py2-none-any.whl/pystachio/config.py",
 line 63, in ast_executor
    cls.compile_into(context, from_path, config_file)
  File 
"/Users/jaybuff/.pex/install/pystachio-0.7.2-py2-none-any.whl.e5dddb66aee457ea98cc4dc757c760eb19718766/pystachio-0.7.2-py2-none-any.whl/pystachio/config.py",
 line 54, in compile_into
    context.compile(from_path, config_file, fp.read())
  File 
"/Users/jaybuff/.pex/install/pystachio-0.7.2-py2-none-any.whl.e5dddb66aee457ea98cc4dc757c760eb19718766/pystachio-0.7.2-py2-none-any.whl/pystachio/config.py",
 line 29, in compile
    Compatibility.exec_function(compile(data, include_string, 'exec'), 
self.environment)
  File "<exec_function>", line 5, in exec_function
  File "hello.aurora", line 1, in <module>
    include('hello_port.aurora')
  File 
"/Users/jaybuff/.pex/install/pystachio-0.7.2-py2-none-any.whl.e5dddb66aee457ea98cc4dc757c760eb19718766/pystachio-0.7.2-py2-none-any.whl/pystachio/config.py",
 line 163, in <lambda>
    self._environment.update(include=lambda fn: root_executor(fn, context))
  File 
"/Users/jaybuff/.pex/install/pystachio-0.7.2-py2-none-any.whl.e5dddb66aee457ea98cc4dc757c760eb19718766/pystachio-0.7.2-py2-none-any.whl/pystachio/config.py",
 line 63, in ast_executor
    cls.compile_into(context, from_path, config_file)
  File 
"/Users/jaybuff/.pex/install/pystachio-0.7.2-py2-none-any.whl.e5dddb66aee457ea98cc4dc757c760eb19718766/pystachio-0.7.2-py2-none-any.whl/pystachio/config.py",
 line 53, in compile_into
    with open(actual_file) as fp:
IOError: [Errno 2] No such file or directory: 'hello_port.aurora'
{code}

> aurora client should look for include()'ed files based on known search path
> ---------------------------------------------------------------------------
>
>                 Key: AURORA-558
>                 URL: https://issues.apache.org/jira/browse/AURORA-558
>             Project: Aurora
>          Issue Type: Story
>          Components: Client
>            Reporter: Jay Buffington
>
> We've written a standard library of sorts to be shared across our 
> organization.  It includes processes for doing things like downloading the 
> app in a standard way, notifying a service discovery service, etc. and 
> pystachio structs for things like modeling variables for our custom web 
> framework.
> After a cursory glance at the code, it looks like these .aurora files have to 
> be included as either an absolute path or a path relative to where the aurora 
> command was run.
> When the path is relative I'd like the aurora client to first search a set of 
> paths defined by an environment var like $AURORA_INC_PATH, then ./ and then a 
> default set of directories that is built into the client like 
> /etc/aurora/include/



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to