Skip to content
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

fix(deadline): use new repository installer log path for Deadline 10.2.* #895

Merged

Conversation

AWS-Samuel
Copy link
Contributor

@AWS-Samuel AWS-Samuel commented Dec 1, 2022

Problem

With the release of Deadline 10.2.0.9, the deadline repository installer log file location changed from /tmp/bitrock_installer.log to /tmp/installbuilder_installer.log.

This introduced a bug which made it so that the log stream in the repository component, meant to stream the repository installation logs, would no longer stream to cloudwatch.

Solution

Add a conditional check in the repository component which changes the path of the installer logs depending on the deadline version.

Testing

  • Build Succeeds
  • Modified unit tests pass
  • Ran e2e tests on multiple versions

E2E Testing Details

Ran the end to end tests in the integ folder by running

yarn e2e in the aws-rfdk/integ directory.

These end to end tests were run using both deadline 10.1.23.6 (max version before installer log change) and 10.2.0.9 (min version after installer log change).

When running for 10.1.23.6

  • Verified that the cloud formation stack template had the following line
    "\",\"log_stream_name\":\"deadlineRepositoryInstallationLogs-{instance_id}\",\"file_path\":\"/tmp/bitrock_installer.log\",\"timezone\":\"Local\"}]}},\"log_stream_name\":\"DefaultLogStream-{instance_id}\",\"force_flush_interval\":15}}"
    
  • Verified that the Repository log group has both of the following streams:
    • deadlineRepositoryInstallationLogs-<instance-id>
    • cloud-init-output-<instance-id>
  • Verified that the deadlineRepositoryInstallationLogs-<instance-id> log stream was streaming installation logs

When running for 10.2.0.9

  • Verified that the cloud formation stack template had the following line
    "\",\"log_stream_name\":\"deadlineRepositoryInstallationLogs-{instance_id}\",\"file_path\":\"/tmp/installbuilder_installer.log\",\"timezone\":\"Local\"}]}},\"log_stream_name\":\"DefaultLogStream-{instance_id}\",\"force_flush_interval\":15}}"
    
  • Verified that the Repository log group has both of the following streams:
    • deadlineRepositoryInstallationLogs-<instance-id>
    • cloud-init-output-<instance-id>
  • Verified that the deadlineRepositoryInstallationLogs-<instance-id> log stream was streaming installation logs

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

ddneilson
ddneilson previously approved these changes Dec 1, 2022
Copy link
Contributor

@ddneilson ddneilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, Sam!

@jusiskin jusiskin added the bug This issue is a bug. label Dec 1, 2022
Copy link
Contributor

@jusiskin jusiskin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, @AWS-Samuel!

Just two non-functional suggestions, so if you can incorporate them you shouldn't need to run integ tests again.

Comment on lines 25 to 28
/**
* The minimum Deadline version which uses Install Builder instead of Bitrock Installer.
*/
public static readonly MINIMUM_VERSION_USING_INSTALLBUILDER = new Version([10, 2, 0, 0]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Bitrock is the company that makes InstallBuilder. Both versions of Deadline use InstallBuilder to make installers, but I suspect that the version of InstallBuilder was changed between Deadline releases and that InstallBuilder changed its (default?) log file path.

Can we instead rename to MINIMUM_VERSION_USING_NEW_INSTALLBUILDER_LOG and adjust the code comment accordingly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in latest commit

@@ -424,7 +424,9 @@ test('repository installer logs all required files', () => {
{}, // log group name. checked in another test.
'\",\"log_stream_name\":\"cloud-init-output-{instance_id}\",\"file_path\":\"/var/log/cloud-init-output.log\",\"timezone\":\"Local\"},{\"log_group_name\":\"',
{}, // log group name again.
'\",\"log_stream_name\":\"deadlineRepositoryInstallationLogs-{instance_id}\",\"file_path\":\"/tmp/bitrock_installer.log\",\"timezone\":\"Local\"}]}},\"log_stream_name\":\"DefaultLogStream-{instance_id}\",\"force_flush_interval\":15}}',
'\",\"log_stream_name\":\"deadlineRepositoryInstallationLogs-{instance_id}\",\"file_path\":\"/tmp/'+
(version.isLessThan(Version.MINIMUM_VERSION_USING_INSTALLBUILDER) ? 'bitrock' : 'installbuilder') +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we actually triggering both code paths here, so there's some missed coverage.

I think the value comes from

version = new MockVersion([10,1,19,4]);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I've done a bit of refactoring to support testing with multiple versions and can confirm that the test covers both cases now.

@jusiskin jusiskin added the contribution/core This is a PR that came from AWS. label Dec 1, 2022
@jusiskin jusiskin changed the title fix: use correct path for repository installer logs fix(deadline): use correct path for repository installer logs Dec 1, 2022
@jusiskin jusiskin changed the title fix(deadline): use correct path for repository installer logs fix(deadline): use new repository installer log path for Deadline 10.2.* Dec 1, 2022
@jusiskin jusiskin merged commit c6db7c0 into aws:mainline Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants