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

Adding a second Dockerfile supporting C++20 for cmake C++20 tests #211

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ WORKDIR /setup-ci
ADD setup_ci_environment.sh /setup-ci
ADD setup_cmake.sh /setup-ci
ADD install_gcc48.sh /setup-ci
ADD install_gcc10.sh /setup-ci
ADD install_bazelisk.sh /setup-ci
ADD install_protobuf.sh /setup-ci
ADD install_format_tools.sh /setup-ci


RUN /setup-ci/setup_ci_environment.sh \
&& /setup-ci/setup_cmake.sh \
&& /setup-ci/install_gcc48.sh \
&& /setup-ci/install_gcc10.sh \
&& /setup-ci/install_bazelisk.sh \
&& /setup-ci/install_protobuf.sh \
&& /setup-ci/install_format_tools.sh

5 changes: 4 additions & 1 deletion ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ CI tests can be run on docker by invoking the script `./ci/run_docker.sh ./ci/do
* `code.coverage`: build cmake targets and run tests. Then upload coverage report to [codecov.io](https://codecov.io/).

Additionally, `./ci/run_docker.sh` can be invoked with no arguments to get a docker shell where tests
can be run manually.
can be run manually, except for `cmake.c++20.test`.

Note that `cmake.c++20.test` can only run in a Ubuntu version 20+ container, as earlier versions of Ubuntu do not support C++20 or g++-10.
To run said test, you must run it in the specified Ubuntu 20.04 container by invoking `./ci/run_docker.sh ./ci/do_ci.sh cmake.c++20.test`.
1 change: 1 addition & 0 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ if [[ "$1" == "cmake.test" ]]; then
make test
exit 0
elif [[ "$1" == "cmake.c++20.test" ]]; then
echo "${BUILD_DIR}"
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
Expand Down
8 changes: 8 additions & 0 deletions ci/install_gcc10.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -e
apt-get -y install software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt-get -y update
apt install -y gcc-10
apt install -y g++-10
8 changes: 4 additions & 4 deletions ci/run_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

set -e

BUILD_IMAGE=opentelemetry-cpp-build
BUILD_IMAGE=opentelemetry-cpp-build-test

docker image inspect "$BUILD_IMAGE" &> /dev/null || {
docker build -t "$BUILD_IMAGE" ci
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably adding considerable amount of CI time to build an image. Have you considered running the ci scripts without a docker, to deploy the tools in one of the readily available GitHub Action images?
https://raw.githubusercontent.com/maxgolov/opentelemetry-cpp/master/.github/workflows/build-ubuntu.yml
Main idea is that total compute and run time for each PR is going to be less, since you won't need to build an image.

}

}
if [[ $# -ge 1 ]]; then
docker run -v "$PWD":/src -w /src -it "$BUILD_IMAGE" "$@"
else
docker run -v "$PWD":/src -w /src --privileged -it "$BUILD_IMAGE" /bin/bash -l
fi
fi