-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a dockerfile for running the model code locally or in azure (#107
) * Adding image-build * Adding docker file * Dockerfile builds pyrenew correctly * Adding action to build image * Adding triggers for the container image * Pushing to the ghcr * Update container-image.yml * Tagging and adding read access [skip ci] * Adding login action via redhat-actions [skip ci] * Hardcoding image_registry [skip ci] * Direct login without the action [skip ci] * Direct login without the action [skip ci] 3 * Cleaning up before undrafting PR * Correcting the instructions to install pyrenew * Wrong address to image
- Loading branch information
Showing
4 changed files
with
120 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Build container image | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
packages: write | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Installs podman | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends podman | ||
- name: Log in to ghcr.io | ||
run: | | ||
podman login \ | ||
-u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} \ | ||
ghcr.io/cdcgov | ||
- name: Build container image | ||
run: | | ||
make image-build | ||
podman tag pyrenew:latest ghcr.io/cdcgov/pyrenew:latest | ||
podman push ghcr.io/cdcgov/pyrenew:latest | ||
working-directory: model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM ubuntu:24.04 | ||
|
||
LABEL org.opencontainers.image.description="Image of PyRenew python package" | ||
LABEL org.opencontainers.image.source="https://github.com/CDCgov/multisignal-epi-inference" | ||
LABEL org.opencontainers.image.authors="CDC's Center for Forecasting Analytics" | ||
LABEL org.opencontainers.image.license="Apache-2.0" | ||
|
||
# Installing python3-11.0 | ||
RUN apt-get update && apt install -y python3.12 | ||
|
||
# Adding the alias python3 for python3.12 | ||
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 | ||
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.12 1 | ||
|
||
# Installing poetry | ||
RUN apt install -y pipx && \ | ||
pipx install poetry | ||
|
||
RUN echo "export PATH=$PATH:/root/.local/bin" >> ~/.bashrc | ||
|
||
ENV PATH="${PATH}:/root/.local/bin" | ||
|
||
# Copying the project files | ||
COPY src/ poetry.lock pyproject.toml Makefile LICENSE README.md /pyrenew/ | ||
|
||
# Setting the working directory | ||
WORKDIR /pyrenew | ||
|
||
# Installing the dependencies | ||
RUN poetry install | ||
|
||
CMD ["bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters