Dmitry Maslennikov · Mar 23, 2020 go to post

$listvalid

%SYS>w $listvalid($lb("test"))
1
%SYS>w $listvalid("test")     
0
%SYS>w $listvalid("")    
1

$listbuild is not an object, so, it's not a check as an instance of, it is only possible that variable is valid as $listbuild

$listbuild as just a string with a special format, so, that's why this will also return true

%SYS>w $listvalid($char(1))   
1
%SYS>write $lb()=$c(1)
1

because

%SYS>zzdump $lb()  

0000: 01                                                      .
Dmitry Maslennikov · Mar 14, 2020 go to post

So, to get own docker-running Cache, is quite easy.

You just need docker desktop installed on your mac. Then when it installed, and running. You'll be able to run it from the terminal by command.

docker run -d --name cache \
  -p 1973:1972 \
  -p 57773:57772 \
  -v $HOME/cache.key:/usr/cachesys/mgr/cache.key \
  daimor/intersystems-cache:2018.1

It supposed that you have valid cache.key in your home directory. And that your ports 1973 and 57773 is free to use. If you would like to change the port just change 1973 and 57773 with any you'd like to use.

This command will download the image (daimor/intersystems-cache:2018.1) from the public repository, and run it in the background.

You can control the running container by commands, wherein all subsequent commands cache is the name of the container from the docker run command.

To see cconsole.log of the container.

docker logs cache

To look at the status of the container

docker ps cache

Stop running container

docker stop cache

This is just an empty instance, to look at how it works. In the real case scenario, some more work should be done.

Docker images for Cache or for Ensemble are provided by me, and it is available for different versions.

Nowadays is best to migrate to IRIS, and use official images provided by InterSystems itself.

And the next step for you would be to use an editor that can be run on macOS, instead of Studio which working only on Windows.  

And you can use VSCode editor with an extension VSCode-ObjectScript, developed by me. 

I would recommend reading here articles tagged by Docker. There much more information about how to best use it. 

As well as about using VSCode.

You can contact me directly, if you need any help with establishing development process, with such modern tools as Docker and VSCode. or migrating to IRIS.

Dmitry Maslennikov · Mar 14, 2020 go to post

I suppose you going to use it like for local development, not for production, so, I would recommend just use docker images instead. I'm using macOS and have not installed Cache/IRIS locally already for some years.

You did not provide the version you try to install and no cconsole.log. If you add this here, so it may help.

Yes, for sure, you can install any packages locally

ZPM> load /path/to/package -v

it can be as a folder, or as file tgz, which you can get with command

ZPM> package-name package -v

-v is optional, to get more logs for debugging

there are some possible issues to have docker related files in a dedicated folder. 

When you would like to start an environment with docker-compose, you can do it with a command like this.

docker-compose up -d

but it will work only if the docker-compose.yml file name has not changed and it lays right in the current folder.

if you change its location or name, you will have to specify the new place

docker-compose -f ./docker/docker-compose.yml up -d

became not so simple, right?

Ok, next about Dockerfile.

when you build docker image, you have to specify context. So, the command below, just uses file Dockerfile in the current folder, and uses current folder as a context for build.

docker build .

To build docker image with Dockerfile placed somewhere else, you should specify it, suppose you still would like to have current folder as context.

docker build -f ./docker/Dockerfile .

any other files in the root, such as Installer.cls, irissession.sh or any other files which should be used during docker build have to be available from specified context folder. And you can't specify more than one context. So, any of those files should have some parent folder at least, and why not the root of a project.

with docker-compose.yml, we forget about docker build command, but we still have to care about docker-compose

The first iris after exec is the service name from docker-compose.yml, then goes command which has to be executed.

 iris command is a replacement for ccontrol from Cache/Ensemble

session - subcommand for iris tool

And the latest iris as the instance name inside for IRIS inside the container

Sounds good. How about to run it on Raspberry PI, is it already a time, to order of some (even now, when it has been recently updated and got a lower price)?

Dmitry Maslennikov · Feb 27, 2020 go to post

It's great that you trying to do it.

But I'm not sure what you actually going to achieve with WebGateway?

A provided link has info about running in docker.

So, if you just want to activate server-status page in internal apache which goes with IRIS, you should know, that it is not recommended to use internal webserver in production.

Some time ago I did an example of Apache with CSPgateway as a docker image. It can be outdated a bit but can be used as an example, how to achieve it. You can easily extend Apache settings there, to allow server-status as well.

Dmitry Maslennikov · Feb 23, 2020 go to post

$lb is a binary format, when you try to write it you just outputs everything including special symbols.

zwrite command, can do it respectively to format.

zzdump can show how it looks in real, it's byte sequence.

USER>zw $lb("words","more","words")
$lb("words","more","words") 

USER>zzdump $lb("words","more","words") 

0000: 07 01 77 6F 72 64 73 06 01 6D 6F 72 65 07 01 77         ..words..more..w
0010: 6F 72 64 73                                             ords

USER>zzdump $lb(1,2,3,4,5)              
0000: 03 04 01 03 04 02 03 04 03 03 04 04 03 04 05            ...............

But it is not so important how it looks low-level, as we mostly don't care about it.  Developers work with $ListBuild mostly through a bunch of functions, such as $list, $listget, $listnext and so on. You can find more information about $listbuild in the documentation, as well as many examples, and all functions which can be used to work with it.

Dmitry Maslennikov · Jan 31, 2020 go to post

Hi Max, thanks for the feedback.

Actually, there are no way to disable it, yet. Could you fill the enhancement request here?

Dmitry Maslennikov · Jan 28, 2020 go to post

Hi Jose,

Interesting, I don't have windows, but as I can see, exit code 2, means 

The system cannot find the file specified.

That's strange when it successfully called docker-compose when looked for a port.

You can also try to open an ordinary terminal in VSCode (Menu, View->Terminal), and put full command there, to see how it works.

Dmitry Maslennikov · Jan 26, 2020 go to post

Thanks, for sharing this.

As an addition, if you have would like to use a different file name from default docker-compose.yml for your configuration, you can set it as well.

"objectscript.conn" :{
  "ns": "IRISAPP",
  "active": true,
  "docker-compose": {
    "service": "iris",
    "internalPort": 52773,
    "file": "docker-compose.yml"
  }
}
Dmitry Maslennikov · Jan 24, 2020 go to post

I'm going to Barcelona this year, catch me there if you would like to see VSCode-ObjectScript in action if you would like to discuss new features you want to see there if you face in issues. 

See you there

Dmitry Maslennikov · Jan 23, 2020 go to post

I'm finally going to Antwerp this year.

So, you have a chance to meet me there, to see VSCode-ObjectScript in action, get quick help with the migration process, and give your feedback.

See you there.

Dmitry Maslennikov · Jan 13, 2020 go to post

A FOR loop pushes a new level onto the stack. A WHILE loop does not change the stack level.  

Source

Working with stack takes time.

Dmitry Maslennikov · Jan 10, 2020 go to post

Embedded SQL queries, with variables, and INTO. When I would like to see query plan, I have to first clean it and replace with `?`.

Would be good, to be able to get query plans for such cases, a bit more easier.

Dmitry Maslennikov · Jan 10, 2020 go to post

Something like this, you can have many serverN folders, with own settings.json there, configured for any server.

{
    "folders": [
        {
            "name": "root",
            "path": ".",
        },
        {
            "name": "server1",
            "path": "server1",
        },
        {
            "uri": "isfs://server1",
            "name": "server1",
        },
        {
            "uri": "isfs://server1?ns=%25SYS",
            "name": "server1 sys",
        },
        {
            "name": "server2",
            "path": "server2",
        },
        {
            "uri": "isfs://server2",
            "name": "server2",
        },
        {
            "uri": "isfs://server2?ns=%25SYS",
            "name": "server2 sys",
        },
        {
            "name": "server3",
            "path": "server3",
        },
        {
            "uri": "isfs://server3",
            "name": "server3",
        },
        {
            "uri": "isfs://server3?ns=%25SYS",
            "name": "server3 sys",
        }
    ],
    "settings": {
        "objectscript.serverSideEditing": true
    }
}