Robert Cemper · May 12, 2021 go to post

if you use Relationship many As obj [ Cardinality = many, Inverse = one ];
you create a managed pointer from many->one  with no sequence of insert.
Though it may be kept if new "many" elements are inserted in sequence with ascending IDs.
Later (manual?) add to the relationship of already exisiting "many" may break this.

To bypass this limitation I see 2 possible solutions:
- you add a property (auto-incremented, insert sequencer) to "many" to keep the insert sequence 
e.g.  Property InsertSequence As %Integer [ InitialExpression = {$increment(^InSeq)} ];
which is rather brute force, but available to manual adjustment for existing data

- you add to "one" side: Property ManyList As %ListOfObjects;
and add your many with Insert() function at and the end of the individual list.
The advantage of this approach is to have the freedom to change the sequence at your needs
And it also allows a kind of m:n relation as you are not limited to add your many to a unique one.
This is not my preferred solution and requires some coding erfort.

Robert Cemper · May 2, 2021 go to post

All your examples are correct.
BUT: 
- all your examples assume that docker is available to the users.
- this prerequisite is not always given. And may even contradict customer-defined rules.
And as I mentioned earlier: customers pay so they define their rules.
Losing a bid just because someone deep in the background dislikes SSH access must not be acceptable.  
[I have learned my lessons using VMware long before it became an "accepted platform" ]

Robert Cemper · Apr 28, 2021 go to post

¡Hola @Kurro Lopez !
It's a really interresting issue.
#2) your second example can't work by principal as you don't pass a call parameter.
#1) It is not foreseen to use object properties as host-variables in SQL
The code fails in the generated Execute method.

set tResult = tStatement.%Execute($g(pObject.KeyProcess),$g(pObject.CodeSpecialist),$g(pObject.CodeProvider),$g(pObject.CodeCenter),$g(pObject.Date))

$GET for oblect-properties is just not ​implemented. It is definded by the class and always there,
But it is required and makes sense for multidimensional properties !

This is valid for ObjectScript as such and not related to SQL.​​​​​​
But in handwritten code you can use $g(NOTHING,pObject.KeyProcess
The generator just doesn't do it. 

 

Workaround #1: directly fiddle in the generated code .  Not recommended
Workaround #2:  move your properties with a helper function into local variables
and adjust your query to those variables 
example helper (with obj or id):

ClassMethod FillProp(pObject As Kurro.MyClass) As %Boolean [ SqlName = FILLP, SqlProc ]
{
if '$isObject(pObject) set obj=##class(Kurro.MyClass).%OpenId(pObject)
else  set obj=pObject
set %Kurro("kp")=obj.KeyProcess
     ,%Kurro("sp")= obj.CodeSpecialist
     ,%Kurro("pr")= obj.CodeProvider
     ,%Kurro("cs")= obj.CodeCenter
    ,%Kurro("dt")= obj.Date
quit 1
}
example query;
Query GetInfoRcc(objid As %Integer) As %SQLQuery(CONTAINID = 0, ROWSPEC = "IdList:%String,IdProcess:%String,Duration:%String")
{
    SELECT IdList, IdProcess, Duration
    FROM Kurro.MyClass
    WHERE KeyProcess = :%Kurro("kp")
    AND CodeSpecialist = :%Kurro("sp")
    AND CodeProvider = :%Kurro("pr")
    AND CodeCenter = :%Kurro("cs")
    AND "Date" = :%Kurro("dt")
   AND FILLP(:objid) = 1
}

works as expected.
Sorry for being late. I was interrupted by ....  15 times at least with nonsense
 

Robert Cemper · Apr 25, 2021 go to post

try:

;
set file=$system.Util.ManagerDirectory()_"messages.log"
open file:("RS"):1 w $T  open 2:99
try { for n=1:1 use file read lin use 2 write lin,! } catch { close 2,file  write n_" lines",! }
;

then use ^SPOOL mapping (OEX) to work on it with SQL

Robert Cemper · Apr 23, 2021 go to post

Hello Hannes!
Thanks for the hint ! I'll check immedeatly.
-  for the stop:
I've seen this in some cases but could imagine it related to large global buffers.
default timeout for docker stop iris is 10 sec  but  docker stop -t 60  iris will give it a minute
the total save approach could be 
docker exec iris iris stop iris quietly      so iris is down
docker stop iris                                          now stop the container

Robert Cemper · Apr 22, 2021 go to post

Reacting to various security concerns  I have adjusted Dockerfile to the template
At the price of an additional command @ container start.
It is now: 

$ docker-compose up -d
$ docker-compose exec -u root iris /sshstart.sh


README.md is adjusted, 
Video is unchanged (to hide the additional grey hairs) .

Robert Cemper · Apr 21, 2021 go to post

This is an excellent application.
- It allows to create a base configuration and handle variants.
- And it's an excellent readable and easy-to-understand documentation.
- On top, it is JSON based and therefore well suited to source and version management
The original CachéParameterFile iris.cpf  does a mimic of versioning.
But it is buried deep into the  installation directory and as cryptic as the
Egyptian Book of the Dead. [reserved to the priest of IRIS cultus]  wink
I was waiting for something similar useful for decades!
I suggest: 

No one running and supporting more than 2 configurations should miss it!

Robert Cemper · Apr 21, 2021 go to post

<ctrl>+C doesn't work anymore   . 
I had to kill terminal or process

I'll step back

Robert Cemper · Apr 21, 2021 go to post

Great hint! 
Up to now I just used select text >  right click "copy + paste"

Robert Cemper · Apr 20, 2021 go to post

Why not take advantage of what is there and what is still working well.
You can't get all the %R*.int and %G*.int routines in Studio (no idea about VSCode)
But a closer look to the well know system globals and a ZLOAD brings those zombies back to life. 
yes 

Robert Cemper · Apr 20, 2021 go to post

@Alexey Maslov 
Following your suggestion, I investigated public key bases authentication.
And it's of course available (no surprise it's standard Linux)


