Closed guiga-zalu closed 1 year ago
Hello Guiga-Zalu,
please, detail how can I reproduce the problem to try to spot a solution.
Best regards, Juan Carlos.
Well, for the installation of the npm modules, I altered install-vpl-sh
and added lines (right after the vpl_install "Valgrind tool" valgrind
) with content like this:
# Processamento Numérico
vpl_install_npm "big.js" big.js
vpl_install_npm "BigNumber.js" bignumber.js
vpl_install_npm "decimal.js" decimal.js
vpl_install_npm "vectorious" vectorious
In total, 14 modules were installed.
The shell showed no installation errors for 13 of them, failing only with opencv4nodejs
, which was not crucial.
So, to try out the modules, I submitted, saved and executed a file (test.js) like that:
const BN = require('bignumber.js');
console.dir(BN);
But the module could not be found.
Hello guiga-zalu, I have not been able to install globally the modules and run the test.js code. I am using Ubuntu 18 it seems that some modules are deprecated. what O.S. are you using?
Best regards, Juan Carlos.
I think is b/c when the student/teacher code is executed its running in another isolated context. In few words, you installed that dependencies for the host, but not to the isolated context. Maybe related: https://github.com/jcrodriguez-dis/vpl-xmlrpc-jail/issues/32
I think i resolved your bug. You need adjust the prisoner environment.
That is the folder structure to the prisoner process. @jcrodriguez-dis Let me know if im wrong.
Sorry, Alejandro, this is an outdated comment. The correct comment must be
# Jail filesystem structure $JAILPATH overlayfs of / with nosuid by default
# $JAILPATH____ dev #Real dir by mount --bind
# | |___ pts #Real dir by mount --bind
# | |___ shm #New tmpfs
# |___ etc #Replaced passwd and group
# |___ home #Relaced dir to create suitable prisoner home dir
# |___ proc #Real dir by mount --bind
# |___ run #Real dir by mount --bind
# | |___ lock #Real dir by mount --bind
@jcrodriguez-dis thanks for your clarification. But related to the @guiga-zalu issue, i mean the problem is the context that the process prisoner for a vpl execution. Global node modules exists in another context, not in the prisoner context. @jcrodriguez-dis Maybe, could u add a way to customize the prisoner file system?
The steps to modify the prisoner context is:
Warning always that you restart your jail process you should repeat the next steps:
Enjoy!
@jcrodriguez-dis let me know if im right
Apologize for my ignorance about the Docker contexts, but I think that the approach of installing the software at each service start is slow and requires knowing the set of packages to install. About the limitations of access to the DNS service from the student code, I think that is related to the firewall configuration managed from VPL (that may be wrong), and I believe that the use of the /etc/hosts file is a not general solution requiring manual intervention. About the @guiga-zalu issue, I did not get to install and use the nodejs modules to run outside VPL, this is the first step to resolve problems of running code inside VPL.
Best regards, Juan Carlos.
Of course, that process gets slowly, but i recommend to node js users to avoid to use another dependencies. Just keep mocha and unit testing libraries.
Dont worry, i was not talking about docker context. I was talking about the file system that the jail mounts every time that create a execution process
The jail server can successfully execute a
.js
file withnodejs
. I altered an installation file to install some modules (as globals, vianpm
), and it installed them successfully. But I can't import them when an script is executed.