|
| 1 | +Web Server |
| 2 | +========== |
| 3 | + |
| 4 | +The ICRN Kernel Manager web server provides a browser-based interface and REST API for exploring available kernels. |
| 5 | + |
| 6 | +Prerequisites |
| 7 | +------------- |
| 8 | + |
| 9 | +The web server requires the JSON files generated by the kernel indexer: |
| 10 | + |
| 11 | +- ``collated_manifests.json`` |
| 12 | +- ``package_index.json`` |
| 13 | + |
| 14 | +Building the Container |
| 15 | +---------------------- |
| 16 | + |
| 17 | +.. code-block:: bash |
| 18 | +
|
| 19 | + docker build -t icrn-kernel-webserver:latest -f web/Dockerfile web/ |
| 20 | +
|
| 21 | +Running the Web Server |
| 22 | +---------------------- |
| 23 | + |
| 24 | +Docker with Mounted Data |
| 25 | +~~~~~~~~~~~~~~~~~~~~~~~~ |
| 26 | + |
| 27 | +.. code-block:: bash |
| 28 | +
|
| 29 | + docker run -d -p 8080:80 --name icrn-web \ |
| 30 | + -v /path/to/kernel/repository:/app/data:ro \ |
| 31 | + -e COLLATED_MANIFESTS_PATH=/app/data/collated_manifests.json \ |
| 32 | + -e PACKAGE_INDEX_PATH=/app/data/package_index.json \ |
| 33 | + icrn-kernel-webserver:latest |
| 34 | +
|
| 35 | +Docker with Example Data |
| 36 | +~~~~~~~~~~~~~~~~~~~~~~~~ |
| 37 | + |
| 38 | +.. code-block:: bash |
| 39 | +
|
| 40 | + docker run -d -p 8080:80 --name icrn-web icrn-kernel-webserver:latest |
| 41 | + docker cp web/examples/collated_manifests.json icrn-web:/app/data/ |
| 42 | + docker cp web/examples/package_index.json icrn-web:/app/data/ |
| 43 | +
|
| 44 | +Environment Variables |
| 45 | +--------------------- |
| 46 | + |
| 47 | +``COLLATED_MANIFESTS_PATH`` |
| 48 | + Path to the kernel-centric manifest file. Default: ``/app/data/collated_manifests.json`` |
| 49 | + |
| 50 | +``PACKAGE_INDEX_PATH`` |
| 51 | + Path to the package-centric index file. Default: ``/app/data/package_index.json`` |
| 52 | + |
| 53 | +API Endpoints |
| 54 | +------------- |
| 55 | + |
| 56 | +The web server exposes the following REST API endpoints: |
| 57 | + |
| 58 | +.. list-table:: |
| 59 | + :header-rows: 1 |
| 60 | + :widths: 30 70 |
| 61 | + |
| 62 | + * - Endpoint |
| 63 | + - Description |
| 64 | + * - ``GET /`` |
| 65 | + - API information and status |
| 66 | + * - ``GET /health`` |
| 67 | + - Health check endpoint |
| 68 | + * - ``GET /api/languages`` |
| 69 | + - List of available languages |
| 70 | + * - ``GET /api/kernels/{language}`` |
| 71 | + - All kernels for a specific language |
| 72 | + * - ``GET /api/kernel/{language}/{kernel_name}/{version}`` |
| 73 | + - Specific kernel details |
| 74 | + * - ``GET /api/manifest/{language}/{kernel_name}/{version}`` |
| 75 | + - Package manifest for a kernel |
| 76 | + * - ``GET /api/package/{package_name}`` |
| 77 | + - All kernels containing a package |
| 78 | + * - ``GET /api/packages/search`` |
| 79 | + - Search for packages by name |
| 80 | + * - ``POST /api/refresh`` |
| 81 | + - Manually trigger data refresh |
| 82 | + |
| 83 | +Kubernetes Service |
| 84 | +------------------ |
| 85 | + |
| 86 | +For the RStudio Addin to communicate with the web server, deploy it as a Kubernetes Service: |
| 87 | + |
| 88 | +.. code-block:: yaml |
| 89 | +
|
| 90 | + apiVersion: v1 |
| 91 | + kind: Service |
| 92 | + metadata: |
| 93 | + name: icrn-web-service |
| 94 | + namespace: kernels |
| 95 | + spec: |
| 96 | + selector: |
| 97 | + app: icrn-web |
| 98 | + ports: |
| 99 | + - port: 80 |
| 100 | + targetPort: 80 |
| 101 | +
|
| 102 | +The RStudio Addin connects to ``http://icrn-web-service.kernels:80`` by default. |
| 103 | + |
| 104 | +Public URLs |
| 105 | +----------- |
| 106 | + |
| 107 | +Configure ingress or load balancers to expose the web interface: |
| 108 | + |
| 109 | +- **Production**: https://kernels.ncsa.illinois.edu |
| 110 | +- **Development**: https://kernels.cori-dev.ncsa.illinois.edu |
| 111 | + |
0 commit comments