$ cd /etc/ssh
$ ls -l
total 580
-rw-r--r-- 1 root root 553122 Mar  4  2019 moduli
-rw-r--r-- 1 root root   1580 Mar  4  2019 ssh_config
-rw------- 1 root root    227 Apr 20 20:32 ssh_host_ecdsa_key
-rw-r--r-- 1 root root    179 Apr 20 20:32 ssh_host_ecdsa_key.pub
-rw------- 1 root root    411 Apr 20 20:32 ssh_host_ed25519_key
-rw-r--r-- 1 root root     99 Apr 20 20:32 ssh_host_ed25519_key.pub
-rw------- 1 root root   1679 Apr 20 20:32 ssh_host_rsa_key
-rw-r--r-- 1 root root    399 Apr 20 20:32 ssh_host_rsa_key.pub

BUT:
- These keys change with every run of a docker build
- the client side varies with the platform, client type, .... and is rather tricky
  It is for sure beyond the bounds of this demo

For production, it makes sense, but not for download and run within 4 minutes.
Robert Cemper · Apr 20, 2021 go to post

Just great! I like it.  yes
with a solid partition / session under the feet. no local stuff, not browsers !
(btw. I had something similaar in mind but this is much better)

Robert Cemper · Apr 19, 2021 go to post

Thank you @Luca Ravazzolo It's a great story!
And 
the CHUI interface is a dead horse. No doubt!
But the need is not an invention but a demand from existing customers that fear
to lose control over their data and operation. Especially if there is nothing
anymore in the basement you can touch.
So I show that is possible. I don't judge if it makes sense. 
Like in real life:
- Some people climb Aiguille de Midi with ropes and hooks
even as there is a cable car to the top installed.
- Others drive SUV and HUMMERs but mostly run the highway
and almost never leave the well-pathed roads. 

Robert Cemper · Apr 19, 2021 go to post

It's just required to produce the demo video to demonstrate  full functionality with this setup

Robert Cemper · Apr 19, 2021 go to post

@Alexey Maslov !
You are totally right.
It is not the final solution but the start of a different scenario.
PW was just the most simple approach to begin with.
I was much more puzzled by the fact that sshd only starts from root
and that it does a very detailed check of the access rights on the internal generated keys.
An just found no way to start a service from within IRIS.
Now in the soft version, it is started with docker exec  ... as by README.md and OEX.
and the pw can be provided in a similar way