Skip to content

Commit f13db9b

Browse files
committed
adding embedded python support
1 parent e5376a9 commit f13db9b

3 files changed

Lines changed: 66 additions & 0 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.224.2/containers/docker-existing-docker-compose
3+
{
4+
"name": "intersystems-iris-dev-template devcontainer",
5+
6+
// Use the same recipe as creates the container we use when working locally.
7+
"dockerComposeFile": [
8+
"../docker-compose.yml"
9+
],
10+
11+
"service": "iris",
12+
13+
"workspaceFolder": "/irisrun/repo",
14+
15+
// This provides the elements of the connection object which require different values when connecting to the workspace within the container,
16+
// versus those in .vscode/settings.json which apply when operating locally on the workspace files.
17+
// We define and use a `server` so that (a) a user-level `objectscript.conn.server` properly doesn't override us, and (b) so InterSystems
18+
// Server Manager can also be used.
19+
"settings": {
20+
"objectscript.conn" :{
21+
"server": "devcontainer",
22+
"active": true,
23+
},
24+
"intersystems.servers": {
25+
"devcontainer": {
26+
"username": "SuperUser",
27+
"password": "SYS",
28+
"webServer": {
29+
"scheme": "http",
30+
"host": "127.0.0.1",
31+
"port": 52773
32+
},
33+
},
34+
},
35+
"python.defaultInterpreterPath":"/usr/irissys/bin/irispython"
36+
},
37+
38+
// Add the IDs of extensions we want installed when the container is created.
39+
// Currently (March 2022) `intersystems.language-server` fails to run within the container (alpine platform).
40+
// Issue is probably https://github.com/intersystems/language-server/issues/185 and/or https://github.com/intersystems/language-server/issues/32
41+
// Crash gets reported to the user, after which `intersystems-community.vscode-objectscript` falls back to
42+
// using its TextMate grammar for code coloring.
43+
"extensions": [
44+
"ms-python.python",
45+
"ms-python.vscode-pylance",
46+
"intersystems-community.vscode-objectscript",
47+
"intersystems.language-server",
48+
"intersystems-community.servermanager",
49+
"ms-vscode.docker"
50+
],
51+
}

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ ARG TESTS=0
1010
ARG MODULE="dc-sample-template"
1111
ARG NAMESPACE="IRISAPP"
1212

13+
## Embedded Python environment
14+
ENV IRISUSERNAME "_SYSTEM"
15+
ENV IRISPASSWORD "SYS"
16+
ENV IRISNAMESPACE $NAMESPACE
17+
ENV PYTHON_PATH=/usr/irissys/bin/
18+
ENV PATH "/usr/irissys/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/irisowner/bin"
19+
20+
1321
RUN --mount=type=bind,src=.,dst=. \
1422
iris start IRIS && \
1523
iris session IRIS < iris.script && \

iris.script

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22
zn "%SYS"
33
Do ##class(Security.Users).UnExpireUserPasswords("*")
44

5+
; enabling callin for Embedded Python
6+
do ##class(Security.Services).Get("%Service_CallIn",.prop)
7+
set prop("Enabled")=1
8+
set prop("AutheEnabled")=48
9+
do ##class(Security.Services).Modify("%Service_CallIn",.prop)
10+
511
// create IRISAPP namespace
612
do $SYSTEM.OBJ.Load("/home/irisowner/irisbuild/Installer.cls", "ck")
713
set sc = ##class(App.Installer).setup()
814

15+
916
// load all the code of the project as a ZPM package
1017
zn "IRISAPP"
1118
zpm "load /home/irisowner/irisbuild/ -v":1:1

0 commit comments

Comments
 (0)