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

Installation on Hosted VSTS Agent too slow #3

Open
vicioussn opened this issue Jun 22, 2018 · 10 comments
Open

Installation on Hosted VSTS Agent too slow #3

vicioussn opened this issue Jun 22, 2018 · 10 comments

Comments

@vicioussn
Copy link

Hello,

Installation of Chromium on Hosted VSTS Agent too slow - about 15 minutes. Is there's something we can do?

Thanks in advance.

@helgejfo
Copy link
Collaborator

Hi, we actually moved away from using this extension to run the tests in a docker image with Chromium installed instead. You can use a docker file similar to this:

FROM node:10.1.0-alpine
RUN apk add --no-cache make gcc g++ python xvfb udev ttf-freefont chromium

COPY . /app
WORKDIR /app

RUN npm install

ENV DISPLAY=:99
ENV CHROME_BIN=/usr/bin/chromium-browser
RUN Xvfb :99 -ac -screen 0 1280x720x16 -nolisten tcp &
RUN npm run test

If you are using Karma for running the tests, the browser should be set up like this:

    customLaunchers: {
      ChromeNoSandbox: {
        base: 'ChromiumHeadless',
        flags: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-translate', '--disable-extensions']
      }
    }

This runs in about 3-4 minutes depending on the speed of npm install and your tests. You can also use this docker image as the first stage to produce a second one which runs your application, or extract the produced result to avoid building/installing twice.

@sandorfr
Copy link
Contributor

sandorfr commented Jun 30, 2018

It's due to Invoke-Request progress bar (see this thread for more info).

I submitted a PR for this issue. On my own fork I'm down to ~30seconds to get it installed. I can share my forked extension if someone needs it until it's merged,

@helgejfo
Copy link
Collaborator

Thanks for the PR @sandorfr, much appreciated.

@sandorfr
Copy link
Contributor

sandorfr commented Jul 1, 2018

Will you have a chance to publish soon ?

@helgejfo
Copy link
Collaborator

helgejfo commented Jul 1, 2018

The PAT in our release to publish to our marketplace has expired, waiting for it to be renewed by someone with the right permissions.

@sandorfr
Copy link
Contributor

sandorfr commented Jul 1, 2018 via email

@helgejfo
Copy link
Collaborator

helgejfo commented Jul 2, 2018

I got a new PAT, but the marketplace wont allow me to update the extension. I am on vacation for the next three weeks with limited internet access and wont have a chance to fix this until I get back. Hope that is OK.

@jessehouwing
Copy link

Also note that Chrome is pre-installed on the VSTS Hosted Agent. Just setting an environment variable will make things even faster:

image

If Chromium isn't detected automatically, add the chromium.bin variable and point it to chrome.exe.

@helgejfo
Copy link
Collaborator

Indeed it is, thanks for letting us know @jessehouwing. I guess we can close this issue then @sandorfr? As it makes this extension more or less obsolete.

@sandorfr
Copy link
Contributor

Yes I don't need it for my personal use case anymore. However, It would be gould to fix it for people still using it. Also, for users using on premises agent who might not have chrome preinstalled it is still valuable.

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

4 participants