Skip to content
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

Feature: Update Python pyproject.toml files to set the minimum Python version to >=3.8 #366

Closed
2 tasks done
meliz19 opened this issue Sep 25, 2024 · 2 comments · Fixed by #371 or #377
Closed
2 tasks done
Assignees
Labels
enhancement New feature or request

Comments

@meliz19
Copy link
Contributor

meliz19 commented Sep 25, 2024

check-pyproject-updates.zip

Description

Currently, aiSSEMBLE sets the minimum Python version to 3.11.4 for its Python modules. We originally did this due to a misunderstanding of how Poetry works. There is no reason why we cannot allow users to use lower Python versions. To extend the use of aiSSEMBLE to a broader user base, this ticket will update the minimum Python version in the pyproject.toml files to >=3.8.

DOD

Test Strategy/Script

  • git pull the latest version of the repo
  • Run mvn clean install
  • Download the attached zip file. Unzip the Python file & run it with the command below to verify all 20 of the METADATA files are updated with python 3.8 - 3.12
    python check-pyproject-updates.py </path/to/aissemble>

For OTS only

  • Generate a new project using the command below.
mvn archetype:generate -B -DarchetypeGroupId=com.boozallen.aissemble \
                          -DarchetypeArtifactId=foundation-archetype \
                          -DarchetypeVersion=1.9.0-SNAPSHOT \
                          -DartifactId=test-project\
                          -DgroupId=org.test \
                          -DprojectName='Test' \
                          -DprojectGitUrl=test.org/test-project\
&& cd test-project
  • Add the following pipelines to test-project-pipeline-models/src/main/resources/pipelines/.
    DataDeliveryPipeline.json:
{
    "name": "DataDeliveryPipeline",
    "package": "com.boozallen",
    "type": {
      "name": "data-flow",
      "implementation": "data-delivery-pyspark"
    },
    "steps": [
      {
        "name": "PysparkStep",
        "type": "synchronous"
      }
    ]
  }

MachineLearningPipeline.json

{
    "name": "MachineLearningPipeline",
    "package": "com.boozallen",
    "type": {
      "name": "machine-learning",
      "implementation": "machine-learning-mlflow"
    },
    "steps": [
      {
        "name": "TrainingStep",
        "type": "training"
      },
      {
        "name": "InferenceStep",
        "type": "inference"
      },
      {
        "name": "SagemakeTrainingStep",
        "type": "sagemakertraining"
      }
    ]
  }
  • Run mvn clean install and resolve all the Manual Actions.
    • In each module that includes a pyproject.toml, you will need to update the relevant aissemble-generated packages to reference the local path. Note Only replace the relevant packages that are listed in the pyproject.toml.
    aissemble-foundation-core-python = {path = "/home/mblack/aissemble/foundation/aissemble-foundation-core-python", develop = true}
    aissemble-foundation-pdp-client-python = {path = "/home/mblack/aissemble/foundation/foundation-security/aissemble-foundation-pdp-client-python", develop = true}
    aissemble-foundation-encryption-policy-python = {path = "/home/mblack/aissemble/foundation/foundation-encryption/aissemble-foundation-encryption-policy-python", develop = true}
    aissemble-extensions-encryption-vault-python = {path = "/home/mblack/aissemble/extensions/extensions-encryption/aissemble-extensions-encryption-vault-python", develop = true}
    aissemble-extensions-data-delivery-spark-py = {path = "/home/mblack/aissemble/extensions/extensions-data-delivery/aissemble-extensions-data-delivery-spark-py", develop = true}
    
  • Run with the command below to verify all 4 of the METADATA files are updated with python 3.8 - 3.12
    python check-pyproject-updates.py </path/to/downstream/project>

References/Additional Context

The current Python modules (1.8.2) on PyPi show that Python 3.12 or just 3 are required.

@meliz19 meliz19 added the enhancement New feature or request label Sep 25, 2024
@meliz19 meliz19 self-assigned this Sep 26, 2024
@cpointe-ibllanos
Copy link
Contributor

Completed an over-the-shoulder. Python upgrade worked as did the mda file changes.

meliz19 added a commit that referenced this issue Sep 26, 2024
meliz19 added a commit that referenced this issue Sep 26, 2024
#366 Feature: Update pyproject.toml files to set min Python version to >=3.8
ewilkins-csi added a commit that referenced this issue Sep 27, 2024
We updated the version bound for python to be `>=3.8` in a previous
commit, but missed updating the MDA templates for data record modules.
This resulted in a failure to build projects with data records, as the
version range `^3.11.4` was no longer satisfied when installing the
dependencies of a PySpark pipeline.
ewilkins-csi added a commit that referenced this issue Sep 27, 2024
@jaebchoi
Copy link
Contributor

Test Passed

  • aissemble built Successfully,
  • running check-pyproject-updates.py updated 20 METADATA as expected.
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants