Skip to content

Commit

Permalink
Merge branch 'jghrefactor/A2j-update-python-environment-to-work-in-ap…
Browse files Browse the repository at this point in the history
…ptainer' of https://github.com/WilhelmusLab/ice-floe-tracker-pipeline into jghrefactor/A2j-update-python-environment-to-work-in-apptainer
  • Loading branch information
hollandjg committed Nov 22, 2024
2 parents 87680c7 + e5374e3 commit 2dcb591
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 24 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/build-docker-julia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
build-args: |
JULIA_CPU_TARGET=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1);x86-64-v4,-rdrnd,base(1)
25 changes: 15 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"

Expand Down

0 comments on commit 2dcb591

Please sign in to comment.