AA computes a function using a software called CasADi. I have installed CasADi, and AA can run on my desktop.
BB has to run in a container and imports data from AA.Because of this, BB cannot run because it doesn't recognize CasADi
How can I change the import statement in file BB to extract data from AA, which is in a different location. Both AA and BB are python files
I have tried the following import statements. Both did not work.
from AA import c_A
from home.user.Desktop.AA import c_A
Similar to @TimRoberts answer, but showing how to bind mount and share a directory on your desktop with your docker instance...
In AA, save the array on your Desktop using
np.save("/home/YOURUSER/Desktop/transfer.npy", data)
.Then start BB in docker, but using a "bind mount" of your Desktop to a folder called
/data
in docker:Then in BB, load the file with:
If you wanted a bit more of a dynamic/interactive interchange between the two processes without involving disk files, you could spin up another docker container with the standard Redis image in it, then you could easily exchange commands/data/Numpy arrays via Redis - see example here.