-
Notifications
You must be signed in to change notification settings - Fork 14
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: add Worker pre-install commands, --start, and Job.get_logs #25
Conversation
95e3dac
to
938de80
Compare
0029fff
to
01e314a
Compare
# TODO: Support multiple job users on Docker | ||
assert ( | ||
len(self.configuration.job_users) == 1 | ||
), f"Multiple job users not supported on Docker worker: {self.configuration.job_users}" |
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.
Going to do the Docker stuff later. It's mostly a dev convenience, and we're at a time crunch at the moment.
415f508
to
b7f25c4
Compare
Signed-off-by: Jericho Tolentino <[email protected]>
b7f25c4
to
e57b537
Compare
session_log_map: dict[str, list[CloudWatchLogEvent]] = {} | ||
for session in sessions: | ||
session_id = session["sessionId"] | ||
get_log_events_response = logs_client.get_log_events( |
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 is a paginated API. As written, this won't be able to fetch the full log stream if there's a lot of data in it.
Returns: | ||
JobLogs: The job logs | ||
""" | ||
list_sessions_response = deadline_client.list_sessions( |
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 is a paginated API. Jobs that have a lot of tasks/steps may end up with more sessions than can be sent in a single response.
Returns: | ||
JobLogs: The job logs | ||
""" | ||
list_sessions_response = deadline_client.list_sessions( |
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.
Canary permissions will need to be updated
session_log_map: dict[str, list[CloudWatchLogEvent]] = {} | ||
for session in sessions: | ||
session_id = session["sessionId"] | ||
get_log_events_response = logs_client.get_log_events( |
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.
Canary permissions will need updating
Signed-off-by: Jericho Tolentino <[email protected]>
7706c1f
to
2e3eb1c
Compare
Related aws-deadline/deadline-cloud-worker-agent#54
What was the problem/requirement? (What/Why)
Need more features and some fixes to add a Worker agent test for the
jobRunAsUser
featureWhat was the solution? (How)
Major changes:
DeadlineWorkerConfiguration,pre_install_commands
property that is a list of commands that run before the Worker agent installer is runworker_config
fixture fromfixtures.py
(see pytest docs on overriding fixtures), then return a newDeadlineWorkerConfiguration
with the modified configurationDeadlineWorkerConfiguration.start_service
and pass it to the Worker agent installer so that the systemd service can be started during installationJob.get_logs
which retrieves the logs for a jobMinor changes / fixes:
raw_kwargs
option to all resource methods that wrap an AWS API call (e.g. CreateJob, CreateQueue, etc.). This gives us the ability to not have to upgrade the library version in order to write testsFARM_ID
andFLEET_ID
to Docker container worker so that users do not need to define those env vars when not usingBYO_DEADLINE
USE_DOCKER_WORKER
so that setting it to something other thantrue
will not use a Docker workerWhat is the impact of this change?
jobRunAsUser
tests for Worker agentHow was this change tested?
Was this change documented?
Is this a breaking change?