From 668d8ae002a95d484a874ec60b0f41371dcd97c6 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 13 Sep 2023 10:44:27 -0500 Subject: [PATCH] GODRIVER-2924 Set up coverage reporting --- Dockerfile | 30 ++++++++++++++++++++++++++++++ etc/docker_entry.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 Dockerfile create mode 100644 etc/docker_entry.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..e51af89855 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM ubuntu:22.04 + +RUN apt-get -qq update && apt-get -qqy -o DPkg::Lock::Timeout=-1 install --no-install-recommends \ + git \ + ca-certificates \ + curl \ + wget \ + sudo \ + gnupg \ + python3 \ + python3.10-venv \ + build-essential \ + golang-go \ + pkg-config \ + libssl-dev \ + make \ + lsof \ + net-tools \ + && rm -rf /var/lib/apt/lists/* + +RUN export LIBMONGOCRYPT_TAG="1.8.0-alpha1" && \ + cd $HOME && \ + git clone https://github.com/mongodb/libmongocrypt --depth=1 --branch $LIBMONGOCRYPT_TAG && \ + PKG_CONFIG_PATH=$HOME/install/libmongocrypt/lib/pkgconfig:$HOME/install/mongo-c-driver/lib/pkgconfig \ + LD_LIBRARY_PATH=$HOME/install/libmongocrypt/lib \ + ./libmongocrypt/.evergreen/compile.sh + +COPY ./etc/docker_entry.sh /root/docker_entry.sh + +ENTRYPOINT ["/bin/bash", "/root/docker_entry.sh"] diff --git a/etc/docker_entry.sh b/etc/docker_entry.sh new file mode 100644 index 0000000000..7bfc435944 --- /dev/null +++ b/etc/docker_entry.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# +# Entry point for Dockerfile for launching a server and running a go test. +# +set -eux + +# TODO: make some things configurable + +export MONGODB_VERSION=latest +export TOPOLOGY=replica_set +export ORCHESTRATION_FILE=basic.json +export DRIVERS_TOOLS=$HOME/drivers-evergreen-tools +export PROJECT_ORCHESTRATION_HOME=$DRIVERS_TOOLS/.evergreen/orchestration +export MONGO_ORCHESTRATION_HOME=$HOME + +if [ ! -d $DRIVERS_TOOLS ]; then + git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS +fi + +# Disable ipv6 +sed -i "s/\"ipv6\": true,/\"ipv6\": false,/g" $PROJECT_ORCHESTRATION_HOME/configs/${TOPOLOGY}s/$ORCHESTRATION_FILE + + +bash $DRIVERS_TOOLS/.evergreen/run-orchestration.sh + +cd /src +export GOPATH=$(go env GOPATH) +export GOCACHE="$(pwd)/.cache" +export LD_LIBRARY_PATH=$HOME/install/libmongocrypt/lib +export PKG_CONFIG_PATH=$HOME/install/libmongocrypt/lib/pkgconfig:$HOME/install/mongo-c-driver/lib/pkgconfig +export BUILD_TAGS="-tags=cse" +make evg-test