Skip to content

Commit

Permalink
Get authz Docker file building for compose
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaSBrown committed Mar 6, 2024
1 parent 748aa5c commit b686635
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
6 changes: 0 additions & 6 deletions compose/build_images_for_compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ docker build -f \
--build-arg RUNTIME="datafed-runtime" \
"${PROJECT_ROOT}" \
-t datafed-web:latest
docker build -f \
"${PROJECT_ROOT}/repository/docker/Dockerfile" \
--build-arg DEPENDENCIES="datafed-dependencies" \
--build-arg RUNTIME="datafed-runtime" \
"${PROJECT_ROOT}" \
-t datafed-repo:latest
docker build -f \
"${PROJECT_ROOT}/docker/Dockerfile.foxx" \
--build-arg DEPENDENCIES="datafed-dependencies" \
Expand Down
1 change: 1 addition & 0 deletions repository/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ ARG DATAFED_DIR
ARG DATAFED_INSTALL_PATH
ARG BUILD_DIR
ARG LIB_DIR
ARG DATAFED_DEPENDENCIES_INSTALL_PATH

# The above should also be available at runtime
ENV DATAFED_INSTALL_PATH="$DATAFED_INSTALL_PATH"
Expand Down
59 changes: 32 additions & 27 deletions repository/docker/Dockerfile.gcs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ARG DEPENDENCIES="dependencies"
ARG RUNTIME="runtime"
ARG DATAFED_DIR="/datafed"
ARG DATAFED_INSTALL_PATH="/opt/datafed"
ARG DATAFED_DEPENDENCIES_INSTALL_PATH="/opt/datafed/dependencies"
ARG GCS_IMAGE="code.ornl.gov:4567/dlsw/datafed/gcs-ubuntu-focal"
ARG BUILD_DIR="$DATAFED_DIR/source"
ARG NVM_DIR="$DATAFED_DIR/.nvm"
Expand All @@ -20,13 +21,15 @@ FROM ${GCS_IMAGE}
ARG DATAFED_DIR
ARG BUILD_DIR
ARG DATAFED_INSTALL_PATH
ARG DATAFED_DEPENDENCIES_INSTALL_PATH
ARG LIB_DIR

ENV GCS_COLLECTION_ROOT_PATH="$DATAFED_DIR/collections/mapped"
ENV DATAFED_INSTALL_PATH="$DATAFED_INSTALL_PATH"
ENV DATAFED_DIR="$DATAFED_DIR"
ENV BUILD_DIR="$BUILD_DIR"
ENV LIB_DIR="$LIB_DIR"
ENV DATAFED_DEPENDENCIES_INSTALL_PATH="$DATAFED_DEPENDENCIES_INSTALL_PATH"
ENV GCS_COLLECTION_ROOT_PATH="$DATAFED_DIR/collections/mapped"
ENV DATAFED_INSTALL_PATH="$DATAFED_INSTALL_PATH"
ENV DATAFED_DIR="$DATAFED_DIR"
ENV BUILD_DIR="$BUILD_DIR"
ENV LIB_DIR="$LIB_DIR"

RUN mkdir -p ${BUILD_DIR}
RUN mkdir -p ${BUILD_DIR}/logs
Expand All @@ -48,6 +51,7 @@ RUN echo "#!/bin/bash\n\$@" > /usr/bin/sudo && chmod +x /usr/bin/sudo

COPY ./scripts/generate_datafed.sh ${BUILD_DIR}/scripts/
COPY ./scripts/dependency_versions.sh ${BUILD_DIR}/scripts/
COPY ./scripts/utils.sh ${BUILD_DIR}/scripts/utils.sh
COPY ./scripts/dependency_install_functions.sh ${BUILD_DIR}/scripts/
COPY ./scripts/install_authz_dependencies.sh ${BUILD_DIR}/scripts/
COPY ./scripts/copy_dependency.sh ${BUILD_DIR}/scripts/
Expand All @@ -61,6 +65,7 @@ RUN chown -R datafed:root ${DATAFED_DIR}

COPY --chown=datafed:root ./scripts/dependency_versions.sh ${BUILD_DIR}/scripts/
COPY --chown=datafed:root ./scripts/generate_authz_config.sh ${BUILD_DIR}/scripts/generate_authz_config.sh
COPY --chown=datafed:root ./scripts/utils.sh ${BUILD_DIR}/scripts/utils.sh
COPY --chown=datafed:root ./CMakeLists.txt ${BUILD_DIR}
COPY --chown=datafed:root ./cmake ${BUILD_DIR}/cmake
COPY --chown=datafed:root ./repository/CMakeLists.txt ${BUILD_DIR}/repository/CMakeLists.txt
Expand All @@ -74,35 +79,35 @@ COPY --chown=datafed:root ./repository/gridftp/globus5 ${BUILD_DIR}/r
# These extra copy statements are necessary as the authz binary is built in the GCS container
# and not the dependencies container so we must copy the build dependencies as well as the
# runtime depedencies
COPY --from=dependencies /usr/local/include/google /usr/local/include/google
COPY --from=dependencies /usr/local/include/sodium /usr/local/include/sodium
COPY --from=dependencies /usr/local/include/sodium.h /usr/local/include/sodium.h
COPY --from=dependencies /usr/local/include/zmq.h /usr/local/include/zmq.h
COPY --from=dependencies /usr/local/include/zmq_utils.h /usr/local/include/zmq_utils.h
COPY --from=dependencies /usr/include/zmq.hpp /usr/include/zmq.hpp
COPY --from=dependencies /usr/local/lib/pkgconfig/libzmq.pc /usr/local/lib/pkgconfig/libzmq.pc
COPY --from=dependencies /usr/local/lib/cmake /usr/local/lib/cmake
COPY --from=dependencies /usr/local/bin/protoc /usr/local/bin/protoc

COPY --from=dependencies /libraries/libprotobuf.a /libraries/libprotobuf.a
COPY --from=dependencies /libraries/libprotoc.a /libraries/libprotoc.a
COPY --from=dependencies /libraries/libzmq.a /libraries/libzmq.a
COPY --from=dependencies /libraries/libsodium.a /libraries/libsodium.a
RUN ${BUILD_DIR}/scripts/copy_dependency.sh protobuf to
RUN ${BUILD_DIR}/scripts/copy_dependency.sh protoc to
RUN ${BUILD_DIR}/scripts/copy_dependency.sh libzmq to
RUN ${BUILD_DIR}/scripts/copy_dependency.sh libsodium to
COPY --from=dependencies ${DATAFED_DEPENDENCIES_INSTALL_PATH} ${DATAFED_DEPENDENCIES_INSTALL_PATH}

COPY --from=dependencies /usr/bin/make /usr/bin/make
COPY --from=dependencies /usr/bin/g++ /usr/bin/g++
COPY --from=dependencies /usr/bin/gcc /usr/bin/gcc
COPY --from=dependencies /usr/bin/ar /usr/bin/ar
COPY --from=dependencies /usr/bin/as /usr/bin/as
COPY --from=dependencies /usr/bin/ld /usr/bin/ld
COPY --from=dependencies /usr/lib/gcc /usr/lib/gcc

COPY --from=dependencies /lib /lib
COPY --from=dependencies /usr/include /usr/include
COPY --from=dependencies /usr/lib /usr/lib

COPY --from=dependencies ${DATAFED_DEPENDENCIES_INSTALL_PATH}/lib/libprotobuf.a ${DATAFED_DEPENDENCIES_INSTALL_PATH}/lib/libprotobuf.a
COPY --from=dependencies ${DATAFED_DEPENDENCIES_INSTALL_PATH}/lib/libprotoc.a ${DATAFED_DEPENDENCIES_INSTALL_PATH}/lib/libprotoc.a
COPY --from=dependencies ${DATAFED_DEPENDENCIES_INSTALL_PATH}/lib/libzmq.a ${DATAFED_DEPENDENCIES_INSTALL_PATH}/lib/libzmq.a
COPY --from=dependencies ${DATAFED_DEPENDENCIES_INSTALL_PATH}/lib/libsodium.a ${DATAFED_DEPENDENCIES_INSTALL_PATH}/lib/libsodium.a

RUN ${BUILD_DIR}/scripts/generate_authz_config.sh && \
${DATAFED_DEPENDENCIES_INSTALL_PATH}/bin/cmake -S. -B build \
${DATAFED_DEPENDENCIES_INSTALL_PATH}/bin/cmake -S. -B build \
-DBUILD_REPO_SERVER=False \
-DBUILD_AUTHZ=True \
-DBUILD_CORE_SERVER=False \
-DBUILD_WEB_SERVER=False \
-DBUILD_DOCS=False \
-DBUILD_PYTHON_CLIENT=False \
-DBUILD_FOXX=False
RUN ${DATAFED_DEPENDENCIES_INSTALL_PATH}/bin/cmake --build build
-DBUILD_PYTHON_CLIENT=False \
-DBUILD_FOXX=False
RUN ${DATAFED_DEPENDENCIES_INSTALL_PATH}/bin/cmake --build build -j 8
RUN ${DATAFED_DEPENDENCIES_INSTALL_PATH}/bin/cmake --build build --target install

COPY --chown=datafed:root ./scripts/globus/setup_globus.sh ${BUILD_DIR}/scripts/globus/setup_globus.sh
Expand Down

0 comments on commit b686635

Please sign in to comment.