tree: bb475c2b80c85fc2e967cef86f001a9f484e79de [path history] [tgz]
  1. go/
  2. .gitignore
  3. build.sh
  4. build_in_chroot.sh
  5. install.sh
  6. OWNERS
  7. README.md
contrib/btpeer_manager/README.md

btpeer_manager

A CLI application that makes managing btpeers in our lab easier by automating common operations including:

  • Building chameleond and preparing the bundle for btpeer deployment
  • Chameleond bundle release management, handling the config logic and GCS uploading
  • Image release management, handling the config logic and GCS uploading

Installation

Use the ./install.sh bash script to build and install btpeer_manager so that it may be run as a regular command, btpeer_manager. The built copy will reside at ./bin/btpeer_manager and a system link to this executable will be placed in your desired install directory. The default install dir is ~/lib/depot_tools to prevent the need of adding another dir to your bash PATH, but it can be adjusted if desired (see below).

Note: The installation script is meant to be run on your main system, not in a chroot.

Note: Syncing an updated version of this source repository will not automatically rebuild an updated version of btpeer_manager. To update your local build, simply re-run ./install.sh (or ./build.sh) to rebuild it.

$ bash ./install.sh help
Usage: install.sh [options]

Options:
 --dir|-d <path>    Path to directory where btpeer_manager is to be
                    installed, which should be in your $PATH
                    (default = '~/lib/depot_tools').

Key Directories & Files

btpeer_manager relies on your chromiumos source directory to identify its source directory and the chameleond source directory. It assumes your chromiumos source directory is located at ~/chromiumos, but you can use a different directory by passing it with the --chromiumos_src_dir flag.

Local:

  • <chromiumos_src_dir>/src/platform/
    • chameleon/ - Chameleond source repository
      • dist/ - Where chameleond builds are created by the chameleond makefile (generated when chameleond is built)
    • dev/contrib/btpeer_manager/ - This directory, and the primary dir for tool
      • build/ - Default working directory location (generated by CLI)
        • bundles/ - Where built and downloaded chameleond bundles are stored
        • config/ - Where copies of the chameleond and image config JSON are download to and uploaded from
        • images - Where images are downloaded to
      • go/
        • bin/ - Stores the CLI executable (generated once built)
        • pkg/ - Download golang package dependencies (generated on build)
        • src/ - CLI source code

Google Cloud Storage (GCS):

Usage

Below are different usage examples highlighting how btpeer_manager is meant to be used. All usage is meant to be preformed outside your chroot on your main system and probably will not all work from within it. Logs are printed to stdout in most cases to highlight important actions and decisions made by the tool.

For ease of reference, copies of CLI help text is included for the different command sections.

Note: The help and log output may differ in your usage since they are contextual and the README may be slightly out of sync with the latest changes, but it should match for the most part. You can always check what commands and flags are available to your installed version with the --help flag.

$ btpeer_manager --help
Utility for managing btpeers

Usage:
  btpeer_manager [command]

Available Commands:
  chameleond  Commands related to managing chameleond on btpeers
  clean       Deletes temporary/build files created by btpeer_manager.
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  image       Commands related to managing images on btpeers

Flags:
      --chromiumos_src_dir string   Path to local chromiumos source directory (default "/usr/local/google/home/jaredbennett/chromiumos")
  -h, --help                        help for btpeer_manager
  -v, --version                     version for btpeer_manager
      --working_dir string          Path to base working directory create build directory (defaults to btpeer_manager source dir)

Use "btpeer_manager [command] --help" for more information about a command.

btpeer_manager chameleond

$ btpeer_manager chameleond --help
Commands related to managing chameleond on btpeers

Usage:
  btpeer_manager chameleond [command]

Available Commands:
  make        Builds chameleond in your chroot and prepares bundle for btpeer distribution
  release     Commands related to managing chameleond releases for btpeers

Flags:
  -h, --help   help for chameleond

Global Flags:
      --chromiumos_src_dir string   Path to local chromiumos source directory (default "/usr/local/google/home/jaredbennett/chromiumos")
      --working_dir string          Path to base working directory create build directory (defaults to btpeer_manager source dir)

Use "btpeer_manager chameleond [command] --help" for more information about a command.

btpeer_manager chameleond make

$ btpeer_manager chameleond make
16:59:54.388707 Running "make clean" from within chroot in chameleon source dir "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon"
cat: /etc/hostname: No such file or directory
cat: /etc/hostname: No such file or directory
16:59:55.644385 Running "make" from within chroot in chameleon source dir "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon"
cat: /etc/hostname: No such file or directory
cat: /etc/hostname: No such file or directory
armv7a-cros-linux-gnueabihf-gcc -g -Wall -O2 -static -Iinclude -c src/histogram.c -o bin/histogram.o
armv7a-cros-linux-gnueabihf-gcc -g -Wall -O2 -static -Iinclude -o bin/histogram bin/histogram.o
armv7a-cros-linux-gnueabihf-gcc -g -Wall -O2 -static -Iinclude -c src/hpd_control.c -o bin/hpd_control.o
...(many lines of logs from chameleond make)...
copying v3/v4l-mjpeg-server/server.c -> chameleond-0.0.2/v3/v4l-mjpeg-server
Writing chameleond-0.0.2/setup.cfg
Creating tar archive
removing 'chameleond-0.0.2' (and everything under it)
rm bin/pixeldump.o bin/printer.o bin/avsync.o bin/hpd_control.o bin/histogram.o
17:00:09.568961 Searching for built bundle files in "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon/dist"
17:00:09.569076 Found chameleond bundle archive "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon/dist/chameleond-0.0.2.tar.gz"
17:00:09.569089 Found chameleond commit file "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon/dist/commit"
17:00:09.569094 Reading chameleond commit from chameleond commit file "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon/dist/commit"
17:00:09.569138 Read chameleond commit as "cf50534"
17:00:09.569142 Preparing bundle archive for distribution
17:00:09.616519 New btpeer chameleond bundle archive "chameleond-0.0.2-cf50534.tar.gz" ready for distribution at "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/bundles/chameleond-0.0.2-cf50534.tar.gz"

Note: If you haven‘t entered your chroot recently (or more specifically, used sudo recently), it will prompt your for your sudo password. This isn’t done by btpeer_manager, but by cros_sdk like usual since it uses that to preform the operations in your chroot. Your stdin is piped cros_sdk to allow this you to still enter it.

btpeer_manager chameleond release

All of these release commands are dependent upon access to the GCS bucket we use to store our chameleond bundles and the release config files, chromeos-connectivity-test-artifacts. By default, access is achieved using the gcloud application-default credentials for ease of use, but you can also specify a GCS cred JSON file if you have one with the --gcloud_cred_file flag (docs).

The default behavior is to use the test release config. To use the prod config you must specify the --prod flag. This applies to anytime the command reads or modifies a config file. The bundles themselves are the same between prod and test, only the config changes.

$ btpeer_manager chameleond release --help
Commands related to managing chameleond releases for btpeers

Usage:
  btpeer_manager chameleond release [command]

Available Commands:
  config      Commands for reading and updating the release config
  download    Downloads a released chameleond bundle
  upload      Uploads a local bundle to GCS and adds it to the release config

Flags:
      --bucket string             GCS storage bucket to use (both prod and test use the same bucket) (default "chromeos-connectivity-test-artifacts")
      --gcloud_cred_file string   The gcloud credential file to use with the GCS API (uses gcloud CLI application-default credentials when unset)
  -h, --help                      help for release
  -p, --prod                      Uses the production config when present, or the test config when not present

Global Flags:
      --chromiumos_src_dir string   Path to local chromiumos source directory (default "/usr/local/google/home/jaredbennett/chromiumos")
      --working_dir string          Path to base working directory create build directory (defaults to btpeer_manager source dir)

Use "btpeer_manager chameleond release [command] --help" for more information about a command.

btpeer_manager chameleond release download

$ btpeer_manager chameleond release download --help
Downloads a released chameleond bundle

Usage:
  btpeer_manager chameleond release download [flags]

Flags:
      --commit string         Download the bundle for this chameleond commit (case-insensitive)
      --cros_version string   Download the bundle for this ChromeOS release version (compatible with --dut)
      --dut string            Download the next bundle if the dut is in the verification pool, or the select it by cros_version otherwise (--cros_version required)
  -h, --help                  help for download
      --next                  Download the next bundle

Global Flags:
      --bucket string               GCS storage bucket to use (both prod and test use the same bucket) (default "chromeos-connectivity-test-artifacts")
      --chromiumos_src_dir string   Path to local chromiumos source directory (default "/usr/local/google/home/jaredbennett/chromiumos")
      --gcloud_cred_file string     The gcloud credential file to use with the GCS API (uses gcloud CLI application-default credentials when unset)
  -p, --prod                        Uses the production config when present, or the test config when not present
      --working_dir string          Path to base working directory create build directory (defaults to btpeer_manager source dir)
$ btpeer_manager chameleond release download --next
DirContext: {
  "Working": {
    "BaseDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build",
    "ChameleondBundlesDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/bundles",
    "ConfigDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/config"
  },
  "Src": {
    "ChromiumosDirPath": "/usr/local/google/home/jaredbennett/chromiumos",
    "BTPeerManagerDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager",
    "ChameleonDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon",
    "ChameleonDistDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon/dist"
  }
}
17:39:24.130573 Creating new GCS client using application-default credentials
17:39:24.571006 Successfully retrieved BluetoothPeerChameleondConfig from "gs://chromeos-connectivity-test-artifacts/btpeer/btpeer_chameleond_config_test.json"
17:39:24.571099 BluetoothPeerChameleondConfig:
{
  "nextChameleondCommit": "723e87b",
  "nextDutHosts": [],
  "nextDutReleaseVersions": [],
  "bundles": [
    {
      "chameleondCommit": "723e87b",
      "archivePath": "gs://chromeos-connectivity-test-artifacts/btpeer/chameleond/chameleond-0.0.2-723e87b.tar.gz",
      "minDutReleaseVersion": "0"
    }
  ]
}
17:39:24.571150 Selected bundle:
{
  "chameleondCommit": "723e87b",
  "archivePath": "gs://chromeos-connectivity-test-artifacts/btpeer/chameleond/chameleond-0.0.2-723e87b.tar.gz",
  "minDutReleaseVersion": "0"
}
17:39:24.571190 Downloading chameleond bundle archive "gs://chromeos-connectivity-test-artifacts/btpeer/chameleond/chameleond-0.0.2-723e87b.tar.gz"
17:39:25.841606 Successfully downloaded chameleond bundle to "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/bundles/chameleond-0.0.2-723e87b.tar.gz"

btpeer_manager chameleond release upload

$ btpeer_manager chameleond release upload --help
Uploads a local bundle to GCS and adds it to the release config

Usage:
  btpeer_manager chameleond release upload <min_cros_version> <path_to_bundle_archive> [flags]

Flags:
  -h, --help                        help for upload
      --next                        Sets the NextChameleondCommit to this new bundle's ChameleondCommit
      --overwrite_cros_version      Allows for replacing other bundles in the bundle config with matching min_cros_version values
      --overwrite_existing_bundle   Allows overwriting of an bundle that already exists with the same ChameleondCommit

Global Flags:
      --bucket string               GCS storage bucket to use (both prod and test use the same bucket) (default "chromeos-connectivity-test-artifacts")
      --chromiumos_src_dir string   Path to local chromiumos source directory (default "/usr/local/google/home/jaredbennett/chromiumos")
      --gcloud_cred_file string     The gcloud credential file to use with the GCS API (uses gcloud CLI application-default credentials when unset)
  -p, --prod                        Uses the production config when present, or the test config when not present
      --working_dir string          Path to base working directory create build directory (defaults to btpeer_manager source dir)

In this example, we are uploading a bundle previously built with btpeer_manager chameleond make, specifying it as the next bundle, setting its minimum ChromeOS build version as 1234.5.6, and applying our config changes to just the test config (since --prod is not included).

Note: It isn't required to use an absolute path for the bundle, but it can be easier.

$ btpeer_manager chameleond release upload 1234.5.6 /usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/bundles/chameleond-0.0.2-cf50534.tar.gz --next
DirContext: {
  "Working": {
    "BaseDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build",
    "ChameleondBundlesDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/bundles",
    "ConfigDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/config"
  },
  "Src": {
    "ChromiumosDirPath": "/usr/local/google/home/jaredbennett/chromiumos",
    "BTPeerManagerDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager",
    "ChameleonDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon",
    "ChameleonDistDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon/dist"
  }
}
17:48:52.852550 Creating new GCS client using application-default credentials
17:48:53.066573 Successfully retrieved BluetoothPeerChameleondConfig from "gs://chromeos-connectivity-test-artifacts/btpeer/btpeer_chameleond_config_test.json"
17:48:53.066685 Bundle ChameleondCommit: "cf50534"
17:48:53.066712 Uploading chameleond bundle from "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/bundles/chameleond-0.0.2-cf50534.tar.gz" to "gs://chromeos-connectivity-test-artifacts/btpeer/chameleond/chameleond-0.0.2-cf50534.tar.gz"
17:48:54.010811 Successfully uploaded 33714306 bytes to "gs://chromeos-connectivity-test-artifacts/btpeer/chameleond/chameleond-0.0.2-cf50534.tar.gz"
17:48:54.010871 Successfully uploaded new chameleond bundle:
{
  "chameleondCommit": "cf50534",
  "archivePath": "gs://chromeos-connectivity-test-artifacts/btpeer/chameleond/chameleond-0.0.2-cf50534.tar.gz",
  "minDutReleaseVersion": "1234.5.6"
}
17:48:54.311275 Saved new BluetoothPeerChameleondConfig to "gs://chromeos-connectivity-test-artifacts/btpeer/btpeer_chameleond_config_test.json":
{
  "nextChameleondCommit": "cf50534",
  "nextDutHosts": [],
  "nextDutReleaseVersions": [],
  "bundles": [
    {
      "chameleondCommit": "723e87b",
      "archivePath": "gs://chromeos-connectivity-test-artifacts/btpeer/chameleond/chameleond-0.0.2-723e87b.tar.gz",
      "minDutReleaseVersion": "0"
    },
    {
      "chameleondCommit": "cf50534",
      "archivePath": "gs://chromeos-connectivity-test-artifacts/btpeer/chameleond/chameleond-0.0.2-cf50534.tar.gz",
      "minDutReleaseVersion": "1234.5.6"
    }
  ]
}
17:48:54.311309 See 'btpeer_manager chameleond release config --help' for ways to update the config further if needed

btpeer_manager chameleond release config

These commands allow you to get and set the release config quickly and easily.

A common workflow would be to retrieve the current test config with get and push it to production with a subsequent set --prod call. Another thing you can do is call get, make local changes to the config file, and then call set to upload your manual changes. Every time btpeer_manager saves a config to GCS it validates it too, so if you make a typo or logic error it will yell at you and not upload your bad config.

$ btpeer_manager chameleond release config --help
Commands for reading and updating the release config

Usage:
  btpeer_manager chameleond release config [command]

Available Commands:
  get         Downloads the release config from storage
  set         Updates the release config in storage

Flags:
  -h, --help   help for config

Global Flags:
      --bucket string               GCS storage bucket to use (both prod and test use the same bucket) (default "chromeos-connectivity-test-artifacts")
      --chromiumos_src_dir string   Path to local chromiumos source directory (default "/usr/local/google/home/jaredbennett/chromiumos")
      --gcloud_cred_file string     The gcloud credential file to use with the GCS API (uses gcloud CLI application-default credentials when unset)
  -p, --prod                        Uses the production config when present, or the test config when not present
      --working_dir string          Path to base working directory create build directory (defaults to btpeer_manager source dir)

Use "btpeer_manager chameleond release config [command] --help" for more information about a command.

btpeer_manager chameleond release config get

$ btpeer_manager chameleond release config get
DirContext: {
  "Working": {
    "BaseDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build",
    "ChameleondBundlesDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/bundles",
    "ConfigDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/config"
  },
  "Src": {
    "ChromiumosDirPath": "/usr/local/google/home/jaredbennett/chromiumos",
    "BTPeerManagerDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager",
    "ChameleonDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon",
    "ChameleonDistDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon/dist"
  }
}
17:58:25.515647 Creating new GCS client using application-default credentials
17:58:25.918004 Successfully retrieved BluetoothPeerChameleondConfig from "gs://chromeos-connectivity-test-artifacts/btpeer/btpeer_chameleond_config_test.json"
17:58:25.918440 Saved copy of config to "file:///usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/config/btpeer_chameleond_config.json"

btpeer_manager chameleond release config set

$ btpeer_manager chameleond release config set
DirContext: {
  "Working": {
    "BaseDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build",
    "ChameleondBundlesDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/bundles",
    "ConfigDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/config"
  },
  "Src": {
    "ChromiumosDirPath": "/usr/local/google/home/jaredbennett/chromiumos",
    "BTPeerManagerDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager",
    "ChameleonDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon",
    "ChameleonDistDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon/dist"
  }
}
17:59:00.553684 Creating new GCS client using application-default credentials
17:59:00.788089 Successfully retrieved BluetoothPeerChameleondConfig from "gs://chromeos-connectivity-test-artifacts/btpeer/btpeer_chameleond_config_test.json"
17:59:00.788140 Reading config file "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/config/btpeer_chameleond_config.json"
17:59:00.788401 Successfully read BluetoothPeerChameleondConfig from "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/config/btpeer_chameleond_config.json":
{
  "nextChameleondCommit": "cf50534",
  "nextDutHosts": [],
  "nextDutReleaseVersions": [],
  "bundles": [
    {
      "chameleondCommit": "723e87b",
      "archivePath": "gs://chromeos-connectivity-test-artifacts/btpeer/chameleond/chameleond-0.0.2-723e87b.tar.gz",
      "minDutReleaseVersion": "0"
    },
    {
      "chameleondCommit": "cf50534",
      "archivePath": "gs://chromeos-connectivity-test-artifacts/btpeer/chameleond/chameleond-0.0.2-cf50534.tar.gz",
      "minDutReleaseVersion": "1234.5.6"
    }
  ]
}
17:59:01.069812 Saved new BluetoothPeerChameleondConfig to "gs://chromeos-connectivity-test-artifacts/btpeer/btpeer_chameleond_config_test.json":
{
  "nextChameleondCommit": "cf50534",
  "nextDutHosts": [],
  "nextDutReleaseVersions": [],
  "bundles": [
    {
      "chameleondCommit": "723e87b",
      "archivePath": "gs://chromeos-connectivity-test-artifacts/btpeer/chameleond/chameleond-0.0.2-723e87b.tar.gz",
      "minDutReleaseVersion": "0"
    },
    {
      "chameleondCommit": "cf50534",
      "archivePath": "gs://chromeos-connectivity-test-artifacts/btpeer/chameleond/chameleond-0.0.2-cf50534.tar.gz",
      "minDutReleaseVersion": "1234.5.6"
    }
  ]
}

btpeer_manager image

$ btpeer_manager image --help
Commands related to managing images on btpeers

Usage:
  btpeer_manager image [command]

Available Commands:
  release     Commands related to managing btpeer images

Flags:
  -h, --help   help for image

Global Flags:
      --chromiumos_src_dir string   Path to local chromiumos source directory (default "/usr/local/google/home/jaredbennett/chromiumos")
      --working_dir string          Path to base working directory create build directory (defaults to btpeer_manager source dir)

Use "btpeer_manager image [command] --help" for more information about a command.

btpeer_manager image release

 $ btpeer_manager image release --help
Commands related to managing btpeer images

Usage:
  btpeer_manager image release [command]

Available Commands:
  config      Commands for reading and updating the image release config
  download    Downloads a released image
  upload      Uploads a local image to GCS and adds it to the image release config

Flags:
      --bucket string             GCS storage bucket to use (both prod and test use the same bucket) (default "chromeos-connectivity-test-artifacts")
      --gcloud_cred_file string   The gcloud credential file to use with the GCS API (uses gcloud CLI application-default credentials when unset)
  -h, --help                      help for release
  -p, --prod                      Uses the production config when present, or the test config when not present

Global Flags:
      --chromiumos_src_dir string   Path to local chromiumos source directory (default "/usr/local/google/home/jaredbennett/chromiumos")
      --working_dir string          Path to base working directory create build directory (defaults to btpeer_manager source dir)

Use "btpeer_manager image release [command] --help" for more information about a command.

btpeer_manager image release upload

$ btpeer_manager image release upload --help
Uploads a local image to GCS and adds it to the image release config

Usage:
  btpeer_manager image release upload <path_to_image_file_in_pi_gen_deploy_dir> [flags]

Flags:
      --current   Sets the CurrentImageUuid to this new image's UUID
  -h, --help      help for upload
      --next      Sets the NextImageUuid to this new image's UUID

Global Flags:
      --bucket string               GCS storage bucket to use (both prod and test use the same bucket) (default "chromeos-connectivity-test-artifacts")
      --chromiumos_src_dir string   Path to local chromiumos source directory (default "/usr/local/google/home/jaredbennett/chromiumos")
      --gcloud_cred_file string     The gcloud credential file to use with the GCS API (uses gcloud CLI application-default credentials when unset)
  -p, --prod                        Uses the production config when present, or the test config when not present
      --working_dir string          Path to base working directory create build directory (defaults to btpeer_manager source dir)
