Commit 4abae985 authored by Madhur Tandon's avatar Madhur Tandon

Add Documentation + Minor Changes

parent 369ce905
...@@ -64,6 +64,22 @@ on your `PATH`. ...@@ -64,6 +64,22 @@ on your `PATH`.
`pytest test/` `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 # Benchmarking
Install the same dependencies as for testing. Install the same dependencies as for testing.
......
...@@ -37,9 +37,9 @@ def main(args): ...@@ -37,9 +37,9 @@ def main(args):
build_dir = args.build_dir build_dir = args.build_dir
port = args.port port = args.port
httpd = server(port) httpd = server(port)
os.chdir(build_dir)
print("serving from {0} at localhost:".format(build_dir) + str(port))
try: try:
os.chdir(build_dir)
print("serving from {0} at localhost:".format(build_dir) + str(port))
httpd.serve_forever() httpd.serve_forever()
except KeyboardInterrupt: except KeyboardInterrupt:
print("\n...shutting down http server") print("\n...shutting down http server")
......
#!/bin/sh #!/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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment