diff --git a/.gitignore b/.gitignore index f1cec08e..fd13538e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,13 @@ logs *.iml *.log /.project + +# Intermediate build artifacts +*.tgz +*.rpm +*.gz +*tar.gz.asc +apache_tomcat_keys +travis/bes.json +travis/beslog2json.py +travis/cookies \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 58ed324d..1ec3f6d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -88,8 +88,6 @@ install: - ls -l ./builds stages: - - name: OLFS - if: branch = master - name: BUILD_AND_TEST if: branch = master - name: BUILD @@ -115,24 +113,23 @@ jobs: - export SNAPSHOT_IMAGE_TAG="opendap/${DOCKER_NAME}:snapshot$TEST_DEPLOYMENT" - export BUILD_VERSION_TAG="opendap/${DOCKER_NAME}:${HYRAX_VERSION}$TEST_DEPLOYMENT" - export TOMCAT_VERSION=$(get_latest_tomcat_version_number "${TOMCAT_MAJOR_VERSION}") + # TODO: use versioned image! For testing, use the snapshot. + - export BES_IMAGE_TAG="opendap/bes_rhel8:snapshot" + # - export BES_IMAGE_TAG="opendap/bes_rhel8:${BES_VERSION}" - show_version - - get_tomcat_distro "${DOCKER_NAME}" "${TOMCAT_VERSION}" - - s3_get_besd_distro - "${S3_BUILD_BUCKET}" - "${DOCKER_NAME}" - "el8" - "${LIBDAP_VERSION}" - "${BES_VERSION}" $ADD_DEBUG 2>&1 - - s3_get_olfs_distro - "${S3_BUILD_BUCKET}" - "${DOCKER_NAME}" - "${OLFS_VERSION}" 2>&1 + # - get_tomcat_distro "${DOCKER_NAME}" "${TOMCAT_VERSION}" + # - s3_get_olfs_distro + # "${S3_BUILD_BUCKET}" + # "${DOCKER_NAME}" + # "${OLFS_VERSION}" 2>&1 + - set -e # Don't keep going if the docker build fails.... - docker build --build-arg TOMCAT_VERSION --build-arg RELEASE_DATE --build-arg HYRAX_VERSION --build-arg LIBDAP_VERSION --build-arg BES_VERSION + --build-arg BES_IMAGE_TAG --build-arg OLFS_VERSION --tag "${SNAPSHOT_IMAGE_TAG}" --tag "${BUILD_VERSION_TAG}" @@ -142,139 +139,139 @@ jobs: - echo "Running Test Script" - ./travis/regression_test_script -i ${SNAPSHOT_IMAGE_TAG} - - stage: BUILD - name: "Build opendap/besd:snapshot (RH8)" - script: - - cd "${TARGET_OS}-builds" - - export DOCKER_NAME="besd" - - source ./build-rh8 - - export SNAPSHOT_IMAGE_TAG="opendap/${DOCKER_NAME}:snapshot$TEST_DEPLOYMENT" - - export BUILD_VERSION_TAG="opendap/${DOCKER_NAME}:${BES_VERSION}$TEST_DEPLOYMENT" - - show_version - - s3_get_besd_distro - "${S3_BUILD_BUCKET}" - "${DOCKER_NAME}" - "el8" - "${LIBDAP_VERSION}" - "${BES_VERSION}" "${ADD_DEBUG_RPMS}" 2>&1 - - docker build - --build-arg RELEASE_DATE - --build-arg HYRAX_VERSION - --build-arg LIBDAP_VERSION - --build-arg BES_VERSION - --tag "${SNAPSHOT_IMAGE_TAG}" - --tag "${BUILD_VERSION_TAG}" - "${DOCKER_NAME}" - - docker image ls -a + # - stage: BUILD + # name: "Build opendap/besd:snapshot (RH8)" + # script: + # - cd "${TARGET_OS}-builds" + # - export DOCKER_NAME="besd" + # - source ./build-rh8 + # - export SNAPSHOT_IMAGE_TAG="opendap/${DOCKER_NAME}:snapshot$TEST_DEPLOYMENT" + # - export BUILD_VERSION_TAG="opendap/${DOCKER_NAME}:${BES_VERSION}$TEST_DEPLOYMENT" + # - show_version + # - s3_get_besd_distro + # "${S3_BUILD_BUCKET}" + # "${DOCKER_NAME}" + # "el8" + # "${LIBDAP_VERSION}" + # "${BES_VERSION}" "${ADD_DEBUG_RPMS}" 2>&1 + # - docker build + # --build-arg RELEASE_DATE + # --build-arg HYRAX_VERSION + # --build-arg LIBDAP_VERSION + # --build-arg BES_VERSION + # --tag "${SNAPSHOT_IMAGE_TAG}" + # --tag "${BUILD_VERSION_TAG}" + # "${DOCKER_NAME}" + # - docker image ls -a - - stage: BUILD - name: "Build opendap/hyrax_ncwms:snapshot (RH8)" - script: - - cd "${TARGET_OS}-builds" - - export DOCKER_NAME="hyrax" - - source ./build-rh8 - - export SNAPSHOT_IMAGE_TAG="opendap/${DOCKER_NAME}_ncwms:snapshot$TEST_DEPLOYMENT" - - export BUILD_VERSION_TAG="opendap/${DOCKER_NAME}_ncwms:${HYRAX_VERSION}$TEST_DEPLOYMENT" - - export TOMCAT_VERSION=$(get_latest_tomcat_version_number "${TOMCAT_MAJOR_VERSION}") - - show_version - - get_tomcat_distro "${DOCKER_NAME}" "${TOMCAT_VERSION}" - - s3_get_besd_distro - "${S3_BUILD_BUCKET}" - "${DOCKER_NAME}" - "el8" - "${LIBDAP_VERSION}" - "${BES_VERSION}" "${ADD_DEBUG_RPMS}" 2>&1 - - s3_get_olfs_distro - "${S3_BUILD_BUCKET}" - "${DOCKER_NAME}" - "${OLFS_VERSION}" 2>&1 - - docker build - --build-arg TOMCAT_VERSION - --build-arg RELEASE_DATE - --build-arg HYRAX_VERSION - --build-arg LIBDAP_VERSION - --build-arg BES_VERSION - --build-arg OLFS_VERSION - --build-arg USE_NCWMS=true - --tag "${SNAPSHOT_IMAGE_TAG}" - --tag "${BUILD_VERSION_TAG}" - "${DOCKER_NAME}" - - docker image ls -a + # - stage: BUILD + # name: "Build opendap/hyrax_ncwms:snapshot (RH8)" + # script: + # - cd "${TARGET_OS}-builds" + # - export DOCKER_NAME="hyrax" + # - source ./build-rh8 + # - export SNAPSHOT_IMAGE_TAG="opendap/${DOCKER_NAME}_ncwms:snapshot$TEST_DEPLOYMENT" + # - export BUILD_VERSION_TAG="opendap/${DOCKER_NAME}_ncwms:${HYRAX_VERSION}$TEST_DEPLOYMENT" + # - export TOMCAT_VERSION=$(get_latest_tomcat_version_number "${TOMCAT_MAJOR_VERSION}") + # - show_version + # - get_tomcat_distro "${DOCKER_NAME}" "${TOMCAT_VERSION}" + # - s3_get_besd_distro + # "${S3_BUILD_BUCKET}" + # "${DOCKER_NAME}" + # "el8" + # "${LIBDAP_VERSION}" + # "${BES_VERSION}" "${ADD_DEBUG_RPMS}" 2>&1 + # - s3_get_olfs_distro + # "${S3_BUILD_BUCKET}" + # "${DOCKER_NAME}" + # "${OLFS_VERSION}" 2>&1 + # - docker build + # --build-arg TOMCAT_VERSION + # --build-arg RELEASE_DATE + # --build-arg HYRAX_VERSION + # --build-arg LIBDAP_VERSION + # --build-arg BES_VERSION + # --build-arg OLFS_VERSION + # --build-arg USE_NCWMS=true + # --tag "${SNAPSHOT_IMAGE_TAG}" + # --tag "${BUILD_VERSION_TAG}" + # "${DOCKER_NAME}" + # - docker image ls -a - - stage: BUILD - name: "Build opendap/hyrax:ngap-snapshot (RH8)" - script: - - cd "${TARGET_OS}-builds" - - export DOCKER_NAME="ngap" - - source ./build-rh8 - - export SNAPSHOT_IMAGE_TAG="opendap/hyrax:${DOCKER_NAME}-snapshot$TEST_DEPLOYMENT" - - export BUILD_VERSION_TAG="opendap/hyrax:${DOCKER_NAME}-${HYRAX_VERSION}$TEST_DEPLOYMENT" - - export TOMCAT_VERSION=$(get_latest_tomcat_version_number "${TOMCAT_MAJOR_VERSION}") - - show_version - - get_tomcat_distro "${DOCKER_NAME}" "${TOMCAT_VERSION}" - - s3_get_besd_distro - "${S3_BUILD_BUCKET}" - "${DOCKER_NAME}" - "el8" - "${LIBDAP_VERSION}" - "${BES_VERSION}" "${ADD_DEBUG_RPMS}" 2>&1 - - get_ngap_olfs_distro - "${S3_BUILD_BUCKET}" - "${DOCKER_NAME}" - "${OLFS_VERSION}" 2>&1 - - docker build - --build-arg TOMCAT_VERSION - --build-arg RELEASE_DATE - --build-arg HYRAX_VERSION - --build-arg LIBDAP_VERSION - --build-arg BES_VERSION - --build-arg OLFS_VERSION - --tag "${SNAPSHOT_IMAGE_TAG}" - --tag "${BUILD_VERSION_TAG}" - "${DOCKER_NAME}" - - docker image ls -a + # - stage: BUILD + # name: "Build opendap/hyrax:ngap-snapshot (RH8)" + # script: + # - cd "${TARGET_OS}-builds" + # - export DOCKER_NAME="ngap" + # - source ./build-rh8 + # - export SNAPSHOT_IMAGE_TAG="opendap/hyrax:${DOCKER_NAME}-snapshot$TEST_DEPLOYMENT" + # - export BUILD_VERSION_TAG="opendap/hyrax:${DOCKER_NAME}-${HYRAX_VERSION}$TEST_DEPLOYMENT" + # - export TOMCAT_VERSION=$(get_latest_tomcat_version_number "${TOMCAT_MAJOR_VERSION}") + # - show_version + # - get_tomcat_distro "${DOCKER_NAME}" "${TOMCAT_VERSION}" + # - s3_get_besd_distro + # "${S3_BUILD_BUCKET}" + # "${DOCKER_NAME}" + # "el8" + # "${LIBDAP_VERSION}" + # "${BES_VERSION}" "${ADD_DEBUG_RPMS}" 2>&1 + # - get_ngap_olfs_distro + # "${S3_BUILD_BUCKET}" + # "${DOCKER_NAME}" + # "${OLFS_VERSION}" 2>&1 + # - docker build + # --build-arg TOMCAT_VERSION + # --build-arg RELEASE_DATE + # --build-arg HYRAX_VERSION + # --build-arg LIBDAP_VERSION + # --build-arg BES_VERSION + # --build-arg OLFS_VERSION + # --tag "${SNAPSHOT_IMAGE_TAG}" + # --tag "${BUILD_VERSION_TAG}" + # "${DOCKER_NAME}" + # - docker image ls -a - - stage: BUILD - name: "Build opendap/olfs:snapshot" - script: - - cd "${TARGET_OS}-builds" - - export DOCKER_NAME="olfs" - - source ./build-rh8 - - export SNAPSHOT_IMAGE_TAG="opendap/${DOCKER_NAME}:snapshot$TEST_DEPLOYMENT" - - export BUILD_VERSION_TAG="opendap/${DOCKER_NAME}:${OLFS_VERSION}$TEST_DEPLOYMENT" - - export TOMCAT_VERSION=$(get_latest_tomcat_version_number "${TOMCAT_MAJOR_VERSION}") - - show_version - - get_tomcat_distro "${DOCKER_NAME}" "${TOMCAT_VERSION}" - - s3_get_olfs_distro - "${S3_BUILD_BUCKET}" - "olfs" - "${OLFS_VERSION}" 2>&1 - - docker build - --build-arg TOMCAT_VERSION - --build-arg RELEASE_DATE - --build-arg HYRAX_VERSION - --build-arg OLFS_VERSION - --tag "${SNAPSHOT_IMAGE_TAG}" - --tag "${BUILD_VERSION_TAG}" olfs - - docker image ls -a + # - stage: BUILD + # name: "Build opendap/olfs:snapshot" + # script: + # - cd "${TARGET_OS}-builds" + # - export DOCKER_NAME="olfs" + # - source ./build-rh8 + # - export SNAPSHOT_IMAGE_TAG="opendap/${DOCKER_NAME}:snapshot$TEST_DEPLOYMENT" + # - export BUILD_VERSION_TAG="opendap/${DOCKER_NAME}:${OLFS_VERSION}$TEST_DEPLOYMENT" + # - export TOMCAT_VERSION=$(get_latest_tomcat_version_number "${TOMCAT_MAJOR_VERSION}") + # - show_version + # - get_tomcat_distro "${DOCKER_NAME}" "${TOMCAT_VERSION}" + # - s3_get_olfs_distro + # "${S3_BUILD_BUCKET}" + # "olfs" + # "${OLFS_VERSION}" 2>&1 + # - docker build + # --build-arg TOMCAT_VERSION + # --build-arg RELEASE_DATE + # --build-arg HYRAX_VERSION + # --build-arg OLFS_VERSION + # --tag "${SNAPSHOT_IMAGE_TAG}" + # --tag "${BUILD_VERSION_TAG}" olfs + # - docker image ls -a - - stage: TEST_DEPLOYED_IMAGE - name: "Test Deployed Image (RH8)" - script: - - source ./el8-builds/build-rh8 ./el8-build-recipe - - export TEST_IMAGE="opendap/hyrax:${HYRAX_VERSION}$TEST_DEPLOYMENT" - - echo "Running Hyrax Regression Test Script on ${TEST_IMAGE}" - - ./travis/regression_test_script -i "${TEST_IMAGE}" - - export DEPLOY_ME="false" + # - stage: TEST_DEPLOYED_IMAGE + # name: "Test Deployed Image (RH8)" + # script: + # - source ./el8-builds/build-rh8 ./el8-build-recipe + # - export TEST_IMAGE="opendap/hyrax:${HYRAX_VERSION}$TEST_DEPLOYMENT" + # - echo "Running Hyrax Regression Test Script on ${TEST_IMAGE}" + # - ./travis/regression_test_script -i "${TEST_IMAGE}" + # - export DEPLOY_ME="false" -before_deploy: - - export DOCKER_LOGIN=`aws ecr get-login --region us-east-1 | sed "s/-e none //g"`; - - $DOCKER_LOGIN; - - echo "DEPLOY_ME is ${DEPLOY_ME}" +# before_deploy: +# - export DOCKER_LOGIN=`aws ecr get-login --region us-east-1 | sed "s/-e none //g"`; +# - $DOCKER_LOGIN; +# - echo "DEPLOY_ME is ${DEPLOY_ME}" -deploy: - - provider: script - script: bash ${TRAVIS_BUILD_DIR}/travis/deploy_to_docker_hub.sh - on: - branch: master - condition: ${DEPLOY_ME} = "true" +# deploy: +# - provider: script +# script: bash ${TRAVIS_BUILD_DIR}/travis/deploy_to_docker_hub.sh +# on: +# branch: master +# condition: ${DEPLOY_ME} = "true" diff --git a/README.md b/README.md index 39430339..b93507ef 100644 --- a/README.md +++ b/README.md @@ -82,8 +82,8 @@ More elaborate instructions may be found below in this document. _Hyrax Docker Hub Pages_ - [**Hyrax Data Server**](https://cloud.docker.com/u/opendap/repository/docker/opendap/hyrax) - [**Hyrax Data Server + ncWMS2**](https://cloud.docker.com/u/opendap/repository/docker/opendap/hyrax_ncmws) -- [**besd**](https://cloud.docker.com/u/opendap/repository/docker/opendap/olfs) -- [**olfs**](https://cloud.docker.com/u/opendap/repository/docker/opendap/besd) +- [**besd**](https://cloud.docker.com/u/opendap/repository/docker/opendap/besd) +- [**olfs**](https://cloud.docker.com/u/opendap/repository/docker/opendap/olfs) #### Build diff --git a/el8-builds/build-rh8 b/el8-builds/build-rh8 index ecdd2f2d..179a6b73 100755 --- a/el8-builds/build-rh8 +++ b/el8-builds/build-rh8 @@ -70,6 +70,7 @@ function show_version(){ loggy " HYRAX_VERSION: ${HYRAX_VERSION}" loggy " OLFS_VERSION: ${OLFS_VERSION}" loggy " BES_VERSION: ${BES_VERSION}" + loggy " BES_IMAGE_TAG: ${BES_IMAGE_TAG}" loggy " BUILD_DMRPP_VERSION: ${BUILD_DMRPP_VERSION}" loggy " LIBDAP_VERSION: ${LIBDAP_VERSION}" loggy " DOCKER_NAME: ${DOCKER_NAME}" diff --git a/el8-builds/hyrax/Dockerfile b/el8-builds/hyrax/Dockerfile index 11fc02cf..630ef7e4 100644 --- a/el8-builds/hyrax/Dockerfile +++ b/el8-builds/hyrax/Dockerfile @@ -13,7 +13,13 @@ # it for debugging stuff. # # Set one or more individual labels -FROM rockylinux:8 +# Add a default base image to keep docker from complaining, +# which is fine because if this ISN'T based on a given image tag, +# everything downstream will fail due to lack of bes, libdap, etc. +# TODO: try FROM ${BES_IMAGE_TAG:-"$(some script that fails!)"} thanks ndp :) +ARG BES_IMAGE_TAG +FROM ${BES_IMAGE_TAG:-"rockylinux:8"} + ENV ARCH="x86_64" ENV java_version="java-11-openjdk" ENV python_version="3.11" @@ -21,13 +27,13 @@ ENV python_version="3.11" ENV HR="###########################################################################" ENV HR2="# -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - --" -RUN export NOW=`date +%s` +ENV NOW="$(`date +%s`)" ARG RELEASE_DATE -ENV RELEASE_DATE ${RELEASE_DATE:-"${NOW}"} +ENV RELEASE_DATE=${RELEASE_DATE:-"${NOW}"} RUN echo "RELEASE_DATE: ${RELEASE_DATE}" ARG TOMCAT_VERSION -ENV TOMCAT_VERSION ${TOMCAT_VERSION:-"9.0.64"} +ENV TOMCAT_VERSION=${TOMCAT_VERSION:-"9.0.64"} RUN echo "TOMCAT_VERSION: ${TOMCAT_VERSION}" ENV TOMCAT_DISTRO="apache-tomcat-${TOMCAT_VERSION}" COPY "${TOMCAT_DISTRO}.tar.gz" / @@ -37,26 +43,17 @@ ARG HYRAX_VERSION ENV HYRAX_VERSION=${HYRAX_VERSION:-"snapshot"} RUN echo "HYRAX_VERSION: ${HYRAX_VERSION}" +# TODO: confirm that LIBDAP_VERSION and BES_VERSION match +# versions previously installed in base image, fail if not + ARG LIBDAP_VERSION ENV LIBDAP_VERSION=${LIBDAP_VERSION:-"snapshot"} RUN echo "LIBDAP_VERSION: ${LIBDAP_VERSION}" -ARG LIBDAP_RPM -ENV LIBDAP_RPM=${LIBDAP_RPM:-"libdap-${LIBDAP_VERSION}.el8.x86_64.rpm"} -RUN echo "LIBDAP_RPM: ${LIBDAP_RPM}" -COPY ${LIBDAP_RPM} libdap-devel-* libdap-debuginfo-* / -RUN ls -l /libdap-* >&2 - ARG BES_VERSION ENV BES_VERSION=${BES_VERSION:-"snapshot"} RUN echo "BES_VERSION: ${BES_VERSION}" -ARG BES_RPM -ENV BES_RPM=${BES_RPM:-"bes-${BES_VERSION}.static.el8.x86_64.rpm"} -RUN echo "BES_RPM: ${BES_RPM}" -COPY ${BES_RPM} bes-devel-* bes-debuginfo-* / -RUN ls -l /bes-* >&2 - ARG OLFS_VERSION ENV OLFS_VERSION=${OLFS_VERSION:-"snapshot"} RUN echo "OLFS_VERSION: ${OLFS_VERSION}" @@ -80,15 +77,16 @@ LABEL org.opendap.hyrax.version=${HYRAX_VERSION} LABEL org.opendap.hyrax.release-date=${RELEASE_DATE} LABEL org.opendap.hyrax.version.is-production="false" -MAINTAINER support@opendap.org +LABEL maintainer=support@opendap.org USER root +WORKDIR / # # The --build-arg USE_NCWMS can be set to "true" in order to # add the ncWMS application to the build. ARG USE_NCWMS -ENV USE_NCWMS ${USE_NCWMS:-"false"} +ENV USE_NCWMS=${USE_NCWMS:-"false"} RUN if [ $USE_NCWMS = "true" ];then echo "NCWMS: ENABLED"; else echo "NCWMS: DISABLED"; fi # @@ -97,12 +95,12 @@ RUN if [ $USE_NCWMS = "true" ];then echo "NCWMS: ENABLED"; else echo "NCWMS: DIS # the URL: https://localhost:8080 if the environment variable NCWMS_BASE # is not in the shell from which the entrypoint.sh script is called. ARG NCWMS_BASE -ENV NCWMS_BASE ${NCWMS_BASE:-"https://localhost:8080"} +ENV NCWMS_BASE=${NCWMS_BASE:-"https://localhost:8080"} RUN if [ $USE_NCWMS = "true" ];then echo "NCWMS_BASE: {$NCWMS_BASE}"; fi ARG DEVELOPER_MODE -ENV DEVELOPER_MODE ${DEVELOPER_MODE:-"false"} +ENV DEVELOPER_MODE=${DEVELOPER_MODE:-"false"} RUN if [ $DEVELOPER_MODE = "true" ];then echo "DEVELOPER_MODE: ENABLED"; else echo "DEVELOPER_MODE: DISABLED"; fi #Get mirrorlist before running yum @@ -163,28 +161,37 @@ RUN set -e \ && dnf clean all ################################################################ -# Install the latest libdap snapshot -# - - - - - - - - - - - - - - - - - - - - - -RUN set -e \ - && echo "Installing the libdap rpm: ${LIBDAP_RPM}" \ - && ls -l ./libdap* \ - && dnf -y install ./libdap-*.rpm \ - && rm -f ./${LIBDAP_RPM} \ - && dnf clean all - -RUN echo "libdap4 is installed." - -################################################################ -# Install the latest BES snapshot -# - - - - - - - - - - - - - - - - - - - - - -RUN set -e \ - && echo "Installing the latest BES rpm: ${BES_RPM}" \ - && ls -l ./bes* \ - && dnf -y install ./bes-*.rpm \ - && rm -f ./${BES_RPM} \ - && dnf clean all - -RUN echo "besdaemon is here: "`which besdaemon` +# Set up BES +# +# BES is already installed on the base image, but +# we need to do some additional configuration (to match what was +# previously handled by bes RPM installation) + +# Add besd service to start at boot +RUN cp ${PREFIX}/etc/rc.d/init.d/besd /etc/rc.d/init.d/besd \ + && chkconfig --add besd \ + && ldconfig \ + && chkconfig --list | grep besd \ + && echo "whoami: "`whoami` \ + && echo "besdaemon is here: "`which besdaemon` + +# Adapted from bes/spec.all_static.in +# Default macros: https://docs.fedoraproject.org/en-US/packaging-guidelines/RPMMacros/ +RUN sed -i.dist \ + -e 's:=.*/bes.log:=/var/log/bes/bes.log:' \ + -e 's:=.*/lib/bes:='"$PREFIX"'/lib/bes:' \ + -e 's:=.*/share/bes:='"$PREFIX"'/share/bes:' \ + -e 's:=.*/share/hyrax:='"$PREFIX"'/share/hyrax:' \ + # -e 's:=/full/path/to/serverside/certificate/file.pem:=/etc/pki/bes/cacerts/file.pem:' \ + # -e 's:=/full/path/to/serverside/key/file.pem:=/etc/pki/bes/public/file.pem:' \ + # -e 's:=/full/path/to/clientside/certificate/file.pem:=/etc/pki/bes/cacerts/file.pem:' \ + # -e 's:=/full/path/to/clientside/key/file.pem:=/etc/pki/bes/public/file.pem:' \ + -e 's:=user_name:='"$USER"':' \ + -e 's:=group_name:='"$USER"':' \ + $PREFIX/etc/bes/bes.conf \ + && mkdir -p "/var/log/bes/" \ + && touch "/var/log/bes/bes.log" \ + && sudo chown -R $USER:$USER "/var/log/bes/" ################################################################ # Install and Setup Tomcat @@ -208,17 +215,15 @@ RUN set -e && systemctl enable tomcat #RUN firewall-cmd --add-port 8080/tcp --permanent #RUN firewall-cmd --reload -ENV CATALINA_HOME /usr/share/tomcat -ENV PATH $CATALINA_HOME/bin:$PATH +ENV CATALINA_HOME=/usr/share/tomcat +ENV PATH=$CATALINA_HOME/bin:$PATH RUN set -e && echo "CATALINA_HOME: ${CATALINA_HOME}" >&2 # Install our modified server.xml so that the server compresses responses. COPY tomcat9-server.xml / RUN set -e \ && mv /tomcat9-server.xml ${CATALINA_HOME}/conf/server.xml \ - && chown -R tomcat:tomcat ${CATALINA_HOME}/conf/server.xml - -RUN set -e \ + && chown -R tomcat:tomcat ${CATALINA_HOME}/conf/server.xml \ && echo "Cleaning up Tomcat distribution files..." >&2 \ && rm -fv "/${TOMCAT_DISTRO}.tar.gz" @@ -231,7 +236,7 @@ RUN echo "Installing the latest olfs distribution (${OLFS_VERSION})." >&2 RUN set -e \ && echo "working_dir: "`pwd` >&2 \ && ls -l . \ - && tar -C ${ROOT} -xzvf ./${OLFS_DISTRO}.tgz \ + && tar -C ${ROOT} -xzvf /${OLFS_DISTRO}.tgz \ && ls -l ${ROOT} \ && echo "Unpacking warfile..." >&2 \ && mkdir -p $(readlink -f ${CATALINA_HOME})/webapps/${DEPLOYMENT_CONTEXT}/ \ @@ -247,7 +252,9 @@ RUN set -e \ && echo "Unpacking dynamic robots.txt warfile..." >&2 \ && unzip -o ${ROOT}/${ROBOTS_DISTRO}/ROOT.war -d ${CATALINA_HOME}/webapps/ROOT/ \ && echo "Cleaning up dynamic robots.txt snapshot..." >&2 \ - && rm -rf ${ROOT}/${ROBOTS_DISTRO} ${ROBOTS_DISTRO}.tgz + && rm -rf ${ROOT}/${ROBOTS_DISTRO} ${ROBOTS_DISTRO}.tgz \ + && echo "Cleaning up the Hyrax distribution binaries..." \ + && rm -vf /olfs*.tgz /robots*.tgz /apache* # Fix ownership and access permissions RUN set -e \ @@ -255,19 +262,12 @@ RUN set -e \ && chown -R tomcat:tomcat ${CATALINA_HOME}/webapps/${DEPLOYMENT_CONTEXT}/WEB-INF/conf/logs \ && chmod 700 ${CATALINA_HOME}/webapps/${DEPLOYMENT_CONTEXT}/WEB-INF/conf/logs -################################################################ -# Clean up the Hyrax distribution binaries. -# -RUN rm -vf /libdap*.rpm /bes*.rpm /olfs*.tgz /robots*.tgz /apache* -# -################################################################ - ################################################################ # retrieve and install the ncWMS web application # - - - - - - - - - - - - - - - - - - - - - ARG NCWMS_VERSION -ENV NCWMS_VERSION ${NCWMS_VERSION:-"2.5.2"} +ENV NCWMS_VERSION=${NCWMS_VERSION:-"2.5.2"} RUN echo "NCWMS_VERSION: ${NCWMS_VERSION}" ENV NCWMS_WAR_URL="https://github.com/Reading-eScience-Centre/ncwms/releases/download/ncwms-${NCWMS_VERSION}/ncWMS2.war" RUN echo "NCWMS_WAR_URL: ${NCWMS_WAR_URL}" @@ -318,7 +318,7 @@ RUN set -e \ && echo "Retrieving, and building hyrax regression tests." \ && echo "h_r_t will be in: ${TEST_INSTALL_DIR}" \ && mkdir -p ${TEST_INSTALL_DIR} \ - && git clone -v https://github.com/opendap/hyrax_regression_tests ${TEST_INSTALL_DIR} \ + && git clone --depth 1 -v https://github.com/opendap/hyrax_regression_tests ${TEST_INSTALL_DIR} \ && cd ${TEST_INSTALL_DIR} \ && autoreconf -vif \ && ./configure @@ -354,10 +354,6 @@ EXPOSE 8443 EXPOSE 10022 EXPOSE 11002 -# can't use USER with entrypoint that needs root -# use gosu or, as done, enable bes user write so the entrypoint does not need root -RUN chown -R bes /etc/bes USER root CMD ["-"] - diff --git a/el8-builds/hyrax/entrypoint.sh b/el8-builds/hyrax/entrypoint.sh index 897a0523..5a61b959 100755 --- a/el8-builds/hyrax/entrypoint.sh +++ b/el8-builds/hyrax/entrypoint.sh @@ -123,11 +123,11 @@ fi # if test "${SERVER_HELP_EMAIL}" != "not_set" ; then echo "Setting Admin Contact To: $SERVER_HELP_EMAIL" - sed -i "s/admin.email.address@your.domain.name/$SERVER_HELP_EMAIL/" /etc/bes/bes.conf + sed -i "s/admin.email.address@your.domain.name/$SERVER_HELP_EMAIL/" $PREFIX/etc/bes/bes.conf fi if test "${FOLLOW_SYMLINKS}" != "not_set" ; then echo "Setting BES FollowSymLinks to YES." >&2 - sed -i "s/^BES.Catalog.catalog.FollowSymLinks=No/BES.Catalog.catalog.FollowSymLinks=Yes/" /etc/bes/bes.conf + sed -i "s/^BES.Catalog.catalog.FollowSymLinks=No/BES.Catalog.catalog.FollowSymLinks=Yes/" $PREFIX/etc/bes/bes.conf fi echo "JAVA VERSION: " @@ -143,19 +143,20 @@ echo "PythonVersion: "$(python3 --version) #------------------------------------------------------------------------------- # Start the BES daemon process # /usr/bin/besdaemon -i /usr -c /etc/bes/bes.conf -r /var/run/bes.pid -bes_uid=$(id -u bes) +bes_username=$USER # As set in bes dockerfile; TODO make it bes again?? +bes_uid=$(id -u ${bes_username}) #TODO: can hardcode to 101 if we want... echo "bes_uid: ${bes_uid}" >&2 -bes_gid=$(id -g bes) +bes_gid=$(id -g ${bes_username}) # TODO: do we hardcode this in the docker image? we maybe should. echo "bes_gid: ${bes_gid}" >&2 echo "Launching besd..." >&2 -/usr/bin/besctl start +$PREFIX/bin/besctl start # TODO: do we want to install this in root in bes docker image? maybe... status=$? if test $status -ne 0 ; then echo "ERROR: Failed to start BES: $status" >&2 exit $status fi -besd_pid=`ps aux | grep /usr/bin/besdaemon | grep -v grep | awk '{print $2;}' - ` +besd_pid=`ps aux | grep $PREFIX/bin/besdaemon | grep -v grep | awk '{print $2;}' - ` echo "The besd is UP! [pid: ${besd_pid}]" >&2 #------------------------------------------------------------------------------- diff --git a/travis/regression_test_script b/travis/regression_test_script index 9dcdff65..381b6bbb 100755 --- a/travis/regression_test_script +++ b/travis/regression_test_script @@ -3,7 +3,7 @@ set -e echo "Starting up ..." default_time_out=30 -default_image_name="opendap/hyrax:snapshot" +default_image_name="opendap/hyrax:snapshot-new" default_endpoint="http://localhost:8080/opendap" time_out="${default_time_out}" @@ -12,6 +12,9 @@ end_point="${default_endpoint}" netrc_file="" tests="" +# As set in bes Dockerfile +BES_PREFIX="/root/install" + while getopts "ht:i:e:n:" OPTION; do case $OPTION in h) @@ -119,7 +122,7 @@ echo "# Python Version: '$(python3 --version)'" echo "# Acquiring bes.log from docker image." docker cp hyrax:/var/log/bes/bes.log . echo "# Acquiring beslog2json.py from docker image." -docker cp hyrax:/usr/bin/beslog2json.py $(pwd)/beslog2json.py +docker cp hyrax:$BES_PREFIX/bin/beslog2json.py $(pwd)/beslog2json.py ls -l ./beslog2json.py echo "############################################################################" echo "# head ./bes.log"