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

add ollama installation to Dockerfile and test and update readme #31

Merged
merged 1 commit into from
Mar 20, 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
14 changes: 12 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ ENV CONTAINER_USER="analyticalplatform" \
VISUAL_STUDIO_CODE_VERSION="1.87.2-1709912201" \
AWS_CLI_VERSION="2.15.28" \
MINICONDA_VERSION="24.1.2-0" \
MINICONDA_SHA265="8eb5999c2f7ac6189690d95ae5ec911032fa6697ae4b34eb3235802086566d78" \
MINICONDA_SHA256="8eb5999c2f7ac6189690d95ae5ec911032fa6697ae4b34eb3235802086566d78" \
OLLAMA_VERSION="0.1.29" \
OLLAMA_SHA256="332911072ca8bc2d41323582eed4d42205074b7ba82e7008d4e75761a1260b0e" \
PATH="/opt/conda/bin:${PATH}"

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
Expand Down Expand Up @@ -96,13 +98,21 @@ RUN gpg --import /opt/aws-cli/[email protected] \
RUN curl --location --fail-with-body \
"https://repo.anaconda.com/miniconda/Miniconda3-py310_${MINICONDA_VERSION}-Linux-x86_64.sh" \
--output "miniconda.sh" \
&& echo "${MINICONDA_SHA265} miniconda.sh" | sha256sum --check \
&& echo "${MINICONDA_SHA256} miniconda.sh" | sha256sum --check \
&& bash miniconda.sh -b -p /opt/conda \
&& rm --force miniconda.sh

COPY --chown=nobody:nobody --chmod=0755 src/usr/local/bin/entrypoint.sh /usr/local/bin/entrypoint.sh
COPY --chown=nobody:nobody --chmod=0755 src/usr/local/bin/healthcheck.sh /usr/local/bin/healthcheck.sh

# Ollama
RUN curl --location --fail-with-body \
"https://github.com/ollama/ollama/releases/download/v${OLLAMA_VERSION}/ollama-linux-amd64" \
--output "ollama" \
&& echo "${OLLAMA_SHA256} ollama" | sha256sum --check \
&& install --owner=root --group=root --mode=775 ollama /usr/local/bin/ollama \
&& rm --force ollama

USER ${CONTAINER_USER}

WORKDIR /home/${CONTAINER_USER}
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Additionally the following tools are installed:

- [AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/index.html)
- [Miniconda](https://docs.anaconda.com/free/miniconda/index.html)
- [Ollama](https://ollama.com/)

## Running Locally

Expand Down Expand Up @@ -89,3 +90,11 @@ As of 20/02/24, the GPG public key used for verifying AWS CLI expires 26/07/24,
### Miniconda

Releases for Miniconda are maintained on [docs.anaconda.com](https://docs.anaconda.com/free/miniconda/miniconda-release-notes/), from there we can use [repo.anaconda.com](https://repo.anaconda.com/miniconda/) to determine the artefact name and SHA256 based on a version. We currently use `py310`, `Linux` and `x86_64`variant.


### Ollama

Ollama is a tool that allows you to run open-source large language models (LLMs) locally on your machine. It supports a variety of models, including Llama 2, Code Llama, and others.

Ollama don't currently provide SHA256 checksum for their installation file. For now, a checksum was acquired by running the following command locally:
`curl --location --fail-with-body "https://github.com/ollama/ollama/releases/download/v0.1.29/ollama-linux-amd64" | sha256sum`
5 changes: 5 additions & 0 deletions test/container-structure-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ commandTests:
args: ["--version"]
expectedOutput: ["pip.*"]

- name: "ollama"
command: "ollama"
args: ["--version"]
expectedOutput: [".*version.*"]

fileContentTests:
- name: "bashrc first-run-notice"
path: "/etc/bash.bashrc"
Expand Down
Loading