Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.5.1 #29

Merged
merged 7 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.1]

### Fixed
* Main Dockerfile so that workflow matches changes introduced by fixing GPU workflow.

### Changed
* Main Dockerfile to use a multi-stage build, mirroring Dockerfile.gpu.

## [0.5.0]

### Added
Expand Down
52 changes: 22 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
FROM condaforge/mambaforge:latest
FROM condaforge/mambaforge:latest as builder

ENV USEGPU=false
ENV FFTW_LIB=/usr/lib/x86_64-linux-gnu/libfftw3f.a
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends unzip vim curl git build-essential gfortran libfftw3-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*

RUN git clone -b main https://github.com/ASFHyP3/back-projection.git
COPY . /hyp3-back-projection/
COPY ./scripts/build_proc.sh ./back-projection
RUN cd /back-projection && ./build_proc.sh && cd /

FROM condaforge/mambaforge:latest as runner

# For opencontainers label definitions, see:
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
Expand All @@ -11,27 +25,17 @@ LABEL org.opencontainers.image.url="https://github.com/ASFHyP3/hyp3-back-project
LABEL org.opencontainers.image.source="https://github.com/ASFHyP3/hyp3-back-projection"
LABEL org.opencontainers.image.documentation="https://hyp3-docs.asf.alaska.edu"

# Dynamic lables to define at build time via `docker build --label`
# LABEL org.opencontainers.image.created=""
# LABEL org.opencontainers.image.version=""
# LABEL org.opencontainers.image.revision=""

ARG DEBIAN_FRONTEND=noninteractive

ENV USEGPU="false"
ARG CONDA_UID=1000
ARG CONDA_GID=1000

ENV PROC_HOME=/back-projection
ENV PYTHONDONTWRITEBYTECODE=true
ENV PROC_HOME=/home/conda/back-projection
ENV MYHOME=/home/conda
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends unzip vim curl build-essential gfortran libfftw3-dev && \
RUN apt-get update && apt-get install -y --no-install-recommends unzip vim curl gfortran && \
apt-get clean && rm -rf /var/lib/apt/lists/*

ARG CONDA_UID=1000
ARG CONDA_GID=1000
ARG BACK_PROJECTION_TAG=0.2.0
ARG FFTW_TAG=3.3.9

RUN groupadd -g "${CONDA_GID}" --system conda && \
useradd -l -u "${CONDA_UID}" -g "${CONDA_GID}" --system -d /home/conda -m -s /bin/bash conda && \
chown -R conda:conda /opt && \
Expand All @@ -43,20 +47,8 @@ SHELL ["/bin/bash", "-l", "-c"]
USER ${CONDA_UID}
WORKDIR /home/conda/

RUN curl -sL https://github.com/ASFHyP3/back-projection/archive/refs/tags/v${BACK_PROJECTION_TAG}.tar.gz > ./back-projection.tar.gz && \
mkdir -p ./back-projection && \
tar -xvf ./back-projection.tar.gz -C ./back-projection/ --strip=1 && \
rm ./back-projection.tar.gz && \
rm -rf ./back-projection/fft

COPY --chown=${CONDA_UID}:${CONDA_GID} ./scripts/build_proc.sh ./back-projection
RUN cd /home/conda/back-projection && \
chmod +x ./build_proc.sh && \
./build_proc.sh && \
find $PROC_HOME -type f -name "*.py" -exec chmod +x {} + && \
cd /home/conda/

COPY --chown=${CONDA_UID}:${CONDA_GID} . /hyp3-back-projection/
COPY --chown=${CONDA_UID}:${CONDA_GID} --from=builder /back-projection /back-projection
COPY --chown=${CONDA_UID}:${CONDA_GID} --from=builder /hyp3-back-projection /hyp3-back-projection

RUN mamba env create -f /hyp3-back-projection/environment.yml && \
conda clean -afy && \
Expand Down
1 change: 0 additions & 1 deletion Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ENV GPU_ARCH=${GPU_ARCH}
ENV USEGPU=true
ENV DEBIAN_FRONTEND=noninteractive

# FIXME: can remove git after switch back to released version of back-projection
RUN apt-get update && apt-get install -y --no-install-recommends unzip vim curl git build-essential gfortran libfftw3-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*

Expand Down
Loading