-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fix AMI builds by pinning pip to 18.1 #3081
Conversation
As of pip 19.0, it started printing warnings for Python 2.7, which are treated as errors by Jenkins. I looked briefly in to ignoring or silencing those warnings (see pypa/pip#6147 (comment)), but couldn't configure Jenkins correctly. Thus, I'm going with the downgrade, as was done for #bees in project-icp/bee-pollinator-app#447.
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.
Hm. To get the environment variable set in the correct context, I'd expect it to need to be set at the Ansible task level via https://stackoverflow.com/a/27736434:
model-my-watershed/deployment/ansible/roles/model-my-watershed.app/tasks/dependencies.yml
Line 14 in 2520885
- name: Install application Python dependencies for production model-my-watershed/deployment/ansible/roles/model-my-watershed.celery-worker/tasks/dependencies.yml
Line 14 in 2520885
- name: Install application Python dependencies for production
Is that what you tried?
Either way, given that this works and is consistent with the other fix, I'd be OK with keeping it as is.
Ah! I'll try that. I just set it in as a Build Environment variable for Jenkins, but it didn't get picked up because the build runs Ansible, not pip. |
Just tried this: commit f730cdae655cd7e77456335a29d028a9c805393b
Author: Terence Tuhinanshu <[email protected]>
Date: Tue Jan 29 14:01:08 2019 -0500
Add environment variable to suppress warnings
As of pip 19, it prints warnings about Python 2.7 (see https://github.com/pypa/pip/pull/6147)
which register as errors in Jenkins, causing builds to fail. We
suppress the warnings by declaring this environment variable.
diff --git a/deployment/ansible/roles/model-my-watershed.app/tasks/dependencies.yml b/deployment/ansible/roles/model-my-watershed.app/tasks/dependencies.yml
index a2353a09..b8b17454 100644
--- a/deployment/ansible/roles/model-my-watershed.app/tasks/dependencies.yml
+++ b/deployment/ansible/roles/model-my-watershed.app/tasks/dependencies.yml
@@ -1,6 +1,8 @@
---
- name: Install numba
pip: name=numba version={{ numba_version }}
+ environment:
+ PYTHONWARNINGS: ignore:Please.upgrade::pip._internal.cli.base_command
- name: Install application Python dependencies for development and test
pip: requirements="{{ app_home }}/requirements/{{ item }}.txt"
@@ -8,11 +10,15 @@
- development
- test
when: "['development', 'test'] | some_are_in(group_names)"
+ environment:
+ PYTHONWARNINGS: ignore:Please.upgrade::pip._internal.cli.base_command
notify:
- Restart mmw-app
- name: Install application Python dependencies for production
pip: requirements="{{ app_home }}/requirements/production.txt"
when: "['packer'] | is_in(group_names)"
+ environment:
+ PYTHONWARNINGS: ignore:Please.upgrade::pip._internal.cli.base_command
notify:
- Restart mmw-app
diff --git a/deployment/ansible/roles/model-my-watershed.celery-worker/tasks/dependencies.yml b/deployment/ansible/roles/model-my-watershed.celery-worker/tasks/dependencies.yml
index 443d9f03..5ed5c6cc 100644
--- a/deployment/ansible/roles/model-my-watershed.celery-worker/tasks/dependencies.yml
+++ b/deployment/ansible/roles/model-my-watershed.celery-worker/tasks/dependencies.yml
@@ -1,6 +1,8 @@
---
- name: Install numba
pip: name=numba version={{ numba_version }}
+ environment:
+ PYTHONWARNINGS: ignore:Please.upgrade::pip._internal.cli.base_command
- name: Install application Python dependencies for development and test
pip: requirements="{{ app_home }}/requirements/{{ item }}.txt"
@@ -8,11 +10,15 @@
- development
- test
when: "['development', 'test'] | some_are_in(group_names)"
+ environment:
+ PYTHONWARNINGS: ignore:Please.upgrade::pip._internal.cli.base_command
notify:
- Restart Celery
- name: Install application Python dependencies for production
pip: requirements="{{ app_home }}/requirements/production.txt"
when: "['packer'] | is_in(group_names)"
+ environment:
+ PYTHONWARNINGS: ignore:Please.upgrade::pip._internal.cli.base_command
notify:
- Restart Celery but it didn't work: http://civicci01.internal.azavea.com/view/mmw/job/model-my-watershed-packer-app-and-worker/1132 I'm going to remove that commit and merge the rest for now. |
f730cda
to
f980197
Compare
Overview
As of pip 19.0, it started printing warnings for Python 2.7, which are treated as errors by Jenkins. I looked briefly in to ignoring or silencing those warnings (see pypa/pip#6147 (comment)), but couldn't configure Jenkins correctly. Thus, I'm going with the downgrade, as was done for #bees in project-icp/bee-pollinator-app#447.
Demo
http://civicci01.internal.azavea.com/view/mmw/job/model-my-watershed-packer-app-and-worker/1131