blob: 096057d6d4f9f2d85dfb7e81e3e3feda993618a2 [file] [log] [blame] [view]
Tom Hughes4af1fe02019-08-02 00:42:371# Dev Server
2
3[TOC]
4
5## Overview
6
7The dev server allows you to update your Chromium OS machine with new builds
8without having to copy them via a USB drive. It also serves as a static file
9repository, allowing you to install your own packages and scripts making it easy
10to customize your machine for development purposes.
11
12Note: Every time you create a Chromium OS build, the URL of the dev server
13corresponding to your development machine is put into `/etc/lsb-release`. This
14file can be changed post-installation to manage a test machine's update source
15or can be overridden in `/mnt/stateful_partition/etc/lsb-release`.
16
17## Starting the Dev Server
18
19Note: Before you start the dev server, you must have already run
Jack Rosenthald05fb3c2023-06-17 01:46:3220`cros build-packages`. If you have not, please run this now.
Tom Hughes4af1fe02019-08-02 00:42:3721
22The first step in using the dev server is starting the web server on your
23development machine:
24
25```bash
26(chroot)$ start_devserver
27```
28
29## Using the Dev Server
30
31### Options
32
33Note that by default the devserver serves the latest image and runs on port
348080. You can change this among many other things. Here is a brief description
35of some of the options. Please see `start_devserver --help` for more
36information.
37
38* `--use_cached` - Forces the devserver to use the `update.gz` it finds in its
39 static dir. This allows you to pre-generate an update payload and place it
40 in the devserver's static file hosting directory
41 (`~/src/platform/dev/static`).
42* `--src_image` - Generates a delta update based from the target image on the
43 source image. If the source image you provide is not the image on the
44 machine, the delta update will fail. Note that delta updates despite their
45 name run slower than full updates (but will save you bandwidth).
46* `--pregenerate_update` - Generates the update before starting the dev
47 server. This keeps from getting nasty timeouts for big update payloads
48 _(necessary for most delta updates)._
49* `--image` - Serve this image to a machine that requests it.
50* `--port` - Start the devserver on this port.
51* `-t` - From the directory (using the latest image and/or using the archive
52 logic) use the test image found in that directory
53 (`chromiumos_test_image.bin`)
54* `--static_dir` - Serve images from a file structure. Clients can prefix
55 which image they want in their request by modifying their `omaha_url`. By
56 default this changes the static directory to `~/src/platform/dev/static`.
57
58## Using Devserver to Stage and Serve Artifacts from Google Storage
59
60A running devserver listens for calls to its stage and xBuddy RPCs.
61
62### Stage RPC
63
64An abbreviated version of the documentation for the stage RPC is copied here,
65but the up to date version can be found by going to host:port/doc/stage on any
66running devserver.
67
68Downloads and caches the artifacts Google Storage URL. Returns once these have
69been downloaded on the devserver. A call to this will attempt to cache
70non-specified artifacts in the background for the given from the given URL
71following the principle of spatial locality. Spatial locality of different
72artifacts is explicitly defined in the build_artifact module. These artifacts
73will then be available from the `static/` sub-directory of the devserver.
74
75To download the autotest and test suites tarballs:
76
77```
78http://devserver_url:/stage?archive_url=gs://your_url/path&artifacts=autotest,test_suites
79```
80
81To download the full update payload:
82
83```
84http://devserver_url:/stage?archive_url=gs://your_url/path&artifacts=full_payload
85```
86
87To download just a file called `blah.bin`:
88
89```
90http://devserver_url:/stage?archive_url=gs://your_url/path&files=blah.bin
91```
92
93### xBuddy RPC
94
95See [xBuddy for Devserver].
96
97## Feature Requests
98
99There are many things that can be done to improve this system. Feel free to make
100suggestions and submit patches.
101
Mike Frysingerc352d3b2024-04-05 20:10:11102[xBuddy for Devserver]: https://www.chromium.org/chromium-os/developer-library/reference/tools/xbuddy/