From 3f3046a406ba99ceb18e4d44f9f64bf6549e124c Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 22 Jun 2021 16:22:03 +0200 Subject: [PATCH 1/8] dockerfiles: remove old base image --- dockerfiles/base-ci-linux/Dockerfile | 69 ---------------------------- dockerfiles/base-ci-linux/README.md | 37 --------------- 2 files changed, 106 deletions(-) delete mode 100644 dockerfiles/base-ci-linux/Dockerfile delete mode 100644 dockerfiles/base-ci-linux/README.md diff --git a/dockerfiles/base-ci-linux/Dockerfile b/dockerfiles/base-ci-linux/Dockerfile deleted file mode 100644 index 8c224b6d..00000000 --- a/dockerfiles/base-ci-linux/Dockerfile +++ /dev/null @@ -1,69 +0,0 @@ -FROM docker.io/library/debian:buster-slim - -ARG VCS_REF=master -ARG BUILD_DATE="" -ARG REGISTRY_PATH=docker.io/paritytech - -# metadata -LABEL summary="Layer 1 image with all dependencies for Rust and WASM compilation." \ - name="${REGISTRY_PATH}/base-ci-linux" \ - maintainer="devops-team@parity.io" \ - version="1.0" \ - description="libssl-dev, clang, libclang-dev, lld, cmake, make, git, pkg-config \ -curl, time, rhash, rust stable, rust nightly, sccache" \ - io.parity.image.vendor="Parity Technologies" \ - io.parity.image.source="https://github.com/paritytech/scripts/blob/${VCS_REF}/\ -dockerfiles/base-ci-linux/Dockerfile" \ - io.parity.image.documentation="https://github.com/paritytech/scripts/blob/${VCS_REF}/\ -dockerfiles/base-ci-linux/README.md" \ - io.parity.image.revision="${VCS_REF}" \ - io.parity.image.created="${BUILD_DATE}" - -WORKDIR /builds - -# config for wasm32-unknown-unknown & clang -COPY utility/base-ci-linux-config /root/.cargo/config - -ENV RUSTUP_HOME=/usr/local/rustup \ - CARGO_HOME=/usr/local/cargo \ - PATH=/usr/local/cargo/bin:$PATH \ - CC=clang \ - CXX=clang - -# install tools and dependencies -RUN set -eux; \ - apt-get -y update; \ - apt-get install -y --no-install-recommends \ - libssl-dev clang lld libclang-dev make cmake \ - git pkg-config curl time rhash ca-certificates jq; \ -# set a link to clang - update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100; \ -# install rustup, use minimum components - curl -L "https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init" \ - -o rustup-init; \ - chmod +x rustup-init; \ - ./rustup-init -y --no-modify-path --profile minimal --default-toolchain stable; \ - rm rustup-init; \ - chmod -R a+w ${RUSTUP_HOME} ${CARGO_HOME}; \ -# install sccache - # cargo install sccache --features redis; \ - # FIXME: TEMPORARY OVERRIDE due to the sccache issue - # https://github.com/mozilla/sccache/issues/663 - cargo install --git https://github.com/mozilla/sccache --rev 6628e1f70db3d583cb5e79210603ad878de3d315 --features redis; \ -# versions - rustup show; \ - cargo --version; \ -# cargo clean up -# removes compilation artifacts cargo install creates (>250M) - rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" /root/.cache/sccache; \ -# apt clean up - apt-get autoremove -y; \ - apt-get clean; \ - rm -rf /var/lib/apt/lists/*; \ -# add non-root user - groupadd -g 1000 nonroot; \ - useradd -u 1000 -g 1000 -s /bin/bash -m nonroot -# cache handler -ENV RUSTC_WRAPPER=sccache \ -# show backtraces - RUST_BACKTRACE=1 diff --git a/dockerfiles/base-ci-linux/README.md b/dockerfiles/base-ci-linux/README.md deleted file mode 100644 index dd62c771..00000000 --- a/dockerfiles/base-ci-linux/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# base-ci-linux - -Docker image based on [official Debian image](https://hub.docker.com/_/debian) debian:buster. - -Used as base for `Substrate`-based CI images. - -Our base CI image ``. - -Used to build and test Substrate-based projects. - -**Dependencies and Tools:** - -- `libssl-dev` -- `clang-7` -- `lld` -- `libclang-dev` -- `make` -- `cmake` -- `git` -- `pkg-config` -- `curl` -- `time` -- `rhash` -- `ca-certificates` - -[Click here](https://hub.docker.com/repository/docker/paritytech/base-ci-linux) for the registry. - -**Rust tools & toolchains:** - -- stable (default) -- `sccache` - -## Usage - -```Dockerfile -FROM docker.io/paritytech/base-ci-linux:latest -``` From a7e032361a1a7f9b9f269856be88d070474243b8 Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 22 Jun 2021 16:34:56 +0200 Subject: [PATCH 2/8] docs: description for the updated images --- dockerfiles/base-ci/README.md | 12 ++++++------ dockerfiles/ci-linux/README.md | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dockerfiles/base-ci/README.md b/dockerfiles/base-ci/README.md index ab87de20..ac4cb4f8 100644 --- a/dockerfiles/base-ci/README.md +++ b/dockerfiles/base-ci/README.md @@ -1,10 +1,10 @@ -# base-ci-linux +# base-ci -Docker image based on [official Debian image](https://hub.docker.com/_/debian) debian:buster. +Docker image based on [official Ubuntu 20.04 image](https://hub.docker.com/_/ubuntu) ubuntu:20.04. -Used as base for `Substrate`-based CI images. +Used as a base for our CI images. -Our base CI image ``. +Our base CI image ``. Used to build and test Substrate-based projects. @@ -24,7 +24,7 @@ Used to build and test Substrate-based projects. - `ca-certificates` - `jq` -[Click here](https://hub.docker.com/repository/docker/paritytech/base-ci-linux) for the registry. +[Click here](https://hub.docker.com/repository/docker/paritytech/base-ci) for the registry. **Rust tools & toolchains:** @@ -34,5 +34,5 @@ Used to build and test Substrate-based projects. ## Usage ```Dockerfile -FROM docker.io/paritytech/base-ci-linux:latest +FROM docker.io/paritytech/base-ci:latest ``` diff --git a/dockerfiles/ci-linux/README.md b/dockerfiles/ci-linux/README.md index e9d4f117..25a74038 100644 --- a/dockerfiles/ci-linux/README.md +++ b/dockerfiles/ci-linux/README.md @@ -1,6 +1,6 @@ # ci-linux -Docker image based on our base CI image ``. +Docker image based on our base CI image ``. Used to build and test Substrate-based projects. @@ -8,7 +8,7 @@ Used to build and test Substrate-based projects. - `chromium-driver` -**Inherited from ``:** +**Inherited from ``:** - `libssl-dev` - `clang-7` From 4b0bc4408ce6ad918cc32ca160a44e78330ae798 Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 22 Jun 2021 16:40:37 +0200 Subject: [PATCH 3/8] dockerfiles: rebase the image to base-ci:latest --- dockerfiles/ci-linux/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfiles/ci-linux/Dockerfile b/dockerfiles/ci-linux/Dockerfile index 4286aab3..aa5fe6da 100644 --- a/dockerfiles/ci-linux/Dockerfile +++ b/dockerfiles/ci-linux/Dockerfile @@ -2,13 +2,13 @@ ARG VCS_REF=master ARG BUILD_DATE="" ARG REGISTRY_PATH=docker.io/paritytech -FROM ${REGISTRY_PATH}/base-ci-linux:latest +FROM ${REGISTRY_PATH}/base-ci:latest # metadata LABEL summary="Image for Substrate-based projects." \ name="${REGISTRY_PATH}/ci-linux" \ maintainer="devops-team@parity.io" \ - version="1.0" \ + version="2.0" \ description="Inherits from base-ci-linux; chromium-driver, \ wasm-gc, wasm-bindgen-cli, wasm-pack, cargo-audit, cargo-web, cargo-deny " \ io.parity.image.vendor="Parity Technologies" \ From 49e7fb2e60bf865277e22bec19f9999a8d1561d0 Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 28 Jun 2021 15:54:39 +0200 Subject: [PATCH 4/8] dockerfiles: substitute chromedriver with geckodriver; update diener --- dockerfiles/ci-linux/Dockerfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dockerfiles/ci-linux/Dockerfile b/dockerfiles/ci-linux/Dockerfile index aa5fe6da..801a44d9 100644 --- a/dockerfiles/ci-linux/Dockerfile +++ b/dockerfiles/ci-linux/Dockerfile @@ -23,7 +23,17 @@ dockerfiles/ci-linux/README.md" \ RUN set -eux && \ apt-get -y update && \ apt-get install -y --no-install-recommends \ - chromium-driver && \ + firefox=89.0.1+build1-0ubuntu0.20.04.1 && \ +# `geckodriver` is needed to run headless browser tests +# we fetch the latest version number from the github api and use that release + curl --silent https://api.github.com/repos/mozilla/geckodriver/releases/latest | \ + egrep --only-matching 'https://github.com/mozilla/geckodriver/releases/download/v[0-9.]+/geckodriver-v[0-9.]+-linux64.tar.gz' | \ + head -n1 | \ + xargs curl -L -O && \ + tar -xvzf geckodriver-v*-linux64.tar.gz && \ + rm geckodriver-v*-linux64.tar.gz && \ + chmod +x geckodriver && \ + mv geckodriver /usr/local/bin/ && \ # install `rust-src` component for ui test rustup component add rust-src && \ # install specific Rust nightly, default is stable, use minimum components @@ -35,7 +45,7 @@ RUN set -eux && \ rustup target add wasm32-unknown-unknown --toolchain nightly && \ # install cargo tools cargo install cargo-audit cargo-web wasm-pack cargo-deny mdbook && \ - cargo install --version 0.3.2 diener && \ + cargo install --version 0.4.0 diener && \ # wasm-bindgen-cli version should match the one pinned in substrate # https://github.com/paritytech/substrate/blob/master/bin/node/browser-testing/Cargo.toml#L15 cargo install --version 0.2.73 wasm-bindgen-cli && \ From edf09077874a68d6d2f11cfe8756adcea2d6cb8e Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 28 Jun 2021 17:09:47 +0200 Subject: [PATCH 5/8] dockerfiles: remove cargo-web, cargo-audit, mdbook --- dockerfiles/ci-linux/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dockerfiles/ci-linux/Dockerfile b/dockerfiles/ci-linux/Dockerfile index 801a44d9..677d10a0 100644 --- a/dockerfiles/ci-linux/Dockerfile +++ b/dockerfiles/ci-linux/Dockerfile @@ -9,8 +9,8 @@ LABEL summary="Image for Substrate-based projects." \ name="${REGISTRY_PATH}/ci-linux" \ maintainer="devops-team@parity.io" \ version="2.0" \ - description="Inherits from base-ci-linux; chromium-driver, \ -wasm-gc, wasm-bindgen-cli, wasm-pack, cargo-audit, cargo-web, cargo-deny " \ + description="Inherits from base-ci-linux; \ +geckodriver, wasm-gc, wasm-bindgen-cli, wasm-pack, cargo-deny " \ io.parity.image.vendor="Parity Technologies" \ io.parity.image.source="https://github.com/paritytech/scripts/blob/${VCS_REF}/\ dockerfiles/ci-linux/Dockerfile" \ @@ -44,7 +44,7 @@ RUN set -eux && \ rustup target add wasm32-unknown-unknown && \ rustup target add wasm32-unknown-unknown --toolchain nightly && \ # install cargo tools - cargo install cargo-audit cargo-web wasm-pack cargo-deny mdbook && \ + cargo install wasm-pack cargo-deny && \ cargo install --version 0.4.0 diener && \ # wasm-bindgen-cli version should match the one pinned in substrate # https://github.com/paritytech/substrate/blob/master/bin/node/browser-testing/Cargo.toml#L15 From 51b1ae05ebf92fc5a90ae2ac0de6b6c507492e3f Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 28 Jun 2021 19:21:05 +0200 Subject: [PATCH 6/8] dockerfiles: edit descriptions --- dockerfiles/ci-linux/Dockerfile | 4 ++-- dockerfiles/ci-linux/README.md | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dockerfiles/ci-linux/Dockerfile b/dockerfiles/ci-linux/Dockerfile index 677d10a0..4ff99629 100644 --- a/dockerfiles/ci-linux/Dockerfile +++ b/dockerfiles/ci-linux/Dockerfile @@ -9,7 +9,7 @@ LABEL summary="Image for Substrate-based projects." \ name="${REGISTRY_PATH}/ci-linux" \ maintainer="devops-team@parity.io" \ version="2.0" \ - description="Inherits from base-ci-linux; \ + description="Inherits from paritytech/base-ci; \ geckodriver, wasm-gc, wasm-bindgen-cli, wasm-pack, cargo-deny " \ io.parity.image.vendor="Parity Technologies" \ io.parity.image.source="https://github.com/paritytech/scripts/blob/${VCS_REF}/\ @@ -27,7 +27,7 @@ RUN set -eux && \ # `geckodriver` is needed to run headless browser tests # we fetch the latest version number from the github api and use that release curl --silent https://api.github.com/repos/mozilla/geckodriver/releases/latest | \ - egrep --only-matching 'https://github.com/mozilla/geckodriver/releases/download/v[0-9.]+/geckodriver-v[0-9.]+-linux64.tar.gz' | \ + grep --only-matching -E 'https://github.com/mozilla/geckodriver/releases/download/v[0-9.]+/geckodriver-v[0-9.]+-linux64.tar.gz' | \ head -n1 | \ xargs curl -L -O && \ tar -xvzf geckodriver-v*-linux64.tar.gz && \ diff --git a/dockerfiles/ci-linux/README.md b/dockerfiles/ci-linux/README.md index 25a74038..03513411 100644 --- a/dockerfiles/ci-linux/README.md +++ b/dockerfiles/ci-linux/README.md @@ -11,7 +11,8 @@ Used to build and test Substrate-based projects. **Inherited from ``:** - `libssl-dev` -- `clang-7` +- `clang-10` +- `clang++-10` - `lld` - `libclang-dev` - `make` @@ -22,6 +23,7 @@ Used to build and test Substrate-based projects. - `time` - `rhash` - `ca-certificates` +- `jq` **Rust versions:** @@ -30,13 +32,11 @@ Used to build and test Substrate-based projects. **Rust tools & toolchains:** -- `cargo-audit` -- `cargo-web` - `sccache` - `wasm-pack` - `wasm-bindgen` +- `wasm-gc` - `cargo-deny` -- `mdbook` - `wasm32-unknown-unknown` toolchain [Click here](https://hub.docker.com/repository/docker/paritytech/ci-linux) for the registry. From c168107b3bcc3cf81bf5e7f4935eeaa9686d236b Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 28 Jun 2021 19:53:30 +0200 Subject: [PATCH 7/8] dockerfiles: any minor version is fine --- dockerfiles/ci-linux/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/ci-linux/Dockerfile b/dockerfiles/ci-linux/Dockerfile index 4ff99629..70eb3fbc 100644 --- a/dockerfiles/ci-linux/Dockerfile +++ b/dockerfiles/ci-linux/Dockerfile @@ -23,7 +23,7 @@ dockerfiles/ci-linux/README.md" \ RUN set -eux && \ apt-get -y update && \ apt-get install -y --no-install-recommends \ - firefox=89.0.1+build1-0ubuntu0.20.04.1 && \ + firefox=89.* && \ # `geckodriver` is needed to run headless browser tests # we fetch the latest version number from the github api and use that release curl --silent https://api.github.com/repos/mozilla/geckodriver/releases/latest | \ From eca589a6e30cd58f05c8b29764bf8113c226a737 Mon Sep 17 00:00:00 2001 From: Denis P Date: Wed, 8 Sep 2021 12:04:16 +0200 Subject: [PATCH 8/8] dockerfiles: remove firefox and geckodriver --- dockerfiles/ci-linux/Dockerfile | 23 +---------------------- dockerfiles/ci-linux/README.md | 3 --- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/dockerfiles/ci-linux/Dockerfile b/dockerfiles/ci-linux/Dockerfile index fe839f19..0243c61f 100644 --- a/dockerfiles/ci-linux/Dockerfile +++ b/dockerfiles/ci-linux/Dockerfile @@ -10,7 +10,7 @@ LABEL summary="Image for Substrate-based projects." \ maintainer="devops-team@parity.io" \ version="2.0" \ description="Inherits from paritytech/base-ci; \ -geckodriver, wasm-gc, wasm-bindgen-cli, wasm-pack, cargo-deny " \ +wasm-gc, wasm-bindgen-cli, wasm-pack, cargo-deny " \ io.parity.image.vendor="Parity Technologies" \ io.parity.image.source="https://github.com/paritytech/scripts/blob/${VCS_REF}/\ dockerfiles/ci-linux/Dockerfile" \ @@ -21,19 +21,6 @@ dockerfiles/ci-linux/README.md" \ # install tools and dependencies RUN set -eux && \ - apt-get -y update && \ - apt-get install -y --no-install-recommends \ - firefox=89.* && \ -# `geckodriver` is needed to run headless browser tests -# we fetch the latest version number from the github api and use that release - curl --silent https://api.github.com/repos/mozilla/geckodriver/releases/latest | \ - grep --only-matching -E 'https://github.com/mozilla/geckodriver/releases/download/v[0-9.]+/geckodriver-v[0-9.]+-linux64.tar.gz' | \ - head -n1 | \ - xargs curl -L -O && \ - tar -xvzf geckodriver-v*-linux64.tar.gz && \ - rm geckodriver-v*-linux64.tar.gz && \ - chmod +x geckodriver && \ - mv geckodriver /usr/local/bin/ && \ # install `rust-src` component for ui test rustup component add rust-src && \ # install specific Rust nightly, default is stable, use minimum components @@ -44,11 +31,7 @@ RUN set -eux && \ rustup target add wasm32-unknown-unknown && \ rustup target add wasm32-unknown-unknown --toolchain nightly && \ # install cargo tools -<<<<<<< HEAD - cargo install wasm-pack cargo-deny && \ -======= cargo install cargo-web wasm-pack cargo-deny cargo-spellcheck && \ ->>>>>>> master cargo install --version 0.4.0 diener && \ # wasm-bindgen-cli version should match the one pinned in substrate # https://github.com/paritytech/substrate/blob/master/bin/node/browser-testing/Cargo.toml#L15 @@ -58,10 +41,6 @@ RUN set -eux && \ # versions rustup show && \ cargo --version && \ -# apt clean up - apt-get autoremove -y && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* && \ # cargo clean up # removes compilation artifacts cargo install creates (>250M) rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" /root/.cache/sccache diff --git a/dockerfiles/ci-linux/README.md b/dockerfiles/ci-linux/README.md index 3e1edc4c..59c7ee03 100644 --- a/dockerfiles/ci-linux/README.md +++ b/dockerfiles/ci-linux/README.md @@ -6,8 +6,6 @@ Used to build and test Substrate-based projects. ## Dependencies and Tools -- `chromium-driver` - **Inherited from ``:** - `libssl-dev` @@ -32,7 +30,6 @@ Used to build and test Substrate-based projects. **Rust tools & toolchains:** -- `cargo-web` - `sccache` - `wasm-pack` - `wasm-bindgen`