Calling Embedded Python in Docker Container - Access Denied
Hi folks!
I'm playing with Embedded python with IRIS trying to do some 'hello-world' exercises.
I'm running IRIS in container and have the following python code:
# Program to test coding with IRIS
print('Hello World')
# Run IRIS Class Method import iris
print(iris.cls('dc.sample.ObjectScript')).Test()
So, when I execute it, I get the following:
$ /usr/irissys/bin/irispython /irisrun/repo/python/app.py
Hello World
Traceback (most recent call last):
File "/irisrun/repo/python/app.py", line 7, in <module>
import iris
File "/usr/irissys/lib/python/iris.py", line 14, in <module>
from pythonint import *
ImportError: IrisStart failed: IRIS_ACCESSDENIED (-15)What am I doing wrong?
Comments
Hi,
You need to fill in some environment variables that allow you to authenticate yourself and therefore connect.
The variables are :
IRISUSERNAME
IRISPASSWORD
IRISNAMESPACEIn a docker file for example :
# environment variables for embedded python
ENV IRISUSERNAME "SuperUser"
ENV IRISPASSWORD "SYS"
ENV IRISNAMESPACE "IRISAPP"In a shell :
export IRISUSERNAME=SuperUser
export IRISPASSWORD=SYS
export IRISNAMESPACE=IRISAPPThank you, @Guillaume Rongier !
Do we have this very valuable info in Documentation? Couldn't find it from scratch.
Here's the link to the documentation:
https://docs.intersystems.com/irisforhealthlatest/csp/docbook/DocBook.U…
Thank you, @Bob Kuszewski ! Indeed it's there, but was not obvious for me for some reason :)
After turning ann CallIns and providing env variables it worked!
There are a few more, the whole set: ## Embedded Python environment ENV IRISUSERNAME "_SYSTEM" ENV IRISPASSWORD "SYS" ENV IRISNAMESPACE "USER" ENV PYTHON_PATH=/usr/irissys/bin/ ENV PATH "/usr/irissys/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/irisowner/bin"
@Guillaume Rongier , correct me if I'm wrong (tooked from your code).
We need a oneliner or zpm to start callins ) It becomes important!