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

ci: Change to clone repo and install for dev #7

Merged
merged 1 commit into from
Feb 13, 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
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Any commit to master branch re-builds images, re-runs tests, and pushes SHA tags to DockerHub
name: Build
on:
pull_request:
Expand Down
19 changes: 14 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@ ARG CAUSTICS_VERSION=0.7.0
ENV DEBIAN_FRONTEND=noninteractive \
# Setup locale to be UTF-8, avoiding gnarly hard to debug encoding errors
LANG=C.UTF-8 \
LC_ALL=C.UTF-8
LC_ALL=C.UTF-8 \
# Set caustics directory home
# this will be empty if not in dev mode
CAUSTICS_HOME=/opt/caustics \
CAUSTICS_REPO="https://github.com/Ciela-Institute/caustics.git"

# Switch over to root user to install apt-get packages
USER root

RUN echo "Setup caustics directory..." \
&& mkdir ${CAUSTICS_HOME} \
&& chown -R $MAMBA_USER:$MAMBA_USER ${CAUSTICS_HOME}

# Install basic apt packages
RUN echo "Installing Apt-get packages..." \
&& apt-get update --fix-missing > /dev/null \
Expand Down Expand Up @@ -39,12 +47,13 @@ RUN micromamba install --name base --yes --file /tmp/conda-linux-64.lock \
# Set to activate mamba environment, otherwise python will not be found
ARG MAMBA_DOCKERFILE_ACTIVATE=1

# Install caustics from a branch for now
ENV CAUSTICS_REPO="git+https://github.com/Ciela-Institute/caustics.git@${CAUSTICS_VERSION}"
# Install caustics from a branch or distribution
RUN echo "Installing caustics ..." \
; if [ "${CAUSTICS_VERSION}" == "dev" ]; then \
echo "Installing from github branch: ${CAUSTICS_VERSION}" \
&& pip install --no-cache ${CAUSTICS_REPO} \
echo "Cloning caustics to ${CAUSTICS_HOME}..." \
&& git clone -b ${CAUSTICS_VERSION} --single-branch https://github.com/Ciela-Institute/caustics.git ${CAUSTICS_HOME} \
&& echo "Installing from github branch: ${CAUSTICS_VERSION}..." \
&& pip install --no-cache "${CAUSTICS_HOME}[dev]" \
; else echo "Installing from production distribution version: ${CAUSTICS_VERSION}" ; \
pip install caustics==${CAUSTICS_VERSION} \
; fi
Loading