$ /bin/bash /btpeer_manager image release upload /usr/local/google/home/jaredbennett/chromiumos/src/third_party/pi-gen-btpeer/deploy/image_2024-04-24-raspios-cros-btpeer.img.gz
DirContext: {
  "Working": {
    "BaseDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build",
    "ChameleondBundlesDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/bundles",
    "ConfigDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/config"
  },
  "Src": {
    "ChromiumosDirPath": "/usr/local/google/home/jaredbennett/chromiumos",
    "BTPeerManagerDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager",
    "ChameleonDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon",
    "ChameleonDistDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon/dist"
  }
}
13:03:48.998216 Creating new GCS client using application-default credentials
13:03:49.200026 Successfully retrieved RaspiosCrosBtpeerImageConfig from "gs://chromeos-connectivity-test-artifacts/btpeer/raspios_cros_btpeer_image_config_test.json"
13:03:49.200064 Preparing to upload image, build info, and package info files
13:03:49.200104 Identified image file as "/usr/local/google/home/jaredbennett/chromiumos/src/third_party/pi-gen-btpeer/deploy/image_2024-04-24-raspios-cros-btpeer.img.gz"
13:03:49.200132 Identified build info file as "/usr/local/google/home/jaredbennett/chromiumos/src/third_party/pi-gen-btpeer/deploy/raspios_cros_btpeer_build_info.json"
13:03:49.200158 Identified package info file as "/usr/local/google/home/jaredbennett/chromiumos/src/third_party/pi-gen-btpeer/deploy/2024-04-24-raspios-cros-btpeer.info"
13:03:49.200170 Reading build info file "/usr/local/google/home/jaredbennett/chromiumos/src/third_party/pi-gen-btpeer/deploy/raspios_cros_btpeer_build_info.json"
13:03:49.200538 Successfully unmarshalled build info file "/usr/local/google/home/jaredbennett/chromiumos/src/third_party/pi-gen-btpeer/deploy/raspios_cros_btpeer_build_info.json" as RaspiosCrosBtpeerImageBuildInfo: {
  "imageUuid": "1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e",
  "imageBuildTime": "2024-04-24T22:47:17Z",
  "sources": {
    "https://chromium.googlesource.com/chromiumos/config": "fc0f57ee",
    "https://chromium.googlesource.com/chromiumos/platform/btpeerd": "eac10d3",
    "https://chromium.googlesource.com/chromiumos/platform/btsocket": "d52a38f",
    "https://chromium.googlesource.com/chromiumos/platform/chameleon": "70f5f1e",
    "https://chromium.googlesource.com/chromiumos/third_party/pi-gen-btpeer": "db84bb0"
  }
}
13:03:49.200565 Identified ImageUuid as "1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e"
13:03:49.200589 Uploading file from "/usr/local/google/home/jaredbennett/chromiumos/src/third_party/pi-gen-btpeer/deploy/image_2024-04-24-raspios-cros-btpeer.img.gz" to "gs://chromeos-connectivity-test-artifacts/btpeer/raspios-cros-btpeer/1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e/image_2024-04-24-raspios-cros-btpeer.img.gz"
13:04:11.718753 Successfully uploaded 1379026325 bytes to "gs://chromeos-connectivity-test-artifacts/btpeer/raspios-cros-btpeer/1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e/image_2024-04-24-raspios-cros-btpeer.img.gz"
13:04:11.718861 Uploading file from "/usr/local/google/home/jaredbennett/chromiumos/src/third_party/pi-gen-btpeer/deploy/raspios_cros_btpeer_build_info.json" to "gs://chromeos-connectivity-test-artifacts/btpeer/raspios-cros-btpeer/1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e/raspios_cros_btpeer_build_info.json"
13:04:11.917212 Successfully uploaded 527 bytes to "gs://chromeos-connectivity-test-artifacts/btpeer/raspios-cros-btpeer/1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e/raspios_cros_btpeer_build_info.json"
13:04:11.917265 Uploading file from "/usr/local/google/home/jaredbennett/chromiumos/src/third_party/pi-gen-btpeer/deploy/2024-04-24-raspios-cros-btpeer.info" to "gs://chromeos-connectivity-test-artifacts/btpeer/raspios-cros-btpeer/1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e/2024-04-24-raspios-cros-btpeer.info"
13:04:12.115490 Successfully uploaded 111549 bytes to "gs://chromeos-connectivity-test-artifacts/btpeer/raspios-cros-btpeer/1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e/2024-04-24-raspios-cros-btpeer.info"
13:04:12.115639 Successfully uploaded new image:
{
  "uuid": "1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e",
  "path": "gs://chromeos-connectivity-test-artifacts/btpeer/raspios-cros-btpeer/1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e/image_2024-04-24-raspios-cros-btpeer.img.gz"
}
13:04:12.367350 Saved new RaspiosCrosBtpeerImageConfig to "gs://chromeos-connectivity-test-artifacts/btpeer/raspios_cros_btpeer_image_config_test.json":
{
  "currentImageUuid": "",
  "nextImageUuid": "",
  "nextImageVerificationDutPool": [],
  "images": [
    {
      "uuid": "1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e",
      "path": "gs://chromeos-connectivity-test-artifacts/btpeer/raspios-cros-btpeer/1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e/image_2024-04-24-raspios-cros-btpeer.img.gz"
    }
  ]
}
13:04:12.367380 See 'btpeer_manager image release config --help' for ways to update the config further if needed

btpeer_manager image release download

$ btpeer_manager image release download --help
Downloads a released image

Select the image by passing one of the selection flags. Selection flags cannot
be combined.

Usage:
  btpeer_manager image release download [flags]

Flags:
      --current       Download the current image
      --dut string    Download the next image if the dut is in the verification pool, otherwise download the current image
  -h, --help          help for download
      --next          Download the next image
      --uuid string   Download the image with a matching UUID known by the image config

Global Flags:
      --bucket string               GCS storage bucket to use (both prod and test use the same bucket) (default "chromeos-connectivity-test-artifacts")
      --chromiumos_src_dir string   Path to local chromiumos source directory (default "/usr/local/google/home/jaredbennett/chromiumos")
      --gcloud_cred_file string     The gcloud credential file to use with the GCS API (uses gcloud CLI application-default credentials when unset)
  -p, --prod                        Uses the production config when present, or the test config when not present
      --working_dir string          Path to base working directory create build directory (defaults to btpeer_manager source dir)
$ btpeer_manager image release download --prod --current
DirContext: {
  "Working": {
    "BaseDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build",
    "ChameleondBundlesDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/bundles",
    "ImagesDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/images",
    "ConfigDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/config"
  },
  "Src": {
    "ChromiumosDirPath": "/usr/local/google/home/jaredbennett/chromiumos",
    "BTPeerManagerDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager",
    "ChameleonDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon",
    "ChameleonDistDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon/dist"
  }
}
14:50:51.340874 Creating new GCS client using application-default credentials
14:50:51.684993 Successfully retrieved RaspiosCrosBtpeerImageConfig from "gs://chromeos-connectivity-test-artifacts/btpeer/raspios_cros_btpeer_image_config_prod.json"
14:50:51.685071 RaspiosCrosBtpeerImageConfig:
{
  "currentImageUuid": "1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e",
  "nextImageUuid": "1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e",
  "nextImageVerificationDutPool": [
    "chromeos15-row14-rack10-host5"
  ],
  "images": [
    {
      "uuid": "1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e",
      "path": "gs://chromeos-connectivity-test-artifacts/btpeer/raspios-cros-btpeer/1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e/image_2024-04-24-raspios-cros-btpeer.img.gz"
    }
  ]
}
14:50:51.685111 Selected image:
{
  "uuid": "1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e",
  "path": "gs://chromeos-connectivity-test-artifacts/btpeer/raspios-cros-btpeer/1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e/image_2024-04-24-raspios-cros-btpeer.img.gz"
}
14:50:51.685176 Downloading image "gs://chromeos-connectivity-test-artifacts/btpeer/raspios-cros-btpeer/1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e/image_2024-04-24-raspios-cros-btpeer.img.gz" to "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/images/1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e/image_2024-04-24-raspios-cros-btpeer.img.gz"
14:51:06.751452 Successfully downloaded image to "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/images/1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e/image_2024-04-24-raspios-cros-btpeer.img.gz"

btpeer_manager image release config

$ btpeer_manager image release config --help
Commands for reading and updating the image release config

Usage:
  btpeer_manager image release config [command]

Available Commands:
  get         Downloads the image release config from storage
  set         Updates the image release config in storage

Flags:
  -h, --help   help for config

Global Flags:
      --bucket string               GCS storage bucket to use (both prod and test use the same bucket) (default "chromeos-connectivity-test-artifacts")
      --chromiumos_src_dir string   Path to local chromiumos source directory (default "/usr/local/google/home/jaredbennett/chromiumos")
      --gcloud_cred_file string     The gcloud credential file to use with the GCS API (uses gcloud CLI application-default credentials when unset)
  -p, --prod                        Uses the production config when present, or the test config when not present
      --working_dir string          Path to base working directory create build directory (defaults to btpeer_manager source dir)

Use "btpeer_manager image release config [command] --help" for more information about a command.

btpeer_manager image release config get

$ btpeer_manager image release config get --help
Downloads the image release config from storage

Usage:
  btpeer_manager image release config get [flags]

Flags:
      --dst string   Path to save config to (defaults to "<working_dir>/config/raspios_cros_btpeer_image_config.json"
  -h, --help         help for get
      --print        Print the config rather than save it to a file

Global Flags:
      --bucket string               GCS storage bucket to use (both prod and test use the same bucket) (default "chromeos-connectivity-test-artifacts")
      --chromiumos_src_dir string   Path to local chromiumos source directory (default "/usr/local/google/home/jaredbennett/chromiumos")
      --gcloud_cred_file string     The gcloud credential file to use with the GCS API (uses gcloud CLI application-default credentials when unset)
  -p, --prod                        Uses the production config when present, or the test config when not present
      --working_dir string          Path to base working directory create build directory (defaults to btpeer_manager source dir)
$ btpeer_manager image release config get --prod
DirContext: {
  "Working": {
    "BaseDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build",
    "ChameleondBundlesDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/bundles",
    "ImagesDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/images",
    "ConfigDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/config"
  },
  "Src": {
    "ChromiumosDirPath": "/usr/local/google/home/jaredbennett/chromiumos",
    "BTPeerManagerDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager",
    "ChameleonDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon",
    "ChameleonDistDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon/dist"
  }
}
14:50:16.139768 Creating new GCS client using application-default credentials
14:50:16.524537 Successfully retrieved RaspiosCrosBtpeerImageConfig from "gs://chromeos-connectivity-test-artifacts/btpeer/raspios_cros_btpeer_image_config_prod.json"
14:50:16.526396 Saved copy of config to "file:///usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/config/raspios_cros_btpeer_image_config.json"

btpeer_manager image release config set

$ btpeer_manager image release config set --help
Updates the image release config in storage

Usage:
  btpeer_manager image release config set [flags]

Flags:
      --force        Bypass config validation failures and forcefully update the config
  -h, --help         help for set
      --src string   Path to read new config from (defaults to "<working_dir>/config/raspios_cros_btpeer_image_config.json"

Global Flags:
      --bucket string               GCS storage bucket to use (both prod and test use the same bucket) (default "chromeos-connectivity-test-artifacts")
      --chromiumos_src_dir string   Path to local chromiumos source directory (default "/usr/local/google/home/jaredbennett/chromiumos")
      --gcloud_cred_file string     The gcloud credential file to use with the GCS API (uses gcloud CLI application-default credentials when unset)
  -p, --prod                        Uses the production config when present, or the test config when not present
      --working_dir string          Path to base working directory create build directory (defaults to btpeer_manager source dir)
$ btpeer_manager image release config set
DirContext: {
  "Working": {
    "BaseDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build",
    "ChameleondBundlesDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/bundles",
    "ImagesDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/images",
    "ConfigDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/config"
  },
  "Src": {
    "ChromiumosDirPath": "/usr/local/google/home/jaredbennett/chromiumos",
    "BTPeerManagerDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager",
    "ChameleonDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon",
    "ChameleonDistDirPath": "/usr/local/google/home/jaredbennett/chromiumos/src/platform/chameleon/dist"
  }
}
13:28:43.628046 Creating new GCS client using application-default credentials
13:28:43.838424 Successfully retrieved RaspiosCrosBtpeerImageConfig from "gs://chromeos-connectivity-test-artifacts/btpeer/raspios_cros_btpeer_image_config_test.json"
13:28:43.838474 Reading config file "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/config/raspios_cros_btpeer_image_config.json"
13:28:43.838748 Successfully read RaspiosCrosBtpeerImageConfig from "/usr/local/google/home/jaredbennett/chromiumos/src/platform/dev/contrib/btpeer_manager/build/config/raspios_cros_btpeer_image_config.json":
{
  "currentImageUuid":  "1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e",
  "nextImageUuid":  "1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e",
  "nextImageVerificationDutPool":  [],
  "images":  [
    {
      "uuid":  "1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e",
      "path":  "gs://chromeos-connectivity-test-artifacts/btpeer/raspios-cros-btpeer/1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e/image_2024-04-24-raspios-cros-btpeer.img.gz"
    }
  ]
}
13:28:44.104683 Saved new RaspiosCrosBtpeerImageConfig to "gs://chromeos-connectivity-test-artifacts/btpeer/raspios_cros_btpeer_image_config_test.json":
{
  "currentImageUuid":  "1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e",
  "nextImageUuid":  "1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e",
  "nextImageVerificationDutPool":  [],
  "images":  [
    {
      "uuid":  "1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e",
      "path":  "gs://chromeos-connectivity-test-artifacts/btpeer/raspios-cros-btpeer/1c2bcdcf-73f3-41da-a71b-c4e08fbb5e4e/image_2024-04-24-raspios-cros-btpeer.img.gz"
    }
  ]
}