Conversation
- Updated StderrViewer and StdoutViewer to use artifact_path for accessing stderr and stdout files. - Introduced staging directory for job outputs, separating them from review directory. - Enhanced SyftJobRunner to manage stdout and stderr in staging, with options for sharing logs with submitters. - Implemented traceback capture functionality to sanitize and record job errors securely. - Added tests to verify the behavior of staged logs and their release process. - Adjusted job processing methods to ensure logs are only shared when explicitly released.
- Drop a traceback block with no frames and read the type only after the last frame, so job output cannot land in the record as the exception type. - Match frames behind an ExceptionGroup gutter. - Keep the innermost frames when the frame cap truncates. - Reject a non-enclave job in approve_job, which took disclosures as approve's reason and granted nothing. - Honour a False value in a map passed to normalize_disclosures.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The job runner writes stdout and stderr to a new staging folder, not to the review folder that the submitter reads. For an enclave job, the enclave moves an artifact to the review folder only when every data owner released that item.
Changes
app_data/job/staging/<ds>/v<n>/<job>/. The runner writesstdout.txtandstderr.txtthere.returncode.txtandoutputs/still go to the review folder. The submitter holds a read grant on the folderreview/<ds>/, and every file under that folder inherits the grant. A write to the review folder is therefore the disclosure. The staging folder carries no grant.JobInfo.release_artifacts()andJobInfo.release_logs()move a staged file to the review folder.JobInfo.artifact_path()finds the file in either folder, soStdoutViewer,StderrViewerand the syft-bg stderr notifier still read a log that no party released.DisclosureItemnames two items:logsandtraceback_frames.approved_disclosures()returns the items that every party released.approve_job(job, disclosures)records the grant of one data owner.update_disclosures()changes that grant after the run, and_forward_new_releases()sends the artifact that a late grant covers.traceback_capturewritestraceback_frames.jsonfrom the staged stderr. The record holds the file and the line of each frame, and the exception type. It never holds the exception message. Job execution does not change: there is no wrapper script and no new environment variable, andrun.shkeeps its current form. A job submitted before this branch therefore also gets a record.Testing
test_staging.py,test_traceback_capture.pyandtest_disclosures.py.test_full_job_lifecycle()andtest_truncated_logs.pyfollow the new paths.uv run pytest packages/syft-job/tests packages/syft-enclave/tests/test_disclosures.py tests/unit/test_truncated_logs.py— 99 passed.uv run pytest packages/syft-enclave/tests/test_enclave_jobs.py packages/syft-rds/tests/test_job_auto_approval.py tests/unit/syft_bg/test_email_approve.py— 45 passed.test_no_sync_runs_while_an_ungranted_artifact_sits_in_review()watches the sync engine and checks that no gated file sits in the review folder at any sync. That test proves the gate, and not only the move.ruff checkandruff formatreport no problem. An old client reads a new approval file, because pydantic drops the extradisclosureskey.Asana task
https://app.asana.com/1/1185126988600652/project/1210542925864934/task/1217980407095932?focus=true