Skip to content

Commit

Permalink
Install yq without Ansible (#1608)
Browse files Browse the repository at this point in the history
Resolves #1595

As part of our continuing effort to eliminate Ansible from our install
process, this installs yq from within the bundle installer rather than
during Ansible.

This is a slight implementation change in that we no longer download the
yq binary at install time and instead pre-download it and include it in
the TinyPilot bundle. This is preferable, as it does more work in the
packaging stage and less work on user devices, though it does increase
the size of our bundles by a few megabytes.

While we're here, we're also upgrading to the latest version of yq, so
we're upgrading from `v4.30.6` to `v4.35.1`.

### Manual tests

For expediency, I tested builds that combined:

* #1605
* #1606 
* #1608

For the manual tests, I verified:

* Video works under MJPEG and H.264
* Changing video settings works

In these environments:

- [x] Pro Voyager build
- [x] Community bundle on top of bare Raspbian system
- [x] Community bundle on top of bare Raspbian system with TC358743
enabled

### Peer tests

To test this bundle (which combines the stack of three PRs mentioned
above), run:

```bash
curl \
  --silent \
  --show-error \
  --location \
  https://raw.githubusercontent.com/tiny-pilot/tinypilot/master/scripts/install-bundle | \
  sudo bash -s -- \
    https://output.circle-artifacts.com/output/job/e70104a2-0f1f-43b7-abe9-098d6eac2799/artifacts/0/bundler/dist/tinypilot-community-20230831T0151Z-1.9.0-87+de1916a.tgz
```

<a data-ca-tag
href="https://codeapprove.com/pr/tiny-pilot/tinypilot/1608"><img
src="https://codeapprove.com/external/github-tag-allbg.png" alt="Review
on CodeApprove" /></a>
  • Loading branch information
mtlynch authored Aug 31, 2023
1 parent b38744d commit 50e7e58
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 29 deletions.
22 changes: 0 additions & 22 deletions ansible-role-ustreamer/tasks/install_yq.yml

This file was deleted.

3 changes: 0 additions & 3 deletions ansible-role-ustreamer/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
import_tasks: provision_tc358743.yml
when: is_tc358743_enabled | bool

- name: install yq
import_tasks: install_yq.yml

- name: create uStreamer Janus plugin config
template:
src: janus.plugin.ustreamer.jcfg.j2
Expand Down
2 changes: 0 additions & 2 deletions ansible-role-ustreamer/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@ ustreamer_dir: /opt/ustreamer

# These variables are only used within this role.
ustreamer_janus_configs_dir: /etc/janus

ustreamer_yq_version: v4.30.6
1 change: 1 addition & 0 deletions bundler/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/bundle/tinypilot
/bundle/roles
/bundle/*.deb
/bundle/yq

# Build artifacts.
/dist
4 changes: 4 additions & 0 deletions bundler/bundle/install
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ apt-get install -y \
"./${USTREAMER_DEBIAN_PACKAGE}" \
"./${TINYPILOT_DEBIAN_PACKAGE}"

# Install yq.
mv yq /usr/bin/yq
chmod 0755 /usr/bin/yq

# Bootstrap environment for installation.
apt-get update --allow-releaseinfo-change-suite
apt-get install -y \
Expand Down
5 changes: 5 additions & 0 deletions bundler/create-bundle
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ wget \
--directory-prefix="${BUNDLE_DIR}" \
https://github.com/tiny-pilot/ustreamer-debian/releases/download/ustreamer_5.38-20230802141939/ustreamer_5.38-20230802141939_armhf.deb

# Download yq binary
wget \
https://github.com/mikefarah/yq/releases/download/v4.35.1/yq_linux_arm \
--output-document="${BUNDLE_DIR}/yq"

# Generate tarball bundle and meta file.
mkdir -p "${OUTPUT_DIR}"
ls -lahR "${BUNDLE_DIR}" > "${OUTPUT_DIR}/files.txt"
Expand Down
4 changes: 2 additions & 2 deletions bundler/verify-bundle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ if [[ "${BUNDLE_SIZE_BYTES}" -eq 0 ]]; then
>&2 echo 'Bundle size is zero.'
exit 1
fi
if [[ "${BUNDLE_SIZE_BYTES}" -gt 5000000 ]]; then
>&2 echo 'Bundle size is larger than 5mb.'
if [[ "${BUNDLE_SIZE_BYTES}" -gt 10000000 ]]; then
>&2 echo 'Bundle size is larger than 10mb.'
exit 1
fi

Expand Down

0 comments on commit 50e7e58

Please sign in to comment.