Skip to content

Commit

Permalink
fix(knora.json): return origin instead of wildcard (DEV-318) (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
subotic authored Feb 11, 2022
1 parent 9456387 commit 3b73ff7
Show file tree
Hide file tree
Showing 4 changed files with 1,486 additions and 956 deletions.
84 changes: 84 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.217.2/containers/cpp/.devcontainer/base.Dockerfile

# [Choice] Debian / Ubuntu version (use Debian 11, Ubuntu 18.04/21.04 on local arm64/Apple Silicon): debian-11, debian-10, ubuntu-21.04, ubuntu-20.04, ubuntu-18.04
ARG VARIANT="bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/cpp:0-${VARIANT}

RUN sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
apt-get clean && apt-get -qq update && apt-get -y install \
ca-certificates \
gnupg2

# Install build dependencies.
RUN sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' | tee -a /etc/apt/sources.list && \
echo 'deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' | tee -a /etc/apt/sources.list && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 15CF4D18AF4F7421 && \
apt-get clean && apt-get -qq update && apt-get -y install \
ca-certificates \
byobu curl git htop man vim wget unzip \
build-essential \
ninja-build \
cmake \
ccache \
libllvm-11-ocaml-dev libllvm11 llvm-11 llvm-11-dev llvm-11-doc llvm-11-runtime \
clang-11 clang-tools-11 clang-11-doc libclang-common-11-dev libclang-11-dev libclang1-11 clang-format-11 \
libfuzzer-11-dev \
lldb-11 \
lld-11 \
libc++-11-dev libc++abi-11-dev \
libomp-11-dev \
g++-10 \
valgrind \
openjdk-11-jdk \
openssl \
libssl-dev \
doxygen \
libreadline-dev \
gettext \
libmagic-dev \
pkg-config \
gperf \
libidn11-dev \
locales \
uuid \
uuid-dev \
ffmpeg \
at

# add locales
RUN locale-gen en_US.UTF-8 && \
locale-gen sr_RS.UTF-8

ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8

# Set environment variables
ENV CC clang-11
ENV CXX clang++-11

# Install additional test dependencies.
RUN apt-get clean && apt-get -y install \
nginx \
libtiff5-dev \
libopenjp2-7-dev \
graphicsmagick \
apache2-utils \
imagemagick \
libxml2 \
libxml2-dev \
libxslt1.1 \
libxslt1-dev

# Install python and python packages
RUN apt-get clean && apt-get -y install \
python3.9 \
python3-pip && \
pip3 install \
Sphinx \
pytest \
requests \
psutil \
iiif_validator && \
rm -rf /var/lib/apt/lists/*
33 changes: 33 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.217.2/containers/cpp
{
"name": "C++",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Debian / Ubuntu OS version: debian-11, debian-10, debian-9, ubuntu-21.04, ubuntu-20.04, ubuntu-18.04
// Use Debian 11, Debian 9, Ubuntu 18.04 or Ubuntu 21.04 on local arm64/Apple Silicon
"args": { "VARIANT": "ubuntu-20.04" }
},
"runArgs": ["--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"],

// Set *default* container specific settings.json values on container create.
"settings": {},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "gcc -v",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"features": {
"git": "latest"
}
}
34 changes: 10 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,50 +67,36 @@ docker-publish-debug: ## publish Sipi Docker image to Docker-Hub with debugging
-t $(DOCKER_IMAGE)-debug --push .

.PHONY: compile
compile: ## compile SIPI inside Docker with Debug symbols
docker run \
-it --rm \
-v ${PWD}:/sipi \
$(SIPI_BASE) /bin/sh -c "mkdir -p /sipi/build-linux && cd /sipi/build-linux && cmake -DMAKE_DEBUG:BOOL=ON .. && make"
compile: ## compile SIPI (needs to be run inside devcontainer)
mkdir -p ${PWD}/build && cd ${PWD}/build && cmake -DMAKE_DEBUG:BOOL=ON .. && make

.PHONY: compile-ci
compile-ci: ## compile SIPI inside Docker with Debug symbols (no it)
docker run \
--rm \
-v ${PWD}:/sipi \
$(SIPI_BASE) /bin/sh -c "mkdir -p /sipi/build-linux && cd /sipi/build-linux && cmake -DMAKE_DEBUG:BOOL=ON .. && make"
$(SIPI_BASE) /bin/sh -c "mkdir -p /sipi/build && cd /sipi/build && cmake -DMAKE_DEBUG:BOOL=ON .. && make"

.PHONY: test
test: ## compile and run tests inside Docker with Debug symbols
test: ## compile and run tests (needs to be run inside devcontainer)
@mkdir -p ${PWD}/images
docker run \
-it --rm \
-v ${PWD}:/sipi \
$(SIPI_BASE) /bin/sh -c "mkdir -p /sipi/build-linux && cd /sipi/build-linux && cmake -DMAKE_DEBUG:BOOL=ON .. && make && ctest --verbose"
mkdir -p ${PWD}/build && cd ${PWD}/build && cmake -DMAKE_DEBUG:BOOL=ON .. && make && ctest --verbose

.PHONY: test-ci
test-ci: ## compile and run tests inside Docker with Debug symbols (no it)
@mkdir -p ${CURRENT_DIR}/images
docker run \
--rm \
-v ${PWD}:/sipi \
$(SIPI_BASE) /bin/sh -c "mkdir -p /sipi/build-linux && cd /sipi/build-linux && cmake -DMAKE_DEBUG:BOOL=ON .. && make && ctest --verbose"
$(SIPI_BASE) /bin/sh -c "mkdir -p /sipi/build && cd /sipi/build && cmake -DMAKE_DEBUG:BOOL=ON .. && make && ctest --verbose"

.PHONY: test-integration
test-integration: docker-build ## run tests against locally published Sipi Docker image
pytest -s test/integration

.PHONY: run
run: docker-build ## run SIPI inside Docker
@mkdir -p ${CURRENT_DIR}/images
docker run \
-it --rm \
--workdir "/sipi" \
--expose "1024" \
--expose "1025" \
-p 1024:1024 \
-p 1025:1025 \
daschswiss/sipi:latest
run: compile ## run SIPI (needs to be run inside devcontainer)
${PWD}/build/sipi --config=${PWD}/config/sipi.config.lua

.PHONY: cmdline
cmdline: ## open shell inside Docker container
Expand Down Expand Up @@ -145,11 +131,11 @@ shell: ## open shell inside privileged Docker container (does not compile)

.PHONY: valgrind
valgrind: ## start SIPI with Valgrind (needs to be started inside Docker container, e.g., 'make shell')
valgrind --leak-check=yes --track-origins=yes ./build-linux/sipi --config=/sipi/config/sipi.config.lua
valgrind --leak-check=yes --track-origins=yes ./build/sipi --config=/sipi/config/sipi.config.lua

.PHONY: clean
clean: ## cleans the project directory
@rm -rf build-linux/
@rm -rf build/
@rm -rf site/

.PHONY: help
Expand Down
Loading

0 comments on commit 3b73ff7

Please sign in to comment.