Skip to content

Commit

Permalink
add flux only container for merlin certs
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Oct 24, 2023
1 parent 8ff1e92 commit 4d398a5
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-merlin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: build merlin (and other manual Dockerfile)
on:
workflow_dispatch:
# Always test on pull request
pull_request: []
# pull_request: []

# Deploy on merge to main
# push:
Expand All @@ -22,6 +22,7 @@ jobs:
["merlin-demos/Dockerfile.rabbitmq", 'ghcr.io/rse-ops/merlin-demos:rabbitmq'],
["merlin-demos/Dockerfile.redis", 'ghcr.io/rse-ops/merlin-demos:redis'],
["merlin-demos-certs/Dockerfile", 'ghcr.io/rse-ops/merlin-demos-certs:merlin'],
["merlin-demos-certs/Dockerfile.flux", 'ghcr.io/rse-ops/merlin-demos-certs-flux:merlin'],
["merlin-demos-certs/Dockerfile.rabbitmq", 'ghcr.io/rse-ops/merlin-demos-certs:rabbitmq'],
["merlin-demos-certs/Dockerfile.redis", 'ghcr.io/rse-ops/merlin-demos-certs:redis']]

Expand Down
20 changes: 8 additions & 12 deletions merlin-demos-certs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/rse-ops/flux-conda:mamba
FROM ubuntu:latest

# docker compose build
# docker compose up -d
Expand All @@ -9,7 +9,6 @@ FROM ghcr.io/rse-ops/flux-conda:mamba

# workdir: /workflow

USER root
RUN apt-get update
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install \
curl \
Expand All @@ -25,16 +24,18 @@ RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install \
libseccomp-dev \
libglib2.0-dev \
pkg-config \
python3-pip \
cryptsetup \
runc \
git \
&& apt-get clean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install Singularity
RUN export VERSION=1.18.2 OS=linux ARCH=amd64 && \
wget https://dl.google.com/go/go$VERSION.$OS-$ARCH.tar.gz && \
sudo tar -C /usr/local -xzvf go$VERSION.$OS-$ARCH.tar.gz && \
tar -C /usr/local -xzvf go$VERSION.$OS-$ARCH.tar.gz && \
rm go$VERSION.$OS-$ARCH.tar.gz && \
export PATH=/usr/local/go/bin:$PATH && \
export VERSION=3.11.0 && \
Expand All @@ -43,14 +44,12 @@ RUN export VERSION=1.18.2 OS=linux ARCH=amd64 && \
cd singularity-ce-${VERSION} && \
./mconfig && \
make -C builddir && \
sudo make -C builddir install
make -C builddir install

ENV PATH=/usr/local/go/bin:$PATH

# Wrappers to ensure we source the mamba environment!
USER fluxuser
WORKDIR /workflow
ENV PATH=$PATH:/home/fluxuser/.local/bin

# Merlin from pip doesn't have flux completely implemented
RUN git clone --depth 1 https://github.com/LLNL/merlin /tmp/merlin && \
Expand All @@ -60,24 +59,21 @@ RUN git clone --depth 1 https://github.com/LLNL/merlin /tmp/merlin && \
# Generate the example in advance so we have it ready to go
# in the Flux Operator
RUN merlin config --broker redis && \
rm /home/fluxuser/.merlin/app.yaml
rm /root/.merlin/app.yaml

# Install spellbuild
RUN git clone --depth 1 https://github.com/LLNL/merlin-spellbook /tmp/spellbook && \
cd /tmp/spellbook && \
pip install .

# Updated app yaml
COPY ./merlinu/app.yaml /home/fluxuser/.merlin/app.yaml
COPY ./merlinu/rabbit.pass /home/fluxuser/.merlin/rabbit.pass
COPY ./merlinu/app.yaml /root/.merlin/app.yaml
COPY ./merlinu/rabbit.pass /root/.merlin/rabbit.pass
COPY ./merlinu/cert_rabbitmq /cert_rabbitmq
COPY ./merlinu/cert_redis /cert_redis
# This will need to be copied to /workflow/flux/flux_par.yaml
# after running merlin example flux_par
COPY ./merlinu/flux_par.yaml /workflow/flux_par.yaml

