Skip to content

Commit

Permalink
update codegen readme (containers#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelClifford authored and lmilbaum committed Mar 24, 2024
1 parent 00cd386 commit 8ddd122
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .devcontainer/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM registry.access.redhat.com/ubi9/python-311:1-52

USER root

COPY playground/tests/requirements.txt .

RUN pip3 install -r requirements.txt && \
dnf install -y podman buildah && \
dnf clean all
8 changes: 8 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "playground",
"build": {
"dockerfile": "Containerfile",
"context": ".."
},
"privileged": true
}
3 changes: 1 addition & 2 deletions playground/Containerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
FROM registry.access.redhat.com/ubi9/python-39:latest
WORKDIR /locallm
COPY requirements.txt /locallm/requirements.txt
RUN pip install --upgrade pip
RUN pip install --no-cache-dir --upgrade -r /locallm/requirements.txt
RUN pip install --no-cache-dir -r /locallm/requirements.txt
COPY run.sh run.sh
EXPOSE 8001
ENTRYPOINT [ "sh", "run.sh" ]
3 changes: 3 additions & 0 deletions playground/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.PHONY: build
build:
buildah bud -f Containerfile --no-cache -t playground .
3 changes: 2 additions & 1 deletion playground/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
llama-cpp-python[server]
llama-cpp-python[server]==0.2.57
pip==24.0
Empty file added playground/tests/__init__.py
Empty file.
7 changes: 7 additions & 0 deletions playground/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import pytest_container

TW = pytest_container.Container(url="containers-storage:localhost/playground",forwarded_ports=[pytest_container.PortForwarding(container_port=8001)])
CONTAINER_IMAGES = [TW]

def pytest_generate_tests(metafunc):
pytest_container.auto_container_parametrize(metafunc)
4 changes: 4 additions & 0 deletions playground/tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pip==24.0
pytest-container==0.3.0
pytest-testinfra==10.1.0
pytest==8.1.1
5 changes: 5 additions & 0 deletions playground/tests/test_alive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import pytest_container


def test_alive(auto_container: pytest_container.container.ContainerData, host):
res = host.run_expect([0],f"curl localhost:{auto_container.forwarded_ports[0].host_port}",).stdout.strip()

0 comments on commit 8ddd122

Please sign in to comment.