forked from elastic/eui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major version dependency upgrades, pt. III; Docker bonus (elastic#4062)
* version updates * remove visual regression test setup * core-js changes * yarn.lock * clean up * use eui/puppeteer image on elastic registry; docs * use the correct name; update docs * clean up * pin docker image to node 10.22.1 * update CL
- Loading branch information
Showing
27 changed files
with
1,106 additions
and
1,991 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Derived from the zenato/puppeteer Docker image | ||
# https://github.com/zenato/docker-puppeteer/blob/master/Dockerfile | ||
|
||
# >=10.18 required | ||
FROM node:10.22.1 | ||
|
||
# See https://crbug.com/795759 | ||
RUN apt-get update && apt-get install -yq libgconf-2-4 | ||
|
||
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 | ||
|
||
# Install latest chrome package. | ||
# Note: this installs the necessary libs to make the bundled version of Chromium that Pupppeteer | ||
# installs, work. | ||
RUN apt-get update && apt-get install -y wget --no-install-recommends \ | ||
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ | ||
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ | ||
&& apt-get update \ | ||
&& apt-get install -y google-chrome-stable \ | ||
--no-install-recommends \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& apt-get purge --auto-remove -y curl \ | ||
&& rm -rf /src/*.deb | ||
|
||
# Uncomment to skip the chromium download when installing puppeteer. If you do, | ||
# you'll need to launch puppeteer with: | ||
# browser.launch({executablePath: 'google-chrome-unstable'}) | ||
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true | ||
|
||
# Install puppeteer so it's available in the container. | ||
RUN yarn add puppeteer | ||
|
||
# Add puppeteer user (pptruser). | ||
RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \ | ||
&& mkdir -p /home/pptruser/Downloads \ | ||
&& chown -R pptruser:pptruser /home/pptruser \ | ||
&& chown -R pptruser:pptruser /node_modules | ||
|
||
# Run user as non privileged. | ||
USER pptruser | ||
|
||
CMD ["google-chrome-stable"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# eui/puppeteer | ||
|
||
Base Docker environment image for Puppeteer (Headless Chromium Node API) | ||
Built containers can be published to the [Elastic Docker Registry](https://container-library.elastic.co) for use locally or in CI environments. | ||
|
||
## Getting started | ||
|
||
### `test-docker` script | ||
The [`test-docker`](../test-docker.js) script is the primary user of this container. Specifically, the [`a11y-testing](../a11y-testing.js) script therein uses the headless Chromium environment to run EUI's automated axe accessibility testing suite. | ||
|
||
### Generic node application | ||
Run the container by passing `node -e "<yourscript.js content as a string>"` as the command: | ||
|
||
```bash | ||
docker run -i --rm --cap-add=SYS_ADMIN \ | ||
--name puppeteer-chrome eui/puppeteer \ | ||
node -e "`cat yourscript.js`" | ||
``` | ||
|
||
## Using with the Elastic Container Library | ||
|
||
To start, you'll need to setup a local Docker environment. See [Docker's "Get started" guide](https://docs-stage.docker.com/get-started/) for instructions. | ||
|
||
[View the current image state](https://container-library.elastic.co/r/eui) in the registry. | ||
|
||
[View general information on Accessing the Docker registry](https://github.com/elastic/infra/blob/master/docs/container-registry/accessing-the-docker-registry.md) | ||
|
||
### Build a new image | ||
|
||
From this directory: | ||
|
||
```bash | ||
docker build [--no-cache] [--tag your_tag] . | ||
``` | ||
|
||
* Use the `--no-cache` option if attempting the upgrade environment installations, like `node.js`, for instance. | ||
* Use the `--tag` option to give the image a reference name. Helpful if you plan on running the image locally (see next step). | ||
|
||
### Test a new image locally | ||
|
||
To run the [`test-docker`](../test-docker.js) script with the new image locally, you'll need to replace the image name line in the `docker run ...` command (`docker.elastic.co/eui/puppeteer:latest`) with the new image ID or tag name (if set during the build with `--tag`). | ||
|
||
### Publish a built image | ||
|
||
Authentication and membership of the `eui-design` team on GitHub is required: | ||
|
||
* You can login at [https://docker-auth.elastic.co](https://docker-auth.elastic.co) using GitHub OAuth to sign in. | ||
* This will give you a login command that you can run locally to connect to the registry, like: | ||
|
||
```bash | ||
docker login -u thompsongl -p supersecret docker.elastic.co | ||
``` | ||
|
||
Then tag the built image as `latest`, first grabbing the image ID using `docker images`: | ||
|
||
```bash | ||
docker tag IMAGE_ID docker.elastic.co/eui/puppeteer:latest | ||
``` | ||
|
||
```bash | ||
docker push docker.elastic.co/eui/puppeteer | ||
``` | ||
|
||
### Use a published image | ||
|
||
Note that authentication is not required. | ||
|
||
```bash | ||
docker pull docker.elastic.co/eui/puppeteer:latest | ||
|
||
docker run [...] | ||
``` | ||
|
||
See the [`test-docker`](../test-docker.js) script as an example. |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
|
||
jest.mock('./../../../src/components/icon', () => { | ||
const { EuiIcon } = require('./../../../src/components/icon/icon.testenv'); | ||
return { EuiIcon } | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.