Add a http performance test script based on wrk
[iec.git] / misc / type1 / macbin / README.md
1 # Deploy Kubernetes and SEBA on MACCHIATObin
2
3 ## Overview
4 The Marvell MACCHIATObin is a family of cost-effective and high-performance networking community
5 boards targeting ARM64bit high end networking and storage applications. With a offering that
6 include a fully open source software that include U-Boot, Linux, ODP and DPDK, the Marvell
7 MACCHIATObin are optimal platforms for community developers and Independent Software Vendors (ISVs)
8 to develop networking and storage applications. The default kernel configuration provided by
9 Marvell does not meet the container's system requirements. So need to reconfigure and compile
10 the kernel to meet SEBA operation,and also u-boot. We provide a kernel configuration file that
11 has been verified on the [MACCHIATObin][1] board for developers to use.
12
13 ## Prerequisites
14 Marvell linux must apply with MUSDK provided kernel patches(see `patches/linux` in musdk repo
15 and relevant documentation).
16
17 U-boot version used: **u-boot-2018.03-armada-18.09**
18
19 Kernel version used: **linux-4.14.22-armada-18.09**
20
21 MUSDK version used: **musdk-armada-18.09**
22
23 ## Build and Update Bootloader
24 Marvell provides detailed documentation on how to [build bootloaders from source code][2].
25 Note that checkout u-boot-2018.03-armada-18.09 branch is important. [This page][3] will
26 walk you through the bootloader update process via network, i.e. using the TFTP server.
27 In addition, you can use the USB Flash drive to update boot as following instructions:
28 ```
29 Marvell>> usb reset
30 Marvell>> bubt flash-image.bin spi usb
31 Marvell>> reset
32 Marvell>> env default -a
33 Marvell>> env save
34 ```
35 **Make sure that the MACCHIATObin board does not experience power loss during the entire
36 updating process, otherwise it will be bricked due to an unfinished bootloader update.**
37
38 ## Setting U-Boot parameters
39 The U-Boot parameter for Micro SD card/USB boot can be found [here][4],but the instructions
40 of the page do not fully apply to 18.09.It needs to be changed a little bit.
41
42 Using Micro SD card:
43 ```
44 Marvell>> setenv image_name boot/Image
45 Marvell>> setenv fdt_name boot/armada-8040-mcbin.dtb
46 Marvell>> setenv bootcmd 'mmc dev 1; ext4load mmc 1:1 $kernel_addr_r $image_name;ext4load \
47 mmc 1:1 $fdt_addr_r $fdt_name;setenv bootargs $console root=/dev/mmcblk1p1 rw rootwait \
48 pci=pcie_bus_safe cpuidle.off=1; booti $kernel_addr_r - $fdt_addr_r'
49 Marvell>> saveenv
50 Marvell>> run bootcmd
51 ```
52 Using USB Stick:
53 ```
54 Marvell>> setenv image_name boot/Image
55 Marvell>> setenv fdt_name boot/armada-8040-mcbin.dtb
56 Marvell>> setenv bootusb 'usb reset; ext4load usb 0:1 $kernel_addr_r $image_name; \
57 ext4load usb 0:1 $fdt_addr_r $fdt_name;setenv bootargs $console root=/dev/sda1 \
58 rw rootwait pci=pcie_bus_safe cpuidle.off=1;booti $kernel_addr_r - $fdt_addr_r'
59 Marvell>> saveenv
60 Marvell>> run bootusb
61 ```
62 If U-Boot version is 17.10, you should repleace $kernel_addr_r/$fdt_addr_r by
63 $kernel_addr/$fdt_addr.
64
65 ## Kernel compilation steps
66 The procedures to build kernel from source is almost the same, but there are still
67 some points you need to pay attention to on MACCHIATObin board.
68 Download Kernel Source:
69 ```
70 mkdir -p ~/kernel/4.14.22
71 cd ~/kernel/4.14.22
72 git clone https://github.com/MarvellEmbeddedProcessors/linux-marvell .
73 git checkout linux-4.14.22-armada-18.09
74 ```
75 Download MUSDK Package Marvell User-Space SDK(MUSDK) is a light-weight user-space I/O driver
76 for Marvell's Embedded Networking SoC's. The MUSDK library provides a simple and direct access
77 to Marvell's SoC blocks to networking applications and networking infrastrucutre:
78 ```
79 mkdir -p ~/musdk
80 cd ~/musdk
81 git clone https://github.com/MarvellEmbeddedProcessors/musdk-marvell .
82 git checkout musdk-armada-18.09
83 ```
84 Linux Kernel needs to be patched and built in order to run MUSDK on the MACCHIATObin board:
85 ```
86 cd ~/kernel/4.14.22/
87 git am ~/musdk/patches/linux-4.14/*.patch
88 ```
89 Replace the default kernel configuration file with defconfig-mcbin-edge which enable necessary
90 kernel modules needed by running kubernetes, also calico:
91 ```
92 cp defconfig-mcbin-edge   ~/kernel/4.14.22/arch/arm64/configs/mvebu_v8_lsp_defconfig
93 ```
94 and then compile the kernel:
95 ```
96 export ARCH=arm64
97 make mvebu_v8_lsp_defconfig
98 make -j$(($(nproc)+1))
99 ```
100 Script is provided to facilitate build of the kernel image, the developer needs to run with
101 root privileges:
102 ```
103 ./setup-macbin-kernel.sh
104 ```
105
106 ## Update the Kernel
107 If kernel is compiled on the MACCHIATObin board, you can easily update kernel using the
108 following instructions:
109 ```
110 cd ~/kernel/4.14.22
111 make modules_install
112 cp ./arch/arm64/boot/Image /boot/
113 cp ./arch/arm64/boot/dts/marvell/armada-8040-mcbin.dtb  /boot/
114 sync
115 reboot
116 ```
117 and also refer to the wiki for MACCHIATObin to [boot from removable storage][5].
118
119 ## Install SEBA
120 SEBA as one of the IEC use cases, you can refer to [README][6] to manually install SEBA
121 on Arm servers.
122
123 [1]: http://macchiatobin.net
124 [2]: http://wiki.macchiatobin.net/tiki-index.php?page=Build+from+source+-+Bootloader#Build_U-Boot
125 [3]: http://wiki.macchiatobin.net/tiki-index.php?page=Update+the+Bootloader
126 [4]: http://wiki.macchiatobin.net/tiki-index.php?page=Boot+from+removable+storage+-+Ubuntu
127 [5]: http://wiki.macchiatobin.net/tiki-index.php?page=Boot+from+removable+storage+-+Ubuntu
128 [6]: ../../../src/use_cases/seba_on_arm/install/README