TACC / abaco

Actor Based Co(mputing)ntainers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

get_context is missing state and actor_id

mwvaughn opened this issue · comments

The get_context() function in samples/base/actors.py isn't returning values for actor_id and state on the tacc.prod deployment. The actor_id and state keys are empty, forcing me to use the .get accessor (and still getting an empty result for those values)

Here's my actor code

def main():
    context = get_context()
    ag = get_client()
    print 'raw_message', context.get('raw_message')
    print 'content_type', context.get('content_type')
    print 'execution_id', context.get('execution_id')
    print 'username', context.get('username')
    print 'actor_id', context.get('actor_id')
    print 'state', context.get('state')
    print 'client', ag
    print 'ENV'
    print json.dumps(dict(os.environ), indent=2)

and here's the content of os.environ inside the actor when it runs

{
  "_abaco_actor_state": "{}", 
  "_abaco_access_token": "", 
  "_abaco_Content-Type": "application/json", 
  "_abaco_actor_dbid": "TACC-PROD_c9fa1536-98ba-11e7-8b45-0242ac110005-059", 
  "HOSTNAME": "d1b445de0ee5", 
  "_abaco_execution_id": "d19cdf2e-98ba-11e7-9d8d-0242ac110006-053", 
  "_abaco_username": "vaughn", 
  "_abaco_actor_id": "c9fa1536-98ba-11e7-8b45-0242ac110005-059", 
  "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", 
  "MSG": "{'key2': 'val2', 'key1': 'val1'}", 
  "HOME": "/root", 
  "_abaco_api_server": "https://api.tacc.utexas.edu", 
  "_abaco_jwt_header_name": "X-Jwt-Assertion-Tacc-Prod"
}

One more bit... here's the output in the actor's log

raw_message {'key2': 'val2', 'key1': 'val1'}
content_type application/json
execution_id d19cdf2e-98ba-11e7-9d8d-0242ac110006-053
username vaughn
actor_id None
state None
client <agavepy.agave.Agave object at 0x7f389bcc1790>

Hey Matt, sorry for the issues. I'm wondering if this is an issue in the Alpine base. I'll test that next (though I am considering abandoning, at least in the short run, until we have more support resources), but when I tested with the ubuntu base it seemed things were working. I'm changing the README to reference it and you might try that as well; e.g.:

from abacosamples/base-ubu

ADD myactor.py /myactor.py
CMD ["python", "/myactor.py"]

Using the Ubuntu base solves this. We can come back to it later when we're sure it's not a PEBKAC.