Skip to content

Commit b04281b

Browse files
committed
Begin process of packaging PRAGmatic
Building Pragmatic into a container image is fairly easy. podman build --build-arg IMAGE=quay.io/ramalama/rocm -t quay.io/ramalama/rocm-rag container-images/pragmatic Signed-off-by: Daniel J Walsh <[email protected]>
1 parent 0befa5c commit b04281b

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
lines changed

.github/workflows/ci-images.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ jobs:
6969
7070
- name: Build Images
7171
run: |
72-
make build_rm
72+
make build-rm

Makefile

+11-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ PATH := $(PATH):$(HOME)/.local/bin
1212
default: help
1313

1414
help:
15-
@echo "Build Container"
15+
@echo "Build Container Image"
1616
@echo
1717
@echo " - make build"
1818
@echo " - make build IMAGE=ramalama"
1919
@echo
20+
@echo "Build RAG Container Image"
21+
@echo
22+
@echo " - make build-rag IMAGE=quay.io/ramalama/ramalama"
23+
@echo
2024
@echo "Build docs"
2125
@echo
2226
@echo " - make docs"
@@ -77,10 +81,14 @@ install: docs completions
7781
build:
7882
./container_build.sh build $(IMAGE)
7983

80-
.PHONY: build_rm
81-
build_rm:
84+
.PHONY: build-rm
85+
build-rm:
8286
./container_build.sh -r build $(IMAGE)
8387

88+
.PHONY: build-rag
89+
build-rag:
90+
podman build --build-arg IMAGE=${IMAGE} -t ${IMAGE}-rag container-images/pragmatic
91+
8492
.PHONY: install-docs
8593
install-docs: docs
8694
make -C docs install
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ARG IMAGE=quay.io/ramalama/ramalama:latest
2+
FROM $IMAGE
3+
4+
COPY pragmatic/build_pragmatic.sh /tmp/
5+
RUN sh /tmp/build_pragmatic.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
clone_and_build_pragmatic() {
4+
git clone https://github.com/redhat-et/PRAGmatic
5+
cd PRAGmatic
6+
git submodule update --init --recursive
7+
PYTHON_VERSION="python3 -m"
8+
9+
if [ "$(python3 --version)" \< "Python 3.11" ]; then
10+
dnf install -y python3.11 python3.11-pip
11+
PYTHON_VERSION="/usr/bin/python3.11 -m"
12+
fi
13+
14+
${PYTHON_VERSION} pip install -r requirements.txt --prefix=/usr
15+
${PYTHON_VERSION} pip install --prefix=/usr .
16+
cd ..
17+
}
18+
19+
clone_and_build_pragmatic
20+
rm -rf /var/cache/*dnf* /opt/rocm-*/lib/*/library/*gfx9* /root/.cache /root/buildinfo PRAGmatic
21+
dnf -y clean all
22+
ldconfig

0 commit comments

Comments
 (0)