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

Feat!: Remove SDK installation from our base image #443

Merged
merged 51 commits into from
Sep 25, 2024

Conversation

SebastianMorawiec
Copy link
Contributor

@SebastianMorawiec SebastianMorawiec commented Aug 23, 2024

The problem

We had to regenerate SDK images each release
https://zapatacomputing.atlassian.net/browse/ORQSDK-1032

This PR's solution

Remove installation of SDK in our worker base images

Checklist

Check that this PR satisfies the following items:

  • Tests have been added for new features/changed behavior (if no new features have been added, check the box).
  • The changelog file has been updated with a user-readable description of the changes (if the change isn't visible to the user in any way, check the box).
  • The PR's title is prefixed with <feat/fix/chore/imp[rovement]/int[ernal]/docs>[!]:
  • The PR is linked to a JIRA ticket (if there's no suitable ticket, check the box).

@SebastianMorawiec SebastianMorawiec requested a review from a team August 23, 2024 10:24
Copy link

github-actions bot commented Aug 23, 2024

🚀 Code Coverage

---------------------------------------------------------------------------------------
src/orquestra/workflow_runtime/_ray/_build_workflow.py      258     45    83%   65-66, 171-177, 189-190, 223, 437-451, 473-479, 492, 563-576, 585-589, 656-663, 696-698
src/orquestra/workflow_runtime/_ray/_client.py               90     12    87%   27-33, 172-173, 187-188, 210-211
src/orquestra/workflow_runtime/_ray/_dag.py                 218     21    90%   81, 241, 351-366, 425-426, 533-534, 554-557, 583-585, 660-662, 698-699, 783, 794
src/orquestra/workflow_runtime/_ray/_dirs.py                 24      8    67%   29-32, 37-40
src/orquestra/workflow_runtime/_testing/_connections.py      38      6    84%   34, 43-56, 83-85
---------------------------------------------------------------------------------------
TOTAL                                                       853     92    89%

6 files skipped due to complete coverage.
-------------
Diff Coverage
Diff: origin/main...HEAD, staged and unstaged changes
-------------
projects/orquestra-workflow-runtime/src/orquestra/workflow_runtime/_ray/_build_workflow.py (91.7%): Missing lines 585
-------------
Total:   12 lines
Missing: 1 line
Coverage: 91%
-------------

@SebastianMorawiec SebastianMorawiec marked this pull request as draft August 23, 2024 11:07
@SebastianMorawiec SebastianMorawiec marked this pull request as ready for review August 30, 2024 14:57
Copy link
Contributor

@alexjuda alexjuda left a comment

Choose a reason for hiding this comment

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

Found few blocking issues, the all the nitpicks are non-blocking

# We should only have two calls: our invocation and the aggregation step
assert len(calls) == 2
# We should only have three calls:
# invocation aggregation step and error handling for aggregation step
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the 3rd call?

@@ -403,7 +393,13 @@ def _(imp: ir.GitImport):
"" if imp.package_name is None else f"{imp.package_name}{extras_string} @ "
)

return [f"{package_name_string}{url_string}"]
# TODO: we should fully support subdirectories as projects
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick TODO without a ticket

@@ -38,7 +37,7 @@ RUN <<EOF
set -ex
. "$VIRTUAL_ENV/bin/activate"
python -m pip install --no-cache-dir -U pip wheel
python -m pip install --no-cache-dir "${SDK_REQUIREMENT}"
python -m pip install --no-cache-dir ray[default]==2.30
Copy link
Contributor

Choose a reason for hiding this comment

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

question: I can imagine the Ray version we're using in the image has to match the Ray version used in other components. Can you remind me what those components are?

It would be great to make a list of them here as a comment, so we know what to pay attention to when bumping the constraint in the future.

Copy link
Contributor Author

@SebastianMorawiec SebastianMorawiec Sep 25, 2024

Choose a reason for hiding this comment

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

Ray version is important in 2 places

  • wdr
  • image being run

B\umping ray version would be the only scenario where we have to rebuild all custom-images as they are based on given ray version.

It will be part of release process

assert deps_imports[0].type == "PYTHON_IMPORT"
# it depends if you have installed SDK with version from PyPi, or
# its local-dev version, it changes what import is used for SDK
assert deps_imports[0].type == "PYTHON_IMPORT" or "GIT_IMPORT"
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: that's not how equality works in Python 😄

>>> foo = "foo"
>>> foo == "abc" or "def"
'def'
Suggested change
assert deps_imports[0].type == "PYTHON_IMPORT" or "GIT_IMPORT"
assert deps_imports[0].type in {"PYTHON_IMPORT", "GIT_IMPORT"}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤦

Copy link
Contributor

Choose a reason for hiding this comment

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

issue: the design doc mentions specifying the images in orquestra-workflow-shared, while this is in orquestra-sdk. Which approach is the intended one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch - I fixed the design doc.

Reasoning:
WDR is dependent on runtime-shared.
If I update WDR to new version, I need to update shared library.
If I updated shared library, I would have to update WDR.
This would basically lead to the looped process.

Now when we update WDR we update client and everything works.

@@ -1178,6 +1190,7 @@ def test_metadata_on_dev(monkeypatch: pytest.MonkeyPatch):
# Given
mocked_installed_version = Mock(return_value="22.42.0.dev1+gitAABBCC.20230101")
monkeypatch.setattr(_versions, "get_installed_version", mocked_installed_version)
monkeypatch.setattr(git.Repo, "is_dirty", Mock(return_value=False))
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: this mock is already set by the autoused fixture mask_sdk_version

Suggested change
monkeypatch.setattr(git.Repo, "is_dirty", Mock(return_value=False))

@@ -384,6 +384,8 @@ class Version(BaseModel):
class WorkflowMetadata(BaseModel):
sdk_version: Version
python_version: Version
# new field added in 0.67. Default to None to allow parsing older IRs
Copy link
Contributor

Choose a reason for hiding this comment

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

nice addition and a nice comment 👍

@SebastianMorawiec SebastianMorawiec merged commit 26daea6 into main Sep 25, 2024
21 of 22 checks passed
@SebastianMorawiec SebastianMorawiec deleted the Morawiec/sdk_base branch September 25, 2024 13:00
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.

2 participants