generated from intersystems-community/iris-interoperability-template
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error registering components in IRIS #21
Comments
how did you install Iop ?if you installed it from pip : pip install iris-pex-embedded-python you must init it to iris (install the associated classes to iris), for that you must do : iop --init or from iop import Utils
Utils.setup() please refer to the documentation : https://github.com/grongierisc/interoperability-embedded-python?tab=readme-ov-file#32-with-pypi For the more, make sure you are on the right namespace by specifying the var env : $IRISNAMESPACE |
IRIS is installed as follows:
Dockerfile :
RUN pip3 install -r requirements.txt
RUN iris start IRIS && iris session IRIS < /external/iris.script && iris stop IRIS quietly
requirements.txt :
requests
sqlalchemy-iris
https://github.com/intersystems-community/intersystems-irispython/releases/download/3.7.9/intersystems_iris-3.7.9-py3-none-any.whl
irissqlcli
iris-pex-embedded-python>=3.0.0
Your recommendations have allowed me to correct my problem in 2 ways:
1 - I'm trying to automate IRIS initialization with the iop -init command via the Dockerfile
Dockerfile :
RUN pip3 install -r requirements.txt
RUN iris start IRIS && iris session IRIS < /external/iris.script && iop --init && iris stop IRIS quietly
Iris.script :
zn "%SYS"
Do ##class(Security.Users).UnExpireUserPasswords("*")
do ##class(Security.Services).Get("%Service_CallIn",.prop)
set prop("Enabled")=1
set prop("AutheEnabled")=48
do ##class(Security.Services).Modify("%Service_CallIn",.prop)
zn "COREMODEL"
zw $SYSTEM.OBJ.ImportDir("/external/src", "*.cls", "cubk", .tErrors, 1)
In my container’s bash shell, when I run my python script which calls the following code :
from iop import Utils
Utils.migrate("/external/src/CoreModel/Python/settings.py")
I get an error:
Une erreur s'est produite : iris.cls: error finding class
On the other hand, in my container's bash shell, if I run the iop -init command before executing my python script, I no longer get an error.
Question :
Have I modified my Dockerfile correctly?
How can I avoid running the iop -init command by hand before executing my python script?
2 – Using the Utils.setup() method in python code
In the python script :
from iop import Utils
Utils.setup()
Utils.migrate("/external/src/CoreModel/Python/settings.py")
This solution correctly registers components in IRIS Production, but displays the list of imported classes in the bash shell (~50 lines):
Load of directory started on 07/11/2024 15:10:36
Loading file /home/irisowner/.local/lib/python3.10/site-packages/iop/cls/IOP/BusinessOperation.cls as cls
Imported class: IOP.BusinessOperation
Loading file /home/irisowner/.local/lib/python3.10/site-packages/iop/cls/IOP/BusinessService.cls as cls
Imported class: IOP.BusinessService
…
Question :
Is it possible not to display the imported class list?
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My DockerFile shows the following IRIS version:
ARG IMAGE=intersystemsdc/iris-community:2023.3-zpm
When I execute the instruction to register components in the IRIS Production below, I get the following error:
irisowner@fd8dbc67a646:/external/src/_Package$ /usr/irissys/bin/irispython
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "", line 1, in
File "/usr/irissys/mgr/python/iop/_utils.py", line 202, in migrate
_Utils.set_classes_settings(settings.CLASSES,path)
File "/usr/irissys/mgr/python/iop/_utils.py", line 228, in set_classes_settings
_Utils.register_component(value.module,value.name,path,1,key)
File "/usr/irissys/mgr/python/iop/_utils.py", line 53, in register_component
return iris.cls('Grongier.PEX.Utils').dispatchRegisterComponent(module,classname,path,overwrite,iris_classname)
RuntimeError: iris.cls: error finding class
Thank you for your help.
The text was updated successfully, but these errors were encountered: