diff --git a/.github/workflows/build-docker-julia.yml b/.github/workflows/build-docker-julia.yml index ec1c804..d3be22d 100644 --- a/.github/workflows/build-docker-julia.yml +++ b/.github/workflows/build-docker-julia.yml @@ -39,19 +39,17 @@ jobs: with: images: ${{ env.IMAGE_NAME }} - - name: Build Docker image - uses: docker/build-push-action@v6 - with: - context: . - platforms: linux/amd64 - load: true - tags: ${{ env.TEST_TAG }} - cache-from: type=gha - cache-to: type=gha + # - name: Build Docker image + # uses: docker/build-push-action@v6 + # with: + # context: . + # platforms: linux/amd64 + # load: true + # tags: ${{ env.TEST_TAG }} - - name: Test CLI - working-directory: ./test - run: source ./test-IFTPipeline.jl-cli.sh && IFT="docker run -v `pwd`:/app -w /app --rm ${{ env.TEST_TAG }}" preprocess_lopez input_data/ne-greenland.20220914.terra.250m + # - name: Test CLI + # working-directory: ./test + # run: source ./test-IFTPipeline.jl-cli.sh && IFT="docker run -v `pwd`:/app -w /app --rm ${{ env.TEST_TAG }}" preprocess_lopez input_data/ne-greenland.20220914.terra.250m - name: Build and push Docker image uses: docker/build-push-action@v6 @@ -61,5 +59,5 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha \ No newline at end of file + build-args: | + JULIA_CPU_TARGET=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1);x86-64-v4,-rdrnd,base(1) \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 337c82d..2fe58b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,26 @@ -FROM julia:1.11-bookworm +FROM --platform=$BUILDPLATFORM julia:1.11-bookworm +ARG TARGETARCH +ARG JULIA_CPU_TARGET="generic" +ENV JULIA_CPU_TARGET=${JULIA_CPU_TARGET} -# DEPENDENCIES +# Dependencies #=========================================== ENV TERM=xterm -# Julia Processor Targets for Precompile -# From https://github.com/JuliaCI/julia-buildkite/blob/main/utilities/build_envs.sh +# Miniconda install #=========================================== -RUN if [ "$TARGETARCH" = "amd64" ]; then \ - export JULIA_CPU_TARGET="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1);x86-64-v4,-rdrnd,base(1)" ; \ -elif [ "$TARGETARCH" = "arm64" ]; then \ - export JULIA_CPU_TARGET="generic;cortex-a57;thunderx2t99;carmel,clone_all;apple-m1,base(3);neoverse-512tvb,base(3)" ; \ -fi ; +# Shell version – miniforge +ENV CONDA_PREFIX=/opt/conda +WORKDIR ${CONDA_PREFIX} +RUN apt-get update && apt-get install -y wget +RUN wget --no-verbose -O miniforge.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-$(uname -m).sh" +RUN bash miniforge.sh -b -u -p ${CONDA_PREFIX} # Python environment build #=========================================== -ENV CONDA_JL_HOME="/opt/conda-env/" +ENV CONDA_JL_CONDA_EXE=${CONDA_PREFIX}/bin/conda +ENV CONDA_JL_HOME=${CONDA_PREFIX} +ENV JULIA_DEPOT_PATH=/opt/julia COPY ./PythonSetupForIFTPipeline.jl /opt/PythonSetupForIFTPipeline.jl RUN julia --project="/opt/PythonSetupForIFTPipeline.jl" "/opt/PythonSetupForIFTPipeline.jl/setup.jl"