Find

Article
· Apr 26, 2021 3m read

SSH for IRIS container

Why SSH ?

If you do not have direct access to the server that runs your IRIS Docker container
you still may require access to the container outside "iris session" or "WebTerminal".
With an SSH terminal (PuTTY, KiTTY,.. ) you get access inside Docker, and then, depending
on your needs you run "iris session iris" or display/manipulate files directly.

Note: 
This is not meant to be the default access for the average application user
but the emergency backdoor for System Management, Support, and Development.

This project is based on templates for InterSystems ObjectScript Github repository.
There a few significant extensions:

  • docker-compose.yaml exposes port 22 for SSH
  • Dockerfile installs SSH server and prepares Server start. You may observe a significant bunch of updates as the underlying Ubuntu is not very fresh

The rest is pretty default for InterSystems IRIS Community Edition in a docker container.

Prerequisites

Make sure you have git and Docker desktop installed.

Installation

Clone/git pull the repo into any local directory

$ git clone https://github.com/rcemper/SSH-for-IRIS-container.git   

Open the terminal in this directory and run:

$ docker-compose build

Run the IRIS container with

$ docker-compose up -d 

How to Test it:

If you didn't assign a fixed port to projected container port 22 you may run

$ docker ps
e37392a1c7c3   ssh-for-iris-container   "/bin/sh -c '/iris-m…"   2 hours ago   Up 2 hours (unhealthy)   
2188/tcp, 54773/tcp,    
0.0.0.0:41022->22/tcp, 0.0.0.0:41773->1972/tcp, 0.0.0.0:42773->52773/tcp, 0.0.0.0:49716->53773/tcp   

and see the assigned_port for port 22 in the container 0.0.0.0:41022->22/tcp,  (here it's 41022).   
Next, you connect with PuTTY over SSH to server:assigned_port
Log in as irisowner + the PW of your choice and you are in your container.

This is similar as with docker-compose exec iris sh in a local docker instance.

Example:

login as: irisowner
irisowner@localhost's password:
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 5.4.72-microsoft-standard-WSL2 x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

To restore this content, you can run the 'unminimize' command.
Last login: Sat Apr 17 11:10:56 2021 from 172.18.0.1
$
$ iris view

Instance 'IRIS'   (default)
        directory:    /usr/irissys
        versionid:    2020.4.0.524.0com
        datadir:      /usr/irissys
        conf file:    iris.cpf  (SuperServer port = 1972, WebServer = 52773)
        status:       running, since Sat Apr 17 09:12:38 2021
        state:        ok
        product:      InterSystems IRIS

$ iris session iris -U "%SYS"
Node: e37392a1c7c3, Instance: IRIS
%SYS>zpm
zpm:%SYS>list
ssh-for-iris-container 0.0.1
webterminal 4.9.2
zpm 0.2.14
zpm:%SYS>q  
%SYS>d ^zSSH 
This is a placeholder for testing
 if you see it, then the installation was OK   
%SYS>h
$

Demo Video is here

GitHub

34 Comments
Discussion (34)2
Log in or sign up to continue
Question
· Apr 23, 2021

Keep session Cookie in SOAP

Hello,

I have a question about a problem calling a SOAP Web Service.

Indeed, to retrieve data via a Web Service, I need to make 4 calls, one to connect, one to place parameters, one to retrieve data and one to disconnect. Using the EnsLib.SOAP.OutboundAdapter class, I manage to make my first connection call but for the other calls I would need to keep my session cookie otherwise it doesn't consider me as connected. I know it's possible to do this in REST directly in the EnsLib.REST.OutboundAdapter class but I can't find a way to do it in SOAP.

Has anyone already encountered the same problem as me?

Thanks in advance for your feedback

1 Comment
Discussion (1)0
Log in or sign up to continue
Question
· Apr 20, 2021

BI Tools and Caché

Hi,

I am testing some BI tools like Tableau, Power BI and Qlik with Caché using ODBC driver

Is there another way to connect them with Caché?

5 Comments
Discussion (5)0
Log in or sign up to continue
Article
· Apr 15, 2021 2m read

プログラムから、クラス定義に記述されたプロパティ定義を取得する方法

これは InterSystems FAQ サイトの記事です。

クラスに定義されたプロパティの情報については、以下システムクラスを利用して情報を取得できます。

%Dictionary.ClassDefintion

%Dictionary.PropertyDefinition

 

コード記述例は以下の通りです。

Class ISJ.Sample
{
ClassMethod getPropInfo(classname As %String)
{
    set cls=##class(%Dictionary.ClassDefinition).%OpenId(classname,,.status)
    if $$$ISERR(status) {
        write "指定クラスは存在しません",!
        quit  // または return
    }
    set x=cls.Properties
    for i=1:1:x.Count() {
        // プロパティ情報を取得(%Dictionary.PropertyDefinition)
        set prop=x.GetAt(i)
        if prop="" {
            continue
        }
        set propname=prop.Name // プロパティ名
        set proptype=prop.Type // プロパティタイプ
        if propname="" {
            continue
        }
        write propname," ",proptype,!
    }
}
}

 

実行例は以下の通りです。

USER>do ##class(ISJ.Sample).getPropInfo("Taxi.Driver")
DriverID %String
Name %String
Phone %String

 

関連記事:指定のテーブルの全フィールドをSQLで取得する方法

Discussion (0)1
Log in or sign up to continue
Question
· Apr 7, 2021

Add div programmatically to th-element after refreshContents()

Hey community,

I want to create my own table resizer. I know that there are some plugins that are doing exactly this but I would like to create my own one. :)

 

I have created a function, which is called in the onloadHandler and which append a div to each th-element of a given table. The method looks like this:

function initializeTableFeatures(){

    jQuery.each($("#table > table > thead > tr > th"), function() {
         if(this.id !== ""){
              var div createDiv($(this).outerHeight());
              $(this).append($(div));
              $(this).css('position','relative');
              setListeners(div);
              this.width $(this).outerWidth()
              console.log(div)
         }

    });

}

 

The function "createDiv()" does this:

function createDiv(tableHeight){
    var div document.createElement('div');
    $(div).css('top','0');
    $(div).css('right','0');
    $(div).css('width','2px');
    $(div).css('position','absolute');
    $(div).css('cursor','col-resize');
    $(div).css('userSelect','none');
    $(div).css('height',tableHeight 'px');
    return div;
}

This is working perfectly then entering the page. The problem is that the table can be multi-paged. So tthe table is splitted into multiple pages. On each page change the method refreshTable() is called. This method executes refreshContents() on the table.

 

I tried to add my initializeTableFeatures() function after the call of refreshContents(), but it didnt work. I thought that the table isnt fully loaded when calling my initializeTableFeatures(). Due to this I added a setTimeout() for this function but it didnt work either.

 

One funny thing is that when I am adding an alert to the refreshTable() function and I am closing this alert, the div are successfully appended to each th-element.

 

Does anyone know a fix to this problem?

 

Thanks in advance

1 Comment
Discussion (1)0
Log in or sign up to continue