Skip to content

Commit 52319c9

Browse files
author
Jonathan Woollett-Light
committed
fix: Update docs
Updates `getting-started.md` to match how tracing has been tested. Signed-off-by: Jonathan Woollett-Light <jcawl@amazon.co.uk>
1 parent 01bef17 commit 52319c9

File tree

1 file changed

+29
-25
lines changed

1 file changed

+29
-25
lines changed

docs/getting-started.md

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -67,26 +67,19 @@ our [integration test suite](#running-the-integration-test-suite) does it. This
6767
guide will not use the [`jailer`](../src/jailer/).
6868

6969
```bash
70-
ARCH="$(uname -m)"
71-
72-
# Download a linux kernel binary
73-
wget https://s3.amazonaws.com/spec.ccfc.min/img/quickstart_guide/${ARCH}/kernels/vmlinux.bin
74-
75-
# Download a rootfs
76-
wget https://s3.amazonaws.com/spec.ccfc.min/ci-artifacts/disks/${ARCH}/ubuntu-18.04.ext4
77-
78-
# Download the ssh key for the rootfs
79-
wget https://s3.amazonaws.com/spec.ccfc.min/ci-artifacts/disks/${ARCH}/ubuntu-18.04.id_rsa
80-
81-
# Set user read permission on the ssh key
82-
chmod 400 ./ubuntu-18.04.id_rsa
83-
8470
# Clone the firecracker repository
8571
git clone https://github.com/firecracker-microvm/firecracker
8672

8773
# Start docker
8874
sudo systemctl start docker
8975

76+
ARCH="$(uname -m)"
77+
78+
API_SOCKET="/tmp/firecracker.socket"
79+
80+
# Remove API unix socket
81+
sudo rm -f $API_SOCKET
82+
9083
# Build firecracker
9184
#
9285
# It is possible to build for gnu, by passing the arguments '-l gnu'.
@@ -96,13 +89,21 @@ sudo systemctl start docker
9689
#
9790
sudo ./firecracker/tools/devtool build
9891

99-
API_SOCKET="/tmp/firecracker.socket"
92+
# Download a linux kernel binary
93+
wget https://s3.amazonaws.com/spec.ccfc.min/img/quickstart_guide/${ARCH}/kernels/vmlinux.bin
10094

101-
# Remove API unix socket
102-
rm -f $API_SOCKET
95+
# Download a rootfs
96+
wget https://s3.amazonaws.com/spec.ccfc.min/ci-artifacts/disks/${ARCH}/ubuntu-18.04.ext4
97+
98+
# Download the ssh key for the rootfs
99+
wget https://s3.amazonaws.com/spec.ccfc.min/ci-artifacts/disks/${ARCH}/ubuntu-18.04.id_rsa
100+
101+
# Set user read permission on the ssh key
102+
chmod 400 ./ubuntu-18.04.id_rsa
103103

104104
# Run firecracker
105-
./firecracker/build/cargo_target/${ARCH}-unknown-linux-musl/debug/firecracker \
105+
sudo \
106+
./firecracker/build/cargo_target/${ARCH}-unknown-linux-musl/debug/firecracker \
106107
--api-sock "${API_SOCKET}"
107108
```
108109

@@ -133,17 +134,20 @@ sudo iptables -I FORWARD 1 -i tap0 -o eth0 -j ACCEPT
133134

134135
API_SOCKET="/tmp/firecracker.socket"
135136
LOGFILE="./firecracker.log"
137+
PROFILE_FILE="./firecracker.folded"
136138

137139
# Create log file
140+
rm -f $LOGFILE
138141
touch $LOGFILE
139142

140143
# Set log file
141-
curl -X PUT --unix-socket "${API_SOCKET}" \
144+
sudo curl -X PUT --unix-socket "${API_SOCKET}" \
142145
--data "{
143146
\"log_path\": \"${LOGFILE}\",
144-
\"level\": \"Debug\",
147+
\"level\": \"Trace\",
145148
\"show_level\": true,
146-
\"show_log_origin\": true
149+
\"show_log_origin\": true,
150+
\"new_format\": true
147151
}" \
148152
"http://localhost/logger"
149153

@@ -157,7 +161,7 @@ if [ ${ARCH} = "aarch64" ]; then
157161
fi
158162

159163
# Set boot source
160-
curl -X PUT --unix-socket "${API_SOCKET}" \
164+
sudo curl -X PUT --unix-socket "${API_SOCKET}" \
161165
--data "{
162166
\"kernel_image_path\": \"${KERNEL}\",
163167
\"boot_args\": \"${KERNEL_BOOT_ARGS}\"
@@ -167,7 +171,7 @@ curl -X PUT --unix-socket "${API_SOCKET}" \
167171
ROOTFS="./ubuntu-18.04.ext4"
168172

169173
# Set rootfs
170-
curl -X PUT --unix-socket "${API_SOCKET}" \
174+
sudo curl -X PUT --unix-socket "${API_SOCKET}" \
171175
--data "{
172176
\"drive_id\": \"rootfs\",
173177
\"path_on_host\": \"${ROOTFS}\",
@@ -182,7 +186,7 @@ curl -X PUT --unix-socket "${API_SOCKET}" \
182186
FC_MAC="06:00:AC:10:00:02"
183187

184188
# Set network interface
185-
curl -X PUT --unix-socket "${API_SOCKET}" \
189+
sudo curl -X PUT --unix-socket "${API_SOCKET}" \
186190
--data "{
187191
\"iface_id\": \"net1\",
188192
\"guest_mac\": \"$FC_MAC\",
@@ -195,7 +199,7 @@ curl -X PUT --unix-socket "${API_SOCKET}" \
195199
sleep 0.015s
196200

197201
# Start microVM
198-
curl -X PUT --unix-socket "${API_SOCKET}" \
202+
sudo curl -X PUT --unix-socket "${API_SOCKET}" \
199203
--data "{
200204
\"action_type\": \"InstanceStart\"
201205
}" \

0 commit comments

Comments
 (0)