Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull xvfb code from vscode CI #6

Open
mrakitin opened this issue Sep 24, 2019 · 12 comments
Open

Pull xvfb code from vscode CI #6

mrakitin opened this issue Sep 24, 2019 · 12 comments

Comments

@mrakitin
Copy link
Member

https://github.com/microsoft/vscode/blob/ab99fbebf87c30a65d2e1152ce63afb587160a57/build/azure-pipelines/linux/continuous-build-linux.yml#L2-L9

- script: |
    set -e
    sudo apt-get update
    sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0
    sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
    sudo chmod +x /etc/init.d/xvfb
    sudo update-rc.d xvfb defaults
    sudo service xvfb start
@klauer
Copy link

klauer commented Sep 24, 2019

@mrakitin
Copy link
Member Author

Thanks for keeping an eye on the NSLS-II kitchen, @klauer!

We are already doing this:

# Start Xvfb
# (from https://developercommunity.visualstudio.com/content/problem/336288/headless-testing-using-xvfb-on-hosted-ubuntu-1604.html)
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
export DISPLAY=:99

However, I am not quite happy I have to do it in the same step as the test itself. I'd rather prefer to start it along with mongodb:

sudo systemctl start mongodb && sudo systemctl status mongodb

but it fails to propagate to the next steps. Maybe I just need to set the DISPLAY env var: https://github.com/slaclab/pydm/blob/ea20288ba0d9a1a2022ffd33416e7b4a93bef259/azure-test-template.yml#L113-L114...

@klauer
Copy link

klauer commented Sep 24, 2019

@mrakitin I see 😄

(I think @hhslepicka could benefit from what you decide on, so I'll ping him here.)

@hhslepicka
Copy link

You just need to set the environment for the display when you run the tests...
Check here: https://github.com/slaclab/pydm/blob/master/azure-test-template.yml#L113-L114

The export there will never work as the steps for a Azure CI job are executed in a separated shell instance.

@mrakitin
Copy link
Member Author

Thanks @hhslepicka! Yes, I was burned by that at some point, but it makes sense. I'll test it using your example.

@hhslepicka
Copy link

@mrakitin it is working fine for me for a couple of months now...
Also, please not that if you are relying on events, such as focus and others, you will need a window manager.... in this case I would recommend the herbstluftwm... it is lightweight and will get you going.
Here is how I start it at my job: https://github.com/slaclab/pydm/blob/master/azure-test-template.yml#L45-L51

@mrakitin
Copy link
Member Author

Neat, thanks for the suggestions, @hhslepicka! I think we are a bit far from clicking in CI, but medium- to long-term we will need that.

A side note: herbstluftwm is pretty unspellable!

@mrakitin
Copy link
Member Author

@hhslepicka, are you still using herbstluftwm, or have you switched to something else?

@hhslepicka
Copy link

@mrakitin I still use that for PyDM but for some internal tasks (Youtube Streaming) I switched to using fluxbox which is smaller than herbstluftwm.

@mrakitin
Copy link
Member Author

mrakitin commented Mar 24, 2021

Thanks, @hhslepicka! I'll post the link you previously shared with me regarding the Youtube streaming - https://github.com/hhslepicka/docker-streaming (so I don't forget). Do you mind sharing how you use fluxbox (http://fluxbox.org)? Thank you.

@hhslepicka
Copy link

@mrakitin here is basically what I do:

# Create the Xvfb
Xvfb :101 -screen 0 1920x1080x24 -ac +extension GLX +render -noreset &
# Run fluxbox on this new display
DISPLAY=:101.0 /usr/bin/fluxbox &
DISPLAY=:101 ./start_ui &

Very similar to how Herbstluftwm is used.

@mrakitin
Copy link
Member Author

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants