-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sdktechno 264 - python 3.12 #644
Merged
Merged
Changes from 27 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
fe89d5c
[BOT] Set version for this branch
github-saagie 3577b1e
first commit
8b1fb4d
remove verbose*
031a450
temp delete tests
1da52f3
revert add tests
1cff9f9
another test for tests
474337e
remove 3.12
78bc9b0
force rebuild 3.11
a742df3
[BOT] Set version for this branch
github-saagie 16d182c
force rebuild 3.12
5ec6261
Merge branch 'SDKTECHNO-264' of github.com:saagie/technologies into S…
4e35f92
keep only 3.12 base
1c0c1be
[BOT] Set version for this branch
github-saagie dee8e57
add python 3.12
0dfe211
another test
97de177
[BOT] Set version for this branch
github-saagie 2a70708
add 3.12
a26fd1f
Merge branch 'SDKTECHNO-264' of github.com:saagie/technologies into S…
c184716
3.11
7f81c15
another test
49e0fe6
without trino
3938ce7
sd
c0a0f29
hg
b015faf
Requests
e8bd0c5
pip
ecbb1da
lightening tests
dc4a24f
[BOT] Set version for this branch
github-saagie 5ed621c
artifact mandatory false
5e1101a
update mandatory artifact
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
FROM python:3.12.4-slim-bullseye | ||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
ENV LC_ALL C | ||
ENV LD_RUN_PATH /usr/local/lib | ||
|
||
# LIGHT DEPENDENCIES START | ||
RUN apt-get update -qq && \ | ||
apt-get install -yqq --no-install-recommends \ | ||
ftp wget curl unzip telnet openssh-client git apt-transport-https ca-certificates \ | ||
krb5-user libpam-krb5 libpam-ccreds locales openjdk-11-jdk ca-certificates-java ant && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
# LIGHT DEPENDENCIES END | ||
|
||
# UPGRADE PIP | ||
RUN pip --no-cache-dir install --upgrade pip | ||
|
||
# Add Hadoop CLI | ||
RUN cd / \ | ||
&& mkdir app \ | ||
&& cd app \ | ||
&& wget -nv https://archive.apache.org/dist/hadoop/common/hadoop-2.6.5/hadoop-2.6.5.tar.gz \ | ||
&& tar xvf hadoop-2.6.5.tar.gz \ | ||
&& rm hadoop-2.6.5.tar.gz \ | ||
&& rm -rf hadoop-2.6.5/etc/hadoop \ | ||
&& ln -s /etc/hadoop/conf hadoop-2.6.5/etc/hadoop; | ||
|
||
# Fix Locale | ||
RUN sed -i '/^#.* en_US.* /s/^#//' /etc/locale.gen \ | ||
&& locale-gen | ||
|
||
# Fix certificate issues | ||
RUN update-ca-certificates -f; | ||
|
||
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/ | ||
ENV HADOOP_HOME=/app/hadoop-2.6.5 | ||
ENV HADOOP_CONF_DIR=/etc/hadoop/conf | ||
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/app/hadoop-2.6.5/lib/native:/usr/lib/jvm/java-11-openjdk-amd64/lib" | ||
ENV PATH "/app/hadoop-2.6.5/bin:${PATH}" | ||
ENV LC_ALL en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 | ||
|
||
COPY entrypoint /entrypoint | ||
RUN chmod 755 /entrypoint | ||
|
||
WORKDIR /sandbox | ||
|
||
ENTRYPOINT ["bash","/entrypoint"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<DockerRemoteApiPlugin>() | ||
apply<SaagieTechnologiesGradlePlugin>() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
image: saagie/python | ||
baseTag: 3.12-base | ||
dynamicVersion: 1.183.0_SDKTECHNO-264 | ||
version: 3.12-base-1.183.0_SDKTECHNO-264 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
export CLASSPATH=`hadoop classpath --glob` | ||
|
||
if compgen -G "*.zip*" > /dev/null; then | ||
unzip -q *.zip | ||
fi | ||
if test -f requirements.txt; | ||
then | ||
echo "*******PIP INSTALL BEGIN*******" | ||
pip install -r requirements.txt; | ||
echo "*******PIP INSTALL END*******" | ||
fi; | ||
if [ $? != 0 ]; then echo "Error during 'pip install -f 'requirements.txt''";exit 1; fi; | ||
if test -f main_script; | ||
then sh ./main_script; | ||
else exec "$@" | ||
fi; |
100 changes: 100 additions & 0 deletions
100
technologies/job/python/python-3.12-base/image_test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
schemaVersion: "2.0.0" | ||
|
||
metadataTest: | ||
env: | ||
- key: LANG | ||
value: "en_US.UTF-8" | ||
- key: LC_ALL | ||
value: "en_US.UTF-8" | ||
- key: LD_RUN_PATH | ||
value: "/usr/local/lib" | ||
- key: PATH | ||
value: "/app/hadoop-2.6.5/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||
- key: "HADOOP_CONF_DIR" | ||
value: "/etc/hadoop/conf" | ||
- key: "JAVA_HOME" | ||
value: "/usr/lib/jvm/java-11-openjdk-amd64/" | ||
|
||
fileExistenceTests: | ||
- name: "unzip" | ||
path: "/usr/bin/unzip" | ||
shouldExist: true | ||
permissions: "-rwxr-xr-x" | ||
|
||
- name: "entrypoint" | ||
path: "/entrypoint" | ||
shouldExist: true | ||
permissions: "-rwxr-xr-x" | ||
|
||
- name: "kinit" | ||
path: "/usr/bin/kinit" | ||
shouldExist: true | ||
permissions: "-rwxr-xr-x" | ||
|
||
fileContentTests: | ||
- name: "entrypoint" | ||
path: "/entrypoint" | ||
expectedContents: | ||
[ | ||
"unzip -q \\*.zip", | ||
"pip install -r requirements.txt", | ||
"sh ./main_script", | ||
] | ||
|
||
commandTests: | ||
- name: "java version" | ||
command: "java" | ||
args: [ "-version" ] | ||
expectedError: [ 'openjdk version "11.*' ] | ||
|
||
- name: "ftp" | ||
args: ["-h"] | ||
command: "ftp" | ||
exitCode: 0 | ||
|
||
- name: "wget" | ||
args: ["--help"] | ||
command: "wget" | ||
exitCode: 0 | ||
|
||
- name: "curl" | ||
args: ["--help"] | ||
command: "curl" | ||
exitCode: 0 | ||
|
||
- name: "unzip" | ||
args: ["--help"] | ||
command: "unzip" | ||
exitCode: 0 | ||
|
||
- name: "tar" | ||
args: ["--help"] | ||
command: "tar" | ||
exitCode: 0 | ||
|
||
- name: "telnet" | ||
command: "which" | ||
args: ["telnet"] | ||
expectedOutput: ["/usr/bin/telnet"] | ||
exitCode: 0 | ||
|
||
- name: "scp" | ||
command: "which" | ||
args: ["scp"] | ||
expectedOutput: ["/usr/bin/scp"] | ||
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*"] | ||
|
||
- name: "krb5-user installation" | ||
command: "kinit" | ||
expectedError: ['kinit: Program lacks support for encryption type while getting initial credentials'] | ||
exitCode: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
ARG base_img | ||
|
||
FROM ${base_img} AS BASE_IMG | ||
|
||
# LIBS PART BEGIN | ||
RUN apt update -qq && apt install -qqy --no-install-recommends \ | ||
python3-pip \ | ||
gcc \ | ||
g++ \ | ||
libsasl2-2 \ | ||
libsasl2-modules-ldap \ | ||
build-essential \ | ||
unixodbc \ | ||
unixodbc-dev \ | ||
libpq-dev \ | ||
libsqlite3-dev \ | ||
libkrb5-dev \ | ||
libsasl2-dev \ | ||
libssl-dev \ | ||
libcurl4-openssl-dev \ | ||
libgeos-dev \ | ||
swig \ | ||
python3-matplotlib \ | ||
python3-lxml \ | ||
cmake \ | ||
&& rm -rf /var/lib/apt/lists/*; | ||
# LIBS PART END | ||
|
||
# Need to read requirements.txt file sequentially to ensure consistent installation order | ||
COPY resources/requirements.txt /tmp/requirements.txt | ||
RUN grep -v '^#' /tmp/requirements.txt | xargs -L 1 pip --no-cache-dir install \ | ||
&& rm -rf /root/.cachex \ | ||
&& rm -rf /boot/.cache/pip \ | ||
&& rm -rf ~/.cache/pip | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* 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 | ||
import com.saagie.technologies.readDockerInfo | ||
import com.saagie.technologies.getVersionForDocker | ||
|
||
|
||
apply<DockerRemoteApiPlugin>() | ||
apply<SaagieTechnologiesGradlePlugin>() | ||
|
||
val dockerInfo = readDockerInfo(projectDir) | ||
|
||
tasks.withType(com.bmuschko.gradle.docker.tasks.image.DockerBuildImage::class) { | ||
dependsOn(":${this.project.name}-base:testImage") | ||
this.buildArgs.put( | ||
"base_img", | ||
"${dockerInfo?.image}:${dockerInfo?.baseTag}-base-${this.project.getVersionForDocker()}" | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
id: "3.12" | ||
label: "3.12" | ||
available: true | ||
recommended: true | ||
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: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. C'était peut être ici le false à mettre pour que ça soit remonté automatiquement |
||
comment: "Compatible upload file : .py or .zip (with optional requirements.txt for pip install)" | ||
- 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
image: saagie/python | ||
baseTag: 3.12 | ||
dynamicVersion: 1.183.0_SDKTECHNO-264 | ||
version: 3.12-1.183.0_SDKTECHNO-264 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
false c'est pratique pour ne pas être obligé de mettre un fichier vide parfois