I would like to know is there any way to run Python4Capella addon API and Create Python scripts outside of Capella/SMW environment?
In case of Py-Capellambse addon, which Reads/Writes Capella model from python coding using Jupyter notebook without Capell/SMW tool.
Can we use the Python4Capella Addon without Capella/SMW tool interface, just read /write Capella model using Python4Capella API library in another environment? Please suggest.
It’s not possible to use the Python4Capella API outside of Capella/SMW. The Python API delegates every calls to the Java API. There are some details about making Python4Capella available via a Jupiter Notebook in this issue. Unfortunately my Python knowledge is a bit limited regarding discussed details.
If you want to run Python4Capella on a server for CI or other uses, you can check the command line documentation.
Hi Yvan,
Thanks for your reply.
Through Command Line (CI) we have tried, able to get the results for individual sample scripts available within the Python4Capella project.
Let me try via other options
Regards,
Balamurali.
Hi Yvan,
As per the instructions given in below Capella forum discussion GitHub - jamilraichouni/ease-ipython: Project demonstrating how one can inject Python code into a running Python process (here Python script running in Eclipse EASE) using GDB, we have tried to build Eclipse and Ease IPython.
In online mode, We tried both the Docker image creation but it getting error mesage as shown
“docker compose build baseeclipse”
“docker compose build easeipython”
undefined (NaN [en_GB.number.human.storage_units.units.byte count=undefined])
We tried in Offline mode, downloaded eclipse from official website and building the Docker image of Eclipse was successful and Ease-iPython failing, please see below snapshots and provide your suggestions.
undefined (NaN [en_GB.number.human.storage_units.units.byte count=undefined])
undefined (NaN [en_GB.number.human.storage_units.units.byte count=undefined])
Regards,
Balamurali.
Hi Yvan, We have some restriction to share the snapshots, so we have shared the logs error…
Online mode - Eclipes and Ease-Iphython Docker build images…
C:\\Downloads\ease-ipython-main\ease-ipython-main>docker compose build baseeclipse
time="2024-10-03T15:29:26+05:30" level=warning msg="C:\\Users\\X0151016\\Downloads\\ease-ipython-main\\ease-ipython-main\\docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion"
[+] Building 5577.8s (12/14) docker:desktop-linux
=> [baseeclipse internal] load build definition from Dockerfile 0.4s
=> => transferring dockerfile: 1.08kB 0.1s
=> [baseeclipse internal] load metadata for docker.io/library/debian:bullseye 9.0s
=> [baseeclipse internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [baseeclipse bullseye 1/7] FROM docker.io/library/debian:bullseye@sha256:152b9a5dc2a03f18ddfd88fbe7b1df41bd2b16be9f2df573a373caf46ce78c08 20.2s
=> => resolve docker.io/library/debian:bullseye@sha256:152b9a5dc2a03f18ddfd88fbe7b1df41bd2b16be9f2df573a373caf46ce78c08 0.1s
=> => sha256:152b9a5dc2a03f18ddfd88fbe7b1df41bd2b16be9f2df573a373caf46ce78c08 984B / 984B 0.0s
=> => sha256:a9f115e23865353139b9312d7596b5183e5c76b4b96830a739304e06e1ed2588 529B / 529B 0.0s
=> => sha256:fd320476a1f2921d0557e3e523db1ff2c1c61cf0d87bccd4ef2a69fb1dcd24f8 1.46kB / 1.46kB 0.0s
=> => sha256:014ac6453c34f79cc163f6567c184e5eb0b48cdc07ecbfb1388d90e95ac90b02 55.08MB / 55.08MB 11.7s
=> => extracting sha256:014ac6453c34f79cc163f6567c184e5eb0b48cdc07ecbfb1388d90e95ac90b02 7.7s
=> [baseeclipse internal] load build context 0.2s
=> => transferring context: 1.40kB 0.0s
=> [baseeclipse bullseye 2/7] COPY entrypoint.sh / 2.2s
=> [baseeclipse bullseye 3/7] COPY gdbextension.py /root 0.3s
=> [baseeclipse bullseye 4/7] COPY .gdbinit /root 0.3s
=> [baseeclipse bullseye 5/7] RUN apt-get update && apt-get install -y curl dbus-x11 gdb libswt-gtk-4-java procps vim xvfb 3812.9s
=> [baseeclipse bullseye 6/7] RUN apt-get install -y python3 python3-dbg python3-pip && ln -s /usr/bin/python3 /usr/local/bin/python && pip install ipykernel 1728.8s
=> [baseeclipse bullseye 7/7] RUN rm -rf /var/lib/apt/lists/* 0.5s
=> ERROR [baseeclipse stage-3 1/2] RUN curl https://mirror.dkm.cz/eclipse/technology/epp/downloads/release/2022-09/R/eclipse-modeling-2022-09-R-linux-gtk-x86_64.t 2.6s
------
> [baseeclipse stage-3 1/2] RUN curl https://mirror.dkm.cz/eclipse/technology/epp/downloads/release/2022-09/R/eclipse-modeling-2022-09-R-linux-gtk-x86_64.tar.gz --output eclipse.tar.gz && tar -xvf eclipse.tar.gz && mv eclipse /opt && rm eclipse.tar.gz:
0.470 % Total % Received % Xferd Average Speed Time Time Time Current
0.470 Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0
2.510 curl: (60) SSL certificate problem: unable to get local issuer certificate
2.511 More details here: https://curl.se/docs/sslcerts.html
2.511
2.511 curl failed to verify the legitimacy of the server and therefore could not
2.511 establish a secure connection to it. To learn more about this situation and
2.511 how to fix it, please visit the web page mentioned above.
------
failed to solve: process "/bin/sh -c curl https://mirror.dkm.cz/eclipse/technology/epp/downloads/release/2022-09/R/eclipse-modeling-2022-09-R-linux-gtk-x86_64.tar.gz --output eclipse.tar.gz && tar -xvf eclipse.tar.gz && mv eclipse /opt && rm eclipse.tar.gz" did not complete successfully: exit code: 60
C:\\Downloads\ease-ipython-main\ease-ipython-main>docker compose build easeipython
time="2024-10-03T17:02:30+05:30" level=warning msg="C:\\Users\Downloads\\ease-ipython-main\\ease-ipython-main\\docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion"
[+] Building 5.7s (2/2) FINISHED docker:desktop-linux
=> [easeipython internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 1.57kB 0.0s
=> WARN: InvalidDefaultArgInFrom: Default value for ARG ${BASE_IMAGE} results in empty or invalid base image name (line 2) 0.1s
=> ERROR [easeipython internal] load metadata for docker.io/library/baseeclipse:latest 5.5s
------
> [easeipython internal] load metadata for docker.io/library/baseeclipse:latest:
------
failed to solve: baseeclipse: failed to resolve source metadata for docker.io/library/baseeclipse:latest: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
has context menu
Offline mode - Eclipse
C:\Users\X0151016\Downloads\ease-ipython-main\ease-ipython-main>docker compose build baseeclipse
time="2024-10-04T15:07:05+05:30" level=warning msg="C:\\Users\\X0151016\\Downloads\\ease-ipython-main\\ease-ipython-main\\docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion"
[+] Building 157.5s (16/16) FINISHED docker:desktop-linux
=> [baseeclipse internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 1.08kB 0.0s
=> WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 29) 0.1s
=> WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 32) 0.1s
=> WARN: InvalidDefaultArgInFrom: Default value for ARG ${BASE_IMAGE} results in empty or invalid base image name (line 3) 0.1s
=> [baseeclipse internal] load metadata for docker.io/library/debian:bullseye 4.8s
=> [baseeclipse internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [baseeclipse internal] load build context 55.3s
=> => transferring context: 569.63MB 55.2s
=> [baseeclipse bullseye 1/7] FROM docker.io/library/debian:bullseye@sha256:152b9a5dc2a03f18ddfd88fbe7b1df41bd2b16be9f2df573a373caf46ce78c08 0.0s
=> CACHED [baseeclipse bullseye 2/7] COPY entrypoint.sh / 0.0s
=> CACHED [baseeclipse bullseye 3/7] COPY gdbextension.py /root 0.0s
=> CACHED [baseeclipse bullseye 4/7] COPY .gdbinit /root 0.0s
=> CACHED [baseeclipse bullseye 5/7] RUN apt-get update && apt-get install -y curl dbus-x11 gdb libswt-gtk-4-java procps vim xvfb 0.0s
=> CACHED [baseeclipse bullseye 6/7] RUN apt-get install -y python3 python3-dbg python3-pip && ln -s /usr/bin/python3 /usr/local/bin/python && pip install ipyke 0.0s
=> CACHED [baseeclipse bullseye 7/7] RUN rm -rf /var/lib/apt/lists/* 0.0s
=> [baseeclipse stage-3 1/2] ADD eclipse.tar.gz /opt 36.1s
=> [baseeclipse stage-3 2/2] RUN ln -s /opt/eclipse/eclipse /usr/local/bin/eclipse && mkdir /tmp/workspace 6.0s
=> [baseeclipse stage-3 3/2] WORKDIR /tmp 0.3s
=> [baseeclipse] exporting to image 54.2s
=> => exporting layers 54.0s
=> => writing image sha256:139c43645909686acb08e31564ce431cde71effb01e086d6e8f36776b612400e 0.0s
=> => naming to docker.io/library/baseeclipse 0.0s
=> [baseeclipse] resolving provenance for metadata file 0.1s
Offlinemode - Ease-Ipython
C:\\Downloads\ease-ipython-main\ease-ipython-main>docker compose build easeipython
time="2024-10-04T15:10:23+05:30" level=warning msg="C:\\Users\\X0151016\\Downloads\\ease-ipython-main\\ease-ipython-main\\docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion"
[+] Building 38.2s (9/10) docker:desktop-linux
=> [easeipython internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 1.57kB 0.1s
=> [easeipython internal] load metadata for docker.io/library/baseeclipse:latest 0.0s
=> [easeipython internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [easeipython internal] load build context 0.4s
=> => transferring context: 637B 0.1s
=> [easeipython 1/6] FROM docker.io/library/baseeclipse:latest 1.1s
=> [easeipython 2/6] COPY inject_ipython_kernel.sh /tmp 0.2s
=> [easeipython 3/6] COPY jupyter_client.sh /tmp 0.2s
=> [easeipython 4/6] COPY my_script.* /tmp 0.2s
=> ERROR [easeipython 5/6] RUN eclipse -nosplash -consolelog -application org.eclipse.equinox.p2.director -repository
https://eclipse.py4j.org/
-installIU org. 35.8s
------
> [easeipython 5/6] RUN eclipse -nosplash -consolelog -application org.eclipse.equinox.p2.director -repository
https://eclipse.py4j.org/
-installIU org.py4j.feature.feature.group:
15.98 Oct 04, 2024 9:40:42 AM org.apache.aries.spifly.BaseActivator log
15.98 INFO: Registered provider ch.qos.logback.classic.servlet.LogbackServletContainerInitializer of service jakarta.servlet.ServletContainerInitializer in bundle ch.qos.logback.classic
15.99 Oct 04, 2024 9:40:42 AM org.apache.aries.spifly.BaseActivator log
15.99 INFO: Registered provider ch.qos.logback.classic.spi.LogbackServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle ch.qos.logback.classic
21.79 !SESSION 2024-10-04 09:40:27.975 -----------------------------------------------
21.85 eclipse.buildId=4.33.0.20240905-0613
21.85 java.version=21.0.4
21.85 java.vendor=Eclipse Adoptium
21.85 BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
21.85 Framework arguments: -product org.eclipse.epp.package.jee.product -application org.eclipse.equinox.p2.director -repository
https://eclipse.py4j.org/
-installIU org.py4j.feature.feature.group
21.85 Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product -consolelog -application org.eclipse.equinox.p2.director -repository
https://eclipse.py4j.org/
-installIU org.py4j.feature.feature.group
21.86
21.86 !ENTRY ch.qos.logback.classic 1 0 2024-10-04 09:40:48.448
21.86 !MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
21.98 09:40:48.536 [Start Level: Equinox Container: 91a56fc0-a3ae-4e5b-bd92-e16b61d535d5] DEBUG org.eclipse.jgit.internal.util.ShutdownHook -- register org.eclipse.jgit.util.FS$FileStoreAttributes$$Lambda/0x00000001002a0608@7839668b with shutdown hook
21.98 09:40:48.536 [Start Level: Equinox Container: 91a56fc0-a3ae-4e5b-bd92-e16b61d535d5] DEBUG org.eclipse.jgit.internal.util.ShutdownHook -- register org.eclipse.jgit.util.FS$FileStoreAttributes$$Lambda/0x00000001002a0608@7839668b with shutdown hook
27.44 09:40:54.035 [Worker-0:
https://eclipse.py4j.org/p2.index]
DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient -- ex-0000000001 preparing request execution
27.45 09:40:54.035 [Worker-0:
https://eclipse.py4j.org/p2.index]
DEBUG org.apache.hc.client5.http.impl.classic.InternalHttpClient -- ex-0000000001 preparing request execution
The installation of org.py4j.feature.feature.group
seems to be the source of the issue. Maybe you can try to install it in a Capella to see if some update site are missing for dependencies. At least using the Eclipse GUI you will have an explanation of what is missing.
Thanks Yvan. Will try and come back.
Regards,
Balamurali.