How to use APL Docker image
1 post
• Page 1 of 1
How to use APL Docker image
I am new to APL, but familiar with Docker.
I'm using the standard image from https://hub.docker.com/r/dyalog/dyalog, and trying to set up a service to support multiple RIDE 4.2 clients.
My basic development environment is working fine. I can start a Docker container, and connect to port 4502 with a RIDE 4.2 client. The client window shows a welcome message, and interprets commands, and prints results in the window:
However, when I try to make a second RIDE connection to the same host:port, I get "Connection rejected; Either no interpreter is listening on the specified port or the interpreter is already serving another RIDE client."
Apparently I need another layer that knows how to receive a connection request, spawn a new instance, and forward the client to the new server.
Traditionally, I've used xinetd for middle layers like that. I can configure xinetd to listen on 4502, and start a new Docker instance every time a client connects, and forward the I/O on stdin/stdout of the Docker process.
But it seems to me that the Docker process only knows how to listen on ports, not read from stdin and write to stdout. For example, I would like this command to evaluate the expression '1+1' and output the result, but it only outputs the welcome message:
I also tried evaluating an expression by launching [b]mapl[b] directly from within the Docker container. Not sure if these are errors or just warnings, but I don't see the result of the
So, there are two things I would like to accomplish:
1) An APL service, supporting multiple RIDE clients who connect to a well-known host:port and get fresh, independent, interactive APL envrionments
2) Execute APL from the host command line, by invoking the interpreter with the filename of an APL program, or evaluate APL code received on stdin, with results written to stdout
Thanks for helping me get acquainted with APL.
--Andy
I'm using the standard image from https://hub.docker.com/r/dyalog/dyalog, and trying to set up a service to support multiple RIDE 4.2 clients.
My basic development environment is working fine. I can start a Docker container, and connect to port 4502 with a RIDE 4.2 client. The client window shows a welcome message, and interprets commands, and prints results in the window:
Dyalog APL/S-64 Version 17.1.36845
Serial number: UNREGISTERED - not for commercial use
...
Rebuilding user command cache... done
⎕SH 'hostname'
40436953b29e
)sh find / -name '*.dyalog'
/home/dyalog/.dyalog
/opt/mdyalog/17.1/64/unicode/Library/Conga/FtpClient.dyalog
/opt/mdyalog/17.1/64/unicode/Library/Conga/HttpCommand.dyalog
...
However, when I try to make a second RIDE connection to the same host:port, I get "Connection rejected; Either no interpreter is listening on the specified port or the interpreter is already serving another RIDE client."
Apparently I need another layer that knows how to receive a connection request, spawn a new instance, and forward the client to the new server.
Traditionally, I've used xinetd for middle layers like that. I can configure xinetd to listen on 4502, and start a new Docker instance every time a client connects, and forward the I/O on stdin/stdout of the Docker process.
But it seems to me that the Docker process only knows how to listen on ports, not read from stdin and write to stdout. For example, I would like this command to evaluate the expression '1+1' and output the result, but it only outputs the welcome message:
# echo "'1+10'" | /usr/bin/docker run --rm dyalog/dyalog
_______ __ _ ____ _____
| __ \ \ / //\ | | / __ \ / ____|
|_| | \ \_/ // \ | | | | | | |
| |\ // /\ \ | | | | | | | _
____| | | |/ / \ \| |___| |__| | |__| |
|_____/ |_/_/ \_\______\____/ \_____|
https://www.dyalog.com
*********************************************************************
* This software is for non-commercial evaluation ONLY *
* https://www.dyalog.com/Private_Personal ... icence.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
I also tried evaluating an expression by launching [b]mapl[b] directly from within the Docker container. Not sure if these are errors or just warnings, but I don't see the result of the
dyalog@2f9b03e2a8b0:~$ echo ".SH 'whoami'" | /opt/mdyalog/17.1/64/unicode/mapl
cp: cannot stat '/opt/mdyalog/17.1/64/unicode/dyalog.config.example': No such file or directory
/opt/mdyalog/17.1/64/unicode/mapl: 107: /opt/mdyalog/17.1/64/unicode/mapl: /opt/mdyalog/17.1/64/unicode/aplkeys.sh: not found
Dyalog APL could not initialise because RIDE is only supported when the interpreter is running full screen.
So, there are two things I would like to accomplish:
1) An APL service, supporting multiple RIDE clients who connect to a well-known host:port and get fresh, independent, interactive APL envrionments
2) Execute APL from the host command line, by invoking the interpreter with the filename of an APL program, or evaluate APL code received on stdin, with results written to stdout
Thanks for helping me get acquainted with APL.
--Andy
- mickish
- Posts: 1
- Joined: Mon Apr 06, 2020 6:36 pm
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group