diff --git a/technologies/job/python/python-3.12-lite/Dockerfile b/technologies/job/python/python-3.12-lite/Dockerfile new file mode 100644 index 000000000..3ec5349dc --- /dev/null +++ b/technologies/job/python/python-3.12-lite/Dockerfile @@ -0,0 +1,21 @@ +FROM python:3.12.4-slim-bullseye + +ENV DEBIAN_FRONTEND noninteractive +ENV LC_ALL en_US.UTF-8 +ENV LANG en_US.UTF-8 + +# INSTALL DEPENDENCIES +RUN apt-get update -qq && \ + apt-get install -yqq --no-install-recommends unzip && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# UPGRADE PIP +RUN pip --no-cache-dir install --upgrade pip + +COPY entrypoint /entrypoint +RUN chmod 755 /entrypoint + +WORKDIR /sandbox + +ENTRYPOINT ["bash","/entrypoint"] diff --git a/technologies/job/python/python-3.12-lite/build.gradle.kts b/technologies/job/python/python-3.12-lite/build.gradle.kts new file mode 100644 index 000000000..b814e94a3 --- /dev/null +++ b/technologies/job/python/python-3.12-lite/build.gradle.kts @@ -0,0 +1,22 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright 2019-2021. + * + * Licensed 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 + * + * https://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. + */ +import com.bmuschko.gradle.docker.DockerRemoteApiPlugin +import com.saagie.technologies.SaagieTechnologiesGradlePlugin + +apply() +apply() diff --git a/technologies/job/python/python-3.12-lite/context.yaml b/technologies/job/python/python-3.12-lite/context.yaml new file mode 100644 index 000000000..93694c4f3 --- /dev/null +++ b/technologies/job/python/python-3.12-lite/context.yaml @@ -0,0 +1,23 @@ +id: "3.12-lite" +label: "3.12-lite" +available: true +recommended: false +trustLevel: stable +job: + features: + - type: COMMAND_LINE + label: Command line + mandatory: true + comment: Linux shell command to launch the job. + defaultValue: python {file} arg1 arg2 + - type: ARTIFACT + label: Package + mandatory: false + comment: "Compatible upload file : .py or .zip" + - type: SCHEDULER + label: Scheduled + mandatory: true + - type: AI_DESCRIPTION_GENERATOR + label: AI description generator enabled. + mandatory: true + comment: Activation of the AI-based automatic description generation function. diff --git a/technologies/job/python/python-3.12-lite/dockerInfo.yaml b/technologies/job/python/python-3.12-lite/dockerInfo.yaml new file mode 100644 index 000000000..414903a54 --- /dev/null +++ b/technologies/job/python/python-3.12-lite/dockerInfo.yaml @@ -0,0 +1,4 @@ +image: saagie/python +baseTag: 3.12-lite +dynamicVersion: 1.193.0_SDKTECHNO-273 +version: 3.12-lite-1.193.0_SDKTECHNO-273 diff --git a/technologies/job/python/python-3.12-lite/entrypoint b/technologies/job/python/python-3.12-lite/entrypoint new file mode 100644 index 000000000..d43d32f97 --- /dev/null +++ b/technologies/job/python/python-3.12-lite/entrypoint @@ -0,0 +1,12 @@ +#!/bin/bash +set -euo pipefail + +if compgen -G "*.zip*" > /dev/null; then + unzip -q *.zip +fi + +if test -f main_script; then + sh ./main_script; +else + exec "$@" +fi diff --git a/technologies/job/python/python-3.12-lite/image_test.yaml b/technologies/job/python/python-3.12-lite/image_test.yaml new file mode 100644 index 000000000..6e211084c --- /dev/null +++ b/technologies/job/python/python-3.12-lite/image_test.yaml @@ -0,0 +1,44 @@ +schemaVersion: "2.0.0" + +metadataTest: + env: + - key: LANG + value: "en_US.UTF-8" + - key: LC_ALL + value: "en_US.UTF-8" + +fileExistenceTests: + - name: "unzip" + path: "/usr/bin/unzip" + shouldExist: true + permissions: "-rwxr-xr-x" + + - name: "entrypoint" + path: "/entrypoint" + shouldExist: true + permissions: "-rwxr-xr-x" + +fileContentTests: + - name: "entrypoint" + path: "/entrypoint" + expectedContents: + [ + "unzip -q \\*.zip", + "sh ./main_script", + ] + +commandTests: + - name: "unzip" + args: ["--help"] + command: "unzip" + exitCode: 0 + + - name: "python installation" + command: "which" + args: ["python"] + expectedOutput: ["/usr/local/bin/python"] + + - name: "python version" + command: "python" + args: ["-V"] + expectedOutput: ["Python 3.12*"]