Find

Announcement
· Aug 7, 2024

Do you use client-side editing in VS Code? If so, we want your feedback!

The VS Code extension development team is looking for beta testers to provide feedback on a proposed overhaul of the client-side editing workflow. The full list of changes can be found in the GitHub pull request description. Here are the highlights:

  • Support the use of client-side editing in any non-isfs workspace folder, not just folders in your local file system. For example, with VS Code Remote Development.
  • Create an index of all Classes, MAC and INT routines, and Include files inside non-isfs workspace folders. This will be used to determine the URI of classes and routines (for example, for Go To Definition).
  • Automatically sync all file changes, creations and deletions in client-side workspace folders with the connected server. This can be turned off using the new objectscript.syncLocalChanges setting. This new setting replaces the old objectscript.importOnSave setting, which is no longer needed. If objectscript.importOnSave was set to false, the extension will set objectscript.syncLocalChanges to false upon activation so no user migration is required.
  • Automatically show and hide the InterSystems Explorer and Projects Explorer views based on the folders in the workspace. InterSystems Explorer is only shown if there is at least one non-isfs workspace folder. Projects Explorer is only shown if there is at least one isfs folder. This replaces the objectscript.showExplorer setting.
  • Change the default value of the objectscript.explorer.alwaysShowServerCopy setting to true. The InterSystems Explorer should always show the server copy since the local copy can be opened from the files explorer.
  • Change the default value of the objectscript.autoAdjustName setting to false. Now that we have an index of the workspace, we no longer require that a document's name match the file path for the extensions to find it.
  • Cache the list of Studio Abstract Document extensions that are supported for each server connection so we can properly import them from client-side folders. Importing abstract documents is now independent of the objectscript.export settings, except for DFI’s which still check the export settings to preserve the current path-splitting behavior. Any file within a workspace folder that has a supported abstract document extension will be imported with the last part of the path used as the server name (except for DFI’s that match the export settings). For example, if the file path on disk is /src/other/example.ext, the server name will be example.ext.

In addition to general feedback on the changes, there are four design questions that have yet to be answered:

  1. Do any users want the InterSystems Explorer (NOT the default VS Code file explorer) to show the local copies of the documents? If not, the objectscript.explorer.alwaysShowServerCopy setting can be removed. EDIT: This setting will be retained for backwards compatibility.
  2. Do any users edit DFI files locally and have repositories that depend on the folder splitting behavior? If not, that special handling will be removed and DFIs will be treated like any other Abstract Document type. EDIT: This behavior will be retained for backwards compatibility, but newly exported DFI files will not be split into subfolders.
  3. Should the automatic deletion of files on the server when the local copy is deleted be guarded by a setting so users can disable it? EDIT: This is covered by the new objectscript.syncLocalChanges setting.
  4. This extension has a feature that will attempt to adjust the name of a class or routine when it's copied or moved to a new location within the workspace folder. This was implemented to help developers keep the file path and document name in sync. It can be turned off using the objectscript.autoAdjustName setting. Do users value this feature? Should the objectscript.autoAdjustName setting be set to false by default? Should this feature be removed entirely since the document index removes the need for the path to match the document name? EDIT: This setting's default has been changed to false.

Here's how you can share your feedback:

  1. Download the zip file at the end of this post and extract the vsix file contained within.
  2. Install the vsix file in VS Code using these directions, or by dragging the file from your file explorer into the Extensions view in VS Code.
  3. Follow your normal development workflow and try out some new features.
  4. Share your experience here, or on the GitHub pull request.

Thanks in advance for trying this out and we hope you like the changes!

vscode-objectscript-2.12.11-dev.1401.vsix.zip

35 Comments
Discussion (35)10
Log in or sign up to continue
InterSystems Official
· Aug 7, 2024

IAM 2.8.4.11 & 3.4.3.11 Anuncio de Lanzamiento

Las versiones 2.8.4.11 y 3.4.3.11 de InterSystems API Manager (IAM) ya están disponibles de forma general. Estas son las versiones más recientes de las dos versiones de IAM con soporte a largo plazo. Estas versiones contienen correcciones importantes y se recomienda a todos los clientes que las actualicen.

Se recomienda a los clientes de IAM 3.0 o 3.2 que actualicen a 3.4.3.11, ya que el soporte para esas versiones pronto finalizará.

IAM es un API gateway entre las aplicaciones y sus servidores InterSystems IRIS, que proporciona herramientas para monitorizar, controlar y gobernar eficazmente el tráfico basado en HTTP a escala. IAM está disponible como un complemento gratuito para su licencia de InterSystems IRIS.

IAM se puede descargar desde el área de Componentes del site de distribución de software de WRC.

Siga la Guía de instalación para obtener instrucciones sobre cómo descargar, instalar y comenzar a usar IAM. La documentación completa de IAM 3.4 le brinda más información sobre IAM y su uso con InterSystems IRIS. Nuestro partner Kong proporciona más documentación sobre el uso de IAM en la documentación de Kong Gateway (Enterprise) 3.4.

IAM solo está disponible en formato de contenedor Docker (OCI, Open Container Initiative). Las imágenes de contenedor están disponibles para motores de ejecución compatibles con OCI para Linux x86-64 y Linux ARM64, como se detalla en el documento Plataformas compatibles.
 

Discussion (0)1
Log in or sign up to continue
Article
· Aug 7, 2024 5m read

在 Docker 容器中长期保留 IRIS 数据

默认情况下,在容器内创建的所有文件都存储在可写的容器层上。 这意味着:

  • 当容器消失时,数据将不会持续存在,并且如果另一个进程需要数据,很难将数据从容器中取出。
  • 容器的可写层与运行容器的主机紧密耦合。 你无法轻易将数据移动到其他地方。
  • 写入容器的可写层需要存储驱动程序来管理文件系统。 存储驱动程序使用 Linux 内核提供联合文件系统, 与使用直接写入主机文件系统的数据卷相比,这种额外的抽象会降低性能。

 

为了演示 docker 容器的默认行为,我们使用以下命令运行容器:

docker run -d --name iris-comm -p 1972:1972 -p 52773:52773 -e IRIS_PASSWORD=demo -e IRIS_USERNAME=demo intersystemsdc/iris-community:latest

 

#docker run command to create and start the container
docker run 
#-d -an option used to start container in deattach mode
-d 
#name of the container
--name iris 
#-p -an option is used to map the ports
-p 1972:1972 
-p 52773:52773 
#-e -an option to set environment variable
-e IRIS_USERNAME=demo
-e IRIS_PASSWORD=demo
#base image
intersystemsdc/iris-community:latest

运行以下 docker 命令列出正在运行的容器的详细信息:

docker ps

使用以下 docker 命令连接到 IRIS 终端:

docker exec -it iris-comm iris session iris

我们将使用“DockerVolume” 将一些数据保存到 IRIS global中

要查看global的值,请导航到管理门户 (demo | demo)
http://localhost:52773/csp/sys/exp/%25CSP.UI.Portal.GlobalList.zen?$NAMESPACE=USER
 
要查看值,请点击 View 选项

现在,重新创建容器来检查 IRIS 数据是否仍然存在。

为了重新创建容器,我们必须停止并移除容器。

下面的 docker 命令将停止、移除并重新创建容器。 

# Stop the container
docker stop iris-comm

# Remove the container
docker rm iris-comm

# Create the container
docker run -d --name iris-comm -p 1972:1972 -p 52773:52773 -e IRIS_PASSWORD=demo -e IRIS_USERNAME=demo intersystemsdc/iris-community:latest



连接到 IRIS 终端并检查之前保存的global的值

重新创建容器后,数据不可用。

Docker 为容器提供了多种存储数据的选项,允许根据不同的使用场景进行灵活性和定制化调整。 主要选项如下:

  • 1

    卷存储在由 Docker 管理的主机文件系统的部分中(Linux 上为 /var/lib/docker/volumes/)。 非 Docker 进程不应修改文件系统的这一部分。 卷是 Docker 中保留数据的最佳方式。 创建卷时,它会存储在 Docker 主机上的目录中。 将卷挂载到容器中时,这个目录就是挂载到容器中的目录。 这与绑定挂载类似,不同之处在于卷由 Docker 管理,并且与主机的核心功能隔离。 挂载卷时,它可能具名,也可能匿名。 匿名卷被赋予随机名称,该名称保证在给定的 Docker 主机中是唯一的。 就像具名卷一样,即使我们移除使用它们的容器,匿名卷也会保留下来,除非你在创建容器时使用 --rm 标志,在这种情况下匿名卷将被销毁。如果创建多个使用匿名卷的容器,则每个容器都会创建自己的卷。 匿名卷不会自动在容器之间重用或共享。 要在两个或多个容器之间共享匿名卷,必须使用随机卷 ID 挂载匿名卷。 卷还支持使用卷驱动程序,这允许你将数据存储在远程主机或云提供商等位置。  
  • 2- 绑定挂载

    绑定挂载可以存储在主机系统上的任何位置。 Docker 主机或 Docker 容器上的非 Docker 进程可以随时修改它们。 与卷相比,它的功能有限。 使用绑定挂载时,主机上的文件或目录将挂载到容器中。 文件或目录由其在主机上的完整路径引用。 文件或目录不需要已经存在于 Docker 主机上。 如果它尚不存在,则会按需创建。 绑定挂载速度很快,但需要主机的文件系统具有可用特定目录结构。 如果是在开发新的 Docker 应用程序,不妨改用具名卷。 你不能使用 Docker CLI 命令直接管理绑定挂载。  
  • 3- tmpfs

    Docker 还支持在主机内存中存储文件的容器。 此类文件不会被保留。 如果你是在 Linux 上运行 Docker,tmpfs 挂载将用于在主机的系统内存中存储文件。 如果你是在 Windows 上运行 Docker,具名管道将用于在主机的系统内存中存储文件。 容器可以在生命周期内使用它来存储非持久状态或敏感信息。 例如,在内部,Swarm 服务使用 tmpfs 挂载将机密挂载到服务的容器中。

使用 Docker 卷在 Docker 容器中长期保留 IRIS 数据

Docker 卷使用起来简单直接。 只需要在运行容器时创建一个卷并指定卷名称

下面是创建名为 irisVol 的新卷的 docker 命令:

docker volume create irisVol


irisVol volume is created.

注意:在容器中使用卷之前,我们不一定需要创建卷。 如果指定的卷名称尚不存在,Docker 将自动创建卷。

下面是检查卷的 docker 命令:

$ docker volume inspect irisVol

具名卷默认在此路径下创建:
/var/lib/docker/volumes/<name>/_data.
 

输入之前用于运行容器的命令,但添加 irisVol 卷选项

docker run -d --name iris-comm -p 1972:1972 -p 52773:52773 -e IRIS_PASSWORD=demo -e IRIS_USERNAME=demo --mount source=mvol,target=/usr/irissys/mgr/user/ intersystemsdc/iris-community:latest

--mount source=mvol,target=/usr/irissys/mgr/user/:

  • 这个选项会将卷挂载到容器。
  • source=mvol specifies the name of the Docker volume to use.
  • target=/usr/irissys/mgr/user/ specifies the directory inside the container where the volume will be mounted. 请注意,这是存储 IRIS 用户数据库的容器目录。


连接到 IRIS 终端并设置一个global值,我们将检查它是否会持续存在

停止并移除容器

重新创建容器

再次连接到 IRIS 终端并检查global ^DockerVolume 值

很好! Docker 保留了 IRIS 数据


我们也可以使用以下命令检查卷详细信息:

$ docker container inspect iris-comm

这个命令的结果很长,但请注意 Mounts 区域包含有关卷的信息,此卷是最初运行时挂载的容器。

使用已挂载的卷完成此流程时,有两个关键点需要掌握:

  • 卷存在于容器的分层文件系统之外。 这意味着在可写容器层中操作文件时,它们不包含在通常的写时复制过程中。
  • 你可以在主机上操作文件,并通过已挂载的卷将这些更改无缝传播到正在运行的容器中。 对于将运行时环境容器化但挂载开发中代码的开发者来说,这是一种流行的技术。 通过这种方式,你可以使用主机编辑代码,并将更改传播到正在运行的容器中,而无需重建或重启计算机。

感谢阅读!

Discussion (0)0
Log in or sign up to continue
Article
· Aug 7, 2024 3m read

Exécution d'applications WSGI avec IPM

Introduction à l'exécution de WSGI dans IRIS

Avec IRIS 2024+, les utilisateurs peuvent héberger des applications WSGI à l'aide de Security.Applications. À titre d'exemple, un utilisateur peut faire quelque chose comme ceci.

Exemple minimal

zn "%SYS"
Kill props
Set props("Description") = "Sample WSGI Application"
Set props("MatchRoles") = ":%All"
Set props("WSGIAppLocation") = "/path/to/flaskapp"
Set props("WSGIAppName") = "myapp"
Set props("WSGICallable") = "app"
Set props("DispatchClass") = "%SYS.Python.WSGI" // important, sinon sera reconnu comme une application CSP
Set sc = ##class(Security.Applications).Create("/flask", .props)
zw sc

où le répertoire /path/to/flaskapp contient un fichier myapp.py

from flask import Flask

app = Flask(__name__)

@app.route("/")
def index():
    return "Hello, WSGI!"

Maintenant, accédez à l'URL http(s)://<host>:<port>/<optional-prefix>/flask/. Elle doit afficher « Hello, WSGI!» en texte brut.

Pièges courants

  1. Si l'URL http(s):///flask/ ne fonctionne pas, vérifiez d'abord la barre oblique finale, qui doit être présente.
  2. De plus, lors de la première exécution, flask doit être installé pour Embedded Python (pas votre interpréteur Python local au niveau du système d'exploitation). Vérifiez que l'installation a réussi en accédant au shell Embedded Python et en exécutant import flask.
  3. Enfin, l'autorisation de lecture de l'utilisateur du système d'exploitation qu'IRIS suppose doit être accordée à /path/to/flaskapp/myapp.py et à tous les dossiers parents.
  4. Si l'erreur ne peut toujours pas être résolue, vérifiez les entrées dans messages.log. Vous pouvez également nous contacter en publiant un problème

Utilisation d'IPM pour expédier des applications WSGI pour une installation facile

IPM facilite le processus en

  1. copiant le répertoire d'applications Flask vers un emplacement avec un accès en lecture garanti
  2. installant les dépendances Python pertinentes dans un fichier requirements.txt

Exemple de package

Voici un exemple qui peut être installé facilement partout où IPM (v0.7.2+) est installé sur IRIS 2024+. Clonez ce package dans un <PACKAGE_ROOT> approprié et démarrez un terminal IRIS

zn "%SYS"
zpm "load <PACKAGE_ROOT>"

Après une installation réussie, vous devriez pouvoir accéder à http(s)://<host>:<port>/<optional-instance-prefix>/my/flask/demo/. Dans mon cas, l'URL est http://localhost:8080/iris-ml-wsgi/my/flask/demo/ et elle contient :

This is a sample WSGI application using Flask!

Astuce : vous devez d'abord installer zpm en suivant les instructions ici pour que la commande zpm fonctionne.

Le module.xml du dépôt ci-dessus est également répertorié ici pour une référence rapide

<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25">
  <Document name="flask-demo.ZPM">
    <Module>
      <Name>flask-demo</Name>
      <Version>1.0.0</Version>
      <Description>This is a demo of a flask application</Description>
      <Keywords>flask</Keywords>
      <Author>
        <Person>Shuheng Liu</Person>
        <Organization>InterSystems</Organization>
        <CopyrightDate>2024</CopyrightDate>
        <License>MIT</License>
        <Notes>notes</Notes>
      </Author>
      <Packaging>module</Packaging>
      <SystemRequirements Version=">=2024.1" />
      <SourcesRoot>src</SourcesRoot>
      <FileCopy Name="src/python/flaskapp/" Target="${libdir}flask-demo/flaskapp/"/>
      <SystemSetting Name="CSP.DefaultFileCharset" Value="UTF-8"/>

      <WSGIApplication
        Url="/my/flask/demo"
        UnauthenticatedEnabled="1"
        Description="Sample WSGI application using Flask"
        MatchRoles=":${dbrole}"
        WSGIAppLocation="${libdir}flask-demo/flaskapp/"
        WSGIAppName="app"
        WSGICallable="app"
       />
    <AfterInstallMessage>Module installed successfully!</AfterInstallMessage>     
    </Module>    
  </Document>
</Export>
Discussion (0)1
Log in or sign up to continue
Article
· Aug 6, 2024 5m read

监控数据库增长 – 第 1 部分_数据收集

数据收集

这篇分步说明指南将讲解如何创建任务来收集 InterSystems 数据库及其全局变量的相关数据(如关联的 Open Exchange App 所示,其中包含所有相关代码)

免责声明:此软件仅用于测试/演示目的。 InterSystems 不支持将此代码作为任何发布产品的一部分。 它由 InterSystems 提供,作为特定产品和版本的演示/测试工具。 用户或客户全权负责此软件交付后的维护和测试,InterSystems 对此代码的错误或误用不承担任何责任

1) 首先,通过管理门户导入文件“DataCollection.xml”,并确保没有错误。 如果存在错误,则可能是版本问题,请发送电子邮件至 ari.glikman@intersystems.com 联系 Ari Glikman 获取适合你的版本的支持。 另外,确保将数据导入到你想要收集其内部数据以供后续检查的命名空间中。

3 Comments
Discussion (3)2
Log in or sign up to continue