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

Remove use of basename from startup-script module #3366

Closed
wants to merge 1 commit into from

Conversation

abbas1902
Copy link
Contributor

@abbas1902 abbas1902 commented Dec 9, 2024

This allows the use of destinations with alternate paths but the same file name from being in the destination field for a startup-script runner:

  - id: example_startup_script
    source: modules/scripts/startup-script
    settings:
      runners:
      - type: data
        destination: /usr/pathA/pathA/t1.txt
        source: /home/user/cluster-toolkit/examples/file1.txt
      
      - type: data
        destination: /usr/pathA/pathB/t1.txt
        source: /home/user/cluster-toolkit/examples/file2.txt

Previously this functionality would not be allowed, note that if the destination paths are identical then an error is still thrown with the following:

**Error: exit status 1

Error: Invalid value for variable

  on main.tf line 31, in module "example_startup_script":
  31:   runners = [{
  32:     destination = "/usr/pathA/pathA/t1.txt"
  33:     source      = "/home/user/cluster-toolkit/examples/file1.txt"
  34:     type        = "data"
  35:     }, {
  36:     destination = "/usr/pathA/pathA/t1.txt"
  37:     source      = "/home/user/cluster-toolkit/examples/file2.txt"
  38:     type        = "data"
  39:   }]
    ├────────────────
    │ var.runners is list of map of string with 2 elements

All startup-script runners must have a unique destination.

This was checked by the validation rule at
modules/embedded/modules/scripts/startup-script/variables.tf:84,3-13.
**

This is a precursor to releasing an HPC Image blueprint since we make use of tuned profiles that maintain a specific path.

Submission Checklist

NOTE: Community submissions can take up to 2 weeks to be reviewed.

Please take the following actions before submitting this pull request.

  • Fork your PR branch from the Toolkit "develop" branch (not main)
  • Test all changes with pre-commit in a local branch #
  • Confirm that "make tests" passes all tests
  • Add or modify unit tests to cover code changes
  • Ensure that unit test coverage remains above 80%
  • Update all applicable documentation
  • Follow Cluster Toolkit Contribution guidelines #

@abbas1902 abbas1902 added the release-chore To not include into release notes label Dec 9, 2024
@abbas1902 abbas1902 requested a review from tpdownes December 9, 2024 20:12
@abbas1902 abbas1902 changed the title Remove basename from in startup-script module to allow for files with Remove use of basename from startup-script module Dec 9, 2024
@tpdownes tpdownes assigned abbas1902 and unassigned tpdownes Dec 16, 2024
@abbas1902 abbas1902 closed this Jan 15, 2025
@abbas1902 abbas1902 deleted the no_basename branch January 15, 2025 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-chore To not include into release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants