workspace-images icon indicating copy to clipboard operation
workspace-images copied to clipboard

Refactor installation of Chrome on the VNC image

Open gengjiawen opened this issue 2 years ago β€’ 23 comments

Description

I feel really unconveninent without it in full image. I checked the size, it's only around 130m increase. It should be in full in the long run. This will make frontend e2e testing like cypress and Puppeteer more out of the box. Also benefit for development like qt, jetbrains plugin development, gitbook generating.

context: https://github.com/gitpod-io/workspace-images/pull/471/

Related Issue(s)

Fixes #

How to test

Release Notes

Documentation

gengjiawen avatar Aug 04 '22 03:08 gengjiawen

gitpod-io[bot] avatar Aug 04 '22 03:08 gitpod-io[bot]

gitpod-staging[bot] avatar Aug 04 '22 03:08 gitpod-staging[bot]

Hi @gengjiawen, just curious, whats the usecase? Headless chrome? Puppeteer?

Another thing, we're also installing and configuring chrome on the tool-vnc chunk. I think it would be beneficial to decouple it from there into tool-chrome and add tool-chrome as a chunk for the tool-vnc combination. Would probably reduce the dazzle build time a lot.

axonasif avatar Aug 04 '22 08:08 axonasif

Hi @gengjiawen, just curious, whats the usecase? Headless chrome? Puppeteer?

Mostly frontend e2e testing like cypress and Puppeteer. Recently wasm (wasm-bindgen pretty lame on testing). Another usecase is that ebook generating, in my case, gitbook.

gengjiawen avatar Aug 04 '22 08:08 gengjiawen

Thanks for taking the step forward for the new change, but I think it's not exactly what I was talking about. Perhaps my message was a bit unclear, will try to collaborate with you on this one πŸ™

axonasif avatar Aug 04 '22 15:08 axonasif

I think it would be beneficial to decouple it from there into tool-chrome and add tool-chrome as a chunk for the tool-vnc combination.

You mean this part ? I am not familiar with dazzle tbh. Feel free to push any changes you like.

gengjiawen avatar Aug 05 '22 03:08 gengjiawen

ping @axonasif

gengjiawen avatar Aug 09 '22 06:08 gengjiawen

Hey @gengjiawen, thanks a lot for your patience, could you please toggle on Allow edits from maintainers on your PR right-side-bar? I want to push some commits into your branch.

axonasif avatar Aug 16 '22 08:08 axonasif

Hey @gengjiawen, thanks a lot for your patience, could you please toggle on Allow edits from maintainers on your PR right-side-bar? I want to push some commits into your branch.

I already checked last week. Maybe something wrong on your side ? image

gengjiawen avatar Aug 16 '22 08:08 gengjiawen

Thank you for the contribution @gengjiawen! πŸŽ‰

Could you share a bit more about why you think this should be included? πŸ™ I'm concerned that the full image is already very big and that not a lot of users would actually use it.

atduarte avatar Aug 16 '22 08:08 atduarte

Thank you for the contribution @gengjiawen! πŸŽ‰

Could you share a bit more about why you think this should be included? πŸ™ I'm concerned that the full image is already very big and that not a lot of users would actually use it.

I update pr description with more info.

gengjiawen avatar Aug 16 '22 08:08 gengjiawen

Hey @gengjiawen, thanks a lot for your patience, could you please toggle on Allow edits from maintainers on your PR right-side-bar? I want to push some commits into your branch.

I already checked last week. Maybe something wrong on your side ? image

my https://gitpod.io/integrations > github was somehow reset, weird πŸ˜… commits are pushed now.

axonasif avatar Aug 16 '22 09:08 axonasif

@axonasif CI passed. Can you merge this ? thx.

gengjiawen avatar Aug 17 '22 09:08 gengjiawen

@gengjiawen as also mentioned previously by @kylos101 [1], we are not convinced that workspace-full should also contain chrome given it's size.

I think it's a balance, and it's worth it. With all due respect It's much more useful and make basic function out of the box. It's just make gitpod more intuitive.

And for size, in my humble experience, this is more deserve it in full than closure or nginx.

gengjiawen avatar Aug 17 '22 11:08 gengjiawen

I understand your point of view. Currently we are very wary of increasing the size of the image and do so only if really needed as it negatively impacts workspace startup times for all, and we can't really remove langs/tools later as we risk breaking users' workspaces.

The image is already at 7.1GB, chrome would actually add 648MB to it. πŸ˜₯

image

atduarte avatar Aug 17 '22 12:08 atduarte

Hey @gengjiawen, since our workspace team suggests that we may not add chrome to the full image, you could utilize the dotfiles feature πŸš€

In your dotfiles install.sh, you could have this (I basically copy pasted from the chrome dockerfile):

#!/usr/bin/env bash

(
    cd /tmp && glink="https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" \
	    && wget -q "$glink" \
	    && sudo install-packages libasound2-dev libgtk-3-dev libnss3-dev \
	    fonts-noto fonts-noto-cjk ./"${glink##*/}" \
	    && ln -srf /usr/bin/google-chrome /usr/bin/chromium \
	    && t="$HOME/.config/google-chrome/First Run" && sudo -u gitpod mkdir -p "${t%/*}" && sudo -u gitpod touch "$t" \
	    && t="/etc/opt/chrome/policies/managed/managed_policies.json" && mkdir -p "${t%/*}" && printf '{ "%s": %s }\n' DefaultBrowserSettingEnabled false > "$t"
) & disown

echo "export QTWEBENGINE_DISABLE_SANDBOX=1" >> $HOME/.bashrc

This will install chrome for each of your personal workspaces πŸ˜„

Or if you need an even more concrete solution, you can use image: gitpod/workspace-full-vnc:latest on your .gitpod.yml for appropriate projects. For example, even our website project follows the same pattern: https://github.com/gitpod-io/website/blob/main/.gitpod.Dockerfile

axonasif avatar Aug 17 '22 13:08 axonasif

I understand your point of view. Currently we are very wary of increasing the size of the image and do so only if really needed as it negatively impacts workspace startup times for all, and we can't really remove langs/tools later as we risk breaking users' workspaces.

The image is already at 7.1GB, chrome would actually add 648MB to it. πŸ˜₯

image

Thx for this detailed info, I take a bit of more into this, looks like chrome is only 300mb, the other 300m is mainly font (electron likely to use, this can keep only in vnc)

Is 300mb acceptable for full ?

gengjiawen avatar Aug 19 '22 06:08 gengjiawen

@axonasif I removed chrome from full, I think it is still worth it in tool-vnc.

gengjiawen avatar Sep 16 '22 06:09 gengjiawen

@axonasif Can you merge this ?

gengjiawen avatar Sep 22 '22 06:09 gengjiawen

Changed the title to be more inline with what the code is now doing. Does it make sense to you?

atduarte avatar Sep 22 '22 12:09 atduarte

Changed the title to be more inline with what the code is now doing. Does it make sense to you?

More like β€œRefactor install chrome on vnc”

gengjiawen avatar Sep 22 '22 13:09 gengjiawen

hi @gengjiawen and thank you for this and all you past contributions! We just noticed that we don't have a singed CLA from you on file yet. Would you mind signing this CLA via this DocuSign form? If there are any questions, you can reach me via [email protected].

meysholdt avatar Sep 22 '22 14:09 meysholdt

hi @gengjiawen and thank you for this and all you past contributions! We just noticed that we don't have a singed CLA from you on file yet. Would you mind signing this CLA via this DocuSign form? If there are any questions, you can reach me via [email protected].

done. But the process is so verbose. I hope you can adopt solution like facebook cla or google cla, which is clean and fast.

gengjiawen avatar Sep 23 '22 02:09 gengjiawen

Can anyone merge this ? thx.

gengjiawen avatar Sep 26 '22 02:09 gengjiawen

:wave: @gengjiawen @axonasif this should be live now :smile:

kylos101 avatar Oct 05 '22 17:10 kylos101