Skip to content

Commit e4a8c46

Browse files
committed
light readme pass
1 parent cf2799b commit e4a8c46

1 file changed

Lines changed: 125 additions & 92 deletions

File tree

README.md

Lines changed: 125 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
1-
# Welcome to the ICRN Kernel Manager
1+
# ICRN Kernel Manager
22

33
## What is the ICRN Kernel Manager?
44
The Illinois Computes Research Notebook (ICRN) enables students and researchers to access computing at scale via an easily accessible web interface. But, many scientific domains rely on a wide array of complex packages for R and Python which are not easy to install. It is common for new users of compute systems to spend hours attempting to configure their environments.
55

6-
The ICRN Kernel Manager aims to eliminate this barrier.
6+
The ICRN Kernel Manager aims to eliminate this barrier by providing a simple command-line interface and web-based catalog for managing pre-configured kernel environments.
7+
8+
## Architecture Overview
9+
10+
The ICRN Kernel Manager consists of three main components:
11+
12+
1. **Command-Line Interface (`icrn_manager`)**: The primary tool for users to discover, download, and activate kernel environments
13+
2. **Kernel Indexer**: A containerized service that indexes kernel repositories and generates JSON manifest files containing package information
14+
3. **Web Interface**: A FastAPI + Nginx web server that provides a browser-based interface for exploring available kernels and searching for packages
15+
16+
### Component Integration
17+
18+
```
19+
Kernel Repository
20+
↓ (read-write mount)
21+
Kernel Indexer (CronJob) → Generates collated_manifests.json & package_index.json
22+
↓ (JSON files)
23+
Web Server (reads JSON files) → Serves via REST API
24+
25+
CLI Tool & Web UI → Users discover and manage kernels
26+
```
727

828
<img src="documentation/demo_resources/icrn_libraries_mngr_use_case_cowsay.gif" align="center" width="600"/>
929

