diff --git a/content/guides/catalog-behind-the-scenes.mdx b/content/guides/catalog-behind-the-scenes.mdx index f18a0742..b533d345 100644 --- a/content/guides/catalog-behind-the-scenes.mdx +++ b/content/guides/catalog-behind-the-scenes.mdx @@ -13,7 +13,7 @@ It is aimed for those more technically inclined who would be interested in under Similar to the [guide on using the application catalog](/guides/using-the-app-catalog), we will use two applications: - [the `nginx/1.25` application](https://github.com/unikraft/catalog/tree/main/library/nginx/1.25) -- [the `http-go1.21` example](https://github.com/unikraft/catalog/tree/main/examples/http-go1.21) +- [the `httpserver-go1.21` example](https://github.com/unikraft/catalog/tree/main/examples/httpserver-go1.21) ## NGINX @@ -23,17 +23,16 @@ The build phase creates the output kernel, and the run phase launches a Unikraft The kernel is a join of the actual Unikraft kernel and the application filesystem, packed as an initial ramdisk. We call the packed initial ramdisk the **embedded initial ramdisk** or **embedded initrd**. -### Configuration +### NGINX configuration The build and run configuration is part of the [`Kraftfile`](https://github.com/unikraft/catalog/blob/main/library/nginx/1.25/Kraftfile). - The `Kraftfile` defines the: - resulting image name: `nginx` - the command line to start the application: `/usr/bin/nginx` - path to the template `app-elfloader` - paths and versions of repositories (`unikraft`, `lwip`, `libelf`) -- configuration options: i.e. the `CONFIG_...` option enables the emdedded initrd build +- configuration options: the `CONFIG_...` option enables the embedded initrd build - build and run targets: currently only x86_64-based builds are available, and only KVM-based builds, using QEMU or Firecracker - root filesystem used to build the (embedded) initrd @@ -109,7 +108,8 @@ The resulting embedded kernel image is `.unikraft/build/nginx_qemu-x86_64`: ```bash $ ls -lh .unikraft/build/nginx_qemu-x86_64 ``` -``` + +```text -rwxr-xr-x 2 razvand docker 15M Jan 2 21:23 .unikraft/build/nginx_qemu-x86_64 ``` @@ -170,14 +170,14 @@ To close the running QEMU instance, use `Ctrl+a x` in the QEMU console. ## HTTP Go Server -For the [`http-go1.21` bincompat example](https://github.com/unikraft/catalog/tree/main/examples/http-go1.21), there is no build phase, only a run phase. +For the [`httpserver-go1.21` bincompat example](https://github.com/unikraft/catalog/tree/main/examples/httpserver-go1.21), there is no build phase, only a run phase. The example is using a prebuilt kernel image. The prebuilt [`base` kernel image](https://github.com/unikraft/catalog/tree/main/library/base) is pulled from the registry, from `unikraft.org/base`. This happens during the run phase. -### Configuration +### Run configuration -The run configuration is part of the [`Kraftfile`](https://github.com/unikraft/catalog/blob/main/examples/http-go1.21/Kraftfile): +The run configuration is part of the [`Kraftfile`](https://github.com/unikraft/catalog/blob/main/examples/httpserver-go1.21/Kraftfile): ```yaml spec: v0.6 @@ -191,7 +191,7 @@ cmd: ["/server"] The `Kraftfile` defines: -- the runtime image to use, containing the kernel: `unikraft.org/base:latest' (it can be summarized as just `base:latest`) +- the runtime image to use, containing the kernel: `unikraft.org/base:latest` (it can be summarized as just `base:latest`) - the root filesystem used, defined in a `Dockerfile` - the command line to start the application: `/server` - the available run targets: currently only x86_64-based builds are available, and only KVM-based builds, using QEMU or Firecracker @@ -224,7 +224,7 @@ COPY --from=build /lib64/ld-linux-x86-64.so.2 /lib64/ The Dockerfile is being interpreted via [BuildKit](https://docs.docker.com/build/buildkit/), hence the need to set up the BuildKit container. -### Run Phase +### HTTP Go Server run phase The run command requires the `BuildKit` container to be configured beforehand: @@ -253,7 +253,8 @@ The resulting initrd image is `.unikraft/build/initramfs.cpio`. ```bash $ ls -lh .unikraft/build/initramfs.cpio ``` -``` + +```text -rw-r--r-- 1 root root 8.9M Jan 4 18:16 .unikraft/build/initramfs-x86_64.cpio ``` @@ -262,7 +263,8 @@ To view the contents of the root filesystem you can use `cpio`: ```bash $ cpio -itv < .unikraft/build/initramfs.cpio ``` -``` + +```text d--------- 0 root root 0 Jan 1 1970 /lib d--------- 0 root root 0 Jan 1 1970 /lib/x86_64-linux-gnu -rwxr-xr-x 1 root root 1922136 Sep 30 11:31 /lib/x86_64-linux-gnu/libc.so.6 diff --git a/content/guides/catalog-using-firecracker.mdx b/content/guides/catalog-using-firecracker.mdx index 675b96ec..5e99c588 100644 --- a/content/guides/catalog-using-firecracker.mdx +++ b/content/guides/catalog-using-firecracker.mdx @@ -35,7 +35,7 @@ sudo cp release-v1.4.0-x86_64/firecracker-v1.4.0-x86_64 /usr/local/bin/firecrack Similar to the ["Application Catalog: Behind the Scenes" guide](/guides/catalog-behind-the-scenes), we will use two applications: - [the `nginx/1.25` application](https://github.com/unikraft/catalog/tree/main/library/nginx/1.25) -- [the `http-go1.21` example](https://github.com/unikraft/catalog/tree/main/examples/http-go1.21) +- [the `httpserver-go1.21` example](https://github.com/unikraft/catalog/tree/main/examples/httpserver-go1.21) ## NGINX @@ -143,7 +143,7 @@ Use the steps below to build and run the HTTP Go server as a binary-compatible a 1. Enter the HTTP Go server example directory: ```bash - cd catalog/examples/http-go1.21/ + cd catalog/examples/httpserver-go1.21/ ``` 1. Pull the unikernel `base` image for the Firecracker (`fc`) platform: @@ -169,7 +169,8 @@ Use the steps below to build and run the HTTP Go server as a binary-compatible a ```bash $ ls -lh .unikraft/build/initramfs-x86_64.cpio ``` - ``` + + ```text -rw-r--r-- 1 razvand razvand 9.7M Jan 26 18:50 .unikraft/build/initramfs-x86_64.cpio ``` diff --git a/content/guides/using-the-app-catalog.mdx b/content/guides/using-the-app-catalog.mdx index f7ea3c44..c50785ef 100644 --- a/content/guides/using-the-app-catalog.mdx +++ b/content/guides/using-the-app-catalog.mdx @@ -19,7 +19,8 @@ You can list the applications in the registry by using: ```bash kraft pkg ls --apps --all --update ``` -``` + +```text TYPE NAME VERSION FORMAT MANIFEST INDEX PLAT app unikraft.org/base latest oci 18cd70e af5c5ed qemu/x86_64 app unikraft.org/base latest oci ac5efa1 af5c5ed fc/x86_64 @@ -57,7 +58,7 @@ kraft run -W unikraft.org/helloworld This will default to the `x86_64` architecture and to the `qemu` platform. It will pull and run run the application from the registry: -``` +```text i using arch=x86_64 plat=qemu [+] pulling unikraft.org/helloworld o. .o _ _ __ _ @@ -84,7 +85,8 @@ Similarly, we can pull and run Nginx: ```bash kraft run -W unikraft.org/nginx:1.15 ``` -``` + +```text i using arch=x86_64 plat=qemu [+] pulling unikraft.org/nginx o. .o _ _ __ _ @@ -101,7 +103,8 @@ In order to connect to it, we need to pass a port mapping, similar to [`docker` ```bash kraft run -W -p 8080:80 unikraft.org/nginx:1.15 ``` -``` + +```text i using arch=x86_64 plat=qemu [+] pulling unikraft.org/nginx Powered by @@ -113,7 +116,6 @@ oOo oOO| | | | | (| | | (_) | _) :_ Telesto 0.16.1~b1fa7c5 ``` - You can use Nginx version 1.25 instead of version 1.15 by appending `:1.25` to the `kraft run` command. For example: `kraft run -W unikraft.org/nginx:1.25` @@ -125,7 +127,8 @@ Query the server to get the index page: ```bash curl localhost:8080 ``` -``` + +```text @@ -148,7 +151,8 @@ First create a bridge interface, as `root` (prefix with `sudo` if required): ```bash sudo kraft run --network virbr0 unikraft.org/nginx:1.15 ``` -``` + +```text i using arch=x86_64 plat=qemu [+] pulling unikraft.org/nginx en1: Interface is up @@ -166,7 +170,8 @@ The IP address used is typically the first available address (`172.44.0.2`, if t ```bash curl 172.44.0.2 ``` -``` + +```text @@ -195,7 +200,7 @@ The end-user appplications are built, packaged and published periodically in the We present the steps to building application and running them locally for: - [the `nginx/1.25` application](https://github.com/unikraft/catalog/tree/main/library/nginx/1.25) -- [the `http-go1.21` example](https://github.com/unikraft/catalog/tree/main/examples/http-go1.21) +- [the `httpserver-go1.21` example](https://github.com/unikraft/catalog/tree/main/examples/httpserver-go1.21) Both are running in binary-compatibility mode. @@ -278,13 +283,13 @@ This is generally the case for end-user applications, located in the [`library/` Another approach is to use a `base` image that is not embedding an actual application. This is the case for examples, located in the [`examples/` directory](https://github.com/unikraft/catalog/tree/main/examples). The application / example is then passed via an initial ramdisk. -One such example is the [`http-go1.21` example](https://github.com/unikraft/catalog/tree/main/examples/http-go1.21). +One such example is the [`httpserver-go1.21` example](https://github.com/unikraft/catalog/tree/main/examples/httpserver-go1.21). Follow the steps below to build and run the example: 1. Enter the example directory: ```bash - cd catalog/examples/http-go1.21 + cd catalog/examples/httpserver-go1.21 ``` 1. Run: diff --git a/content/hackathons/usw24/index.mdx b/content/hackathons/usw24/index.mdx index b2468f6d..753866e7 100644 --- a/content/hackathons/usw24/index.mdx +++ b/content/hackathons/usw24/index.mdx @@ -61,16 +61,16 @@ The complete schedule for USW'24 is (all times in CEST - Central European Summer | Date | Interval | Activity | |------|----------|----------| -| Tue, 02.07.2023 | 3:30pm-4pm
4pm-7pm| Opening Ceremony
Session 01: Overview of Unikraft | -| Thu, 04.07.2023 | 4pm-7pm | Session 02: Baby Steps | -| Fri, 05.07.2023 | 4pm-7pm | Session 03: Behind the Scenes | -| Tue, 09.07.2023 | 4pm-7pm | Session 04: Binary Compatibility | -| Thu, 11.07.2023 | 4pm-7pm | Session 05: Debugging in Unikraft | -| Fri, 12.07.2023 | 4pm-7pm | Session 06: Application Porting | -| Tue, 16.07.2023 | 4pm-7pm | Support Session 01 | -| Thu, 18.07.2023 | 4pm-7pm | Support Session 02 | -| Fri, 19.07.2023 | 4pm-7pm | Support Session 03 | -| Sat, 20.07.2023 | 9am-5pm | Final Hackathon | +| Tue, 02-07-2023 | 3:30pm-4pm
4pm-7pm| Opening Ceremony
Session 01: Overview of Unikraft | +| Thu, 04-07-2023 | 4pm-7pm | Session 02: Baby Steps | +| Fri, 05-07-2023 | 4pm-7pm | Session 03: Behind the Scenes | +| Tue, 09-07-2023 | 4pm-7pm | Session 04: Binary Compatibility | +| Thu, 11-07-2023 | 4pm-7pm | Session 05: Debugging in Unikraft | +| Fri, 12-07-2023 | 4pm-7pm | Session 06: Application Porting | +| Tue, 16-07-2023 | 4pm-7pm | Support Session 01 | +| Thu, 18-07-2023 | 4pm-7pm | Support Session 02 | +| Fri, 19-07-2023 | 4pm-7pm | Support Session 03 | +| Sat, 20-07-2023 | 9am-5pm | Final Hackathon | ### Registration Challenges @@ -81,9 +81,9 @@ The goal is to create an environment where these services can interact seamlessl Services Overview: - * Database Service: You can use whatever database suits you. - * Stats Service: A service that computes and provides statistical data (e.g. Grafana). - * Query Service: A simple API that interacts with the database (can be done in any programming language you like). +* Database Service: You can use whatever database suits you. +* Stats Service: A service that computes and provides statistical data (e.g. Grafana). +* Query Service: A simple API that interacts with the database (can be done in any programming language you like). Be creative, use networks, volume, everything you like. You can extend the stack as much as you like. @@ -151,7 +151,7 @@ All of them will be cloned by `kraft`, so we don't have to worry about that. #### `helloworld-c` -Let's start with the [`helloworld-c`](https://github.com/unikraft/catalog/tree/main/examples/helloworld-c) application. +Let's start with the [`helloworld-gcc13.2`](https://github.com/unikraft/catalog/tree/main/examples/helloworld-gcc13.2) application. We need to update the `Kraftfile`, so it build a kernel image locally, whithout pulling it directly from the registry. You can copy the [`Nginx` Kraftfile](https://github.com/unikraft/catalog/blob/main/library/nginx/1.25/Kraftfile), change the `name:` to `helloworld` and the `cmd:` to `["/helloworld"]`. @@ -171,8 +171,11 @@ First, we will see some messages that look like this: This tells us that `kraft` successfully cloned all the required dependencies to build the kernel. They are placed under `.unikraft/`: -```console +```bash $ tree -L 1 .unikraft/ +``` + +```text .unikraft/ |-- apps/ |-- build/ @@ -217,9 +220,11 @@ To build the image, we run `make C=$(pwd)/.config.helloworld_qemu-x86_64 -j$(npr The final image will be placed under `.unikraft/build/elfloader_qemu-x86_64`. We can run it manually, using `qemu-system-x86`, which is what `kraft` does behind the scenes. -```console +```bash $ qemu-system-x86_64 -cpu max -nographic -kernel .unikraft/build/elfloader_qemu-x86_64 --append "/helloworld" +``` +```text [...] [ 0.431128] dbg: [appelfloader] brk @ 0x407821000 (brk heap region: 0x407800000-0x407a00000) [ 0.432070] dbg: [libposix_fdio] (ssize_t) uk_syscall_r_write((int) 0x1, (const void *) 0x4078002a0, (size_t) 0xc) @@ -275,15 +280,15 @@ Create a `Makefile`, build the application and then run it. #### `hugo` -Follow the same steps with [`hugo`](https://github.com/unikraft/catalog/tree/main/library/redis/0.122). +Follow the same steps with [`hugo`](https://github.com/unikraft/catalog/tree/main/library/hugo/0.122). Create a `Makefile`, build the application and then run it. -#### `redis` +#### `node/21` Follow the same steps with [`node/21`](https://github.com/unikraft/catalog/tree/main/library/node/21). Create a `Makefile`, build the application and then run it. -#### `redis` +#### `PHP` Follow the same steps with [`PHP`](https://github.com/unikraft/catalog/tree/main/library/php/8.2). Create a `Makefile`, build the application and then run it. @@ -310,7 +315,7 @@ They are identical, since the application is run unmodified on Linux and on Unik ### Session 05: Debugging Many times, when we try to port an application and to use it on top of Unikraft, we will run into issues, as we do when we use any other platform. -Unikernels can seem harder to debug, since they function as virtual machines, but having the kernel code in the same address space as the application makes it easy to jump from the application code to the kernel code.. +Unikernels can seem harder to debug, since they function as virtual machines, but having the kernel code in the same address space as the application makes it easy to jump from the application code to the kernel code. In this sessions, we will look at different ways we can debug our Unikraft applications, from simple debug messages to using `gdb` to attach to the guest. #### Enable Debug Messages @@ -360,7 +365,7 @@ To do that, we need to update the run script accordingly. Let's start with the [`helloworld` application](https://unikraft.org/hackathons/usw24#session-04-binary-compatibility) that we used in the last session. The new run command will be: -```console +```bash qemu-system-x86_64 -cpu max -nographic -kernel .unikraft/build/elfloader_qemu-x86_64 --append "/helloworld" -S -s ``` @@ -368,7 +373,7 @@ Notice the extra `-S -s` flags. The `-S` option will start the application in a paused state, while the `-s` will open a gdbserver on TCP port 1234. After that, we can open another terminal and run gdb: -```console +```bash gdb --eval-command="target remote :1234" .unikraft/build/elfloader_qemu-x86_64.dbg ``` @@ -382,17 +387,17 @@ When debugging, instead of the usual breakpoints, use `hb` (hardware breakpoints Follow the same steps on the `nginx` application. Attach gdb, toy around, place some breakpoints and see how the application flows. -#### `redis` +#### Debug: redis Follow the steps for debugging messages and gdb for [`redis`](https://github.com/unikraft/catalog/tree/main/library/redis/7.2). Use the `redis` setup from the last session. -#### `hugo` +#### Debug: hugo Follow the steps for debugging messages and gdb for [`hugo`](https://github.com/unikraft/catalog/tree/main/library/hugo/0.122). Use the `hugo` setup from the last session. -#### `node` +#### Debug: node Follow the steps for debugging messages and gdb for [`node`](https://github.com/unikraft/catalog/tree/main/library/node/21). Use the `node` setup from the last session. @@ -408,14 +413,17 @@ We start from the already existing [`nginx` port](https://github.com/unikraft/ca Next, we start a docker container from the `nginx` official image: -```console +```bash docker run --rm -it nginx:1.25.3-bookworm /bin/bash ``` We use `ldd` to get the dependencies: -```console +```bash $ ldd /usr/sbin/nginx +``` + +```text linux-vdso.so.1 (0x00007ffdf39e8000) libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x000073162deb9000) libpcre2-8.so.0 => /lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x000073162de1f000) @@ -512,14 +520,14 @@ COPY ./wwwroot /wwwroot After that, everything should work properly. -#### `node` +#### Porting: node Now that you have seen how porting an application works, you can try it yourself with the [`node`](https://github.com/unikraft/catalog/tree/main/library/node/21) application. Remove the `Dockerfile`, start from the `node:21-alpine` image and follow the same steps as above. #### `memcached` -Do the same for [`memcached`](https://github.com/unikraft/catalog/blob/main/library/memcached/1.6/). +Do the same for [`memcached`](https://github.com/unikraft/catalog/blob/main/library/memcached/1.6). Remove the `Dockerfile` and start from `memcached:1.6.23-bookworm`. ### Session Recordings diff --git a/src/components/landing/catalog-strip.tsx b/src/components/landing/catalog-strip.tsx index 29f9a505..7241bd4a 100644 --- a/src/components/landing/catalog-strip.tsx +++ b/src/components/landing/catalog-strip.tsx @@ -143,21 +143,21 @@ export function CatalogStrip(props: BoxProps) { }} > C C++ @@ -168,14 +168,14 @@ export function CatalogStrip(props: BoxProps) { snippet="kraft run unikraft.org/helloworld:latest" /> Caddy @@ -191,35 +191,35 @@ export function CatalogStrip(props: BoxProps) { */} Flask Go Gohugo Lua @@ -242,35 +242,35 @@ export function CatalogStrip(props: BoxProps) { NGINX Node Perl PHP Python 3 @@ -286,35 +286,35 @@ export function CatalogStrip(props: BoxProps) { */} Ruby Rust Rust Actix Rust Rocket diff --git a/src/components/language-link.tsx b/src/components/language-link.tsx index dfff8b6c..c919d99f 100644 --- a/src/components/language-link.tsx +++ b/src/components/language-link.tsx @@ -45,49 +45,49 @@ export const LanguageLinks = () => { }} > C C++ Rust Go Python 3 Flask