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

[develop] Reuse the rotation script inside the munge resource #2471

Merged
merged 17 commits into from
Oct 12, 2023

Conversation

hehe7318
Copy link
Contributor

Description of changes

  • Avoid code duplication by reusing the "rotation" script inside the munge resource when retrieving the custom munge key from Secrets Manager

Checklist

  • Make sure you are pointing to the right branch.
  • If you're creating a patch for a branch other than develop add the branch name as prefix in the PR title (e.g. [release-3.6]).
  • Check all commits' messages are clear, describing what and why vs how.
  • Make sure to have added unit tests or integration tests to cover the new/modified code.
  • Check if documentation is impacted by this change.

…e resource when retrieving the custom munge key from Secrets Manager
@hehe7318 hehe7318 requested review from a team as code owners September 25, 2023 04:25
@hehe7318 hehe7318 changed the title Reuse the rotation script inside the munge resource [develop] Reuse the rotation script inside the munge resource Sep 25, 2023
@hehe7318 hehe7318 changed the title [develop] Reuse the rotation script inside the munge resource [develop][draft] Reuse the rotation script inside the munge resource Sep 25, 2023
@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (f905257) 76.06% compared to head (90f7216) 76.06%.
Report is 1 commits behind head on develop.

❗ Current head 90f7216 differs from pull request most recent head 6d6a6a4. Consider uploading reports for the commit 6d6a6a4 to get more accurate results

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2471   +/-   ##
========================================
  Coverage    76.06%   76.06%           
========================================
  Files           13       13           
  Lines         1876     1876           
========================================
  Hits          1427     1427           
  Misses         449      449           
Flag Coverage Δ
unittests 76.06% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@jdeamicis jdeamicis left a comment

Choose a reason for hiding this comment

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

Good job. Just implement the change I requested and then we can merge it.

@hehe7318 hehe7318 changed the title [develop][draft] Reuse the rotation script inside the munge resource [develop] Reuse the rotation script inside the munge resource Sep 29, 2023
Copy link
Contributor

@jdeamicis jdeamicis left a comment

Choose a reason for hiding this comment

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

This is not what we had discussed yesterday. Please address the comments.

Copy link
Contributor

@jdeamicis jdeamicis left a comment

Choose a reason for hiding this comment

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

You have to rebase your PR on top of other developments, so I will just provide a comment here.

user 'root'
group 'root'
cwd ::File.dirname(script_path)
command "./#{::File.basename(script_path)} -d"
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe you can simplify this block:

def fetch_and_decode_munge_key
  declare_resource(:execute, 'fetch_and_decode_munge_key') do
    user 'root'
    group 'root'
    command "/#{node['cluster']['scripts_dir']}/slurm/update_munge_key.sh -d"
  end
end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great comment! Thank you Jacopo.

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we actually need the first / character in the command variable. Though, in principle scripts_dir will always be an absolute path, so it shouldn't hurt.

user 'root'
group 'root'
cwd ::File.dirname(script_path)
command "./#{::File.basename(script_path)} -d"
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we actually need the first / character in the command variable. Though, in principle scripts_dir will always be an absolute path, so it shouldn't hurt.

@jdeamicis jdeamicis closed this Oct 11, 2023
@jdeamicis jdeamicis reopened this Oct 11, 2023
@hehe7318 hehe7318 enabled auto-merge (squash) October 12, 2023 13:34
@hehe7318 hehe7318 merged commit 02fa532 into aws:develop Oct 12, 2023
30 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants