Skip to content

Commit bb2f98e

Browse files
committed
some fixes for docker
1 parent 8e50b54 commit bb2f98e

4 files changed

Lines changed: 40 additions & 27 deletions

File tree

.vscode/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"objectscript.conn": {
3+
"active": true,
4+
"port": 52774,
5+
"user": "admin",
6+
"password": "SYS",
7+
"ns": "DCANALYTICS"
8+
},
9+
"objectscript.conn.version": 3
10+
}

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,21 @@ RUN mkdir -p /tmp/deps \
3232
| wget -O - -i - \
3333
| gunzip > /opt/app/globals.xml
3434

35-
3635
RUN iris start $ISC_PACKAGE_INSTANCENAME quietly EmergencyId=sys,sys && \
3736
/bin/echo -e "sys\nsys\n" \
3837
" Do ##class(Security.Users).UnExpireUserPasswords(\"*\")\n" \
3938
" Do ##class(Security.Users).AddRoles(\"admin\", \"%ALL\")\n" \
4039
" do \$system.OBJ.Load(\"/opt/app/dswinstaller.cls\",\"ck\")\n" \
4140
" Do ##class(Security.System).Get(,.p)\n" \
42-
" Set p(\"AutheEnabled\")=p(\"AutheEnabled\")+16\n" \
41+
" Set p(\"AutheEnabled\")=\$zb(p(\"AutheEnabled\"),16,7)\n" \
4342
" Do ##class(Security.System).Modify(,.p)\n" \
4443
" set ^%SYS(\"CSP\",\"DefaultFileCharset\")=\"utf-8\"\n" \
4544
# " do \$system.OBJ.Load(\"/tmp/deps/Cache-MDX2JSON-master/MDX2JSON/Installer.cls.xml\",\"ck\")\n" \
4645
# " do \$system.OBJ.Load(\"/tmp/deps/deepseeweb.xml\",\"ck\")\n" \
4746
" s sc=##class(DSWMDX2JSON.Installer).setup()\n" \
4847
" If 'sc do \$zu(4, \$JOB, 1)\n" \
4948
# "do CreateDatabase^%SYS.SQLSEC(\"DCANALYTICS\",\"\",,0)\n" \
50-
"zn \"DCANALYTICS\"\n" \
49+
" zn \"DCANALYTICS\"\n" \
5150
" do \$system.OBJ.ImportDir(\"/opt/app/src\",,\"ck\",,1)\n" \
5251
" do ##class(Community.Utils).setup(\"/opt/app/globals.xml\")" \
5352
" halt" \
@@ -57,4 +56,6 @@ RUN iris start $ISC_PACKAGE_INSTANCENAME quietly EmergencyId=sys,sys && \
5756

5857
COPY ./other/dcanalytics.json /usr/irissys/csp/dsw/configs/
5958

60-
CMD [ "-l", "/usr/irissys/mgr/messages.log" ]
59+
COPY ./buildiknow.sh ./
60+
61+
CMD [ "-l", "/usr/irissys/mgr/messages.log", "-a", "/opt/app/buildiknow.sh" ]

buildiknow.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
/bin/echo -e '' \
4+
' do $system.DeepSee.BuildCube("POST", 1, 1)' \
5+
' halt' \
6+
| iris session $ISC_PACKAGE_INSTANCENAME -UDCANALYTICS

src/cls/Community/Utils.cls

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ ClassMethod setup(globalPath As %String = "") As %Status
3535

3636
ClassMethod enableIknow() As %Status
3737
{
38-
set app = $System.CSP.GetDefaultApp($znspace) _ "/"
39-
do EnableIKnow^%SYS.cspServer(app)
38+
set app = $System.CSP.GetDefaultApp($znspace)
39+
new $NAMESPACE
40+
set $NAMESPACE = "%SYS"
41+
set props("DeepSeeEnabled") = 1
42+
set props("iKnowEnabled") = 1
43+
do ##class(Security.Applications).Modify(app, .props)
4044
return $$$OK
4145
}
4246

@@ -62,28 +66,20 @@ ClassMethod buildIndices() As %Status
6266

6367
ClassMethod UpdateCubes(verbose = 1) As %Status
6468
{
65-
set st = ##class(%DeepSee.Utils).%GetCubeList(.list, "cubes")
66-
return:$$$ISERR(st) st
69+
set st = ##class(%DeepSee.Utils).%GetCubeList(.list, "cubes")
70+
return:$$$ISERR(st) st
6771

68-
set cube=""
69-
for {
70-
set cube=$Order(list(cube))
71-
72-
quit:cube=""
73-
Set st1 = ##class(%DeepSee.Utils).%BuildCube(cube, $$$YES, verbose)
74-
75-
// TODO Fix that hack
76-
if ((cube="POST") &&
77-
($SYSTEM.Status.GetErrorCodes(st1) = 5001/*GeneralError*/) &&
78-
($SYSTEM.Status.GetErrorText(st1) [ "Insert into dimension table failed")) {
79-
/// Reported as prodlog 141297
80-
set st1 = $$$OK
81-
}
82-
if (cube="POST") continue
83-
84-
set st = $$$ADDSC(st, st1)
85-
}
86-
return st
72+
set cube=""
73+
for {
74+
set cube=$Order(list(cube))
75+
if (cube="POST") continue
76+
quit:cube=""
77+
78+
Set st1 = ##class(%DeepSee.Utils).%BuildCube(cube, $$$YES, verbose)
79+
80+
set st = $$$ADDSC(st, st1)
81+
}
82+
return st
8783
}
8884

8985
}

0 commit comments

Comments
 (0)