Skip to content
Open
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
9 changes: 8 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,24 @@ jobs:
with:
tool-cache: false

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and export
- name: Build and export multi-arch image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
tags: ${{ env.DEV_IMAGE }}
platforms: linux/amd64,linux/s390x
# outputs: type=oci,dest=/tmp/image.tar
outputs: type=docker,dest=/tmp/image.tar
provenance: false

- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down
40 changes: 40 additions & 0 deletions Dockerfile.s390x
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest as poetry-builder

RUN microdnf -y update && \
microdnf -y install \
git wget shadow-utils python3.11 python3.11-pip python-wheel gcc gcc-c++ && \
pip3.11 install --no-cache-dir --upgrade pip wheel && \
microdnf clean all

WORKDIR /caikit
RUN microdnf update -y
RUN wget -q -O miniconda.sh \
https://repo.anaconda.com/miniconda/Miniconda3-py311_24.11.1-0-Linux-s390x.sh && \
chmod 755 miniconda.sh && \
echo 'export PATH=/opt/conda3/bin:$PATH' > /etc/profile.d/conda.sh && \
/bin/bash miniconda.sh -b -p /opt/conda3 && \
rm miniconda.sh && \
. /etc/profile.d/conda.sh

ENV PATH /opt/conda3/bin:$PATH
RUN ln -s /opt/conda3 /opt/conda
RUN conda config --add channels defaults
RUN conda install numpy==1.26.4 pandas==2.2.3 scikit-learn==1.6.1 pytorch==2.5.1 pyarrow==19.0.0 pillow
COPY grpcio-1.72.0.dev0-cp311-cp311-linux_s390x.whl /caikit
RUN pip install grpcio-1.72.0.dev0-cp311-cp311-linux_s390x.whl
COPY requirements.txt /caikit
RUN pip install -r requirements.txt

COPY caikit.yml /caikit/config/caikit.yml

RUN groupadd --system caikit --gid 1001 && \
adduser --system --uid 1001 --gid 0 --groups caikit \
--create-home --home-dir /caikit --shell /sbin/nologin \
--comment "Caikit User" caikit

USER caikit

ENV CONFIG_FILES=/caikit/config/caikit.yml
VOLUME ["/caikit/config/"]

CMD ["python", "-m", "caikit.runtime"]
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
CAIKIT_IMAGE=caikit-tgis-serving
ENGINE ?= podman
export DOCKER_DEFAULT_PLATFORM=linux/amd64
ARCH ?= $(shell uname -m)
PLATFORM = linux/$(ARCH)

ifeq ($(ARCH),s390x)
DOCKERFILE = Dockerfile.s390x
else
DOCKERFILE = Dockerfile
endif

export DOCKER_DEFAULT_PLATFORM = $(PLATFORM)

.PHONY: default refresh-poetry-lock-files

default:
$(ENGINE) build \
--platform=$(PLATFORM) \
-f $(DOCKERFILE) \
-t $(CAIKIT_IMAGE):dev \
-t $(CAIKIT_IMAGE):$$(git rev-parse --short HEAD) \
.


shell: default
$(ENGINE) run -it --rm \
--platform=$(PLATFORM) \
--name caikit-tgis-serving-test-$$(git rev-parse --short HEAD) \
$(CAIKIT_IMAGE):dev \
/bin/bash
Binary file added grpcio-1.72.0.dev0-cp311-cp311-linux_s390x.whl
Binary file not shown.
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
caikit==0.27.7
caikit-nlp==0.5.13
caikit-tgis-backend==0.1.38