-
Notifications
You must be signed in to change notification settings - Fork 118
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
add integration tests #310
Merged
jperez999
merged 18 commits into
NVIDIA-Merlin:main
from
radekosmulski:add_integration_test
Jul 12, 2022
Merged
Changes from 8 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
83bb4a4
minor tweaks to the unit test
radekosmulski 65e67e4
add integration tests
radekosmulski 2beb9d7
increase integration test timeout
radekosmulski 7baaffe
set minimal NUM_ROWS for neccessary features to be generated
radekosmulski db28702
switch back to a single test comprising two notebooks
radekosmulski f1b0f50
restructure integration test to prevent OOM error
radekosmulski 7b1258e
updated cI
bschifferer d02b886
remove old file
bschifferer 312309d
remove test_integration.sh
bschifferer 726920d
Merge branch 'main' into add_integration_test
rnyak 52fd61a
Merge branch 'main' into add_integration_test
radekosmulski e5dc74d
add changes from Julio
radekosmulski 071da27
Merge branch 'main' into add_integration_test
radekosmulski 3f0d332
Merge branch 'main' into add_integration_test
jperez999 f6f4204
Merge branch 'main' into add_integration_test
jperez999 e52d249
Fix typo in CI script file name (#445)
karlhigley e2fb7c1
Merge branch 'add_integration_test' of https://github.com/radekosmuls…
bschifferer 1b54899
update notebook
bschifferer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# Copyright (c) 2022, NVIDIA CORPORATION. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
#!/bin/bash | ||
set -e | ||
|
||
pytest -rsx ./tests/integration/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
tests/integration/examples/test_ci_building_deploying_multi_stage_RecSys.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import os | ||
|
||
from testbook import testbook | ||
|
||
from tests.conftest import REPO_ROOT | ||
|
||
import pytest | ||
|
||
pytest.importorskip("tensorflow") | ||
pytest.importorskip("feast") | ||
pytest.importorskip("faiss") | ||
|
||
@testbook( | ||
REPO_ROOT | ||
/ "examples/Building-and-deploying-multi-stage-RecSys/02-Deploying-multi-stage-RecSys-with-Merlin-Systems.ipynb", | ||
execute=False, | ||
timeout=2400 | ||
) | ||
def test_func(tb2): | ||
with testbook( | ||
REPO_ROOT | ||
/ "examples/Building-and-deploying-multi-stage-RecSys/01-Building-Recommender-Systems-with-Merlin.ipynb", | ||
execute=False, | ||
timeout=450 | ||
) as tb1: | ||
tb1.inject( | ||
""" | ||
import os | ||
os.environ["DATA_FOLDER"] = "/tmp/data/" | ||
os.system("mkdir -p /tmp/examples") | ||
os.environ["BASE_DIR"] = "/tmp/examples/" | ||
""" | ||
) | ||
tb1.execute_cell(list(range(0, 16))) | ||
tb1.execute_cell(list(range(17, 22))) | ||
tb1.inject(""" | ||
from pathlib import Path | ||
from merlin.datasets.ecommerce import transform_aliccp | ||
|
||
import glob | ||
|
||
#transform_aliccp(Path('/raid/data/aliccp'), output_path, nvt_workflow=outputs, workflow_name='workflow_ranking') | ||
train = Dataset(sorted(glob.glob('/raid/data/aliccp/train/*.parquet'))[0:2]) | ||
valid = Dataset(sorted(glob.glob('/raid/data/aliccp/test/*.parquet'))[0:2]) | ||
|
||
transform_aliccp( | ||
(train, valid), output_path, nvt_workflow=outputs, workflow_name="workflow_ranking" | ||
) | ||
""") | ||
tb1.execute_cell(list(range(23, len(tb1.cells)))) | ||
|
||
assert os.path.isdir("/tmp/examples/dlrm") | ||
assert os.path.isdir("/tmp/examples/feature_repo") | ||
assert os.path.isdir("/tmp/examples/query_tower") | ||
assert os.path.isfile("/tmp/examples/item_embeddings.parquet") | ||
assert os.path.isfile("/tmp/examples/feature_repo/user_features.py") | ||
assert os.path.isfile("/tmp/examples/feature_repo/item_features.py") | ||
|
||
tb2.inject( | ||
""" | ||
import os | ||
os.environ["DATA_FOLDER"] = "/tmp/data/" | ||
os.environ["BASE_DIR"] = "/tmp/examples/" | ||
""" | ||
) | ||
NUM_OF_CELLS = len(tb2.cells) | ||
tb2.execute_cell(list(range(0, NUM_OF_CELLS - 3))) | ||
top_k = tb2.ref("top_k") | ||
outputs = tb2.ref("outputs") | ||
request = tb2.ref("request") | ||
assert outputs[0] == "ordered_ids" | ||
tb2.inject( | ||
""" | ||
import shutil | ||
from merlin.models.loader.tf_utils import configure_tensorflow | ||
configure_tensorflow() | ||
from merlin.systems.triton.utils import run_ensemble_on_tritonserver | ||
response = run_ensemble_on_tritonserver( | ||
"/tmp/examples/poc_ensemble", outputs, request, "ensemble_model" | ||
) | ||
response = [x.tolist()[0] for x in response["ordered_ids"]] | ||
shutil.rmtree("/tmp/examples/", ignore_errors=True) | ||
""" | ||
) | ||
tb2.execute_cell(NUM_OF_CELLS - 2) | ||
response = tb2.ref("response") | ||
assert len(response) == top_k |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
pytest.importorskip("feast") | ||
pytest.importorskip("faiss") | ||
|
||
|
||
def test_func(): | ||
with testbook( | ||
REPO_ROOT | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
remove this change and the tests seem to work. I would replace this code box with a text box that just tells them the command to run.