Code Monkey home page Code Monkey logo

setup-headless-display-action's Introduction

๐Ÿ“บ Setup Headless Display Action

Setup a headless display on Linux and Windows (not needed on MacOS)

- name: Setup headless display
  uses: pyvista/setup-headless-display-action@v2

๐Ÿš€ Usage

name: Tests that require virtual display

on:
  pull_request:
  workflow_dispatch:
  push:
    tags:
      - "*"
    branches:
      - main

jobs:
  test:
    strategy:
      matrix:
        os: [macos-latest, ubuntu-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Setup headless display
        uses: pyvista/setup-headless-display-action@v2

Options

  • qt (default false): set to true to install libraries required for Qt on Linux, e.g.:
        - uses: pyvista/setup-headless-display-action@v2
          with:
            qt: true
  • pyvista (default true): set to false if you don't want to set env vars to use PyVista in offscreen mode.

๐Ÿ–ผ๏ธ PyVista Example

name: Workflow that uses PyVista for plotting

on:
  pull_request:
  workflow_dispatch:
  push:
    tags:
      - "*"
    branches:
      - main

jobs:
  test:
    strategy:
      matrix:
        os: [macos-latest, ubuntu-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup headless display
        uses: pyvista/setup-headless-display-action@v2

      - name: Setup Python
        uses: actions/setup-python@v1
        with:
          python-version: 3.9

      - name: Install PyVista
        run: pip install pyvista

      - name: Use PyVista
        run: python -c "import pyvista;pyvista.Sphere().plot(screenshot='${{ matrix.os }}-sphere.png')"

      - uses: actions/upload-artifact@v2
        with:
          name: sphere
          path: ${{ matrix.os }}-sphere.png

setup-headless-display-action's People

Contributors

banesullivan avatar larsoner avatar tlambert03 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

setup-headless-display-action's Issues

Missing GL version error on docker windows container while running pyvista

Hi,

I am trying to build a docker image based on windows container (mcr.microsoft.com/windows:20H2) to run on it a python project, and I am getting issues running pyvista in the built container. In fact I have used this repository script to set up OpenGL related features like headless displays in my windows container, but when trying to run tests involving Pyvista I am getting windows fatal exception error which I think it is related to this below :
image

Here the pyvista report about the windows container:

Date: Tue May 10 11:17:18 2022 Paris, Madrid (heure dโ€™รฉtรฉ)

            OS : Windows
        CPU(s) : 2
       Machine : AMD64
  Architecture : 64bit
   Environment : Python
   GPU Details : error

Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit
(AMD64)]

       pyvista : 0.34.1
           vtk : 9.0.3
         numpy : 1.22.3
       imageio : 2.19.0
       appdirs : 1.4.4
        scooby : 0.5.12
    matplotlib : 3.5.1
     pyvistaqt : 0.5.0
         PyQt5 : 5.15.6
         scipy : 1.8.0
        meshio : 5.3.4

Docker version 20.10.14, build a224086.

Thank you,

Update OSMesa on Windows

The current version of OSMesa on windows used here is mesa-10.2.4-1 which is 8+ years old and has all kinds of issues rendering which show up in PyVista's image regression tests, for example:

unnamed

This old version of Mesa is coming from @vispy's https://github.com/vispy/demo-data/raw/main/mesa/ (cc @larsoner)

I've started drafting a PR in #4 to add a DLL directly to this action to use but I don't know anything about PowerShell and windows so this is taking me a bit to debug.

Opening this issue to track the fact that we need to and are updating the OSMesa DLL for windows and to have a broader conversation to see if @vispy wants to update their OSMesa version

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.