The linux ec2-based tests are currently structured to create the worker-agent user during instance startup using ec2-userdata scripting. The worker agent installer contains code that will create the agent-user if it does not exist. The current test setup prevents writing tests that test that functionality
What was the solution? (How)
Refactor the scripting that is materialized in the PosixInstanceWorker. Now, user-creation-wise the ec2-userdata only creates the job users and their groups. The 'worker configuration' scripting is now responsible for letting the install script create the worker agent user, and adding it to the required groups & sudoers rules.
What is the impact of this change?
Increased confidence that the deadline cloud worker agent's installer script on Linux correctly creates the agent-user if it needs to.
To make the e2e tests use the Before running the tests:
Modified the agent's requirements-testing.txt to point at my built whl file for the test-fixtures. ( deadline-cloud-test-fixtures @ file:///home/<user>/deadline-cloud-test-fixtures/dist/deadline_cloud_test_fixtures-0.0.post98+g6d4023d.d20240813-py3-none-any.whl)
Force pip installed the requirements-testing.txt into my testing venv.
Set the WORKER_AGENT_WHL_PATH env var to point to my locally built agent whl file.
Pruned all hatch environments, and then ran the e2e tests as prescribed.
I then checked command history in Systems Manager to ensure that the expected RunCommands were run (as a verification that my test fixtures changes were being tested).
What was the problem/requirement? (What/Why)
The linux ec2-based tests are currently structured to create the worker-agent user during instance startup using ec2-userdata scripting. The worker agent installer contains code that will create the agent-user if it does not exist. The current test setup prevents writing tests that test that functionality
What was the solution? (How)
Refactor the scripting that is materialized in the PosixInstanceWorker. Now, user-creation-wise the ec2-userdata only creates the job users and their groups. The 'worker configuration' scripting is now responsible for letting the install script create the worker agent user, and adding it to the required groups & sudoers rules.
What is the impact of this change?
Increased confidence that the deadline cloud worker agent's installer script on Linux correctly creates the agent-user if it needs to.
How was this change tested?
requirements-testing.txt
to point at my built whl file for the test-fixtures. (deadline-cloud-test-fixtures @ file:///home/<user>/deadline-cloud-test-fixtures/dist/deadline_cloud_test_fixtures-0.0.post98+g6d4023d.d20240813-py3-none-any.whl
)WORKER_AGENT_WHL_PATH
env var to point to my locally built agent whl file.I then checked command history in Systems Manager to ensure that the expected RunCommands were run (as a verification that my test fixtures changes were being tested).
All Linux tests pass:
Was this change documented?
There is no documentation to update.
Is this a breaking change?
It should not be.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.