RUN sudo chown -R fluxuser /cert_redis/ && \
sudo chown -R fluxuser /cert_rabbitmq/

# Entrypoint to keep container running!
ENTRYPOINT ["tail", "-f", "/dev/null"]
83 changes: 83 additions & 0 deletions merlin-demos-certs/Dockerfile.flux
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
FROM ghcr.io/rse-ops/flux-conda:mamba

# docker compose build
# docker compose up -d
# docker exec -it <merlin container> bash
# command with flux: flux start --test-size=4
# merlin run feature_demo/feature_demo.yaml
# merlin run-workers feature_demo/feature_demo.yaml

# workdir: /workflow

USER root
RUN apt-get update
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install \
curl \
redis \
libbz2-dev \
liblzma-dev \
libcurl4-openssl-dev \
libncurses5-dev \
squashfs-tools \
tzdata \
wget \
build-essential \
libseccomp-dev \
libglib2.0-dev \
pkg-config \
cryptsetup \
runc \
&& apt-get clean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install Singularity
RUN export VERSION=1.18.2 OS=linux ARCH=amd64 && \
wget https://dl.google.com/go/go$VERSION.$OS-$ARCH.tar.gz && \
sudo tar -C /usr/local -xzvf go$VERSION.$OS-$ARCH.tar.gz && \
rm go$VERSION.$OS-$ARCH.tar.gz && \
export PATH=/usr/local/go/bin:$PATH && \
export VERSION=3.11.0 && \
wget https://github.com/sylabs/singularity/releases/download/v${VERSION}/singularity-ce-${VERSION}.tar.gz && \
tar -xzf singularity-ce-${VERSION}.tar.gz && \
cd singularity-ce-${VERSION} && \
./mconfig && \
make -C builddir && \
sudo make -C builddir install

ENV PATH=/usr/local/go/bin:$PATH

# Wrappers to ensure we source the mamba environment!
USER fluxuser
WORKDIR /workflow
ENV PATH=$PATH:/home/fluxuser/.local/bin

# Merlin from pip doesn't have flux completely implemented
RUN git clone --depth 1 https://github.com/LLNL/merlin /tmp/merlin && \
cd /tmp/merlin && \
pip install .

# Generate the example in advance so we have it ready to go
# in the Flux Operator
RUN merlin config --broker redis && \
rm /home/fluxuser/.merlin/app.yaml

# Install spellbuild
RUN git clone --depth 1 https://github.com/LLNL/merlin-spellbook /tmp/spellbook && \
cd /tmp/spellbook && \
pip install .

# Updated app yaml
COPY ./merlinu/app.yaml /home/fluxuser/.merlin/app.yaml
COPY ./merlinu/rabbit.pass /home/fluxuser/.merlin/rabbit.pass
COPY ./merlinu/cert_rabbitmq /cert_rabbitmq
COPY ./merlinu/cert_redis /cert_redis
# This will need to be copied to /workflow/flux/flux_par.yaml
# after running merlin example flux_par
COPY ./merlinu/flux_par.yaml /workflow/flux_par.yaml

RUN sudo chown -R fluxuser /cert_redis/ && \
sudo chown -R fluxuser /cert_rabbitmq/

# Entrypoint to keep container running!
ENTRYPOINT ["tail", "-f", "/dev/null"]
4 changes: 0 additions & 4 deletions merlin-demos-certs/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@ services:
# certs to the rabbitmq and redis users (uid 999) respectively
build:
dockerfile: Dockerfile.redis
ports:
- "6379:6379"
tty: true
ports:
- "6379:6379"
networks:
- mernet
networks:
- rabbitmq

Expand Down

0 comments on commit 4d398a5

Please sign in to comment.