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

CKAN pip requirements management -- PIPENV #3415

Closed
1 task
jbrown-xentity opened this issue Sep 8, 2021 · 6 comments
Closed
1 task

CKAN pip requirements management -- PIPENV #3415

jbrown-xentity opened this issue Sep 8, 2021 · 6 comments
Assignees

Comments

@jbrown-xentity
Copy link
Contributor

User Story

In order to have a native python module management system and locking system, data.gov sysadmin wants to implement pipenv to manage python dependencies for catalog and inventory applications.

Acceptance Criteria

[ACs should be clearly demoable/verifiable whenever possible. Try specifying them using BDD.]

  • GIVEN a python module is ready to be upgraded
    WHEN make update-dependencies is run
    THEN the python module is upgraded and locked at the latest possible version
    AND cloud.gov can build and implement the locked dependencies

Background

The custom way that the python modules is managed (requirements.txt and requirements.in files) makes it difficult to manage with 3rd party scanning systems; they create PR's that need editing before they can be merged. We want to move to a more standard approach.
It has been mentioned that pipenv does not work with CKAN, though there is no evidence of this. There may be some blockers to making this work.

Security Considerations (required)

None

Sketch

[Notes or a checklist reflecting our understanding of the selected approach]

@btylerburton
Copy link
Contributor

btylerburton commented Jul 6, 2022

Some deeper discussion on pipenv vs poetry here: https://news.ycombinator.com/item?id=26093926

Poetry also helps with publishing to PyPi FWIW.

EDIT: there's also lightweight alternative pip-tools > https://github.com/jazzband/pip-tools

@hkdctol hkdctol moved this to Product Backlog in data.gov team board Aug 25, 2022
@hkdctol hkdctol moved this from Product Backlog to Sprint Backlog [7] in data.gov team board Aug 25, 2022
@hkdctol hkdctol moved this from Sprint Backlog [7] to Product Backlog in data.gov team board Aug 25, 2022
@hkdctol hkdctol moved this from 📔 Product Backlog to 📟 Sprint Backlog [7] in data.gov team board Nov 10, 2022
@nickumia-reisys nickumia-reisys self-assigned this Nov 11, 2022
@nickumia-reisys nickumia-reisys moved this from 📟 Sprint Backlog [7] to 🏗 In Progress [8] in data.gov team board Nov 11, 2022
@nickumia-reisys
Copy link
Contributor

I'm not sure we can use pipenv in isolation. As far as I know, to satisfy the cloud.gov need to vendor dependencies, pip is the only tool that does this..

@nickumia-reisys
Copy link
Contributor

Well, I take back the "only tool" part. Poetry supports downloading them, but I'm still not sure this is compatible with cloud.gov

@nickumia-reisys
Copy link
Contributor

I wanted to wait until I had the absolute final decision to post it here (since I'm not hopeful of the path I'm taking now), but the intermediary answer is that pipenv is very, very ... very slow. Using it for all of our requirements management is not practical. It triples or quadruples the build time of ckan in docker and the locking process takes 10 to 30 minutes which is not realistic when updating dependencies. These results are when using the latest version 2022.11.11 in docker. Using an older version 2021.5.29 locally is some form of faster.

I pushed GSA/catalog.data.gov@c7ee555 that would use pip for all local testing and then pipenv for "vendoring" of cloud.gov. It is a solution, but it would still leave the (minimum) 10 to 30 mins to update-dependencies which I still think is impractical.

I believe it's the decision of the team currently that the benefits of pipenv do not outweigh the drawbacks. So I'm closing this issue. All of the work has been documented in the PR above.

Repository owner moved this from 🏗 In Progress [8] to ✔ Done in data.gov team board Nov 17, 2022
@nickumia-reisys nickumia-reisys changed the title CKAN pip requirements management CKAN pip requirements management -- PIPENV Nov 17, 2022
@btylerburton
Copy link
Contributor

I wonder how they're achieving this benchmarking if that's the case. 34s! Their requirements.txt is just a bit smaller than ours.
https://lincolnloop.github.io/python-package-manager-shootout/

@nickumia-reisys
Copy link
Contributor

I'd be interested in that as well. 🦑

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants