Skip to content

Commit

Permalink
Merge pull request #42 from daimor/master
Browse files Browse the repository at this point in the history
updates for latest iris
  • Loading branch information
evshvarov authored Aug 23, 2024
2 parents 29060e6 + 59c5674 commit d9ab8f1
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ env:
irishealth-community
iris-ml-community
irishealth-ml-community
latest: 2024.2
latest: latest-em
version: |
2023.3
2023.2
2023.1.1.380.0
latest-cd
2024.1
2024.2
2023.1.4.580.0
preview: latest-preview
jobs:
version:
Expand Down
73 changes: 73 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
FROM --platform=$BUILDPLATFORM intersystems/iris-community-${BUILDARCH}:2024.1.0.238.0

RUN \
wget -q https://pm.community.intersystems.com/packages/zpm/latest/installer -O /tmp/zpm.xml && \
mkdir /usr/irissys/mgr/zpm && \
iris start $ISC_PACKAGE_INSTANCENAME quietly && \
/bin/echo -e \
"set pNS(\"Globals\")=\"%DEFAULTDB\"\n" \
"set sc=##class(Config.Namespaces).Create(\"%ALL\",.pNS)\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set pDB(\"Directory\")=\"/usr/irissys/mgr/zpm/\"\n" \
"set sc=##class(SYS.Database).CreateDatabase(pDB(\"Directory\"), 30)\n" \
"do ##class(SYS.Database).MountDatabase(pDB(\"Directory\"))" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set sc=##class(Config.Databases).Create(\"ZPM\",.pDB)\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set pMap(\"Database\")=\"ZPM\"\n" \
"set sc=##Class(Config.MapPackages).Create(\"%ALL\",\"%ZPM\",.pMap)\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set sc=##Class(Config.MapGlobals).Create(\"%ALL\",\"%ZPM.*\",.pMap)\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set sc=##Class(Config.MapGlobals).Create(\"%SYS\",\"ZPM.*\",.pMap)\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set sc=##Class(Config.MapRoutines).Create(\"%ALL\",\"%ZPM.*\",.pMap)\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set sc=##Class(Config.MapRoutines).Create(\"%ALL\",\"%ZLANGF00\",.pMap)\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set sc=##Class(Config.MapRoutines).Create(\"%ALL\",\"%ZLANGC00\",.pMap)\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"set sc = ##class(%SYSTEM.OBJ).Load(\"/tmp/zpm.xml\", \"c\")\n" \
"if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \
"do ##class(SYS.Database).Defragment(pDB(\"Directory\"))" \
"do ##class(SYS.Database).CompactDatabase(pDB(\"Directory\"),100)" \
"do ##class(SYS.Database).ReturnUnusedSpace(pDB(\"Directory\"))" \
"do ##class(SYS.Database).DismountDatabase(pDB(\"Directory\"))" \
"halt" \
| iris session $ISC_PACKAGE_INSTANCENAME -U %SYS && \
iris stop $ISC_PACKAGE_INSTANCENAME quietly

FROM --platform=$TARGETPLATFORM intersystems/iris-community-${TARGETARCH}:2024.1.0.238.0

COPY iris.key /usr/irissys/mgr/iris.key

USER root

WORKDIR /opt/irisapp
RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y install git && \
apt-get clean -y && rm -rf /var/lib/apt/lists/* && \
mkdir /docker-entrypoint-initdb.d/

COPY docker-entrypoint.sh /

USER ${ISC_PACKAGE_MGRUSER}

COPY --from=0 --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /usr/irissys/iris.cpf /usr/irissys/iris.cpf
COPY --from=0 --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /usr/irissys/mgr/zpm /usr/irissys/mgr/zpm

ENV PATH="$PATH:/home/irisowner/.local/bin"

COPY --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} iris_ipm.py /usr/irissys/lib/python/

ENV PIP_BREAK_SYSTEM_PACKAGES=1

RUN pip install irissqlcli && \
cat /usr/irissys/lib/python/iris_ipm.py >> /usr/irissys/lib/python/iris.py

COPY iriscli /home/irisowner/bin/

ENTRYPOINT [ "/tini", "--", "/docker-entrypoint.sh" ]

CMD [ "iris" ]
2 changes: 2 additions & 0 deletions Dockerfile-phase2
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ ENV PATH="$PATH:/home/irisowner/.local/bin"

COPY --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} iris_ipm.py /usr/irissys/lib/python/

ENV PIP_BREAK_SYSTEM_PACKAGES=1

RUN pip install irissqlcli && \
cat /usr/irissys/lib/python/iris_ipm.py >> /usr/irissys/lib/python/iris.py

Expand Down

0 comments on commit d9ab8f1

Please sign in to comment.