-
Notifications
You must be signed in to change notification settings - Fork 21
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: run job attachment output upload as job user #495
Conversation
…n, update attachment download to use python Signed-off-by: Godot Bian <[email protected]>
src/deadline_worker_agent/sessions/actions/run_attachment_download.py
Outdated
Show resolved
Hide resolved
|
||
|
||
def upload(s3_root_uri: str, path_mapping_rules: str, manifests: list[str]) -> None: | ||
s3_path = f"{os.environ.get("DEADLINE_FARM_ID")}/{os.environ.get("DEADLINE_QUEUE_ID")}/{os.environ.get("DEADLINE_JOB_ID")}/{os.environ.get("DEADLINE_STEP_ID")}/{os.environ.get("DEADLINE_TASK_ID")}/{os.environ.get("DEADLINE_SESSIONACTION_ID")}" |
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.
Super nit, maybe a nice refactoring later to make this a helper function in Job Attachment APIs.
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.
Noted!
Signed-off-by: Godot Bian <[email protected]>
Signed-off-by: Godot Bian <[email protected]>
Signed-off-by: Godot Bian <[email protected]>
This is because some tests added are under feature flag. The duplicate will be removed along with feature flag cleanup. |
StepActions as StepActions_2023_09, | ||
) | ||
from openjd.model import ParameterValue | ||
from deadline.job_attachments.api.manifest import _manifest_snapshot |
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.
This could cause an import error in windows, which need to be fixed before merging.
Python could not import the service's module
Traceback (most recent call last):
File "C:\Program Files\Python311\Lib\site-packages\deadline_worker_agent\__init__.py", line 6, in <module>
from .installer import install
File "C:\Program Files\Python311\Lib\site-packages\deadline_worker_agent\installer\__init__.py", line 15, in <module>
from deadline_worker_agent.installer.win_installer import (
File "C:\Program Files\Python311\Lib\site-packages\deadline_worker_agent\installer\win_installer.py", line 36, in <module>
from ..windows.win_service import WorkerAgentWindowsService
File "C:\Program Files\Python311\Lib\site-packages\deadline_worker_agent\windows\win_service.py", line 14, in <module>
from deadline_worker_agent.startup.entrypoint import entrypoint
File "C:\Program Files\Python311\Lib\site-packages\deadline_worker_agent\startup\entrypoint.py", line 24, in <module>
from ..worker import Worker
File "C:\Program Files\Python311\Lib\site-packages\deadline_worker_agent\worker.py", line 25, in <module>
from .scheduler import WorkerScheduler
File "C:\Program Files\Python311\Lib\site-packages\deadline_worker_agent\scheduler\__init__.py", line 4, in <module>
from .session_queue import SessionActionQueue
File "C:\Program Files\Python311\Lib\site-packages\deadline_worker_agent\scheduler\session_queue.py", line 29, in <module>
from ..sessions.actions import (
File "C:\Program Files\Python311\Lib\site-packages\deadline_worker_agent\sessions\actions\__init__.py", line 10, in <module>
from .run_attachment_upload import AttachmentUploadAction
File "C:\Program Files\Python311\Lib\site-packages\deadline_worker_agent\sessions\actions\run_attachment_upload.py", line 24, in <module>
from deadline.job_attachments.api.manifest import _manifest_snapshot
File "C:\Program Files\Python311\Lib\site-packages\deadline\job_attachments\api\__init__.py", line 5, in <module>
from .attachment import attachment_download, attachment_upload
File "C:\Program Files\Python311\Lib\site-packages\deadline\job_attachments\api\attachment.py", line 18, in <module>
from deadline.client.cli._groups.click_logger import ClickLogger
File "C:\Program Files\Python311\Lib\site-packages\deadline\client\cli\__init__.py", line 6, in <module>
from ._deadline_cli import main
File "C:\Program Files\Python311\Lib\site-packages\deadline\client\cli\_deadline_cli.py", line 14, in <module>
from ._common import _PROMPT_WHEN_COMPLETE
File "C:\Program Files\Python311\Lib\site-packages\deadline\client\cli\_common.py", line 31, in <module>
sigint_handler = SigIntHandler()
^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\site-packages\deadline\client\cli\_groups\_sigint_handler.py", line 19, in __new__
signal.signal(signal.SIGINT, cls._instance._handle_sigint)
File "C:\Program Files\Python311\Lib\signal.py", line 58, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: signal only works in main thread of the main interpreter
Kudos to @jericht for helping me find the error log in windows instance!
src/deadline_worker_agent/sessions/actions/run_attachment_download.py
Outdated
Show resolved
Hide resolved
src/deadline_worker_agent/sessions/actions/run_attachment_download.py
Outdated
Show resolved
Hide resolved
src/deadline_worker_agent/sessions/actions/run_attachment_download.py
Outdated
Show resolved
Hide resolved
src/deadline_worker_agent/sessions/actions/run_attachment_download.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Godot Bian <[email protected]>
src/deadline_worker_agent/sessions/actions/scripts/attachment_upload.py
Outdated
Show resolved
Hide resolved
src/deadline_worker_agent/sessions/actions/run_attachment_download.py
Outdated
Show resolved
Hide resolved
src/deadline_worker_agent/sessions/actions/run_attachment_download.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Godot Bian <[email protected]>
Quality Gate failedFailed conditions |
What was the problem/requirement? (What/Why)
Worker Agent runs sync_input and sync_output callbacks to interact with customer s3 as worker agent user. This brings the following problem
What was the solution? (How)
Worker Agent is in the process of changing Job Attachment sync input and sync output to use attachment and manifest commands running as job user.
A sequel to #476
What is the impact of this change?
This is still in development and is under a feature flag.
How was this change tested?
hatch deadline-worker-agent
Was this change documented?
It's currently only documented in the code docstring.
Is this a breaking change?
Not yet
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.