Skip to content

Commit 7124fba

Browse files
StefanJumrazvand
authored andcommitted
usw25: Add session 1, Overview
Update the Overview guide to use the catalog-core scripts and add USW25 session 01. Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
1 parent 7c3bd2c commit 7124fba

File tree

2 files changed

+90
-13
lines changed

2 files changed

+90
-13
lines changed

content/guides/overview.mdx

Lines changed: 81 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ description: |
88

99
## Set Up
1010

11-
We encourage you to split into teams of 2-4 people, for both the tutorials and the hackathon challenges.
11+
You will be part of a team of 3-4 people.
12+
Discuss on the [thread](https://discord.com/channels/762976922531528725/1385697301007433898) and create/announce your team on Discord.
13+
Each team will be assigned a Discord channel to work together.
1214
You can use the `#hack-team-XX-voice` channels on the [Discord server](https://bit.ly/UnikraftDiscord).
1315
You will need a Linux environment for this session.
1416
You can use a virtual machine, but we strongly recommend a native Linux install.
15-
We provide you with a [virtual machine](https://drive.google.com/file/d/16oBxfjFvu5mpf6DMb4-bsnyd5n2FqReo/view?usp=sharing) that has the minimum requirements already installed.
16-
The credentials for the virtual machine are `unikraft:unikraft`.
1717

1818
You will need to install the following packages:
1919

@@ -57,20 +57,88 @@ sudo mkdir /etc/qemu/
5757
echo "allow all" | sudo tee /etc/qemu/bridge.conf
5858
```
5959

60-
## `app-helloworld` on Unikraft
60+
## Running Applications Using Unikraft
6161

62-
The Unikraft `helloworld` application is located in [this repository](https://github.com/unikraft/app-helloworld), along with instructions on how to configure, build and run the application.
63-
We will go through them without focusing that much on the details, since we will see how everything works behind the scenes in the next sessions.
64-
Go through the repository `README.md` file and run your first Unikraft unikernel.
62+
The applications that we will look at are located in [this repository](https://github.com/unikraft/catalog-core/tree/scripts) (we will use the `scripts` branch for now, not the `main` branch).
63+
64+
Before building and running applications, there are some setup steps we need to do.
65+
First, run the [`./setup.sh` script in the root of the repository](https://github.com/unikraft/catalog-core/blob/scripts/setup.sh).
66+
This will clone all the dependencies we need.
67+
After that, for every application we will run, we must run the `setup.sh` script from the application directory.
68+
69+
All the applications have a `scripts/` subdirectory where several useful things are located:
70+
71+
* Building scripts, under `scripts/build/`, named `plat.architecture` (we will use `qemu.x86_64` and `qemu.arm64`).
72+
* Running scripts, under `scripts/run/`, same naming convention as the build scripts.
73+
* Configuration files, under `scripts/defconfig/`, we will ignore that for now, and will come back to it in a later session.
74+
75+
### `helloworld` on Unikraft
76+
77+
We will start with the `c-hello` application, which is a simple "Hello, world", written in `C`.
78+
79+
First, we `cd` into the `c-hello` directory and run `./setup.sh`.
80+
This will create a new directory, `c-hello/workdir/`, with all the unikraft-related dependencies.
81+
In order to build and run it as a `x86_64` virtual machine, we need to first run the `scripts/build/qemu.x86_64` script, then `scripts/run/qemu.x86_64`.
82+
83+
```console
84+
git clone https://github.com/unikraft/catalog-core/
85+
cd catalog-core
86+
git checkout scripts
87+
./setup.sh
88+
cd c-hello/
89+
./setup.sh
90+
./scripts/build/qemu.x86_64 # This might take a while
91+
./scripts/run/qemu.x86_64
92+
```
93+
94+
After the run script, we should see the output of the `hello-world` VM:
95+
96+
```console
97+
SeaBIOS (version 1.16.3-debian-1.16.3-2)
98+
99+
100+
iPXE (https://ipxe.org) 00:03.0 CA00 PCI2.10 PnP PMM+0078AE00+006CAE00 CA00
101+
102+
103+
104+
Booting from ROM..Powered by
105+
o. .o _ _ __ _
106+
Oo Oo ___ (_) | __ __ __ _ ' _) :_
107+
oO oO ' _ `| | |/ / _)' _` | |_| _)
108+
oOo oOO| | | | | (| | | (_) | _) :_
109+
OoOoO ._, ._:_:_,\_._, .__,_:_, \___)
110+
Pan 0.19.0~e4d07100
111+
Hello from Unikraft!
112+
```
113+
114+
You can also try the `arm64` scripts:
115+
116+
```console
117+
./scripts/build/qemu.arm64
118+
./scripts/run/qemu.arm64
119+
```
120+
121+
This will emulate an `ARM64` VM and print the application message, similar to the `x86_64` application.
65122

66123
## Work Items
67124

68125
Now that you've seen how to run Unikraft `helloworld`, you can go through the list below, follow the same steps and try more applications.
69-
All the steps required for running the applications can be found in every app repository `README.md` file.
126+
The steps for running all applications are similar, you run the `setup.sh` script, then `scripts/build/qemu.arch` and `scripts/run/qemu.arch`.
127+
Try to run the foolowing applications for both `x86_64` and `arm64`.
70128

71-
* [`app-httpreply`](https://github.com/unikraft/app-httpreply)
72-
* [`app-nginx`](https://github.com/unikraft/app-nginx)
73-
* [`app-redis`](https://github.com/unikraft/app-redis)
74-
* [`app-sqlite`](https://github.com/unikraft/app-sqlite)
75-
* [`app-python3`](https://github.com/unikraft/app-python3)
129+
* [`c-html`](https://github.com/unikraft/catalog-core/tree/scripts/c-http)
130+
* [`cpp-hello`](https://github.com/unikraft/catalog-core/tree/scripts/cpp-hello)
131+
* [`cpp-html`](https://github.com/unikraft/catalog-core/tree/scripts/cpp-http)
132+
* [`nginx`](https://github.com/unikraft/catalog-core/tree/scripts/nginx)
133+
* [`redis`](https://github.com/unikraft/catalog-core/tree/scripts/redis)
134+
* [`python3-hello`](https://github.com/unikraft/catalog-core/tree/scripts/python3-hello)
76135

136+
For applications that wait for connections (i.e. `nginx`, `*-http`, `redis`), the VM IP address is `172.44.0.2`.
137+
You can curl `172.44.0.2` for `nginx`, `172.44.0.2:8080` for `*-http`, and you must use [`redis-cli`](https://redis.io/docs/latest/develop/tools/cli/) for the `redis` application.
138+
To use `redis-cli`, you can use:
139+
140+
```console
141+
redis-cli -h 172.44.0.2
142+
172.44.0.2:6379> PING
143+
PONG
144+
```

content/hackathons/usw25/index.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,12 @@ Run it using `qemu-system-x86_64` and find the flag.
9696
Upload the flag in the [registration form](https://forms.gle/sV3Vm9Fe73kg1gb37).
9797

9898
Read the basic unikernel concepts [here](https://unikraft.org/docs/concepts).
99+
100+
### Sessions
101+
102+
#### Session 1 - Overview of Unikraft
103+
104+
For the following sessions we will build and run applications using Unikraft.
105+
Unikraft supports multiple platforms (e.g. KVM, Firecracker, Xen), but we will focus on running applications using Qemu/KVM.
106+
107+
Follow the steps under [the `Overview` guide](/guides/overview), and mark the items in [this form](https://forms.gle/Du11pP2mgEjuYtj39).

0 commit comments

Comments
 (0)