Hi guys, just curious. Do you guys have CI pipelin...
# ask-metaflow
f
Hi guys, just curious. Do you guys have CI pipelines setup for step function creation?
1
s
@fancy-mouse-14245 can you expand on what kind of CI setup you are referring to? Many users embed
python flow.py step-functions create
in their CI runners to deploy a blessed flow onto step functions.
f
I wanted to confirm in most of the CI setup do you guys run step-functions create command from docker file?
c
@fancy-mouse-14245 hey I use SFN within a CI/CD pipeline to productionise our Flows, more info in this article here. I have a Docker image that is used to run the SFN commands in, this is what it looks like:
Copy code
FROM python:3.8-slim-bullseye

# Used within Metaflow Configuration to know who is the user accessing the
# Metaflow Configuration otherwise you won't be able to use the Metaflow Configuration
ENV USERNAME="METAFLOW_USERNAME"
# Used to set the path to where the Metaflow Configuration should reside in
# As we are using a Linux based image we will need to use the root dir
ENV METAFLOW_HOME="/root/.metaflowconfig"

ENV AWS_DEFAULT_REGION="us-east-1"

# Could remove this and set it within the Flow
ENV CONDA_CHANNELS="conda-forge"

WORKDIR /app

ENV CONDA_DIR /opt/conda

RUN apt-get update && \
  apt-get install -y \
  unzip \
  curl \
  jq \
  git \
  wget \
  && apt-get clean \
  && curl "<https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip>" -o "awscliv2.zip" \
  && unzip awscliv2.zip \
  && ./aws/install \
  && rm -rf awscliv2.zip \
  && rm -rf /var/lib/apt/lists/* \
  && wget --quiet <https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh> -O ~/miniconda.sh \
  && /bin/bash ~/miniconda.sh -b -p /opt/conda

# Put conda in path so we can use conda activate
ENV PATH=$CONDA_DIR/bin:$PATH

ENTRYPOINT [ "/bin/bash" ]
You will also need to be able to pull in the Metaflow Configuration within the image, you could either bake it into the image during the build step or pull it at run time(I do it this way cause I have multiple configurations that can be used).
f
Thanks a lot.