Flow deployment does not work as expected (flow id: cfca133db6)
nan-wang opened this issue · comments
Nan Wang commented
Flow deployment does work as expected
The flow is deployed successfully in jcloud. However, the problem is the variable I got from the executor is $1234
, instead of 1234
Command
.
├── executor
│ ├── config.yml
│ └── executor.py
├── flow.env
├── flow.py
└── flow.yml
Flow yaml
jtype: Flow
version: '1'
with:
cors: true
protocol: http
executors:
- name: fooexecutor
uses: executor/config.yml
Flow ID / Request ID
Flow ID: cfca133db6
Request ID: N/A
.env
file
MY_TOKEN=123456789
jina
version
jina -vf
...
executor.py
from jina import Executor, requests
class FooExecutor(Executor):
def __init__(self, env_var, *args, **kwargs):
super(FooExecutor, self).__init__(*args, **kwargs)
self._token = env_var
@requests
def foo(self, docs, **kwargs):
for doc in docs:
doc.text = f'here is my token: {self._token}'
executor/config.yml
jtype: FooExecutor
with:
env_var: ${{ ENV.MY_TOKEN }}
metas:
py_modules:
- executor.py