@@ -44,43 +64,6 @@ Alias:
4464
./icrn_manager kernels avail
4565
```
4666

47-
### Get a package set
48-
```sh
49-
./icrn_manager kernels get <language> <kernel> <version>
50-
```
51-
Example:
52-
```sh
53-
./icrn_manager kernels get R cowsay 1.0
54-
./icrn_manager kernels get Python numpy 1.24.0
55-
```
56-
This command obtains the correct environment from the central repository, unpacks it, identifies the location of the packages, and updates the user's catalogue with this information.
57-
58-
```sh
59-
./icrn_manager kernels get R cowsay 1.0
60-
Desired kernel:
61-
Language: R
62-
Kernel: cowsay
63-
Version: 1.0
64-
65-
ICRN Catalog:
66-
/u/hdpriest/icrn_temp_repository/icrn_kernel_catalog.json
67-
User Catalog:
68-
/u/hdpriest/.icrn/icrn_kernels/user_catalog.json
69-
70-
Making target directory: /u/hdpriest/.icrn/icrn_kernels/cowsay-1.0/
71-
Checking out kernel...
72-
checking for: /u/hdpriest/.icrn/icrn_kernels/cowsay-1.0//bin/activate
73-
activating environment
74-
doing unpack
75-
getting R path.
76-
determined: /u/hdpriest/.icrn/icrn_kernels/cowsay-1.0/lib/R/library
77-
deactivating
78-
Updating user's catalog with R cowsay and 1.0
79-
Done.
80-
81-
Be sure to call "./icrn_manager kernels use R cowsay 1.0" to begin using this kernel in R.
82-
```
83-
8467
### Use a package set
8568
```sh
8669
./icrn_manager kernels use <language> <kernel> <version>
@@ -90,35 +73,6 @@ Example:
9073
./icrn_manager kernels use R cowsay 1.0
9174
./icrn_manager kernels use Python numpy 1.24.0
9275
```
93-
<img src="documentation/demo_resources/icrn_libraries_mngr_simple_use_cowsay.gif" align="center" width="600"/>
94-
95-
```sh
96-
./icrn_manager kernels use R cowsay 1.0
97-
Desired kernel:
98-
Language: R
99-
Kernel: cowsay
100-
Version: 1.0
101-
checking for: /u/hdpriest/.icrn/icrn_kernels/r/cowsay-1.0/lib/R/library
102-
Found existing link; removing...
103-
104-
./icrn_manager kernels use Python numpy 1.24.0
105-
Desired kernel:
106-
Language: Python
107-
Kernel: numpy
108-
Version: 1.24.0
109-
Found. Activating Python kernel...
110-
Installing Python kernel: numpy-1.24.0
111-
Python kernel installation complete.
112-
Kernel 'numpy-1.24.0' is now available in Jupyter.
113-
/u/hdpriest/.icrn/icrn_kernels/cowsay
114-
Found. Linking and Activating...
115-
Using /u/hdpriest/.icrn_b/icrn_kernels/cowsay within R...
116-
Done.
117-
118-
```
119-
This command updates the user's ```~{HOME}/.Renviron``` file with the location of the indicated kernel. Only one package-set can be 'in-use' at any time. Package-sets can be switched without 'get'ing them again.
120-
121-
Note that the user doesn't have to download, install, or compile any R packages at all.
12276

12377
### Switch to a different set of packages
12478
```sh
@@ -130,37 +84,72 @@ Note that the user doesn't have to download, install, or compile any R packages
13084
./icrn_manager kernels use R none
13185
```
13286

87+
## Kernel Indexer
88+
89+
The kernel indexer is a containerized service that indexes kernel repositories and generates JSON manifest files. It scans kernel directories, extracts package information, and creates two key files:
90+
91+
- `collated_manifests.json`: A kernel-centric index listing all available kernels with their packages
92+
- `package_index.json`: A package-centric index showing which kernels contain each package
93+
94+
### Building the Kernel Indexer
95+
96+
```bash
97+
docker build -t icrn-kernel-indexer:latest -f kernel-indexer/Dockerfile .
98+
```
99+
100+
### Running the Kernel Indexer
101+
102+
The indexer requires read-write access to the kernel repository:
103+
104+
```bash
105+
docker run --rm \
106+
-v /path/to/kernel/repository:/sw/icrn/jupyter/icrn_ncsa_resources/Kernels \
107+
-e KERNEL_ROOT=/sw/icrn/jupyter/icrn_ncsa_resources/Kernels \
108+
icrn-kernel-indexer:latest
109+
```
110+
111+
### Kubernetes Deployment
112+
113+
The kernel indexer is designed to run as a Kubernetes CronJob. See [`kernel-indexer/README.md`](kernel-indexer/README.md) for detailed deployment instructions.
114+
115+
For more information, see the [Kernel Indexer documentation](kernel-indexer/README.md) and [design document](kernel-indexer/DESIGN.md).
116+
133117
## Web Interface
134118

135-
The ICRN Kernel Manager includes a web-based interface for browsing available kernels and searching for packages. The web interface provides an intuitive way to explore the kernel catalog without using the command line.
119+
The ICRN Kernel Manager includes a web-based interface for browsing available kernels and searching for packages. The web interface reads the JSON files generated by the kernel indexer and provides an intuitive way to explore the kernel catalog without using the command line.
136120

137-
### Starting the Web Interface with Docker
121+
### Prerequisites
122+
123+
The web interface requires the JSON files generated by the kernel indexer:
124+
- `collated_manifests.json`
125+
- `package_index.json`
138126

139-
The web interface runs in a Docker container. To start it:
127+
These files should be located in the data directory or mounted as volumes.
128+
129+
### Starting the Web Interface with Docker
140130

141131
1. **Build the Docker image:**
142132
```sh
143-
docker build -t icrn-web ./web
133+
docker build -t icrn-kernel-webserver:latest -f web/Dockerfile .
144134
```
145135

146-
2. **Run the container:**
136+
2. **Run the container with kernel data:**
147137
```sh
148-
docker run -d -p 8080:80 --name icrn-web icrn-web
138+
docker run -d -p 8080:80 \
139+
-v /path/to/kernel/repository:/app/data:ro \
140+
-e COLLATED_MANIFESTS_PATH=/app/data/collated_manifests.json \
141+
-e PACKAGE_INDEX_PATH=/app/data/package_index.json \
142+
--name icrn-web icrn-kernel-webserver:latest
149143
```
150144

151-
This starts the container in detached mode, mapping port 8080 on your host to port 80 in the container.
152-
153-
3. **Copy example data into the container (optional):**
154-
155-
If you have example data files (`collated_manifests.json` and `package_index.json`), you can copy them into the running container:
145+
Or with example data:
156146
```sh
147+
docker run -d -p 8080:80 --name icrn-web icrn-kernel-webserver:latest
157148
docker cp web/examples/collated_manifests.json icrn-web:/app/data/
158149
docker cp web/examples/package_index.json icrn-web:/app/data/
159150
```
160-
161-
The web service will automatically detect and load these files.
162151

163-
4. **Access the web interface:**
152+
3. **Access the web interface:**
164153

165154
Open your web browser and navigate to:
166155
```
@@ -175,19 +164,53 @@ The web interface provides two main views:
175164

176165
- **View Packages**: Search for packages by name to see which kernels contain them. Results show the language, kernel name, kernel version, and package version for each match.
177166

178-
### Managing the Docker Container
167+
### API Endpoints
179168

180-
- **Rebuild after making changes:**
181-
```sh
182-
docker stop icrn-web
183-
docker rm icrn-web
184-
docker build -t icrn-web ./web
185-
docker run -d -p 8080:80 --name icrn-web icrn-web
186-
```
169+
The web interface exposes a REST API:
187170

188-
## Implementation Details
171+
- `GET /`: API information and status
172+
- `GET /health`: Health check endpoint
173+
- `GET /api/languages`: Get list of available languages
174+
- `GET /api/kernels/{language}`: Get all kernels for a specific language
175+
- `GET /api/kernel/{language}/{kernel_name}/{version}`: Get specific kernel details
176+
- `GET /api/manifest/{language}/{kernel_name}/{version}`: Get package manifest for a kernel
177+
- `GET /api/package/{package_name}`: Get all kernels containing a package
178+
- `GET /api/packages/search`: Search for packages by name
179+
- `POST /api/refresh`: Manually trigger data refresh (reloads JSON files from disk)
180+
181+
For more information, see the [Web Interface documentation](web/README.md).
182+
183+
## Containerized Deployment
184+
185+
The ICRN Kernel Manager components are containerized for easy deployment:
186+
187+
### Available Container Images
188+
189+
1. **Kernel Indexer**: `icrn-kernel-indexer`
190+
- Automatically builds and pushes to Docker Hub on commits to `main`/`develop` branches
191+
- Designed for Kubernetes CronJob deployment
192+
- See [kernel-indexer/README.md](kernel-indexer/README.md) for details
193+
194+
2. **Web Server**: `icrn-kernel-webserver`
195+
- Automatically builds and pushes to Docker Hub on commits to `main`/`develop` branches
196+
- FastAPI backend with Nginx reverse proxy
197+
- See [web/README.md](web/README.md) for details
198+
199+
3. **Apptainer/Singularity Support**: The kernel indexer also supports Apptainer/Singularity containers
200+
- See [kernel-indexer/APPTAINER_EXAMPLE.md](kernel-indexer/APPTAINER_EXAMPLE.md) for usage
201+
202+
### Continuous Integration
203+
204+
GitHub Actions workflows automatically build and push Docker images:
205+
206+
- `docker-build-indexer.yml`: Builds and pushes kernel indexer container
207+
- `docker-build-webserver.yml`: Builds and pushes web server container
208+
- `docker-build.yml`: Builds the main CLI tool container
209+
210+
All workflows trigger on pushes and pull requests to `main` and `develop` branches.
211+
212+
## Testing
189213

190-
### Testing
191214
The project includes a comprehensive test suite to ensure reliability and code quality:
192215

193216
```sh
@@ -199,6 +222,7 @@ The project includes a comprehensive test suite to ensure reliability and code q
199222
./tests/run_tests.sh update_r_libs # R library management
200223
./tests/run_tests.sh config # Configuration validation
201224
./tests/run_tests.sh help # Help and basic commands
225+
./tests/run_tests.sh kernel_indexer # Kernel indexing and collation
202226
```
203227

204228
**Test Features:**
@@ -212,5 +236,14 @@ The project includes a comprehensive test suite to ensure reliability and code q
212236
- File path validation to prevent silent failures
213237
- Improved test isolation for more reliable testing
214238
- Better permission checking and validation
239+
- Added kernel indexer test suite with 20+ tests
215240

216241
For detailed testing information, see the [Contributing Guide](documentation/source/contributing.rst).
242+
243+
## Documentation
244+
245+
- [User Guide](documentation/source/user/usage.rst): Detailed usage instructions
246+
- [Contributing Guide](documentation/source/contributing.rst): Guidelines for contributors
247+
- [Kernel Indexer](kernel-indexer/README.md): Kernel indexing service documentation
248+
- [Web Interface](web/README.md): Web server documentation
249+
- [CHANGELOG](CHANGELOG.md): Project changelog

0 commit comments

Comments
 (0)