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

Upgrading Tron to py3.8 + patching it with the fix #934

Merged
merged 19 commits into from
Jan 31, 2024
Merged

Conversation

EmanElsaban
Copy link
Contributor

@EmanElsaban EmanElsaban commented Jan 17, 2024

This PR includes python upgrades for 3.8, the patch to stop tron jobs from getting stuck, fixes to some mypy issues/ tests failing and files edited by the precommit hook + additional PR in task_processing for adding logging and handling of ADDED events (PR : Yelp/task_processing#212)

@EmanElsaban EmanElsaban changed the title Upgrading Tron to py3.8 Upgrading Tron to py3.8 + patching it with the fix Jan 19, 2024
@EmanElsaban EmanElsaban force-pushed the temp-jammy-fork branch 4 times, most recently from 08f4f59 to eda4bc0 Compare January 19, 2024 21:20
tests/commands/retry_test.py Outdated Show resolved Hide resolved
dev/config/MASTER.yaml Outdated Show resolved Hide resolved
debian/rules Outdated Show resolved Hide resolved
tox.ini Outdated Show resolved Hide resolved
tron/commands/client.py Show resolved Hide resolved
tron/core/actionrun.py Outdated Show resolved Hide resolved
tron/kubernetes.py Outdated Show resolved Hide resolved
tron/serialize/runstate/dynamodb_state_store.py Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@EmanElsaban EmanElsaban force-pushed the temp-jammy-fork branch 2 times, most recently from e9283b1 to bee49c1 Compare January 22, 2024 23:59
@EmanElsaban EmanElsaban requested a review from Molaire January 23, 2024 00:11
@EmanElsaban EmanElsaban requested a review from nemacysts January 23, 2024 00:11
tron/kubernetes.py Outdated Show resolved Hide resolved
tron/kubernetes.py Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@EmanElsaban EmanElsaban force-pushed the temp-jammy-fork branch 2 times, most recently from 77708fd to 028a87a Compare January 25, 2024 17:08
@@ -11,7 +11,7 @@ endif

NOOP = true
ifeq ($(PAASTA_ENV),YELP)
export PIP_INDEX_URL ?= https://pypi.yelpcorp.com/simple
export PIP_INDEX_URL ?= http://169.254.255.254:20641/$*/simple/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh nice, this works! I was thinking that we'd need to do the $* bit inside the targets themselves :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yupp, same I thought I would need to add it at first to the targets themselves :p

if self.deferred is None:
log.warning("Unable to get a handler for next event in queue - this should never happen!")
# TODO: figure out how to recover if we were unable to get a handler
# Not adding a callback is very bad here as this means we will never handle this event
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super-nit if we want to be extra verbose for future-us:

Suggested change
# Not adding a callback is very bad here as this means we will never handle this event
# Not adding a callback is very bad here as this means we will never handle future events
# This hasn't happened to date, and if it does hopefully the errback added in a previous
# handle_next_event() will get us back on track for now

@@ -1046,7 +1176,7 @@ def submit_command(self, attempt: ActionRunAttempt) -> Optional[KubernetesTask]:
service_account_name=attempt.command_config.service_account_name,
ports=attempt.command_config.ports,
)
except Exception:
except InvariantException:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically, we could have other exceptions thrown here (e.g., build_environment() or filehandler.OutputStreamSerializer() could throw - but those do seem somewhat unlikely

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm should we change this to except Exception to catch all other exceptions based on the hierarchy shown here: https://martinxpn.medium.com/exception-hierarchy-python-58-100-days-of-python-9d8585e6569b#:~:text=The%20Exception%20Hierarchy,class%20in%20the%20exception%20hierarchy.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, unless we're extra-sure that none of the other things we do here will throw, it's probably a good idea to change this back to except Exception

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or

except (InvariantException, Exception):

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm honestly not sure if anything else throws or not since I didn't really touch this code, I will change it in a separate follow up PR and not here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL, I'm so confused as of why it shows as added in this PR. This change was added three years ago: https://github.com/Yelp/Tron/blame/b1118433b10c06a6f15b668d2f5c184115d701e5/tron/core/actionrun.py

Copy link
Contributor Author

@EmanElsaban EmanElsaban Jan 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to this PR it should be Exception: https://github.com/Yelp/Tron/pull/926/files , not sure what brought it back in this PR. Will make it except Exception as this is how it is in Master branch

@EmanElsaban EmanElsaban requested a review from nemacysts January 30, 2024 15:47
@EmanElsaban EmanElsaban merged commit 0480527 into master Jan 31, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants