-
Notifications
You must be signed in to change notification settings - Fork 30
Input files packaging #510
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
Merged
andrii-i
merged 33 commits into
jupyter-server:main
from
andrii-i:package_input_files_no_autodownload
Apr 26, 2024
Merged
Changes from 28 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
3ca4cef
package input files and folders (backend)
andrii-i 3b5f74e
package input files and folders (frontend)
andrii-i eaed794
remove "input_dir" from staging_paths dict
andrii-i 292b445
ensure execution context matches the notebook directory
andrii-i 324f043
update snapshots
andrii-i 92f01b9
copy staging folder to output folder after job runs (SUCESS or FAILURE)
andrii-i e3cf95a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] ee89d9e
copy staging folder and side effects to output after job runs, track …
andrii-i f0fd372
remove staging to output copying logic from executor
andrii-i dcc096b
refactor output files creation logic into a separate function for cla…
andrii-i 3a9ac88
Fix job definition data model
andrii-i 2a6da0e
add packaged_files to JobDefinition and DescribeJobDefinition model
andrii-i 6ec35f8
fix existing pytests
andrii-i d9936f7
clarify FilesDirectoryLink title
andrii-i ff7cc25
Dynamically display input folder in the checkbox text
andrii-i e2596eb
display packageInputFolder parameter as 'Files included'
andrii-i 51a0e55
use helper text with input directory for 'include files' checkbox
andrii-i fb65360
Update Playwright Snapshots
github-actions[bot] 6720e84
add test side effects accountability test for execution manager
andrii-i a56a740
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2a83057
Use "Run job with input folder" for packageInputFolder checkbox text
andrii-i f2318b1
Update Playwright Snapshots
github-actions[bot] 7ff7e50
Use "Ran with input folder" in detail page
andrii-i ad43bde
Update src/components/input-folder-checkbox.tsx
andrii-i 5da9b26
fix lint error
andrii-i 1452f1f
Update Playwright Snapshots
github-actions[bot] 343f403
Update existing screenshots
andrii-i 22483a6
Update "Submit the Create Job" section mentioning “Run job with input…
andrii-i 5497f08
Update docs/users/index.md
andrii-i 9ef28ee
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] abc5085
Update src/components/input-folder-checkbox.tsx
andrii-i 247e44d
Update Playwright Snapshots
github-actions[bot] 106bdc8
Describe side effects behavior better
andrii-i 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,50 @@ | ||
import os | ||
from contextlib import contextmanager | ||
from pathlib import Path | ||
from unittest.mock import PropertyMock, patch | ||
|
||
import pytest | ||
from sqlalchemy import create_engine | ||
from sqlalchemy.orm import sessionmaker | ||
|
||
from jupyter_scheduler.executors import DefaultExecutionManager | ||
from jupyter_scheduler.orm import Base, Job | ||
|
||
NOTEBOOK_DIR = Path(__file__).resolve().parent / "test_staging_dir" / "job-3" | ||
NOTEBOOK_NAME = "side_effects.ipynb" | ||
NOTEBOOK_PATH = NOTEBOOK_DIR / NOTEBOOK_NAME | ||
SIDE_EFFECT_FILE = NOTEBOOK_DIR / "output_side_effect.txt" | ||
|
||
|
||
def test_execution_manager_with_side_effects(): | ||
db_url = "sqlite://" | ||
engine = create_engine(db_url, echo=False) | ||
Base.metadata.create_all(engine) | ||
db_session = sessionmaker(bind=engine) | ||
with db_session() as session: | ||
job = Job( | ||
runtime_environment_name="abc", | ||
input_filename=NOTEBOOK_NAME, | ||
job_id="123", | ||
) | ||
session.add(job) | ||
session.commit() | ||
|
||
manager = DefaultExecutionManager( | ||
job_id="123", | ||
root_dir=str(NOTEBOOK_DIR), | ||
db_url=db_url, | ||
staging_paths={"input": str(NOTEBOOK_PATH)}, | ||
) | ||
|
||
with patch.object( | ||
DefaultExecutionManager, | ||
"db_session", | ||
new_callable=PropertyMock, | ||
) as mock_db_session: | ||
mock_db_session.return_value = db_session | ||
manager.add_side_effects_files(str(NOTEBOOK_DIR)) | ||
|
||
assert ( | ||
"output_side_effect.txt" in job.packaged_files | ||
), "Side effect file was not added to packaged_files" |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.