diff options
-rw-r--r-- | README.md | 9 | ||||
-rw-r--r-- | tasks.py | 14 | ||||
-rw-r--r-- | yaksh/scripts/yaksh_script.sh | 1 |
3 files changed, 15 insertions, 9 deletions
@@ -61,13 +61,17 @@ Quick Start $ invoke serve + - *Note:* The serve command will run the django application server on the 8000 port + and hence this port will be unavailable to other processes. + 1. On another terminal start up the code server that executes the user code safely: - To run the code server in a sandboxed docker environment, run the command: $ invoke start - - Make sure that you have docker installed on your system beforehand + - Make sure that you have Docker installed on your system beforehand. + [Docker Installation](https://docs.docker.com/engine/installation/#desktop) - To run the code server without docker, locally use: @@ -75,7 +79,8 @@ Quick Start $ invoke start --unsafe - Note this command will run the yaksh code server locally on your machine - and is susceptible to malicious code. + and is susceptible to malicious code. You will have to install the code + server requirements in sudo mode. @@ -47,26 +47,26 @@ def start(ctx, ports=SERVER_POOL_PORT, image=SRC_IMAGE_NAME, unsafe=False): cmd_params = {'ports': ports, 'image': SRC_IMAGE_NAME, 'name': TARGET_CONTAINER_NAME, - 'vol_mount': os.path.join(SCRIPT_DIR, 'yaksh_data/'), + 'vol_mount': os.path.join(SCRIPT_DIR, 'yaksh_data'), 'command': 'sh {0}'.format( os.path.join(SCRIPT_DIR, - 'yaksh_data/yaksh/scripts/yaksh_script.sh') + 'yaksh_data', 'yaksh', 'scripts', 'yaksh_script.sh') ) } getimage(ctx, image=SRC_IMAGE_NAME) print("** Preparing code server **") - create_dir(os.path.join(SCRIPT_DIR, 'yaksh_data/data')) - create_dir(os.path.join(SCRIPT_DIR, 'yaksh_data/output')) + create_dir(os.path.join(SCRIPT_DIR, 'yaksh_data', 'data')) + create_dir(os.path.join(SCRIPT_DIR, 'yaksh_data', 'output')) ctx.run('cp -r {0} {1}'.format( - os.path.join(SCRIPT_DIR, 'yaksh/'), - os.path.join(SCRIPT_DIR, 'yaksh_data/') + os.path.join(SCRIPT_DIR, 'yaksh'), + os.path.join(SCRIPT_DIR, 'yaksh_data') ) ) ctx.run('cp {0} {1}'.format( - os.path.join(SCRIPT_DIR, 'requirements/requirements-codeserver.txt'), + os.path.join(SCRIPT_DIR, 'requirements', 'requirements-codeserver.txt'), os.path.join(SCRIPT_DIR, 'yaksh_data') ) ) diff --git a/yaksh/scripts/yaksh_script.sh b/yaksh/scripts/yaksh_script.sh index f19ad3d..f39153e 100644 --- a/yaksh/scripts/yaksh_script.sh +++ b/yaksh/scripts/yaksh_script.sh @@ -2,6 +2,7 @@ # Basic script to install pip packages and run the yaksh code server command chown -R nobody output +chmod -R a+rwX output chmod -R a+rX data yaksh chmod -R o-w data yaksh echo "** Installing python dependencies **" |