Docker images and SALT

Using Dyalog under 'nixes

Docker images and SALT

Postby StefanoLanzavecchia on Mon Apr 06, 2020 9:07 am

As one of my first experiments with Docker and friends I decided to see what I could do with the official images distributed and published by Dyalog on Docker Hub.

If I go:
Code: Select all
    docker run -it dyalog/dyalog

I get an interactive session. I don't need an interactive session but it's a good way to experiment. If in the session I try and use any user-defined command I get this:
Code: Select all
 _______     __      _      ____   _____
|  __ \ \   / //\   | |    / __ \ / ____|
|_|  | \ \_/ //  \  | |   | |  | | |
     | |\   // /\ \ | |   | |  | | |   _
 ____| | | |/ /  \ \| |___| |__| | |__| |
|_____/  |_/_/    \_\______\____/ \_____|

https://www.dyalog.com

*************************************************************************************
*               This software is for non-commercial evaluation ONLY                 *
* https://www.dyalog.com/uploads/documents/Private_Personal_Educational_Licence.pdf *
*************************************************************************************

Dyalog APL/S-64 Version 17.1.36845 Unicode
For i86_64
Created: Aug 15 2019 at 00:13:45
Copyright (c) Dyalog Limited 1982-2019
      ]???

VALUE ERROR: Undefined name: ⎕SE.UCMD


Yet the files with the commands are all there:
Code: Select all
      )sh find / -name '*.dyalog'
find: ‘/root’: Permission denied
find: ‘/var/cache/apt/archives/partial’: Permission denied
find: ‘/var/cache/ldconfig’: Permission denied
/opt/mdyalog/17.1/64/unicode/Library/Core/APLProcess.dyalog
/opt/mdyalog/17.1/64/unicode/Library/Core/Tool.dyalog
/opt/mdyalog/17.1/64/unicode/Library/Conga/HttpCommand.dyalog
/opt/mdyalog/17.1/64/unicode/Library/Conga/HttpUtils.dyalog
/opt/mdyalog/17.1/64/unicode/Library/Conga/InitConga.dyalog
/opt/mdyalog/17.1/64/unicode/Library/Conga/FtpClient.dyalog
/opt/mdyalog/17.1/64/unicode/PublicCACerts/Export.dyalog
/opt/mdyalog/17.1/64/unicode/StartupSession/Link/Deserialise.dyalog
/opt/mdyalog/17.1/64/unicode/StartupSession/Link/Serialise.dyalog
/opt/mdyalog/17.1/64/unicode/StartupSession/Link/Install/WSLoaded-default.dyalog
/opt/mdyalog/17.1/64/unicode/StartupSession/Link/Install/RemoveLinks.dyalog
/opt/mdyalog/17.1/64/unicode/StartupSession/Link/Install/WSLoaded-clean.dyalog
/opt/mdyalog/17.1/64/unicode/StartupSession/Link/Install/BUILD_DYALOGSPACE.dyalog
/opt/mdyalog/17.1/64/unicode/StartupSession/Link/Test.dyalog
/opt/mdyalog/17.1/64/unicode/StartupSession/Dyalog/Serial.dyalog
/opt/mdyalog/17.1/64/unicode/SALT/core/Utils.dyalog
/opt/mdyalog/17.1/64/unicode/SALT/core/SALTUtils.dyalog
/opt/mdyalog/17.1/64/unicode/SALT/core/Parser.dyalog
/opt/mdyalog/17.1/64/unicode/SALT/core/UnicodeFile.dyalog
/opt/mdyalog/17.1/64/unicode/SALT/core/SALT.dyalog
[...]


Is this an oversight? The same applies to dyalog/dyalog:17.1.
Should I try a different image?

EDIT: dyalog/dyalog:17.1-dbg seems to work. I spent a few minutes trying to understand the difference, but I don't see it.
User avatar
StefanoLanzavecchia
 
Posts: 75
Joined: Fri Oct 03, 2008 9:37 am

Re: Docker images and SALT

Postby StefanoLanzavecchia on Wed Apr 08, 2020 7:18 am

Also dyalog:17.1-dbg adds its own problems, the main one being that, despite the name, it's impossible to debug what is happening if code execution errors. Surely that's due to my ignorance. I wouldn't mind a bit of guidance here...
But mainly, I'd like to know why []SE is empty in dyalog/dyalog or dyalog/dyalog:17.1.
Thank you.
User avatar
StefanoLanzavecchia
 
Posts: 75
Joined: Fri Oct 03, 2008 9:37 am

Re: Docker images and SALT

Postby Morten|Dyalog on Thu Apr 09, 2020 10:22 am

Hi Stefano! I could have sworn that I posted a reply to this yesterday, but I must have forgotten to submit it after going off to double-check something... By default, the Docker container starts APL with the -s (no session) flag, which is why SALT is not loaded. You can enable it after startup as follows:

Code: Select all
       )load salt
       enableSALT


Don't worry that it tells you it is unable to boot SALT (this is the thing I went off to investigate), it just hit an error trying to set the session font. UCMDs seem to work.

Alternatively, if you set RIDE_INIT, the script in the container will give you a session.

Code: Select all
docker run -it -e RIDE_INIT=SERVE:*:4502 -p 4502:4502 dyalog/dyalog


Hope this helps!
User avatar
Morten|Dyalog
 
Posts: 369
Joined: Tue Sep 09, 2008 3:52 pm

Re: Docker images and SALT

Postby StefanoLanzavecchia on Thu Apr 09, 2020 10:32 am

It helps a lot, thank you very much! And it's something I could have figured out by myself given that /run contains:
Code: Select all
if [ -n "${RIDE_INIT}" ]; then
    $DYALOG/dyalog +s -q ${WS} $@
else
    $DYALOG/dyalog -s ${WS} $@
fi


With hindsight it all seems pretty obvious. I need more hindsight :)
User avatar
StefanoLanzavecchia
 
Posts: 75
Joined: Fri Oct 03, 2008 9:37 am


Return to UNIX and Linux

Who is online

Users browsing this forum: No registered users and 1 guest