Dockerfile: Add Dolos and Labstation code to the image.
There is a move to get labstation specific code out of servod and
into labstation on code. The first phase is usb hub power cycling.
The code has already been moved and tested on labstation.
Dolos is to add possible future support for Dolos boxes on Satlab.
BUG=b:330576788
TEST=build local container ran doloscmd and powercycle-servo-usbhub-port
with no errors observed.
Change-Id: Ic7322b46e02210fcaf2614ba6765dda3831271d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/xolabs-common-core/+/5833976
Tested-by: Keith Haddow <haddowk@chromium.org>
Auto-Submit: Keith Haddow <haddowk@chromium.org>
Reviewed-by: Michal Matyjek <mmatyjek@google.com>
Commit-Queue: Michal Matyjek <mmatyjek@google.com>
Commit-Queue: Keith Haddow <haddowk@chromium.org>
diff --git a/src/dockerfiles/servod/Dockerfile b/src/dockerfiles/servod/Dockerfile
index 3e7b2fd..69d67ac 100644
--- a/src/dockerfiles/servod/Dockerfile
+++ b/src/dockerfiles/servod/Dockerfile
@@ -4,15 +4,51 @@
ARG RELEASE_TYPE=beta
+#####################################################################
+FROM python:3.11-slim-bookworm as labstationtools
+
+RUN apt-get update --no-install-recommends \
+ && apt-get install -y --no-install-recommends \
+ git
+
+WORKDIR /
+RUN git clone https://chromium.googlesource.com/chromiumos/platform/labstation
+
+WORKDIR /labstation/usb_hubs
+RUN python3 setup.py bdist_wheel
+
+#####################################################################
+FROM python:3.11-slim-bookworm as dolostools
+
+RUN apt-get update --no-install-recommends \
+ && apt-get install -y --no-install-recommends \
+ git \
+ python3-pip
+
+RUN pip3 install grpcio-tools grpcio-reflection grpcio --break-system-packages
+
+WORKDIR /
+RUN git clone https://chromium.googlesource.com/chromiumos/platform/dolos
+
+
+WORKDIR /dolos/tools/doloscmd
+RUN python3 setup.py bdist_wheel
+
+#####################################################################
+
FROM us-docker.pkg.dev/chromeos-hw-tools/servod/servod:${RELEASE_TYPE}
RUN apt-get update --no-install-recommends \
&& apt-get install -y --no-install-recommends \
+ python3-yaml \
bzip2 \
curl \
fdisk \
- uhubctl \
- python-is-python3
+ python-is-python3 \
+ python3-pip \
+ uhubctl
+
+RUN pip3 install grpcio-reflection grpcio --break-system-packages
# As part of the migration from servod supplied to package supplied uhubctl
# remove any provided install and link the package install as the power code
@@ -24,6 +60,15 @@
# container, we should not stop/start it in the case a new version is pushed.
LABEL com.centurylinklabs.watchtower.enable="false"
+# Labstation tools is where the power cycle code for pluggable and cambronix
+# hubs is checked in.
+COPY --from=labstationtools /labstation/usb_hubs/dist .
+# Dolos command tools necessary to update, reset, and audit Dolos.
+COPY --from=dolostools /dolos/tools/doloscmd/dist .
+
+RUN pip3 install *.whl --break-system-packages
+RUN rm *.whl
+
# Try to remove as much as possible to make the container smaller
RUN apt-get autoclean \
&& rm -rf /var/lib/apt/lists/*