Skip to content

Commit

Permalink
Merge branch 'master' into feature/bump-inf-tf-tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
BraisVQ authored May 30, 2023
2 parents 7fc6c3c + b7a9d82 commit 41050b3
Show file tree
Hide file tree
Showing 19 changed files with 41 additions and 35 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- Ionic maintenance ([#899](https://github.com/opendevstack/ods-quickstarters/issues/899))
- Update of Maven agent, Java and Spock/Geb quickstarter ([#878](https://github.com/opendevstack/ods-quickstarters/issues/878))
- inf-terraform-[aws|azure], add new jenkins-agent-terraform-2306 with updated tools (ruby 3.2.2, python 3.11, etc.) and dependencies, add tflint, mark other jenkins-agent-terraform as deprecated([#914](https://github.com/opendevstack/ods-quickstarters/issues/914))
- Update of Python agent, Python, Streamlit and Jupyter quickstarters ([#902](https://github.com/opendevstack/ods-quickstarters/issues/902))

## [4.1] - 2022-11-17

Expand Down
4 changes: 2 additions & 2 deletions be-python-flask/Jenkinsfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def stageTestSuite(def context) {

stage('Prepare Test Suite') {
sh """
python3.9 -m venv testsuite
python3.11 -m venv testsuite
. ./testsuite/bin/activate
pip install -r tests_requirements.txt
pip check
Expand All @@ -50,7 +50,7 @@ def stageTestSuite(def context) {
def status = sh(
script: """
. ./testsuite/bin/activate
PYTHONPATH=src python3.9 -m pytest --junitxml=tests.xml -o junit_family=xunit2 --cov-report term-missing --cov-report xml --cov=src -o testpaths=tests
PYTHONPATH=src python3.11 -m pytest --junitxml=tests.xml -o junit_family=xunit2 --cov-report term-missing --cov-report xml --cov=src -o testpaths=tests
mv tests.xml ${testLocation}
mv coverage.xml ${coverageLocation}
mv .coverage ${coverageLocation}
Expand Down
2 changes: 1 addition & 1 deletion be-python-flask/files/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi9/python-39
FROM registry.access.redhat.com/ubi9/python-311

ARG nexusHostWithBasicAuth
ARG nexusHostWithoutScheme
Expand Down
2 changes: 1 addition & 1 deletion be-python-flask/files/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
gunicorn==20.1.0
flask==2.2.2
flask==2.3.2
8 changes: 4 additions & 4 deletions be-python-flask/files/tests_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-r ./requirements.txt

mypy==0.982
flake8==5.0.4
pytest==7.2.0
pytest-cov==4.0.0
mypy==1.3.0
flake8==6.0.0
pytest==7.3.1
pytest-cov==4.1.0
5 changes: 3 additions & 2 deletions common/jenkins-agents/python/docker/Dockerfile.ubi8
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ ENV PYTHONUNBUFFERED=1 \

RUN yum module install -y python38:3.8/build && \
yum module install -y python39:3.9/build --allowerasing && \
yum install -y python3.11 python3.11-pip python3.11-devel python3.11-setuptools --allowerasing && \
yum install -y autoconf automake gcc-c++ openssl-devel libffi-devel && \
yum -y clean all

RUN pipVersions=( pip3.8 pip3.9 ); \
RUN pipVersions=( pip3.8 pip3.9 pip3.11 ); \
for pipV in "${pipVersions[@]}"; \
do \
if [ ! -z ${nexusHost} ] && [ ! -z ${nexusAuth} ]; \
Expand All @@ -25,7 +26,7 @@ RUN pipVersions=( pip3.8 pip3.9 ); \
fi; \
$pipV config set global.cert /etc/ssl/certs/ca-bundle.crt && \
$pipV install --upgrade pip --user && \
$pipV install virtualenv==20.16.6 setuptools==65.5.1 Cython==0.29.32 pypandoc==1.10; \
$pipV install virtualenv==20.23.0 setuptools==67.8.0 Cython==0.29.35 pypandoc==1.11; \
done;

# Enables default user to access $HOME folder
Expand Down
4 changes: 3 additions & 1 deletion docs/modules/jenkins-agents/pages/python.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ This agent is used to build / execute Python code.
The image is built in the global `ods` project and is named `jenkins-agent-python`.
It can be referenced in a `Jenkinsfile` with `ods/jenkins-agent-python`.

It supports building on **Python** versions: **3.9, 3.8 and 3.6**.
It supports building on **Python** versions: **3.11, 3.9, 3.8 and 3.6**.

**NOTE**: Python 3.6 have reached EOL on 2021-12-23. See https://devguide.python.org/versions/[Python versions] for further information.

== Features
1. https://docs.python.org/[Python]
Expand Down
1 change: 1 addition & 0 deletions docs/modules/quickstarters/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
** xref:quickstarters:fe-ionic.adoc[FE Ionic]
** xref:quickstarters:ds-jupyter-lab.adoc[Data Science Jupyter Lab]
** xref:quickstarters:ds-rshiny.adoc[Data Science RShiny app]
** xref:quickstarters:ds-streamlit.adoc[Data Science Streamlit app]
** xref:quickstarters:e2e-cypress.adoc[Cypress E2E testing]
** xref:quickstarters:e2e-spock-geb.adoc[Spock, Geb and Unirest E2E testing]
** xref:quickstarters:inf-terraform-aws.adoc[INF Terraform AWS]
Expand Down
12 changes: 6 additions & 6 deletions docs/modules/quickstarters/pages/be-python-flask.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ It contains the basic setup for Docker, Jenkins, SonarQube and OpenShift.

== Frameworks used

* https://docs.python.org/3.9[Python 3.9]
* https://docs.python.org/3.11[Python 3.11]
* https://gunicorn.org/[gunicorn]
* http://flask.pocoo.org/[flask]
* https://docs.pytest.org/en/stable/[pytest]
Expand All @@ -47,9 +47,9 @@ The project is production ready when deployed in OpenShift thanks to gunicorn.

It is strongly recommended when you are developing a Python project to use separated environments.
For this purpose usually one can use Python's
https://docs.python.org/3.9/library/venv.html[venv] core package (check how to use it in the next steps).
https://docs.python.org/3.11/library/venv.html[venv] core package (check how to use it in the next steps).

NOTE: since the version of Python is 3.9, ensure your system's python executable is also in version 3.9
NOTE: since the version of Python is 3.11, ensure your system's python executable is also in version 3.11

[source,bash]
----
Expand Down Expand Up @@ -115,16 +115,16 @@ The Jenkinsfile is provisioned with this quick starter to ease CI/CD process. In

This quickstarter uses https://github.com/opendevstack/ods-quickstarters/tree/master/common/jenkins-agents/python[Python] builder agent Jenkins builder agent.

**NOTE**: The ODS Jenkins Pytnon Agent supports Python versions 3.9, 3.8 and 3.6. See next chapter for further information.
**NOTE**: The ODS Jenkins Pytnon Agent supports Python versions 3.11, 3.9 and 3.8. See next chapter for further information.


== Multiple Python versions support

Build and run environment defaults to python3.9, but older python3.8 and python3.6 versions are also supported.
Build and run environment defaults to python3.11, but older python3.8 and python3.6 versions are also supported.

If you need older versions support in your project, change:

* in the provided `Jenkinsfile`, the mentions of `python3.9` binary to, for example, `python3.8` binary,
* in the provided `Jenkinsfile`, the mentions of `python3.11` binary to, for example, `python3.9` binary,

* and switch the `FROM` statement in your `Dockerfile` to the python version required, for example, `registry.access.redhat.com/ubi8/python-38`.

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/quickstarters/pages/ds-jupyter-lab.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Provision a shared Jupyter Lab within OpenShift for rapid prototyping of data sc

== Frameworks used

* https://docs.python.org/3.9[Python 3.9]
* https://docs.python.org/3.11[Python 3.11]
* https://jupyterlab.readthedocs.io/en/stable/[JupyterLab]

== Usage - how do you start after you provisioned this quickstarter
Expand Down
6 changes: 3 additions & 3 deletions docs/modules/quickstarters/pages/ds-streamlit.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Provisions a streamlit based dashboard with authentication.

== Frameworks used

* https://docs.python.org/3.9[Python 3.9]
* https://docs.python.org/3.11[Python 3.11]
* https://docs.streamlit.io/library/changelog[streamlit]
* https://pandas.pydata.org/[pandas]
* https://plotly.com/python/[plotly]
Expand All @@ -45,9 +45,9 @@ The quickstarter sets up in OpenShift a pod with two containers. The main `ds-st

It is strongly recommended when you are developing a Python project to use separated environments.
For this purpose usually one can use Python's
https://docs.python.org/3.9/library/venv.html[venv] core package (check how to use it in the next steps).
https://docs.python.org/3.11/library/venv.html[venv] core package (check how to use it in the next steps).

NOTE: since the version of Python is 3.9, ensure your system's python executable is also in version 3.9
NOTE: since the version of Python is 3.11, ensure your system's python executable is also in version 3.11

[source,bash]
----
Expand Down
1 change: 1 addition & 0 deletions docs/modules/quickstarters/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Quickstarters are used from the https://github.com/opendevstack/ods-provisioning
=== Data Science Quickstarter
* xref::ds-jupyter-lab.adoc[Data Science - Jupyter Lab]
* xref::ds-rshiny.adoc[Data Science - R-Shiny]
* xref::ds-streamlit.adoc[Data Science Streamlit app]

=== E2E Test Quickstarter
* xref::e2e-cypress.adoc[E2E test - Cypress]
Expand Down
2 changes: 1 addition & 1 deletion ds-jupyter-lab/files/docker_jupyterlab/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi9/python-39
FROM registry.access.redhat.com/ubi9/python-311

ARG nexusHostWithBasicAuth
ARG nexusHostWithoutScheme
Expand Down
4 changes: 2 additions & 2 deletions ds-jupyter-lab/files/docker_jupyterlab/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
jupyter==1.0.0
ipywidgets==8.0.2
jupyterlab==3.5.0
ipywidgets==8.0.6
jupyterlab==4.0.0
2 changes: 1 addition & 1 deletion ds-streamlit/Jenkinsfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def createTestVirtualenv(def context) {
stage('Create virtualenv for tests') {
sh(
script: """
python3.9 -m venv testvenv
python3.11 -m venv testvenv
. ./testvenv/bin/activate
pip install --upgrade pip
pip install -r test_requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion ds-streamlit/files/docker_streamlit/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi9/python-39
FROM registry.access.redhat.com/ubi9/python-311

ARG nexusHostWithBasicAuth
ARG nexusHostWithoutScheme
Expand Down
2 changes: 1 addition & 1 deletion ds-streamlit/files/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file

[tool.mypy]
python_version = 3.9
python_version = 3.11
warn_unused_configs = true
disallow_untyped_calls = true # Disallow calling functions without type annotations from functions with type annotations (inverse: __allow_untyped_calls)
disallow_untyped_defs=true # Disallow defining functions without type annotations or with incomplete type annotations (inverse: __allow_untyped_defs)
Expand Down
6 changes: 3 additions & 3 deletions ds-streamlit/files/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
streamlit==1.18.1
plotly==5.12.0
pandas==1.5.3
streamlit==1.22.0
plotly==5.14.1
pandas==2.0.2
10 changes: 5 additions & 5 deletions ds-streamlit/files/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-r ./requirements.txt

mypy==0.982
flake8==5.0.4
pytest==7.2.1
pytest-cov==4.0.0
black==23.1.0
mypy==1.3.0
flake8==6.0.0
pytest==7.3.1
pytest-cov==4.1.0
black==23.3.0

0 comments on commit 41050b3

Please sign in to comment.