diff --git a/Dockerfile.oed-4_server b/Dockerfile.oed-4_server new file mode 100644 index 0000000..02cce30 --- /dev/null +++ b/Dockerfile.oed-4_server @@ -0,0 +1,13 @@ +FROM coreoasis/api_server:2.3.9 + +USER root +RUN apt-get update && apt-get -y install git python3-pip && rm -rf /var/lib/apt/lists/* +USER server + +# Install ODS-Tools from git branch (Optional) 'docker build --build-arg ods_tools_branch=develop' +ARG ods_tools_branch +RUN if [ ! -z "$ods_tools_branch" ] ; then \ + apt update && apt install -y git; \ + pip uninstall ods-tools -y; \ + pip install --user --no-warn-script-location -v git+https://git@github.com/OasisLMF/ODS_Tools.git@${ods_tools_branch}#egg=ods-tools; \ + fi diff --git a/Dockerfile.oed-4_worker b/Dockerfile.oed-4_worker new file mode 100644 index 0000000..72b3a0f --- /dev/null +++ b/Dockerfile.oed-4_worker @@ -0,0 +1,17 @@ +FROM coreoasis/model_worker:2.3.9 + +# Install ODS-Tools from git branch (Optional) 'docker build --build-arg ods_tools_branch=develop' +ARG ods_tools_branch +RUN if [ ! -z "$ods_tools_branch" ] ; then \ + apt update && apt install -y git; \ + pip uninstall ods-tools -y; \ + pip install --user --no-warn-script-location -v git+https://git@github.com/OasisLMF/ODS_Tools.git@${ods_tools_branch}#egg=ods-tools; \ + fi + +# install MDK from git branch (Optional) 'docker build --build-arg oasislmf_branch=develop' +ARG oasislmf_branch +RUN if [ ! -z "$oasislmf_branch" ] ; then \ + apt update && apt install -y git; \ + pip uninstall oasislmf -y; \ + pip install -v git+https://git@github.com/OasisLMF/OasisLMF.git@${oasislmf_branch}#egg=oasislmf[extra]; \ + fi diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..f5ecbec --- /dev/null +++ b/build.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -x + +ODS_BRANCH='feature/v4_integration' +LMF_BRANCH='feature/oed_v4' +IMG_TAG='oed-4-dev' + +if [ ! -z $ODS_BRANCH ]; then + BUILD_ARGS_WORKER="${BUILD_ARGS_WORKER} --build-arg ods_tools_branch=${ODS_BRANCH}" + BUILD_ARGS_SERVER="${BUILD_ARGS_SERVER} --build-arg ods_tools_branch=${ODS_BRANCH}" +fi + +if [ ! -z $LMF_BRANCH ]; then + BUILD_ARGS_WORKER="${BUILD_ARGS_WORKER} --build-arg oasislmf_branch=${LMF_BRANCH}" +fi + +docker build -f Dockerfile.oed-4_worker $BUILD_ARGS_WORKER -t coreoasis/model_worker:$IMG_TAG . +docker build -f Dockerfile.oed-4_server $BUILD_ARGS_SERVER -t coreoasis/api_server:$IMG_TAG . diff --git a/install.sh b/install.sh index 595c6f7..a97a353 100755 --- a/install.sh +++ b/install.sh @@ -3,9 +3,9 @@ set -e SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -export VERS_MDK=2.3.5 -export VERS_API=2.3.5 -export VERS_WORKER=2.3.5 +export VERS_MDK=2.3.9 +export VERS_API='oed-4-dev' +export VERS_WORKER='oed-4-dev' export VERS_UI=1.11.7 export VERS_PIWIND='stable/2.3.x' @@ -39,7 +39,7 @@ if [[ $(docker volume ls | grep OasisData -c) -gt 1 || -d $SCRIPT_DIR/$GIT_PIWIN docker-compose -f $SCRIPT_DIR/oasis-platform.yml -f $SCRIPT_DIR/oasis-ui-standalone.yml down --remove-orphans set -e printf "Deleting docker data: \n" - rm -rf $SCRIPT_DIR/$GIT_PIWIND + #rm -rf $SCRIPT_DIR/$GIT_PIWIND docker volume ls | grep OasisData | awk 'BEGIN { FS = "[ \t\n]+" }{ print $2 }' | xargs -r docker volume rm else echo "-- Reinstall aborted -- " @@ -48,12 +48,12 @@ if [[ $(docker volume ls | grep OasisData -c) -gt 1 || -d $SCRIPT_DIR/$GIT_PIWIN fi -# --- Clone PiWind ---------------------------------------------------------- # - -mkdir -p $SCRIPT_DIR/$GIT_PIWIND -cd $SCRIPT_DIR/$GIT_PIWIND -git clone --depth 1 --branch $VERS_PIWIND https://github.com/OasisLMF/$GIT_PIWIND.git . -git checkout $VERS_PIWIND +## --- Clone PiWind ---------------------------------------------------------- # +# +#mkdir -p $SCRIPT_DIR/$GIT_PIWIND +#cd $SCRIPT_DIR/$GIT_PIWIND +#git clone --depth 1 --branch $VERS_PIWIND https://github.com/OasisLMF/$GIT_PIWIND.git . +#git checkout $VERS_PIWIND @@ -62,9 +62,8 @@ git checkout $VERS_PIWIND cd $SCRIPT_DIR set +e -docker pull ${WORKER_IMG}:${VERS_WORKER} -docker pull ${SERVER_IMG}:${VERS_API} docker pull coreoasis/oasisui_app:$VERS_UI +./build.sh set -e # RUN OasisPlatform / OasisUI / Portainer