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

[SEMANTIC CONVENTIONS] Code generation script fails on SELINUX #2455

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 19 additions & 6 deletions buildscripts/semantic-convention/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,29 @@ git fetch origin "$SPEC_VERSION"
git reset --hard FETCH_HEAD
cd ${SCRIPT_DIR}

# SELINUX
# https://docs.docker.com/storage/bind-mounts/#configure-the-selinux-label

USE_MOUNT_OPTION=""

if [ -x "$(command -v getenforce)" ]; then
SELINUXSTATUS=$(getenforce);
if [ "${SELINUXSTATUS}" == "Enforcing" ]; then
echo "Detected SELINUX"
USE_MOUNT_OPTION=":z"
fi;
fi

# echo "Help ..."

# docker run --rm otel/semconvgen:$GENERATOR_VERSION -h

echo "Generating semantic conventions for traces ..."

docker run --rm \
-v ${SCRIPT_DIR}/tmp-semconv/model:/source \
-v ${SCRIPT_DIR}/templates:/templates \
-v ${ROOT_DIR}/api/include/opentelemetry/trace/:/output \
-v ${SCRIPT_DIR}/tmp-semconv/model:/source${USE_MOUNT_OPTION} \
-v ${SCRIPT_DIR}/templates:/templates${USE_MOUNT_OPTION} \
-v ${ROOT_DIR}/api/include/opentelemetry/trace/:/output${USE_MOUNT_OPTION} \
otel/semconvgen:$GENERATOR_VERSION \
--only span,event,attribute_group,scope \
-f /source code \
Expand All @@ -62,9 +75,9 @@ docker run --rm \
echo "Generating semantic conventions for resources ..."

docker run --rm \
-v ${SCRIPT_DIR}/tmp-semconv/model:/source \
-v ${SCRIPT_DIR}/templates:/templates \
-v ${ROOT_DIR}/sdk/include/opentelemetry/sdk/resource/:/output \
-v ${SCRIPT_DIR}/tmp-semconv/model:/source${USE_MOUNT_OPTION} \
-v ${SCRIPT_DIR}/templates:/templates${USE_MOUNT_OPTION} \
-v ${ROOT_DIR}/sdk/include/opentelemetry/sdk/resource/:/output${USE_MOUNT_OPTION} \
otel/semconvgen:$GENERATOR_VERSION \
--only resource \
-f /source code \
Expand Down