WhoBrokeTheBuild / DockerizedMDSplus

MIT License
0 stars 1 forks source link

Cannot run demo, error creating demo tree #1

Open fluffynukeit opened 2 years ago

fluffynukeit commented 2 years ago

Hi. I am new to MDSPlus and am trying to use your docker containers to try it out. When going through your demo commands, I get a failure when trying to run demo-mdstcl:

dan@dan-desktop:~/Desktop/DockerizedMDSplus/demo$  UID=$(id -u) GID=$(id -g) docker-compose up -d
bash: UID: readonly variable
WARNING: The UID variable is not set. Defaulting to a blank string.
Creating network "demo_default" with the default driver
Creating demo_daq_server_1      ... done
Creating demo_tree_server_1     ... done
Creating demo_analysis_server_1 ... done
Creating demo_dispatch_server_1 ... done
dan@dan-desktop:~/Desktop/DockerizedMDSplus/demo$ demo-traverser -tree demo -shot -1
d88efe8a67b562633a0ae4eaf3413afdcc401acb9a3bfb6fb370c69e3ef607a4
dan@dan-desktop:~/Desktop/DockerizedMDSplus/demo$ demo-mdstcl """@/scripts/create_demo_tree.tcl"""
Error connecting to host: tree_server, port 8000 error=Try again
Error connecting to host /tree_server/ in io_open_one_remote
Error: Unable to edit shot number -1 of the 'demo' tree
Error msg was: %TREE-E-FCREATE, Error creating new file.
mdsdcl: --> failed on line 'edit demo /new'
mdsdcl: --> failed on line '@/scripts/create_demo_tree.tcl'

I also tried with sudo just to see if I could get it working. This time, no connection error but still unable to edit the shot number:

dan@dan-desktop:~/Desktop/DockerizedMDSplus/demo$ sudo UID=$(id -u) GID=$(id -g) docker-compose up -d
Creating network "demo_default" with the default driver
Creating demo_analysis_server_1 ... done
Creating demo_dispatch_server_1 ... done
Creating demo_tree_server_1     ... done
Creating demo_daq_server_1      ... done
dan@dan-desktop:~/Desktop/DockerizedMDSplus/demo$ demo-mdstcl """@/scripts/create_demo_tree.tcl"""
Error: Unable to edit shot number -1 of the 'demo' tree
Error msg was: %TREE-E-FCREATE, Error creating new file.
mdsdcl: --> failed on line 'edit demo /new'
mdsdcl: --> failed on line '@/scripts/create_demo_tree.tcl'
dan@dan-desktop:~/Desktop/DockerizedMDSplus/demo$ sudo demo-mdstcl """@/scripts/create_demo_tree.tcl"""
sudo: demo-mdstcl: command not found

I tried a number of workarounds related to UID and GID to no avail. On my system I'm 1000:1000, would this cause any issue?

I'm looking to get experience in just understanding MDSplus, what it is, what pieces there are and how they work together, etc. Thanks.

gauge2 commented 2 years ago

Hi. I am new to MDSPlus and am trying to use your docker containers to try it out. When going through your demo commands, I get a failure when trying to run demo-mdstcl:

dan@dan-desktop:~/Desktop/DockerizedMDSplus/demo$  UID=$(id -u) GID=$(id -g) docker-compose up -d
bash: UID: readonly variable
WARNING: The UID variable is not set. Defaulting to a blank string.
Creating network "demo_default" with the default driver
Creating demo_daq_server_1      ... done
Creating demo_tree_server_1     ... done
Creating demo_analysis_server_1 ... done
Creating demo_dispatch_server_1 ... done
dan@dan-desktop:~/Desktop/DockerizedMDSplus/demo$ demo-traverser -tree demo -shot -1
d88efe8a67b562633a0ae4eaf3413afdcc401acb9a3bfb6fb370c69e3ef607a4
dan@dan-desktop:~/Desktop/DockerizedMDSplus/demo$ demo-mdstcl """@/scripts/create_demo_tree.tcl"""
Error connecting to host: tree_server, port 8000 error=Try again
Error connecting to host /tree_server/ in io_open_one_remote
Error: Unable to edit shot number -1 of the 'demo' tree
Error msg was: %TREE-E-FCREATE, Error creating new file.
mdsdcl: --> failed on line 'edit demo /new'
mdsdcl: --> failed on line '@/scripts/create_demo_tree.tcl'

I also tried with sudo just to see if I could get it working. This time, no connection error but still unable to edit the shot number:

dan@dan-desktop:~/Desktop/DockerizedMDSplus/demo$ sudo UID=$(id -u) GID=$(id -g) docker-compose up -d
Creating network "demo_default" with the default driver
Creating demo_analysis_server_1 ... done
Creating demo_dispatch_server_1 ... done
Creating demo_tree_server_1     ... done
Creating demo_daq_server_1      ... done
dan@dan-desktop:~/Desktop/DockerizedMDSplus/demo$ demo-mdstcl """@/scripts/create_demo_tree.tcl"""
Error: Unable to edit shot number -1 of the 'demo' tree
Error msg was: %TREE-E-FCREATE, Error creating new file.
mdsdcl: --> failed on line 'edit demo /new'
mdsdcl: --> failed on line '@/scripts/create_demo_tree.tcl'
dan@dan-desktop:~/Desktop/DockerizedMDSplus/demo$ sudo demo-mdstcl """@/scripts/create_demo_tree.tcl"""
sudo: demo-mdstcl: command not found

I tried a number of workarounds related to UID and GID to no avail. On my system I'm 1000:1000, would this cause any issue?

I'm looking to get experience in just understanding MDSplus, what it is, what pieces there are and how they work together, etc. Thanks.

Had these same problems.

1) The start script has a conditional statement looking for the '$DIR' to be opening. I changed it to point to the $PWD I'm in and the demo runs. However, the default config is python 2 in this Alpine container. :-( I'm working out an Ubuntu18 image to run with python3.6. But ran into new problems. Yay.

Here's what I changed to to get it running:

if [[ "$0" == "" ]]; then
    DIR=$(realpath "$(dirname $BASH_SOURCE)/")
else
    # DIR=$(realpath "$(dirname $0)/")
    DIR="./"
fi

DEMO_PATH="/home/controls/DockerizedMDSplus/demo"

NETWORK=demo_default
# DOCKER_FLAGS="--network=$NETWORK --env-file=$DIR/config.env --volume=$DIR/scripts:/scripts --volume=$DIR/pydevices:/pydevices"
DOCKER_FLAGS="--network=$NETWORK --env-file=config.env --volume=${DEMO_PATH}/scripts:/scripts --volume=${DEMO_PATH}/pydevices:/pydevices"
...
...
...

2) In the compose file, change the stanza:

UID=${UID}
GID=${GID}

to

UID=${uid}
GID=${gid}

and instead of the given up command preface, preface with

uid=${id -u} gid=${id -g} docker-compose ...

This way, you don't get the READ ONLY error. I'm in a similar boat too, trying to understand MDSplus. And tbh, a lot of it is underwhelmingly under documented or out of date: see EPICS interface.

Now, see my next post for the trouble I'm in...

I hope that helped.