Skip to content
Snippets Groups Projects
Commit 6631d3d8 authored by Philipp Wissmann's avatar Philipp Wissmann
Browse files

Merge branch 'fix-devcontainers' into 'main'

DevContainer: add real and complex container, fix permission issues

See merge request mechanics-and-materials/ae108!149
parents 10ef3278 8d9975e5
No related branches found
No related tags found
No related merge requests found
Pipeline #322839 passed
{
"name": "ae108-dev-complex",
"settings": {
"cmake.sourceDirectory": "${workspaceFolder}",
"cmake.buildDirectory": "${workspaceFolder}/build/complex"
},
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"ms-python.vscode-pylance",
"ms-azuretools.vscode-docker",
"gitlab.gitlab-workflow",
"xaver.clang-format",
"llvm-vs-code-extensions.vscode-clangd",
"mhutchie.git-graph"
],
"dockerComposeFile": "../../docker-compose.yml",
"service": "dev-complex",
"workspaceFolder": "/mnt/io",
"remoteEnv": {
"OMPI_ALLOW_RUN_AS_ROOT": "1",
"OMPI_ALLOW_RUN_AS_ROOT_CONFIRM": "1",
"OMPI_MCA_btl_vader_single_copy_mechanism": "none"
}
}
\ No newline at end of file
......@@ -2,16 +2,19 @@
"name": "ae108-dev-real",
"settings": {
"cmake.sourceDirectory": "${workspaceFolder}",
"cmake.buildDirectory": "${workspaceFolder}/build"
"cmake.buildDirectory": "${workspaceFolder}/build/real"
},
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"ms-python.vscode-pylance",
"ms-azuretools.vscode-docker",
"gitlab.gitlab-workflow"
"gitlab.gitlab-workflow",
"xaver.clang-format",
"llvm-vs-code-extensions.vscode-clangd",
"mhutchie.git-graph"
],
"dockerComposeFile": "../docker-compose.yml",
"dockerComposeFile": "../../docker-compose.yml",
"service": "dev-real",
"workspaceFolder": "/mnt/io",
"remoteEnv": {
......
......@@ -15,6 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with ae108. If not, see <https://www.gnu.org/licenses/>.
build
build/**
*.pyc
.vscode
# clangd cache
.cache
\ No newline at end of file
......@@ -73,7 +73,7 @@ build-image-lint:
variables:
DOCKERFILE_NAME: "Dockerfile"
IMAGE_NAME: "lint"
BASE_IMAGE: "ubuntu:noble"
BASE_IMAGE: "ubuntu:jammy"
<<: *build-image
check-code-format:
......@@ -98,7 +98,7 @@ lint:
name: $CI_REGISTRY_IMAGE/lint:$CI_COMMIT_REF_SLUG
script:
- CMAKE_EXPORT_COMPILE_COMMANDS=1 cmake -B build -S . -G Ninja -DCMAKE_BUILD_TYPE=Release
- run-clang-tidy -j 4 -quiet -p build/
- run-clang-tidy -j 4 -quiet -clang-tidy-binary=clang-tidy-18 -p build/
check-license-header:
needs: []
......@@ -127,19 +127,13 @@ check-script:
.build-library: &build-library
stage: build
coverage: '/^lines:\s*\d+\.\d+\%/'
script:
- useradd developer
- mkdir build
- chown developer:developer build
- >
su developer -c '
cmake -B build -S . -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="--coverage -Werror -Wall -Wextra -Wpedantic" &&
cmake --build build &&
cd build &&
GTEST_OUTPUT="xml:gtest-results.xml" ctest --output-on-failure --exclude-regex ".*_mpi$" &&
ctest --output-on-failure --tests-regex ".*_mpi$" &&
python3 -m gcovr --print-summary --xml coverage.xml -j$(nproc) --root .. .
'
script:
- cmake -B build -S . -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="--coverage -Werror -Wall -Wextra -Wpedantic"
- cmake --build build
- cd build
- GTEST_OUTPUT="xml:gtest-results.xml" ctest --output-on-failure --exclude-regex ".*_mpi$"
- ctest --output-on-failure --tests-regex ".*_mpi$"
- python3 -m gcovr --print-summary --xml coverage.xml -j$(nproc) --root .. .
artifacts:
reports:
coverage_report:
......@@ -165,7 +159,7 @@ build-library-complex:
- >
bash -c '
cmake -B build -S . -G Ninja -DCMAKE_BUILD_TYPE=Debug &&
cmake --build build --target install
sudo cmake --build build --target install
'
- mkdir build-examples
- >
......@@ -187,17 +181,10 @@ install-library-complex:
.build-deb: &build-deb
stage: build
script:
- useradd developer
- mkdir build
- chown developer:developer build
- >
su developer -c '
cmake -B deb -S . -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wpedantic" \
&& cmake --build deb \
&& cd deb && cpack
'
- cmake -B deb -S . -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wpedantic"
- cmake --build deb
- cd deb
- cpack
artifacts:
paths:
- deb/*.deb
......
......@@ -27,10 +27,12 @@ RUN apt-get update && \
apt-get install -y \
clang-format \
clang-tidy \
clangd \
cmake \
g++ \
gdb \
git \
vim \
libboost-program-options-dev \
libeigen3-dev \
libgmock-dev \
......@@ -39,7 +41,10 @@ RUN apt-get update && \
ninja-build \
python3 python3-pip \
libgmsh-dev \
voro++-dev
voro++-dev \
software-properties-common \
gnupg \
sudo
RUN pip_args="$(pip3 install --help | grep -o -- --break-system-packages)" ; \
pip3 install $pip_args \
......@@ -52,5 +57,25 @@ RUN pip_args="$(pip3 install --help | grep -o -- --break-system-packages)" ; \
RUN apt-get update && \
DEBIAN_FRONTEND="noninteractive" \
apt-get install -y \
wget \
libpetsc-${PETSC_SCALAR_TYPE}-dev \
libslepc-${PETSC_SCALAR_TYPE}-dev
# Clang 18
ARG LLVM_VERSION=18
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh
RUN ./llvm.sh ${LLVM_VERSION} all
RUN rm llvm.sh
ARG USERNAME=dev
ARG UID=1000
ARG GID=1000
RUN groupadd -r -g ${GID} ${USERNAME} && \
useradd -u ${UID} -g ${GID} -m -G sudo -s /bin/bash ${USERNAME} && \
echo "${USERNAME}:${USERNAME}" | chpasswd && \
echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/${USERNAME} && \
chmod 440 /etc/sudoers.d/${USERNAME}
USER ${USERNAME}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment