diff --git a/.config.httpreply_qemu-arm64 b/.config.httpreply_qemu-arm64 deleted file mode 100644 index 92b0e72..0000000 --- a/.config.httpreply_qemu-arm64 +++ /dev/null @@ -1,179 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Unikraft/0.13.1~5eb820bd Configuration -# -CONFIG_UK_ARCH="arm64" -CONFIG_UK_DEFNAME="httpreply" - -# -# Architecture Selection -# -CONFIG_ARCH_ARM_64=y -CONFIG_MCPU_ARM64_NONE=y - -# -# Armv8-A Extensions -# -# end of Armv8-A Extensions - -CONFIG_STACK_SIZE_PAGE_ORDER=4 -# end of Architecture Selection - -# -# Platform Configuration -# -CONFIG_PLAT_KVM=y -CONFIG_KVM_BOOT_PROTO_MULTIBOOT=y -CONFIG_KVM_VMM_QEMU=y - -# -# Console Options -# -CONFIG_KVM_KERNEL_SERIAL_CONSOLE=y -CONFIG_KVM_DEBUG_SERIAL_CONSOLE=y - -# -# Serial console configuration -# -CONFIG_EARLY_PRINT_PL011_UART_ADDR=0x09000000 -# end of Serial console configuration -# end of Console Options - -CONFIG_KVM_MAX_IRQ_HANDLER_ENTRIES=8 -CONFIG_KVM_PCI=y -CONFIG_KVM_PF=y -CONFIG_VIRTIO_BUS=y - -# -# Virtio -# -CONFIG_VIRTIO_PCI=y -CONFIG_VIRTIO_NET=y -# end of Virtio - -CONFIG_RTC_PL031=y -CONFIG_LIBOFW=y -CONFIG_UKPLAT_ALLOW_GIC=y - -# -# Platform Interface Options -# -CONFIG_UKPLAT_LCPU_MAXCOUNT=1 -# end of Platform Interface Options - -CONFIG_HZ=100 -CONFIG_LIBGIC=y -CONFIG_LIBGICV2=y -CONFIG_LIBGICV3=y -# end of Platform Configuration - -# -# Library Configuration -# -CONFIG_LIBFDT=y -CONFIG_LIBNOLIBC=y -CONFIG_LIBNOLIBC_UKDEBUG_ASSERT=y -CONFIG_LIBPOSIX_SOCKET=y -CONFIG_LIBPOSIX_TIME=y -CONFIG_LIBUKALLOC=y -CONFIG_LIBUKALLOCBBUDDY=y -CONFIG_LIBUKARGPARSE=y -CONFIG_LIBUKBOOT=y -CONFIG_LIBUKBOOT_BANNER_POWEREDBY=y -CONFIG_LIBUKBOOT_MAXNBARGS=60 -CONFIG_LIBUKBOOT_INITBBUDDY=y -CONFIG_LIBUKBOOT_INITSCHEDCOOP=y -CONFIG_LIBUKBUS=y -CONFIG_LIBUKDEBUG=y -CONFIG_LIBUKDEBUG_PRINTK=y -CONFIG_LIBUKDEBUG_PRINTK_ERR=y -CONFIG_LIBUKDEBUG_REDIR_PRINTD=y -CONFIG_LIBUKDEBUG_PRINT_TIME=y -CONFIG_LIBUKDEBUG_PRINT_SRCNAME=y -CONFIG_LIBUKDEBUG_ENABLE_ASSERT=y -CONFIG_LIBUKLIBPARAM=y -CONFIG_LIBUKLOCK=y -CONFIG_LIBUKLOCK_SPINLOCK=y -CONFIG_LIBUKLOCK_SEMAPHORE=y -CONFIG_LIBUKLOCK_MUTEX=y -CONFIG_LIBUKLOCK_RWLOCK=y -CONFIG_LIBUKMPI=y -CONFIG_LIBUKMPI_MBOX=y -CONFIG_LIBUKNETDEV=y -CONFIG_LIBUKNETDEV_MAXNBQUEUES=1 -CONFIG_LIBUKNETDEV_DISPATCHERTHREADS=y -CONFIG_LIBUKSCHED=y -CONFIG_LIBUKSCHEDCOOP=y -CONFIG_LIBUKSGLIST=y -CONFIG_LIBUKSWRAND=y -CONFIG_LIBUKSWRAND_CHACHA=y -CONFIG_LIBUKSWRAND_INITIALSEED_TIME=y -CONFIG_LIBUKTIMECONV=y -CONFIG_LIBVFSCORE=y - -# -# vfscore: Configuration -# -CONFIG_LIBVFSCORE_PIPE_SIZE_ORDER=16 -# end of vfscore: Configuration - -CONFIG_HAVE_BOOTENTRY=y -CONFIG_HAVE_TIME=y -CONFIG_HAVE_SCHED=y -CONFIG_HAVE_NW_STACK=y -CONFIG_LIBLWIP=y -CONFIG_LWIP_UNIKRAFT21X=y - -# -# Netif drivers -# -CONFIG_LWIP_UKNETDEV=y -CONFIG_LWIP_UKNETDEV_SCRATCH=64 -# end of Netif drivers - -CONFIG_LWIP_AUTOIFACE=y -CONFIG_LWIP_THREADS=y -CONFIG_LWIP_STACKTHREAD_MBOX_SIZE_256=y -CONFIG_LWIP_STACKTHREAD_MBOX_SIZE=256 -CONFIG_LWIP_HEAP=y -CONFIG_LWIP_NETIF_EXT_STATUS_CALLBACK=y -CONFIG_LWIP_NETIF_STATUS_PRINT=y -CONFIG_LWIP_LOOPBACK=y -CONFIG_LWIP_IPV4=y - -# -# IP Configuration -# -CONFIG_LWIP_IP_REASS_MAX_PBUFS=10 -# end of IP Configuration - -CONFIG_LWIP_UDP=y -CONFIG_LWIP_TCP=y -CONFIG_LWIP_TCP_MSS=1460 -CONFIG_LWIP_WND_SCALE=y -CONFIG_LWIP_NUM_TCPCON=64 -CONFIG_LWIP_NUM_TCPLISTENERS=64 -CONFIG_LWIP_ICMP=y -CONFIG_LWIP_DNS=y -CONFIG_LWIP_DNS_MAX_SERVERS=2 -CONFIG_LWIP_DNS_TABLE_SIZE=32 -CONFIG_LWIP_SOCKET=y -CONFIG_LWIP_UDP_RECVMBOX_FACTOR=2 -CONFIG_LWIP_TCP_RECVMBOX_FACTOR=2 -# end of Library Configuration - -# -# Build Options -# -CONFIG_OPTIMIZE_PERF=y -CONFIG_OPTIMIZE_NOOMITFP=y -CONFIG_DEBUG_SYMBOLS_LVL3=y -CONFIG_OPTIMIZE_COMPRESS=y -CONFIG_CROSS_COMPILE="" -CONFIG_LLVM_TARGET_ARCH="" -# end of Build Options - -# -# Application Options -# -CONFIG_UK_NAME="httpreply" diff --git a/.config.httpreply_qemu-x86_64 b/.config.httpreply_qemu-x86_64 deleted file mode 100644 index 329c33e..0000000 --- a/.config.httpreply_qemu-x86_64 +++ /dev/null @@ -1,177 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Unikraft/0.13.1~5eb820bd Configuration -# -CONFIG_UK_ARCH="x86_64" -CONFIG_UK_DEFNAME="httpreply" - -# -# Architecture Selection -# -CONFIG_ARCH_X86_64=y -CONFIG_MARCH_X86_64_GENERIC=y - -# -# Processor Features -# -# end of Processor Features - -CONFIG_STACK_SIZE_PAGE_ORDER=4 -# end of Architecture Selection - -# -# Platform Configuration -# -CONFIG_PLAT_KVM=y -CONFIG_KVM_BOOT_PROTO_MULTIBOOT=y -CONFIG_KVM_VMM_QEMU=y - -# -# Console Options -# -CONFIG_KVM_KERNEL_SERIAL_CONSOLE=y -CONFIG_KVM_KERNEL_VGA_CONSOLE=y -CONFIG_KVM_DEBUG_SERIAL_CONSOLE=y -CONFIG_KVM_DEBUG_VGA_CONSOLE=y - -# -# Serial console configuration -# -CONFIG_KVM_SERIAL_BAUD_115200=y -# end of Serial console configuration -# end of Console Options - -CONFIG_KVM_MAX_IRQ_HANDLER_ENTRIES=8 -CONFIG_KVM_PCI=y -CONFIG_VIRTIO_BUS=y - -# -# Virtio -# -CONFIG_VIRTIO_PCI=y -CONFIG_VIRTIO_NET=y -# end of Virtio - -CONFIG_UKPLAT_ALLOW_GIC=y - -# -# Platform Interface Options -# -CONFIG_UKPLAT_LCPU_MAXCOUNT=1 -# end of Platform Interface Options - -CONFIG_HZ=100 -# end of Platform Configuration - -# -# Library Configuration -# -CONFIG_LIBNOLIBC=y -CONFIG_LIBNOLIBC_UKDEBUG_ASSERT=y -CONFIG_LIBPOSIX_SOCKET=y -CONFIG_LIBPOSIX_TIME=y -CONFIG_LIBUKALLOC=y -CONFIG_LIBUKALLOCBBUDDY=y -CONFIG_LIBUKARGPARSE=y -CONFIG_LIBUKBOOT=y -CONFIG_LIBUKBOOT_BANNER_POWEREDBY=y -CONFIG_LIBUKBOOT_MAXNBARGS=60 -CONFIG_LIBUKBOOT_INITBBUDDY=y -CONFIG_LIBUKBOOT_INITSCHEDCOOP=y -CONFIG_LIBUKBUS=y -CONFIG_LIBUKDEBUG=y -CONFIG_LIBUKDEBUG_PRINTK=y -CONFIG_LIBUKDEBUG_PRINTK_ERR=y -CONFIG_LIBUKDEBUG_REDIR_PRINTD=y -CONFIG_LIBUKDEBUG_PRINT_TIME=y -CONFIG_LIBUKDEBUG_PRINT_SRCNAME=y -CONFIG_LIBUKDEBUG_ENABLE_ASSERT=y -CONFIG_LIBUKLIBPARAM=y -CONFIG_LIBUKLOCK=y -CONFIG_LIBUKLOCK_SEMAPHORE=y -CONFIG_LIBUKLOCK_MUTEX=y -CONFIG_LIBUKLOCK_RWLOCK=y -CONFIG_LIBUKMPI=y -CONFIG_LIBUKMPI_MBOX=y -CONFIG_LIBUKNETDEV=y -CONFIG_LIBUKNETDEV_MAXNBQUEUES=1 -CONFIG_LIBUKNETDEV_DISPATCHERTHREADS=y -CONFIG_LIBUKSCHED=y -CONFIG_LIBUKSCHEDCOOP=y -CONFIG_LIBUKSGLIST=y -CONFIG_LIBUKSWRAND=y -CONFIG_LIBUKSWRAND_CHACHA=y -CONFIG_LIBUKSWRAND_INITIALSEED_TIME=y -CONFIG_LIBUKTIMECONV=y -CONFIG_LIBVFSCORE=y - -# -# vfscore: Configuration -# -CONFIG_LIBVFSCORE_PIPE_SIZE_ORDER=16 -# end of vfscore: Configuration - -CONFIG_HAVE_BOOTENTRY=y -CONFIG_HAVE_TIME=y -CONFIG_HAVE_SCHED=y -CONFIG_HAVE_NW_STACK=y -CONFIG_LIBLWIP=y -CONFIG_LWIP_UNIKRAFT21X=y - -# -# Netif drivers -# -CONFIG_LWIP_UKNETDEV=y -CONFIG_LWIP_UKNETDEV_SCRATCH=64 -# end of Netif drivers - -CONFIG_LWIP_AUTOIFACE=y -CONFIG_LWIP_THREADS=y -CONFIG_LWIP_STACKTHREAD_MBOX_SIZE_256=y -CONFIG_LWIP_STACKTHREAD_MBOX_SIZE=256 -CONFIG_LWIP_HEAP=y -CONFIG_LWIP_NETIF_EXT_STATUS_CALLBACK=y -CONFIG_LWIP_NETIF_STATUS_PRINT=y -CONFIG_LWIP_LOOPBACK=y -CONFIG_LWIP_IPV4=y - -# -# IP Configuration -# -CONFIG_LWIP_IP_REASS_MAX_PBUFS=10 -# end of IP Configuration - -CONFIG_LWIP_UDP=y -CONFIG_LWIP_TCP=y -CONFIG_LWIP_TCP_MSS=1460 -CONFIG_LWIP_WND_SCALE=y -CONFIG_LWIP_NUM_TCPCON=64 -CONFIG_LWIP_NUM_TCPLISTENERS=64 -CONFIG_LWIP_ICMP=y -CONFIG_LWIP_DNS=y -CONFIG_LWIP_DNS_MAX_SERVERS=2 -CONFIG_LWIP_DNS_TABLE_SIZE=32 -CONFIG_LWIP_SOCKET=y -CONFIG_LWIP_UDP_RECVMBOX_FACTOR=2 -CONFIG_LWIP_TCP_RECVMBOX_FACTOR=2 -# end of Library Configuration - -# -# Build Options -# -CONFIG_OPTIMIZE_PERF=y - -# -# Hint: Specify a CPU type to get most benefits from performance optimization -# -CONFIG_OPTIMIZE_NOOMITFP=y -CONFIG_DEBUG_SYMBOLS_LVL3=y -CONFIG_OPTIMIZE_COMPRESS=y -CONFIG_CROSS_COMPILE="" -CONFIG_LLVM_TARGET_ARCH="" -# end of Build Options - -# -# Application Options -# -CONFIG_UK_NAME="httpreply" diff --git a/.gitignore b/.gitignore index 56701e6..c4c13c1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /build/ -/.config.old -/.config +/.config* /.unikraft/ +/workdir/ diff --git a/Makefile b/Makefile index 115b485..1725171 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,10 @@ -UK_ROOT ?= $(PWD)/.unikraft/unikraft -UK_LIBS ?= $(PWD)/.unikraft/libs +UK_ROOT ?= $(PWD)/workdir/unikraft +UK_LIBS ?= $(PWD)/workdir/libs +UK_BUILD ?= $(PWD)/workdir/build LIBS := $(UK_LIBS)/lwip all: - @$(MAKE) -C $(UK_ROOT) A=$(PWD) L=$(LIBS) + @$(MAKE) -C $(UK_ROOT) A=$(PWD) L=$(LIBS) O=$(UK_BUILD) $(MAKECMDGOALS): - @$(MAKE) -C $(UK_ROOT) A=$(PWD) L=$(LIBS) $(MAKECMDGOALS) + @$(MAKE) -C $(UK_ROOT) A=$(PWD) L=$(LIBS) O=$(UK_BUILD) $(MAKECMDGOALS) diff --git a/README.md b/README.md index 441ab66..4a611b4 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,12 @@ For building and running everything for `x86_64`, follow the steps below: ```console git clone https://github.com/unikraft/app-httpreply httpreply cd httpreply/ -mkdir .unikraft -git clone https://github.com/unikraft/unikraft .unikraft/unikraft -git clone https://github.com/unikraft/lib-lwip .unikraft/libs/lwip -UK_DEFCONFIG=$(pwd)/.config.httpreply_qemu-x86_64 make defconfig -make -j $(nproc) -./run-qemu-x86_64.sh +./scripts/setup.sh +wget https://raw.githubusercontent.com/unikraft/app-testing/staging/scripts/generate.py -O scripts/generate.py +chmod a+x scripts/generate.py +./scripts/generate.py +./scripts/build/make-qemu-x86_64.sh +./scripts/run/qemu-x86_64.sh ``` This will configure, build and run the `httpreply` application. @@ -27,10 +27,14 @@ You can see how to test it in the [running section](#run). The same can be done for `AArch64`, by running the commands below: ```console -make properclean -UK_DEFCONFIG=$(pwd)/.config.httpreply_qemu-arm64 make defconfig -make -j $(nproc) -./run-qemu-aarch64.sh +git clone https://github.com/unikraft/app-httpreply httpreply +cd httpreply/ +./scripts/setup.sh +wget https://raw.githubusercontent.com/unikraft/app-testing/staging/scripts/generate.py -O scripts/generate.py +chmod a+x scripts/generate.py +./scripts/generate.py +./scripts/build/make-qemu-arm64.sh +./scripts/run/qemu-arm64.sh ``` Similar to the `x86_64` build, this will start the `httpreply` server. @@ -112,56 +116,25 @@ Follow the steps below for the setup: This will print the contents of the repository: ```text - .config.httpreply_qemu-arm64 .config.httpreply_qemu-x86_64 fs0/ kraft.yaml Makefile Makefile.uk README.md - ``` - - 1. While inside the `httpreply/` directory, create the `.unikraft/` directory: - - ```console - mkdir .unikraft - ``` - - Enter the `.unikraft/` directory: - - ```console - cd .unikraft/ - ``` - - 1. While inside the `.unikraft` directory, clone the [`unikraft` repository](https://github.com/unikraft/unikraft): - - ```console - git clone https://github.com/unikraft/unikraft unikraft - ``` - - 1. While inside the `.unikraft/` directory, create the `libs/` directory: - - ```console - mkdir libs - ``` - - 1. While inside the `.unikraft/` directory, clone the library repositories in the `libs/` directory: - - ```console - git clone https://github.com/unikraft/lib-lwip libs/lwip + [...] README.md defconfigs/ kraft.cloud.yaml kraft.yaml main.c scripts/ ``` - 1. Get back to the application directory: + 1. While inside the `httpreply/` directory, clone all required repositories by using the `setup.sh` script: ```console - cd ../ + ./scripts/setup.sh ``` - Use the `tree` command to inspect the contents of the `.unikraft/` directory. - It should print something like this: + 1. Use the `tree` command to inspect the contents of the `workdir/` directory: ```console - tree -F -L 2 .unikraft/ + tree -F -L 2 workdir/ ``` - The layout of the `.unikraft/` directory should look something like this: + The layout of the `workdir/` directory should look something like this: ```text - .unikraft/ + workdir/ |-- libs/ | `-- lwip/ `-- unikraft/ @@ -181,7 +154,74 @@ Follow the steps below for the setup: 10 directories, 7 files ``` -## Configure +## Scripted Building and Running + +To make it easier to build, run and test different configurations, the repository provides a set of scripts that do everything required. +These are scripts used for building different configurations of the httpreply server and for running these with all the requirements behind the scenes: creating network configurations, setting up archives etc. + +First of all, grab the [`generate.py` script](https://github.com/unikraft/app-testing/blob/staging/scripts/generate.py) and place it in the `scripts/` directory by running: + +```console +wget https://raw.githubusercontent.com/unikraft/app-testing/staging/scripts/generate.py -O scripts/generate.py +chmod a+x scripts/generate.py +``` + +Now, run the `generate.py` script. +You must run it from the root directory of this repository: + +```console +./scripts/generate.py +``` + +The scripts (as shell scripts) are now generated in `scripts/build/` and `scripts/run/`: + +```text +scripts// +|-- build/ +| |-- kraft-fc-arm64.sh* +| |-- kraft-fc-x86_64.sh* +| |-- kraft-qemu-arm64.sh* +| |-- kraft-qemu-x86_64.sh* +| |-- make-fc-arm64.sh* +| |-- make-fc-x86_64.sh* +| |-- make-qemu-arm64.sh* +| `-- make-qemu-x86_64.sh* +|-- generate.py* +|-- run/ +| |-- fc-arm64.json +| |-- fc-arm64.sh* +| |-- fc-x86_64.json +| |-- fc-x86_64.sh* +| |-- kraft-fc-arm64.sh* +| |-- kraft-fc-x86_64.sh* +| |-- kraft-qemu-arm64.sh* +| |-- kraft-qemu-x86_64.sh* +| |-- qemu-arm64.sh* +| `-- qemu-x86_64.sh* +|-- run.yaml +`-- setup.sh* +``` + +They are shell scripts, so you can use an editor or a text viewer to check their contents: + +```console +cat scripts/run/fc-x86_64.sh +``` + +Now, invoke each script to build and run the application. +A sample build and run set of commands is: + +```console +./scripts/build/make-qemu-x86_64.sh +./scripts/run/qemu-x86_64.sh +``` + +Note that Firecracker only works with initrd (not 9pfs). +And Firecracker networking is not yet upstream. + +## Detailed Steps + +### Configure Configuring, building and running a Unikraft application depends on our choice of platform and architecture. Currently, supported platforms are QEMU (KVM), Xen and linuxu. @@ -189,13 +229,14 @@ QEMU (KVM) is known to be working, so we focus on that. Supported architectures are x86_64 and AArch64. -Use the corresponding the configuration files (`config-...`), according to your choice of platform and architecture. +Use the corresponding the configuration files (`defconfigs/*`), according to your choice of platform and architecture. ### QEMU x86_64 -Use the `.config.httpreply_qemu-x86_64` configuration file together with `make defconfig` to create the configuration file: +Use the `defconfigs/qemu-x86_64` configuration file together with `make defconfig` to create the configuration file: ```console +UK_DEFCONFIG=$(pwd)/defconfigs/qemu-x86_64 make defconfig ``` This results in the creation of the `.config` file: @@ -209,10 +250,10 @@ The `.config` file will be used in the build step. ### QEMU AArch64 -Use the `.config.httpreply_qemu-arm64` configuration file together with `make defconfig` to create the configuration file: +Use the `defconfigs/qemu-arm64` configuration file together with `make defconfig` to create the configuration file: ```console -UK_DEFCONFIG=$(pwd)/.config.httpreply_qemu-arm64 make defconfig +UK_DEFCONFIG=$(pwd)/defconfigs/qemu-arm64 make defconfig ``` Similar to the x86_64 configuration, this results in the creation of the `.config` file that will be used in the build step. @@ -252,7 +293,7 @@ This will print a list of files that are generated by the build system. UKBI httpreply_qemu-x86_64.dbg.bootinfo SCSTRIP httpreply_qemu-x86_64 GZ httpreply_qemu-x86_64.gz -make[1]: Leaving directory '/media/stefan/projects/unikraft/usoc23/test-01/httpreply/.unikraft/unikraft' +make[1]: Leaving directory 'httpreply/workdir/unikraft' ``` At the end of the build command, the `httpreply-x86_64` unikernel image is generated. @@ -283,7 +324,7 @@ This will print a list of files that are generated by the build system. UKBI httpreply_qemu-arm64.dbg.bootinfo SCSTRIP httpreply_qemu-arm64 GZ httpreply_qemu-arm64.gz -make[1]: Leaving directory '/media/stefan/projects/unikraft/usoc23/test-01/httpreply/.unikraft/unikraft' +make[1]: Leaving directory 'httpreply/workdir/unikraft' ``` Similarly to x86_64, at the end of the build command, the `httpreply-arm64` unikernel image is generated. @@ -300,7 +341,17 @@ All this is part of the `./run-qemu-*.sh` scripts. To run the QEMU x86_64 build, use `./run-qemu-x86_64.sh`: ```console -./run-qemu-x86_64.sh +sudo ip link set dev tap0 down 2> /dev/null +sudo ip link del dev tap0 2> /dev/null +sudo ip link set dev virbr0 down 2> /dev/null +sudo ip link del dev virbr0 2> /dev/null +sudo qemu-system-x86_64 \ + -kernel workdir/build/httpreply_qemu-x86_64 \ + -nographic \ + -m 64M \ + -netdev bridge,id=en0,br=virbr0 -device virtio-net-pci,netdev=en0 \ + -append "netdev.ipv4_addr=172.44.0.2 netdev.ipv4_gw_addr=172.44.0.1 netdev.ipv4_subnet_mask=255.255.\ + -cpu max ``` This will start the `httpreply` application: @@ -350,7 +401,18 @@ that is press the `Ctrl` and `a` keys at the same time and then, separately, pre To run the AArch64 build, use `./run-qemu-aarch64.sh`: ```console -./run-qemu-aarch64.sh +sudo ip link set dev tap0 down 2> /dev/null +sudo ip link del dev tap0 2> /dev/null +sudo ip link set dev virbr0 down 2> /dev/null +sudo ip link del dev virbr0 2> /dev/null +sudo qemu-system-aarch64 \ + -machine virt \ + -kernel workdir/build/httpreply_qemu-x86_64 \ + -nographic \ + -m 64M \ + -netdev bridge,id=en0,br=virbr0 -device virtio-net-pci,netdev=en0 \ + -append "netdev.ipv4_addr=172.44.0.2 netdev.ipv4_gw_addr=172.44.0.1 netdev.ipv4_subnet_mask=255.255.\ + -cpu max ``` Similar to running for x86_64, this will start the `httpreply` application: diff --git a/defconfigs/fc-arm64 b/defconfigs/fc-arm64 new file mode 100644 index 0000000..97c860f --- /dev/null +++ b/defconfigs/fc-arm64 @@ -0,0 +1,4 @@ +CONFIG_ARCH_ARM_64=y +CONFIG_PLAT_KVM=y +CONFIG_KVM_VMM_FIRECRACKER=y +CONFIG_LIBLWIP=y diff --git a/defconfigs/fc-x86_64 b/defconfigs/fc-x86_64 new file mode 100644 index 0000000..aece6a4 --- /dev/null +++ b/defconfigs/fc-x86_64 @@ -0,0 +1,3 @@ +CONFIG_PLAT_KVM=y +CONFIG_KVM_VMM_FIRECRACKER=y +CONFIG_LIBLWIP=y diff --git a/defconfigs/qemu-arm64 b/defconfigs/qemu-arm64 new file mode 100644 index 0000000..ce283b2 --- /dev/null +++ b/defconfigs/qemu-arm64 @@ -0,0 +1,3 @@ +CONFIG_ARCH_ARM_64=y +CONFIG_PLAT_KVM=y +CONFIG_LIBLWIP=y diff --git a/defconfigs/qemu-x86_64 b/defconfigs/qemu-x86_64 new file mode 100644 index 0000000..7064632 --- /dev/null +++ b/defconfigs/qemu-x86_64 @@ -0,0 +1,2 @@ +CONFIG_PLAT_KVM=y +CONFIG_LIBLWIP=y diff --git a/kraft.yaml b/kraft.yaml index 1b06847..de228d1 100644 --- a/kraft.yaml +++ b/kraft.yaml @@ -12,6 +12,10 @@ targets: platform: qemu - architecture: arm64 platform: qemu + - architecture: x86_64 + platform: fc + - architecture: arm64 + platform: fc libraries: lwip: version: stable diff --git a/run-qemu-aarch64.sh b/run-qemu-aarch64.sh deleted file mode 100755 index 803def4..0000000 --- a/run-qemu-aarch64.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -sudo ip link set dev virbr0 down 2> /dev/null -sudo ip link del dev virbr0 2> /dev/null -sudo ip link add dev virbr0 type bridge -sudo ip address add 172.44.0.1/24 dev virbr0 -sudo ip link set dev virbr0 up - -sudo qemu-system-aarch64 \ - -netdev bridge,id=en0,br=virbr0 -device virtio-net-pci,netdev=en0 \ - -append "netdev.ipv4_addr=172.44.0.2 netdev.ipv4_gw_addr=172.44.0.1 netdev.ipv4_subnet_mask=255.255.255.0 --" \ - -kernel build/httpreply_qemu-arm64 -nographic \ - -machine virt -cpu cortex-a57 diff --git a/run-qemu-x86_64.sh b/run-qemu-x86_64.sh deleted file mode 100755 index f1d9a6b..0000000 --- a/run-qemu-x86_64.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -sudo ip link set dev virbr0 down 2> /dev/null -sudo ip link del dev virbr0 2> /dev/null -sudo ip link add dev virbr0 type bridge -sudo ip address add 172.44.0.1/24 dev virbr0 -sudo ip link set dev virbr0 up - -sudo qemu-system-x86_64 \ - -netdev bridge,id=en0,br=virbr0 -device virtio-net-pci,netdev=en0 \ - -append "netdev.ipv4_addr=172.44.0.2 netdev.ipv4_gw_addr=172.44.0.1 netdev.ipv4_subnet_mask=255.255.255.0 --" \ - -kernel build/httpreply_qemu-x86_64 \ - -nographic diff --git a/scripts/.gitignore b/scripts/.gitignore new file mode 100644 index 0000000..e41dccf --- /dev/null +++ b/scripts/.gitignore @@ -0,0 +1,3 @@ +/generate.py +/build/ +/run/ diff --git a/scripts/run.yaml b/scripts/run.yaml new file mode 100644 index 0000000..875db21 --- /dev/null +++ b/scripts/run.yaml @@ -0,0 +1,3 @@ +runs: + - memory: 64 + networking: True diff --git a/scripts/setup.sh b/scripts/setup.sh new file mode 100755 index 0000000..900dcf0 --- /dev/null +++ b/scripts/setup.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +test ! -d "workdir" && echo "Cloning unikraft..." || true +test ! -d "workdir/unikraft" && git clone https://github.com/unikraft/unikraft workdir/unikraft || true +test ! -d "workdir/libs/lwip" && git clone https://github.com/unikraft/lib-lwip workdir/libs/lwip || true