From 06ac734a33125cdf2253fe87f91f5b725c2de055 Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Mon, 30 Sep 2024 13:58:39 +0100 Subject: [PATCH] Build both packages to one container, bump version --- Containerfile | 22 +++++++++++++++------- Makefile | 6 ++---- trustgraph-core/setup.py | 4 ++-- trustgraph-embeddings-hf/setup.py | 4 ++-- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Containerfile b/Containerfile index 7f80a514..bfcbe5df 100644 --- a/Containerfile +++ b/Containerfile @@ -21,7 +21,7 @@ RUN pip3 install anthropic boto3 cohere openai google-cloud-aiplatform ollama \ pip3 cache purge # ---------------------------------------------------------------------------- -# Build a container which contains the built Python package. The build +# Build a container which contains the built Python packages. The build # creates a bunch of left-over cruft, a separate phase means this is only # needed to support package build # ---------------------------------------------------------------------------- @@ -30,12 +30,18 @@ FROM ai AS build env PACKAGE_VERSION=0.0.0 -COPY setup.py /root/build/ -COPY README.md /root/build/ -COPY scripts/ /root/build/scripts/ -COPY trustgraph/ root/build/trustgraph/ +COPY trustgraph-core/ /root/build/trustgraph-core/ +COPY README.md /root/build/trustgraph-core/ -RUN (cd /root/build && pip3 wheel -w /root/wheels --no-deps .) +COPY trustgraph-embeddings-hf/ /root/build/trustgraph-embeddings-hf/ +COPY README.md /root/build/trustgraph-embeddings-hf/ + +WORKDIR /root/build/ + +RUN pip3 wheel -w /root/wheels/ --no-deps ./trustgraph-core/ +RUN pip3 wheel -w /root/wheels/ --no-deps ./trustgraph-embeddings-hf/ + +RUN ls /root/wheels # ---------------------------------------------------------------------------- # Finally, the target container. Start with base and add the package. @@ -45,7 +51,9 @@ FROM ai COPY --from=build /root/wheels /root/wheels -RUN pip3 install /root/wheels/trustgraph-* && \ +RUN \ + pip3 install /root/wheels/trustgraph_core-* && \ + pip3 install /root/wheels/trustgraph_embeddings_hf-* && \ pip3 cache purge && \ rm -rf /root/wheels diff --git a/Makefile b/Makefile index 28635fe1..a238d9dd 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,15 @@ # VERSION=$(shell git describe | sed 's/^v//') -VERSION=0.11.5 +VERSION=0.11.6 DOCKER=podman -all: pkgs +all: container pkgs: pip3 wheel --no-deps --wheel-dir dist trustgraph-core/ pip3 wheel --no-deps --wheel-dir dist trustgraph-embeddings-hf/ -# container - CONTAINER=docker.io/trustgraph/trustgraph-flow container: diff --git a/trustgraph-core/setup.py b/trustgraph-core/setup.py index a31bfcbd..c6cd3697 100644 --- a/trustgraph-core/setup.py +++ b/trustgraph-core/setup.py @@ -1,10 +1,10 @@ import setuptools import os -with open("../README.md", "r") as fh: +with open("README.md", "r") as fh: long_description = fh.read() -version = "0.11.5" +version = "0.11.6" setuptools.setup( name="trustgraph-core", diff --git a/trustgraph-embeddings-hf/setup.py b/trustgraph-embeddings-hf/setup.py index 2202b934..82683e18 100644 --- a/trustgraph-embeddings-hf/setup.py +++ b/trustgraph-embeddings-hf/setup.py @@ -1,10 +1,10 @@ import setuptools import os -with open("../README.md", "r") as fh: +with open("README.md", "r") as fh: long_description = fh.read() -version = "0.11.0" +version = "0.11.6" setuptools.setup( name="trustgraph-embeddings-hf",