Add Documentation + Minor Changes

This commit is contained in:
Madhur Tandon 2018-12-11 13:26:51 +05:30
parent 369ce905c1
commit 4abae985ea
3 changed files with 22 additions and 3 deletions

View File

@ -64,6 +64,22 @@ on your `PATH`.
`pytest test/`
# Manual Testing
The port 8000 of the docker environment and the system are automatically binded when ``./run_docker`` is run.
This can be used to test the ``pyodide`` builds running within the docker environment using external browser
programs of the system.
To do this, simply run ``./bin/pyodide serve``
This serves the ``build`` directory of the ``pyodide`` project on port 8000.
* To serve a different directory, use the ``--build_dir`` argument followed the path of the directory
* To serve on a different port, use the ``--port`` argument followed by the desired port number
Make sure that the port passed in ``--port`` argument is same as the one defined as ``DOCKER_PORT`` in the ``run_docker`` script.
# Benchmarking
Install the same dependencies as for testing.

View File

@ -37,9 +37,9 @@ def main(args):
build_dir = args.build_dir
port = args.port
httpd = server(port)
os.chdir(build_dir)
print("serving from {0} at localhost:".format(build_dir) + str(port))
try:
os.chdir(build_dir)
print("serving from {0} at localhost:".format(build_dir) + str(port))
httpd.serve_forever()
except KeyboardInterrupt:
print("\n...shutting down http server")

View File

@ -1,2 +1,5 @@
#!/bin/sh
docker run -p 8000:8000 --rm -v $PWD:/src --user root -e NB_UID=$UID -e NB_GID=$GID -it iodide/pyodide-env:0.3.1 /bin/bash
DOCKER_PORT=8000
SYSTEM_PORT=8000
docker run -p $SYSTEM_PORT:$DOCKER_PORT --rm -v $PWD:/src --user root -e NB_UID=$UID -e NB_GID=$GID -it iodide/pyodide-env:0.3.1 /bin/bash