Skip to content

Commit

Permalink
Merge pull request #43 from intersystems-community/ipm-0.9-updates
Browse files Browse the repository at this point in the history
Updates for 0.9.0
  • Loading branch information
evshvarov authored Dec 17, 2024
2 parents 38c2f3d + 24ac6f5 commit 033f927
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 73 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
**
!docker-entrypoint.sh
!iriscli
!iris_ipm.py
!iris_ipm.py
!iris.script
44 changes: 8 additions & 36 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,45 +1,17 @@
FROM --platform=$BUILDPLATFORM intersystems/iris-community-${BUILDARCH}:2024.1.0.238.0
FROM --platform=$BUILDPLATFORM intersystems/iris-community:2024.1-linux-${BUILDARCH}

ARG IPM_INSTALLER=https://pm.community.intersystems.com/packages/zpm/latest/installer

COPY ./iris.script /tmp/iris.script

RUN \
wget -q https://pm.community.intersystems.com/packages/zpm/latest/installer -O /tmp/zpm.xml && \
wget -q $IPM_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 session $ISC_PACKAGE_INSTANCENAME -U %SYS < /tmp/iris.script && \
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
FROM --platform=$TARGETPLATFORM intersystems/iris-community:2024.1-linux-${BUILDARCH}

USER root

Expand Down
41 changes: 7 additions & 34 deletions Dockerfile-phase1
Original file line number Diff line number Diff line change
@@ -1,41 +1,14 @@
ARG IMAGE=containers.intersystems.com/intersystems/iris-community:2022.2.0.368.0
ARG IMAGEARM=containers.intersystems.com/intersystems/iris-community-arm64:2022.2.0.368.0
ARG IMAGE=intersystems/iris-community:latest-cd
ARG DEV=0
FROM $IMAGE

ARG IPM_INSTALLER=https://pm.community.intersystems.com/packages/zpm/latest/installer

COPY ./iris.script /tmp/iris.script

RUN \
wget -q https://pm.community.intersystems.com/packages/zpm/latest/installer -O /tmp/zpm.xml && \
wget -q $IPM_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 session $ISC_PACKAGE_INSTANCENAME -U %SYS < /tmp/iris.script && \
iris stop $ISC_PACKAGE_INSTANCENAME quietly
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ The published images could be found at following Docker Repositories:
[InterSystems IRIS Community Edition](https://hub.docker.com/r/intersystemsdc/iris-community)
[InterSystems IRIS Community Edition for Health:](https://hub.docker.com/r/intersystemsdc/irishealth-community)

Current version of [ZPM installed](https://openexchange.intersystems.com/package/ObjectScript-Package-Manager-2): 0.7.0
Current version of [IPM installed](https://openexchange.intersystems.com/package/InterSystems-Package-Manager-1): 0.9.0
16 changes: 16 additions & 0 deletions docker-compose-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3.6'
services:
iris:
build:
context: .
dockerfile: Dockerfile-amd64
args:
IPM_INSTALLER: https://github.com/intersystems/ipm/releases/download/v0.9.0-beta.31/zpm-0.9.0-beta.31.xml
restart: always
ports:
- 1972
- 57774:52773
- 53773
volumes:
- ~/iris.key:/usr/irissys/mgr/iris.key
- ./:/irisdev/app
41 changes: 41 additions & 0 deletions iris.script
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
set pNS("Globals")="%DEFAULTDB"
set sc=##class(Config.Namespaces).Create("%ALL",.pNS)
if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)
set pDB("Directory")="/usr/irissys/mgr/zpm/"
set sc=##class(SYS.Database).CreateDatabase(pDB("Directory"), 30)
do ##class(SYS.Database).MountDatabase(pDB("Directory"))
if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)
set sc=##class(Config.Databases).Create("IPM",.pDB)
if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)
set pNamespace("Globals")="IPM"
set pNamespace("Routines")="IPM"
set sc=##Class(Config.Namespaces).Create("IPM",.pNamespace)
if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)
set pMap("Database")="IPM"
set sc=##Class(Config.MapPackages).Create("%ALL","%IPM",.pMap)
if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)
set sc=##Class(Config.MapPackages).Create("%ALL","IPM",.pMap)
if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)
set sc=##Class(Config.MapGlobals).Create("%ALL","%IPM.*",.pMap)
if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)
set sc=##Class(Config.MapGlobals).Create("%ALL","IPM.Repo.*",.pMap)
if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)
set sc=##Class(Config.MapGlobals).Create("%SYS","IPM.*",.pMap)
if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)
set sc=##Class(Config.MapRoutines).Create("%ALL","%IPM.*",.pMap)
if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)
set sc=##Class(Config.MapRoutines).Create("%ALL","%ZLANGF00",.pMap)
if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)
set sc=##Class(Config.MapRoutines).Create("%ALL","%ZLANGC00",.pMap)
if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)
zn "IPM"
set sc = ##class(%SYSTEM.OBJ).Load("/tmp/zpm.xml", "c")
if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)
zpm "repo -reset-defaults"
zn "%SYS"
do ##class(Config.Namespaces).Delete("IPM")
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
2 changes: 1 addition & 1 deletion iris_ipm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def shell(cmd, status):

status.put(True)

res = iris.cls("%ZPM.PackageManager").Shell(cmd)
res = iris.cls("%IPM.Main").Shell(cmd)
print('')
if res != 1:
status.get()
Expand Down

0 comments on commit 033f927

Please sign in to comment.