app: use passt from PATH #20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: AppBuild | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| paths-ignore: | |
| - '.github/workflows/vm-image.yml' | |
| workflow_dispatch: | |
| jobs: | |
| build-ui: | |
| runs-on: ubuntu-latest | |
| container: debian:trixie | |
| steps: | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| - name: Install deps | |
| run: | | |
| apt-get update | |
| apt-get install -y libgtk-4-dev libadwaita-1-dev cargo build-essential | |
| - name: Build | |
| run: | | |
| cd bubbles-app/ | |
| cargo build --release | |
| - name: 'Upload Artifact' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bubbles | |
| path: bubbles-app/target/release/bubbles | |
| retention-days: 1 | |
| build-crosvm: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout crosvm | |
| uses: actions/[email protected] | |
| with: | |
| repository: google/crosvm | |
| ref: b2cf2fba8bf240bc09cc396fdd677d853b158a62 | |
| - name: Apply passt patch (only fits into old crosvm revision) | |
| run: | | |
| git apply - <<EOF | |
| diff --git a/devices/src/virtio/vhost_user_frontend/mod.rs b/devices/src/virtio/vhost_user_frontend/mod.rs | |
| index 1f847409e..8d6b5e646 100644 | |
| --- a/devices/src/virtio/vhost_user_frontend/mod.rs | |
| +++ b/devices/src/virtio/vhost_user_frontend/mod.rs | |
| @@ -26,6 +26,7 @@ use base::RawDescriptor; | |
| use base::WorkerThread; | |
| use snapshot::AnySnapshot; | |
| use sync::Mutex; | |
| +use virtio_sys::virtio_config::VIRTIO_F_VERSION_1; | |
| use vm_memory::GuestMemory; | |
| use vmm_vhost::message::VhostUserConfigFlags; | |
| use vmm_vhost::message::VhostUserMigrationPhase; | |
| @@ -178,9 +179,9 @@ impl VhostUserFrontend { | |
| if avail_features & 1 << VHOST_USER_F_PROTOCOL_FEATURES != 0 { | |
| // The vhost-user backend supports VHOST_USER_F_PROTOCOL_FEATURES; enable it. | |
| backend_client | |
| - .set_features(1 << VHOST_USER_F_PROTOCOL_FEATURES) | |
| + .set_features(1 << VHOST_USER_F_PROTOCOL_FEATURES | 1 << VIRTIO_F_VERSION_1) | |
| .map_err(Error::SetFeatures)?; | |
| - acked_features |= 1 << VHOST_USER_F_PROTOCOL_FEATURES; | |
| + acked_features |= 1 << VHOST_USER_F_PROTOCOL_FEATURES | 1 << VIRTIO_F_VERSION_1; | |
| let avail_protocol_features = backend_client | |
| .get_protocol_features() | |
| EOF | |
| - name: 'Apply display patch (derived from https://gitlab.com/talex5/crosvm/-/commit/2e71ed5243ff1e484b6cb14c515805ed69b8ece2)' | |
| run: | | |
| git apply - <<EOF | |
| diff --git a/src/crosvm/sys/linux/gpu.rs b/src/crosvm/sys/linux/gpu.rs | |
| index 7bb3ff7af..7eba55ee7 100644 | |
| --- a/src/crosvm/sys/linux/gpu.rs | |
| +++ b/src/crosvm/sys/linux/gpu.rs | |
| @@ -125,7 +125,6 @@ pub fn create_gpu_device( | |
| gpu_params.allow_implicit_render_server_exec && !is_sandboxed; | |
| let mut display_backends = vec![ | |
| - virtio::DisplayBackend::X(cfg.x_display.clone()), | |
| virtio::DisplayBackend::Stub, | |
| ]; | |
| @@ -134,14 +133,6 @@ pub fn create_gpu_device( | |
| display_backends.insert(0, virtio::DisplayBackend::Android(service_name.to_string())); | |
| } | |
| - // Use the unnamed socket for GPU display screens. | |
| - if let Some(socket_path) = cfg.wayland_socket_paths.get("") { | |
| - display_backends.insert( | |
| - 0, | |
| - virtio::DisplayBackend::Wayland(Some(socket_path.to_owned())), | |
| - ); | |
| - } | |
| - | |
| let dev = virtio::Gpu::new( | |
| exit_evt_wrtube | |
| .try_clone() | |
| EOF | |
| - name: 'Apply CopyPaste patch (from https://gitlab.com/talex5/crosvm/-/commit/cc29efcc00afe3c3097c567d7003d5b072f92e60)' | |
| run: | | |
| git apply - <<EOF | |
| diff --git a/rutabaga_gfx/src/cross_domain/mod.rs b/rutabaga_gfx/src/cross_domain/mod.rs | |
| index a35bf6425f0b4581426ad7d9eeda7341873e2811..56c6b72826eb059d9cd9ee225ded0deb9fd8abd3 100644 | |
| --- a/rutabaga_gfx/src/cross_domain/mod.rs | |
| +++ b/rutabaga_gfx/src/cross_domain/mod.rs | |
| @@ -344,7 +344,7 @@ impl CrossDomainWorker { | |
| ) | |
| } | |
| Ok(DescriptorType::WritePipe) => { | |
| - *identifier_type = CROSS_DOMAIN_ID_TYPE_VIRTGPU_BLOB; | |
| + *identifier_type = CROSS_DOMAIN_ID_TYPE_WRITE_PIPE; | |
| add_item( | |
| &self.item_state, | |
| CrossDomainItem::WaylandWritePipe(WritePipe::new( | |
| EOF | |
| - name: Build crosvm | |
| run: | | |
| sudo apt-get update | |
| git submodule update --init && tools/deps/install-x86_64-debs | |
| cargo build --release | |
| - name: 'Upload Artifact' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: crosvm | |
| path: target/release/crosvm | |
| retention-days: 1 | |
| build-dist: | |
| needs: | |
| - build-crosvm | |
| - build-ui | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| - name: Download bubbles and crosvm | |
| uses: actions/download-artifact@v5 | |
| with: | |
| path: binaries | |
| merge-multiple: true | |
| - name: chmod binaries | |
| run: | | |
| chmod +x binaries/* | |
| - run: | | |
| cat > Dockerfile <<EOF | |
| FROM debian:trixie | |
| RUN apt-get update && apt-get install -y libgtk-4-dev libadwaita-1-dev socat oras | |
| RUN mkdir -p /runtime_libs && cd /usr/lib/x86_64-linux-gnu && cp libadwaita-1.so libgtk-4.so libwrap.so.0 /runtime_libs | |
| FROM busybox | |
| WORKDIR /opt/artifacts | |
| COPY --from=0 /runtime_libs runtime_libs | |
| WORKDIR /opt/artifacts/bin | |
| COPY binaries/crosvm . | |
| COPY binaries/bubbles . | |
| COPY --from=0 /usr/bin/socat1 ./socat | |
| COPY --from=0 /usr/bin/oras . | |
| COPY ./bubbles-app/scripts /opt/artifacts/scripts | |
| VOLUME ["/output"] | |
| ENTRYPOINT ["/bin/sh", "-c"] | |
| CMD ["cp /opt/artifacts/bin/* /output && cp -r /opt/artifacts/runtime_libs /output && cp -r /opt/artifacts/scripts /output"] | |
| EOF | |
| - name: Log into registry | |
| uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| run: | | |
| docker build -t "ghcr.io/${{ github.repository }}/bubbles:${{ github.sha }}" . | |
| docker push "ghcr.io/${{ github.repository }}/bubbles:${{ github.sha }}" |