This is an automated email from the ASF dual-hosted git repository. sciabarracom pushed a commit to branch 0.9.0 in repository https://gitbox.apache.org/repos/asf/openserverless-task.git
commit 66308a992c4754e0b815bf7511e31a7f474766ad Author: Build OpenServerless <[email protected]> AuthorDate: Tue Sep 22 13:45:20 2026 +0000 added tika --- opsroot.json | 3 +- setup/openserverless/opsfile.yml | 3 + setup/openserverless/tika/opsfile.yml | 52 ++++++++++++++ setup/openserverless/tika/tika.yaml | 128 ++++++++++++++++++++++++++++++++++ setup/opsfile.yml | 6 ++ 5 files changed, 191 insertions(+), 1 deletion(-) diff --git a/opsroot.json b/opsroot.json index 61df9e8..85bcdd3 100644 --- a/opsroot.json +++ b/opsroot.json @@ -30,7 +30,8 @@ "pgvector": "docker.io/pgvector/pgvector:pg16", "kubegres": "docker.io/reactivetechio/kubegres:1.18", "ferretdb": "ghcr.io/nuvolaris/ferretdb:1.6.0", - "rbacproxy": "registry.k8s.io/kubebuilder/kube-rbac-proxy:v0.14.1" + "rbacproxy": "registry.k8s.io/kubebuilder/kube-rbac-proxy:v0.14.1", + "tika": "docker.io/apache/tika:3.2.3.0-full" } } } diff --git a/setup/openserverless/opsfile.yml b/setup/openserverless/opsfile.yml index 52c9197..81bd55c 100644 --- a/setup/openserverless/opsfile.yml +++ b/setup/openserverless/opsfile.yml @@ -269,6 +269,9 @@ tasks: system-api: desc: manage the system api deployment + tika: + desc: manate tika deployment + add-user: silent: true desc: create a new U=user (default 'devel') with P=password, (default a random pw) diff --git a/setup/openserverless/tika/opsfile.yml b/setup/openserverless/tika/opsfile.yml new file mode 100644 index 0000000..7a99e9a --- /dev/null +++ b/setup/openserverless/tika/opsfile.yml @@ -0,0 +1,52 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +version: "3" + +vars: + ACTION: "apply" + DRY: "" + +env: + TIKA_IMAGE: + sh: echo $IMAGES_TIKA + KUBECONFIG: + sh: |- + if test -e "$OPS_TMP/kubeconfig" + then echo "$OPS_TMP/kubeconfig" + else echo ~/.kube/config + fi + +tasks: + + deploy: + silent: true + desc: deploy tika + cmds: + - echo tika=$TIKA_IMAGE + - envsubst -i tika.yaml -o _tika.yaml + - > + {{.DRY}} kubectl -n openserverless {{.ACTION}} -f _tika.yaml + - > + {{.DRY}} ops setup kubernetes wait OBJECT=po/tika-0 COND=true + + undeploy: + silent: true + desc: uninstall trustable + ignore_error: true + cmds: + - > + {{.DRY}} kubectl -n openserverless delete + sts/tika svc/tika cm/tika-config diff --git a/setup/openserverless/tika/tika.yaml b/setup/openserverless/tika/tika.yaml new file mode 100644 index 0000000..fb8e575 --- /dev/null +++ b/setup/openserverless/tika/tika.yaml @@ -0,0 +1,128 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +apiVersion: v1 +kind: ConfigMap +metadata: + name: tika-config + namespace: openserverless +data: + JAVA_OPTS: "-Xms256m -Xmx1g -Djava.awt.headless=true" + tika-config.xml: | + <properties> + <ocr> + <tesseractPath>/usr/bin/tesseract</tesseractPath> + <applyOcr>true</applyOcr> + <ocrStrategy>ocr_only</ocrStrategy> + <!-- o "ocr_and_text_extraction" se vuoi unire OCR e testo digitale --> + </ocr> + </properties> + +--- +# StatefulSet +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: tika + namespace: openserverless + labels: + app: tika +spec: + serviceName: tika + replicas: 1 + selector: + matchLabels: + app: tika + updateStrategy: + type: RollingUpdate + template: + metadata: + labels: + app: tika + spec: + containers: + - name: tika + image: ${TIKA_IMAGE} + imagePullPolicy: IfNotPresent + #args: + # - "-config" + #s - "/tika-config/tika-config.xml" + ports: + - containerPort: 9998 + name: http + env: + - name: JAVA_OPTS + valueFrom: + configMapKeyRef: + name: tika-config + key: JAVA_OPTS + readinessProbe: + tcpSocket: + port: 9998 + initialDelaySeconds: 10 + periodSeconds: 5 + failureThreshold: 6 + livenessProbe: + tcpSocket: + port: 9998 + initialDelaySeconds: 30 + periodSeconds: 20 + failureThreshold: 3 + resources: + requests: + cpu: "250m" + memory: "512Mi" + limits: + cpu: "1000m" + memory: "2Gi" + volumeMounts: + - name: tika-config + mountPath: /tika-config + - name: tika-data + mountPath: /data + volumes: + - name: tika-config + configMap: + name: tika-config + volumeClaimTemplates: + - metadata: + name: tika-data + labels: + app: tika + spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 10Gi + +--- +# Service +apiVersion: v1 +kind: Service +metadata: + name: tika + namespace: openserverless + labels: + app: tika +spec: + type: ClusterIP + selector: + app: tika + ports: + - port: 9998 + targetPort: 9998 + protocol: TCP + name: http diff --git a/setup/opsfile.yml b/setup/opsfile.yml index c8b8a85..ef8172b 100644 --- a/setup/opsfile.yml +++ b/setup/opsfile.yml @@ -127,6 +127,7 @@ tasks: - ops setup openserverless add-user - ops setup openserverless streamer deploy - ops setup openserverless system-api deploy + - ops setup openserverless tika deploy devcluster: vars: @@ -159,7 +160,11 @@ tasks: then {{.RUN}} ops setup kubernetes delete CONTEXT="{{._context_}}" else {{.RUN}} ops setup kubernetes create CONTEXT="{{._context_}}" + {{.RUN}} ops setup openserverless streamer deploy + {{.RUN}} ops setup openserverless system-api deploy + {{.RUN}} ops setup openserverless tika deploy {{.RUN}} ops setup openserverless login + {{.RUN}} ops setup openserverless add-user config STATUS_LAST=cluster if test -n "{{._context_}}" then config STATUS_CONTEXT="{{._context_}}" @@ -179,6 +184,7 @@ tasks: {{.RUN}} ops setup kubernetes create {{.RUN}} ops setup openserverless streamer deploy {{.RUN}} ops setup openserverless system-api deploy + {{.RUN}} ops setup openserverless tika deploy {{.RUN}} ops setup openserverless login {{.RUN}} ops setup openserverless add-user config STATUS_LAST=server STATUS_SERVER="{{._server_}}"
