Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

fix(images): resolve released cua-spacesd and bump the Chromium pin (#4434)

ddupont6f63ca32a902
diff --git a/.github/workflows/cd-image-linux.yml b/.github/workflows/cd-image-linux.yml
index 231df11ffc..054c64f778 100644
--- a/.github/workflows/cd-image-linux.yml
+++ b/.github/workflows/cd-image-linux.yml
@@ -128,9 +128,12 @@ jobs:
stamp: ${{ steps.meta.outputs.stamp }}
publish: ${{ steps.meta.outputs.publish }}
spacesd_source: ${{ steps.meta.outputs.spacesd_source }}
+ spacesd_version: ${{ steps.meta.outputs.spacesd_version }}
steps:
- id: meta
env:
+ GH_TOKEN: ${{ github.token }}
+ INPUT_VERSION: ${{ inputs.spacesd_version }}
EVENT: ${{ github.event_name }}
REF: ${{ github.ref }}
SHA: ${{ github.event.pull_request.head.sha || github.sha }}
@@ -158,12 +161,31 @@ jobs:
if [ "$publish" = true ] && [ "$source" = none ]; then
echo "::error::spacesd_source=none cannot be published"; exit 1
fi
+ # source=release: pin one published cua-spacesd release. `latest` is the
+ # newest cua-spacesd-v* release that is neither a draft nor a
+ # prerelease (GitHub's own "latest" is repo-wide, so not usable).
+ version="${INPUT_VERSION:-latest}"
+ version="${version#cua-spacesd-v}"; version="${version#v}"
+ if [ "$source" = release ]; then
+ if [ "$version" = latest ]; then
+ version="$(gh api "repos/$GITHUB_REPOSITORY/releases?per_page=100" \
+ --jq '[.[] | select(.draft == false and .prerelease == false and (.tag_name | startswith("cua-spacesd-v")))][0].tag_name // ""')"
+ version="${version#cua-spacesd-v}"
+ [ -n "$version" ] || { echo "::error::no published cua-spacesd-v* release"; exit 1; }
+ fi
+ for arch in x86_64 aarch64; do
+ gh release view "cua-spacesd-v$version" -R "$GITHUB_REPOSITORY" --json assets \
+ --jq '.assets[].name' | grep -qx "cua-spacesd-linux-$arch.tar.gz" \
+ || { echo "::error::cua-spacesd-v$version has no cua-spacesd-linux-$arch.tar.gz"; exit 1; }
+ done
+ fi
{
# The per-arch children's tag: dated, so immutable once pushed.
echo "tag=build-$stamp"
echo "stamp=$stamp"
echo "publish=$publish"
echo "spacesd_source=$source"
+ echo "spacesd_version=$version"
} | tee -a "$GITHUB_OUTPUT"
spacesd:
@@ -241,7 +263,7 @@ jobs:
TIER: ${{ matrix.tier }}
STAMP: ${{ needs.meta.outputs.stamp }}
SPACESD_SOURCE: ${{ needs.meta.outputs.spacesd_source }}
- SPACESD_VERSION: ${{ inputs.spacesd_version || 'latest' }}
+ SPACESD_VERSION: ${{ needs.meta.outputs.spacesd_version }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Fetch cua-spacesd
@@ -262,8 +284,15 @@ jobs:
scripts/images/install-release-tools.sh --free-disk
- name: cua images release (build, gates, stage)
run: |
+ # prepare only builds cua-spacesd from source: skip it unless the
+ # image takes that build (the Dockerfile still bind-mounts dist/).
+ steps=prepare,build,gate,stage
+ if [ "$SPACESD_SOURCE" != local ]; then
+ steps=build,gate,stage
+ mkdir -p "$IMAGE_DIR/dist"
+ fi
cua images release "$IMAGE_DIR" --tier "$TIER" --arch "$ARCH" --stamp "$STAMP" --work release \
- --steps prepare,build,gate,stage \
+ --steps "$steps" \
--var "spacesd_source=$SPACESD_SOURCE" --var "spacesd_version=$SPACESD_VERSION"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
diff --git a/libs/images/linux/Dockerfile b/libs/images/linux/Dockerfile
index b485a0e5c1..35b800bb29 100644
--- a/libs/images/linux/Dockerfile
+++ b/libs/images/linux/Dockerfile
@@ -106,8 +106,8 @@ RUN install -d -m 0755 /etc/apt/keyrings
# Per-arch pins: the PPA keeps only its newest build per arch, and the
# arches do not always move together. CHROMIUM_VERSION, when set, wins.
ARG CHROMIUM_VERSION=
-ARG CHROMIUM_VERSION_AMD64=154.0.8037.57-1xtradeb1.2404.1
-ARG CHROMIUM_VERSION_ARM64=154.0.8037.57-1xtradeb1.2404.1
+ARG CHROMIUM_VERSION_AMD64=154.0.8037.92-1xtradeb1.2404.1
+ARG CHROMIUM_VERSION_ARM64=154.0.8037.92-1xtradeb1.2404.1
ARG CHROMIUM_PPA_KEY=5301FA4FD93244FBC6F6149982BB6851C64F6880
RUN curl -fsSL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x${CHROMIUM_PPA_KEY}" \
| gpg --dearmor >/etc/apt/keyrings/xtradeb-apps.gpg \
@@ -161,10 +161,21 @@ RUN --mount=type=bind,source=linux/dist,target=/dist \
install -m 0755 "$src" "$bin" ;; \
release) \
case "$TARGETARCH" in amd64) arch=x86_64 ;; arm64) arch=aarch64 ;; *) arch="$TARGETARCH" ;; esac; \
+ CUA_SPACESD_VERSION="${CUA_SPACESD_VERSION#cua-spacesd-v}"; CUA_SPACESD_VERSION="${CUA_SPACESD_VERSION#v}"; \
+ if [ "$CUA_SPACESD_VERSION" = latest ]; then \
+ CUA_SPACESD_VERSION="$(curl -fsSL 'https://api.github.com/repos/trycua/cua/releases?per_page=100' \
+ | python3 -c 'import json,sys; print(next(r["tag_name"][len("cua-spacesd-v"):] for r in json.load(sys.stdin) if r["tag_name"].startswith("cua-spacesd-v") and not r["draft"] and not r["prerelease"]))')"; \
+ echo "latest cua-spacesd release: $CUA_SPACESD_VERSION"; \
+ fi; \
url="$(echo "$CUA_SPACESD_RELEASE_URL" | sed "s/{version}/$CUA_SPACESD_VERSION/g; s/{arch}/$arch/g")"; \
echo "fetching $url"; \
- curl -fsSL "$url" | tar -xz -C /usr/local/bin cua-spacesd; \
- chmod 0755 "$bin" ;; \
+ curl -fsSL -o /tmp/cua-spacesd.tar.gz "$url"; \
+ sum="$(curl -fsSL "$url.sha256" | cut -d' ' -f1)"; \
+ echo "$sum /tmp/cua-spacesd.tar.gz" | sha256sum -c -; \
+ tar -xzf /tmp/cua-spacesd.tar.gz -C /usr/local/bin cua-spacesd; \
+ rm /tmp/cua-spacesd.tar.gz; \
+ chmod 0755 "$bin"; \
+ echo "$CUA_SPACESD_VERSION" >/tmp/cua-spacesd-version ;; \
none) echo "building without cua-spacesd" ;; \
*) echo "unknown CUA_SPACESD_SOURCE=$CUA_SPACESD_SOURCE" >&2; exit 1 ;; \
esac; \
@@ -175,6 +186,7 @@ RUN --mount=type=bind,source=linux/dist,target=/dist \
fi; \
mkdir -p /etc/cua-image; \
echo "$CUA_SPACESD_SOURCE" >/etc/cua-image/spacesd-source; \
+ if [ -f /tmp/cua-spacesd-version ]; then mv /tmp/cua-spacesd-version /etc/cua-image/spacesd-release; fi; \
ln -s spacesd-source /etc/cua-image/env-driver-source; \
ln -s spacesd-source /etc/cua-image/guestd-source