├── .bandit.ini ├── .dockerignore ├── .github ├── workflows │ ├── dokken-validate.yml │ ├── changelog_enforcer.yml │ └── codeql-analysis.yml ├── CODEOWNERS └── dependabot.yml ├── cookbooks ├── line │ ├── documentation │ │ ├── .gitkeep │ │ └── resources │ │ │ └── filters │ │ │ ├── comment.md │ │ │ ├── replace.md │ │ │ ├── missing.md │ │ │ ├── before.md │ │ │ ├── substitute.md │ │ │ ├── between.md │ │ │ ├── delete_between.md │ │ │ ├── after.md │ │ │ └── stanza.md │ ├── .mdlrc │ ├── .github │ │ ├── CODEOWNERS │ │ └── lock.yml │ ├── .envrc │ ├── recipes │ │ └── default.rb │ ├── test │ │ ├── fixtures │ │ │ └── cookbooks │ │ │ │ └── test │ │ │ │ ├── metadata.rb │ │ │ │ ├── templates │ │ │ │ ├── samplefile1.erb │ │ │ │ ├── text_file.erb │ │ │ │ ├── samplefile.erb │ │ │ │ ├── samplefile2.erb │ │ │ │ └── stanza.erb │ │ │ │ └── recipes │ │ │ │ ├── filter_lines_comment.rb │ │ │ │ ├── replace_or_add_change_line_eof.rb │ │ │ │ ├── filter_lines_between.rb │ │ │ │ ├── filter_lines_substitute.rb │ │ │ │ ├── filter_lines_replace.rb │ │ │ │ ├── filter_lines_delete_between.rb │ │ │ │ ├── replace_or_add_add_a_line_matching_pattern.rb │ │ │ │ ├── append_if_no_line_template.rb │ │ │ │ ├── filter_lines_replace_between.rb │ │ │ │ ├── append_if_no_line_single_line.rb │ │ │ │ ├── delete_lines_empty.rb │ │ │ │ ├── delete_lines_regexp.rb │ │ │ │ ├── delete_lines_string.rb │ │ │ │ ├── delete_from_list_empty.rb │ │ │ │ ├── delete_from_list_3d.rb │ │ │ │ ├── delete_from_list_2d.rb │ │ │ │ ├── add_to_list_1d.rb │ │ │ │ ├── replace_or_add_replace_only.rb │ │ │ │ ├── add_to_list_empty.rb │ │ │ │ ├── add_to_list_3d.rb │ │ │ │ ├── filter_lines_multi.rb │ │ │ │ ├── add_to_list_2d.rb │ │ │ │ └── append_if_no_line_empty.rb │ │ └── integration │ │ │ ├── line_resources │ │ │ ├── controls │ │ │ │ └── dummy │ │ │ ├── inspec.yml │ │ │ └── README.md │ │ │ ├── delete_lines │ │ │ └── inspec │ │ │ │ ├── controls │ │ │ │ ├── delete_lines_empty.rb │ │ │ │ ├── delete_lines_regexp.rb │ │ │ │ └── delete_lines_string.rb │ │ │ │ └── inspec.yml │ │ │ ├── add_to_list │ │ │ └── inspec │ │ │ │ ├── controls │ │ │ │ ├── add_to_list_empty.rb │ │ │ │ ├── add_to_list_1d.rb │ │ │ │ ├── add_to_list_2d.rb │ │ │ │ ├── add_to_list_3d.rb │ │ │ │ ├── add_to_list_1d_terminal.rb │ │ │ │ ├── add_to_list_3d_terminal.rb │ │ │ │ └── add_to_list_2d_terminal.rb │ │ │ │ └── inspec.yml │ │ │ ├── delete_from_list │ │ │ └── inspec │ │ │ │ ├── controls │ │ │ │ ├── delete_from_list_empty.rb │ │ │ │ ├── delete_from_list_3d.rb │ │ │ │ ├── delete_from_list_1d.rb │ │ │ │ └── delete_from_list_2d.rb │ │ │ │ └── inspec.yml │ │ │ ├── filter_lines │ │ │ ├── inspec.yml │ │ │ └── controls │ │ │ │ ├── filter_lines_substitue.rb │ │ │ │ ├── filter_lines_comment.rb │ │ │ │ ├── filter_lines_between.rb │ │ │ │ ├── filter_lines_delete_between.rb │ │ │ │ ├── filter_lines_replace_between.rb │ │ │ │ ├── filter_lines_multi.rb │ │ │ │ ├── filter_lines_replace.rb │ │ │ │ ├── filter_lines_misc.rb │ │ │ │ └── filter_lines_stanza.rb │ │ │ ├── replace_or_add │ │ │ ├── inspec.yml │ │ │ └── controls │ │ │ │ ├── replace_or_add_change_line_eof.rb │ │ │ │ └── replace_or_add_add_a_line_matching_pattern.rb │ │ │ └── append_if_no_line │ │ │ └── inspec │ │ │ ├── inspec.yml │ │ │ └── controls │ │ │ ├── append_if_no_line_single_line.rb │ │ │ └── append_if_no_line_template.rb │ ├── spec │ │ ├── fixtures │ │ │ └── cookbooks │ │ │ │ └── spectest │ │ │ │ ├── metadata.rb │ │ │ │ ├── README.md │ │ │ │ └── recipes │ │ │ │ ├── delete_lines_missing_file.rb │ │ │ │ ├── append_if_no_line_missing_file.rb │ │ │ │ ├── replace_or_add_missing_file.rb │ │ │ │ ├── delete_from_list_missing_file.rb │ │ │ │ └── add_to_list_missing_file.rb │ │ ├── rspec_helper.rb │ │ ├── chefspec_helper.rb │ │ └── cookbook │ │ │ └── documentation_spec.rb │ ├── CODE_OF_CONDUCT.md │ ├── kitchen.exec.yml │ ├── TESTING.md │ ├── .markdownlint-cli2.yaml │ ├── Berksfile │ ├── CONTRIBUTING.md │ ├── .yamllint │ ├── .editorconfig │ ├── metadata.rb │ ├── renovate.json │ └── .overcommit.yml ├── nfs │ ├── documentation │ │ └── .gitkeep │ ├── .envrc │ ├── .github │ │ └── CODEOWNERS │ ├── .mdlrc │ ├── test │ │ ├── integration │ │ │ ├── default │ │ │ │ └── inspec.yml │ │ │ └── server │ │ │ │ └── inspec.yml │ │ └── cookbooks │ │ │ └── nfs_test │ │ │ ├── recipes │ │ │ ├── default.rb │ │ │ └── issue46.rb │ │ │ └── metadata.rb │ ├── Berksfile │ ├── .markdownlint-cli2.yaml │ ├── CODE_OF_CONDUCT.md │ ├── spec │ │ ├── spec_helper.rb │ │ └── unit │ │ │ ├── recipes │ │ │ ├── default_spec.rb │ │ │ ├── client4_spec.rb │ │ │ └── server4_spec.rb │ │ │ └── resources │ │ │ └── export_spec.rb │ ├── TESTING.md │ ├── templates │ │ └── default │ │ │ ├── exports.erb │ │ │ ├── mountd.erb │ │ │ ├── nfs-common.erb │ │ │ └── nfs.conf.erb │ ├── CONTRIBUTING.md │ ├── .yamllint │ ├── .editorconfig │ ├── .overcommit.yml │ ├── metadata.rb │ └── Rakefile ├── yum │ ├── documentation │ │ └── .gitkeep │ ├── .github │ │ └── CODEOWNERS │ ├── .mdlrc │ ├── .envrc │ ├── test │ │ ├── cookbooks │ │ │ └── test │ │ │ │ ├── recipes │ │ │ │ ├── test_globalconfig_one.rb │ │ │ │ └── dnf_module.rb │ │ │ │ └── metadata.rb │ │ └── integration │ │ │ ├── default │ │ │ └── inspec │ │ │ │ └── default_spec.rb │ │ │ └── dnf_module │ │ │ └── inspec │ │ │ └── module_spec.rb │ ├── CODE_OF_CONDUCT.md │ ├── Berksfile │ ├── kitchen.exec.yml │ ├── TESTING.md │ ├── spec │ │ ├── unit │ │ │ └── recipes │ │ │ │ └── default_spec.rb │ │ └── spec_helper.rb │ ├── .markdownlint-cli2.yaml │ ├── CONTRIBUTING.md │ ├── .yamllint │ ├── .editorconfig │ ├── renovate.json │ ├── metadata.rb │ └── .overcommit.yml ├── openssh │ ├── documentation │ │ └── .gitkeep │ ├── .mdlrc │ ├── .github │ │ └── CODEOWNERS │ ├── .envrc │ ├── Berksfile │ ├── CODE_OF_CONDUCT.md │ ├── kitchen.exec.yml │ ├── TESTING.md │ ├── templates │ │ ├── ca_keys.erb │ │ ├── revoked_keys.erb │ │ └── port_ssh.erb │ ├── .markdownlint-cli2.yaml │ ├── CONTRIBUTING.md │ ├── mlc_config.json │ ├── .yamllint │ ├── .editorconfig │ ├── spec │ │ └── spec_helper.rb │ ├── renovate.json │ ├── test │ │ └── integration │ │ │ └── iptables │ │ │ └── default_spec.rb │ └── .overcommit.yml ├── yum-epel │ ├── .markdownlint-cli2.yaml │ ├── documentation │ │ └── .gitkeep │ ├── .envrc │ ├── .github │ │ └── CODEOWNERS │ ├── .mdlrc │ ├── Berksfile │ ├── spec │ │ └── spec_helper.rb │ ├── .yamllint │ ├── .editorconfig │ ├── metadata.rb │ ├── .overcommit.yml │ └── attributes │ │ ├── epel-next.rb │ │ ├── epel-source.rb │ │ ├── epel-testing.rb │ │ ├── epel-debuginfo.rb │ │ ├── default.rb │ │ ├── epel-next-source.rb │ │ └── epel-next-testing.rb ├── aws-parallelcluster-platform │ ├── files │ │ ├── nvidia │ │ │ ├── nvidia.conf │ │ │ └── blacklist-nouveau.conf │ │ ├── cron │ │ │ ├── jobs.deny.weekly │ │ │ └── jobs.deny.daily │ │ ├── infiniband │ │ │ └── infiniband.conf │ │ ├── centos-7 │ │ │ └── intel │ │ │ │ ├── intelpython2_modulefile │ │ │ │ └── intelpython3_modulefile │ │ ├── cookbook_virtualenv │ │ │ └── requirements.txt │ │ ├── dcv │ │ │ ├── 10_org.gnome.desktop.screensaver.gschema.override │ │ │ └── __init__.py │ │ ├── supervisord.conf │ │ └── AWS-ParallelCluster-License-README.txt │ ├── recipes │ │ └── default.rb │ ├── templates │ │ ├── sudo_access │ │ │ └── 99-parallelcluster-revoke-sudo.erb │ │ ├── sudo │ │ │ ├── 99-parallelcluster-user-tty.erb │ │ │ └── 99-parallelcluster-secure-path.erb │ │ ├── nvidia │ │ │ ├── amazon │ │ │ │ └── dkms │ │ │ │ │ └── nvidia.conf.erb │ │ │ └── parallelcluster_nvidia_service.erb │ │ ├── intel_mpi │ │ │ └── qt_source_code.erb │ │ ├── loginmgtd │ │ │ ├── 99-parallelcluster-loginmgtd.erb │ │ │ └── loginmgtd_config.json.erb │ │ ├── log_rotation │ │ │ ├── parallelcluster_cfn_init_log_rotation.erb │ │ │ ├── parallelcluster_chef_client_log_rotation.erb │ │ │ ├── parallelcluster_cloud_init_log_rotation.erb │ │ │ ├── parallelcluster_cloud_init_output_log_rotation.erb │ │ │ ├── parallelcluster_bootstrap_error_msg_log_rotation.erb │ │ │ ├── parallelcluster_pam_ssh_key_generator_log_rotation.erb │ │ │ ├── parallelcluster_slurmd_log_rotation.erb │ │ │ ├── parallelcluster_clustermgtd_events_log_rotation.erb │ │ │ ├── parallelcluster_slurm_resume_events_log_rotation.erb │ │ │ ├── parallelcluster_slurmdbd_log_rotation.erb │ │ │ ├── parallelcluster_slurmctld_log_rotation.erb │ │ │ ├── parallelcluster_compute_console_output_log_rotation.erb │ │ │ ├── parallelcluster_slurm_fleet_status_manager_log_rotation.erb │ │ │ ├── parallelcluster_dcv_log_rotation.erb │ │ │ ├── parallelcluster_slurm_resume_log_rotation.erb │ │ │ ├── parallelcluster_slurm_suspend_log_rotation.erb │ │ │ ├── parallelcluster_clustermgtd_log_rotation.erb │ │ │ ├── parallelcluster_computemgtd_log_rotation.erb │ │ │ ├── parallelcluster_supervisord_log_rotation.erb │ │ │ └── parallelcluster_clusterstatusmgtd_log_rotation.erb │ │ ├── nvidia-imex │ │ │ ├── nvidia-imex-nodes.erb │ │ │ └── nvidia-imex.service.erb │ │ └── supervisord │ │ │ └── supervisord-service.erb │ ├── test │ │ ├── inspec.yml │ │ └── controls │ │ │ ├── sticky_bits_spec.rb │ │ │ ├── c_states_spec.rb │ │ │ └── directories_spec.rb │ ├── resources │ │ ├── c_states │ │ │ └── partial │ │ │ │ ├── _c_states_redhat_9_based.rb │ │ │ │ ├── _c_states_debian.rb │ │ │ │ └── _c_states_redhat_based.rb │ │ └── stunnel │ │ │ └── partial │ │ │ └── _common.rb │ ├── spec │ │ ├── unit │ │ │ └── recipes │ │ │ │ ├── config_login.rb │ │ │ │ ├── ami_cleanup_spec.rb │ │ │ │ └── sudo_config_spec.rb │ │ └── spec_helper.rb │ └── metadata.rb ├── iptables │ ├── .github │ │ ├── CODEOWNERS │ │ └── workflows │ │ │ └── branchcleanup.yml │ ├── test │ │ ├── cookbooks │ │ │ └── test │ │ │ │ ├── metadata.rb │ │ │ │ ├── README.md │ │ │ │ └── recipes │ │ │ │ ├── centos-6-helper.rb │ │ │ │ ├── install-and-remove.rb │ │ │ │ ├── rule-line.rb │ │ │ │ └── all-tables.rb │ │ └── integration │ │ │ ├── all-tables │ │ │ ├── rules_spec.rb │ │ │ └── all_tables_spec.rb │ │ │ ├── rule-line │ │ │ ├── rules_spec.rb │ │ │ └── rule-line.rb │ │ │ ├── rule-line-number │ │ │ ├── rules_spec.rb │ │ │ └── rule-line-number.rb │ │ │ ├── rules │ │ │ └── rules.rb │ │ │ ├── install-and-remove │ │ │ └── install-and-remove.rb │ │ │ ├── default │ │ │ └── inspec │ │ │ │ ├── default_spec.rb │ │ │ │ └── rules_spec.rb │ │ │ └── disabled │ │ │ └── inspec │ │ │ └── disabled_spec.rb │ ├── CODE_OF_CONDUCT.md │ ├── TESTING.md │ ├── templates │ │ └── default │ │ │ ├── iptables_load.erb │ │ │ └── iptables-config.erb │ ├── .delivery │ │ └── project.toml │ ├── Berksfile │ ├── CONTRIBUTING.md │ ├── spec │ │ └── spec_helper.rb │ ├── Gemfile │ ├── .editorconfig │ ├── resources │ │ └── packages.rb │ └── metadata.rb ├── aws-parallelcluster-slurm │ ├── files │ │ ├── default │ │ │ ├── pmix │ │ │ │ └── ld.so.conf.d │ │ │ │ │ └── pmix.conf │ │ │ ├── head_node_slurm │ │ │ │ └── slurm │ │ │ │ │ ├── templates │ │ │ │ │ ├── slurm_parallelcluster_gres.conf │ │ │ │ │ ├── slurm_parallelcluster_cgroup.conf │ │ │ │ │ └── slurm_external_slurmdbd.conf │ │ │ │ │ └── __init__.py │ │ │ ├── install_slurm │ │ │ │ └── slurm_patches │ │ │ │ │ └── README.md │ │ │ ├── head_node_checks │ │ │ │ ├── __init__.py │ │ │ │ └── common │ │ │ │ │ └── __init__.py │ │ │ └── config_slurm │ │ │ │ └── scripts │ │ │ │ └── epilog.d │ │ │ │ └── 90_pcluster_noop │ │ ├── redhat │ │ │ └── dns_domain │ │ │ │ └── 99-disable-ipv6-metadata.cfg │ │ └── rocky │ │ │ └── dns_domain │ │ │ └── 99-disable-ipv6-metadata.cfg │ ├── recipes │ │ ├── default.rb │ │ └── test │ │ │ └── mock_slurm_dir.rb │ ├── templates │ │ └── default │ │ │ ├── compute_node_finalize │ │ │ └── slurm │ │ │ │ └── slurm.sysconfig.erb │ │ │ ├── slurm │ │ │ ├── compute │ │ │ │ ├── slurmd_nvidia_persistenced.conf.erb │ │ │ │ ├── slurm_node_spec.json.erb │ │ │ │ └── slurmd.service.erb │ │ │ ├── suspend_program.erb │ │ │ ├── parallelcluster_slurm_suspend.conf.erb │ │ │ ├── gres.conf.erb │ │ │ ├── head_node │ │ │ │ ├── health_check │ │ │ │ │ └── health_check_manager.conf.erb │ │ │ │ ├── slurm.sh.erb │ │ │ │ ├── slurm.csh.erb │ │ │ │ ├── slurmdbd.service.erb │ │ │ │ └── slurmctld.service.erb │ │ │ ├── fleet_status_manager_program.erb │ │ │ ├── parallelcluster_slurm_fleet_status_manager.conf.erb │ │ │ ├── cgroup.conf.erb │ │ │ ├── parallelcluster_computemgtd.conf.erb │ │ │ ├── block_topology │ │ │ │ └── slurm_parallelcluster_topology.conf.erb │ │ │ ├── external_slurmdbd │ │ │ │ └── slurm_external_slurmdbd.conf.erb │ │ │ ├── parallelcluster_slurm_resume.conf.erb │ │ │ ├── 99-parallelcluster-slurm.erb │ │ │ └── resume_program.erb │ │ │ └── pyxis │ │ │ ├── plugstack.conf.erb │ │ │ └── pyxis.conf.erb │ ├── test │ │ └── inspec.yml │ ├── spec │ │ └── spec_helper.rb │ ├── resources │ │ ├── mysql_client │ │ │ └── partial │ │ │ │ └── _setup_ubuntu.rb │ │ ├── munge │ │ │ ├── munge_amazon2.rb │ │ │ ├── munge_alinux2023.rb │ │ │ └── munge_rocky8.rb │ │ ├── jwt_dependencies │ │ │ ├── jwt_dependencies_amazon2.rb │ │ │ ├── jwt_dependencies_rocky8.rb │ │ │ ├── jwt_dependencies_redhat8.rb │ │ │ └── jwt_dependencies_alinux2023.rb │ │ └── dns_domain │ │ │ ├── dns_domain_amazon2.rb │ │ │ └── partial │ │ │ └── _dns_domain_redhat.rb │ └── libraries │ │ └── pyxis.rb ├── aws-parallelcluster-shared │ ├── recipes │ │ └── default.rb │ ├── test │ │ ├── inspec.yml │ │ └── controls │ │ │ └── node_attributes_spec.rb │ ├── attributes │ │ ├── users_ubuntu.rb │ │ ├── users_amazon2.rb │ │ ├── users_rocky8.rb │ │ ├── users_redhat8.rb │ │ ├── users_alinux2023.rb │ │ ├── environment.rb │ │ └── versions.rb │ ├── templates │ │ └── profile │ │ │ └── path.sh.erb │ ├── libraries │ │ ├── networking.rb │ │ ├── test.rb │ │ └── kitchen.rb │ ├── kitchen.shared-config.yml │ ├── metadata.rb │ ├── resources │ │ └── alinux_extras_topic.rb │ └── spec │ │ └── unit │ │ ├── resources │ │ └── node_attributes_spec.rb │ │ └── recipes │ │ └── setup_envars_spec.rb ├── aws-parallelcluster-environment │ ├── recipes │ │ ├── default.rb │ │ ├── test │ │ │ ├── mock_cfnconfig.rb │ │ │ ├── mock_compute_raid.rb │ │ │ ├── mock_compute_ebs.rb │ │ │ ├── mock_compute_shared_storages.rb │ │ │ ├── mock_export_directories.rb │ │ │ └── mock_login_node_keys.rb │ │ └── finalize.rb │ ├── templates │ │ ├── spack │ │ │ ├── spack.sh.erb │ │ │ └── packages-aarch64.yaml.erb │ │ ├── cfn_hup_configuration │ │ │ ├── cfn-hup.conf.erb │ │ │ └── cfn-hup-runner.sh.erb │ │ ├── setup-ephemeral.service.erb │ │ ├── cfn_bootstrap │ │ │ └── pcluster_cookbook_environment.sh.erb │ │ ├── imds │ │ │ └── parallelcluster-iptables.service.erb │ │ ├── directory_service │ │ │ └── sssd.conf.erb │ │ └── ec2_udev_rules │ │ │ └── ec2-volid.rules.erb │ ├── resources │ │ ├── efs │ │ │ └── partial │ │ │ │ ├── _get_package_version_rpm.rb │ │ │ │ └── _get_package_version_dpkg.rb │ │ ├── raid │ │ │ ├── raid.rb │ │ │ ├── raid_rocky8.rb │ │ │ ├── raid_redhat8.rb │ │ │ ├── raid_ubuntu22+.rb │ │ │ └── raid_alinux2023.rb │ │ └── cloudwatch │ │ │ └── partial │ │ │ ├── _cloudwatch_install_package_rhel.rb │ │ │ └── _cloudwatch_install_package_debian.rb │ ├── test │ │ ├── inspec.yml │ │ └── controls │ │ │ └── network_service_spec.rb │ ├── spec │ │ ├── spec_helper.rb │ │ └── unit │ │ │ ├── libraries │ │ │ └── volume_spec.rb │ │ │ └── recipes │ │ │ └── efs_spec.rb │ ├── libraries │ │ ├── networking.rb │ │ └── fsx.rb │ ├── files │ │ └── spack │ │ │ └── modules.yaml │ └── metadata.rb ├── aws-parallelcluster-computefleet │ ├── spec │ │ └── spec_helper.rb │ ├── test │ │ └── inspec.yml │ ├── attributes │ │ └── computefleet.rb │ ├── templates │ │ ├── clusterstatusmgtd │ │ │ ├── clusterstatusmgtd.conf.erb │ │ │ └── 99-parallelcluster-clusterstatusmgtd.erb │ │ └── compute_fleet_status │ │ │ └── is_fleet_ready.erb │ ├── metadata.rb │ ├── files │ │ └── clusterstatusmgtd │ │ │ └── clusterstatusmgtd_logging.conf │ └── recipes │ │ ├── config.rb │ │ └── init.rb ├── aws-parallelcluster-entrypoints │ ├── spec │ │ └── spec_helper.rb │ ├── test │ │ └── inspec.yml │ └── metadata.rb ├── aws-parallelcluster-awsbatch │ ├── templates │ │ └── default │ │ │ └── awsbatch │ │ │ ├── awsbatch-cli.cfg.erb │ │ │ └── pcluster_awsbatchcli.sh.erb │ ├── test │ │ └── inspec.yml │ ├── kitchen.awsbatch-config.yml │ ├── metadata.rb │ └── kitchen.awsbatch-install.yml └── aws-parallelcluster-tests │ ├── recipes │ └── tear_down.rb │ └── metadata.rb ├── NOTICE.txt ├── CODE_OF_CONDUCT.md ├── .isort.cfg ├── Gemfile ├── kitchen └── kitchen.local-yml.sh ├── kitchen.docker.sh ├── Rakefile └── kitchen.global.yml /.bandit.ini: -------------------------------------------------------------------------------- 1 | skips: [] 2 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | ./.github 2 | ./.tox 3 | -------------------------------------------------------------------------------- /.github/workflows/dokken-validate.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cookbooks/line/documentation/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cookbooks/nfs/documentation/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cookbooks/yum/documentation/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cookbooks/line/.mdlrc: -------------------------------------------------------------------------------- 1 | rules "~MD013" 2 | -------------------------------------------------------------------------------- /cookbooks/openssh/documentation/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/.markdownlint-cli2.yaml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/documentation/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cookbooks/nfs/.envrc: -------------------------------------------------------------------------------- 1 | use chefworkstation 2 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/.envrc: -------------------------------------------------------------------------------- 1 | use chefworkstation 2 | -------------------------------------------------------------------------------- /cookbooks/line/.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @sous-chefs/maintainers 2 | -------------------------------------------------------------------------------- /cookbooks/nfs/.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @sous-chefs/maintainers 2 | -------------------------------------------------------------------------------- /cookbooks/openssh/.mdlrc: -------------------------------------------------------------------------------- 1 | rules "~MD013", "~MD024", "~MD025" 2 | -------------------------------------------------------------------------------- /cookbooks/yum/.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @sous-chefs/maintainers 2 | -------------------------------------------------------------------------------- /cookbooks/yum/.mdlrc: -------------------------------------------------------------------------------- 1 | rules "~MD013", "~MD024", "~MD025" 2 | -------------------------------------------------------------------------------- /cookbooks/openssh/.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @sous-chefs/maintainers 2 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @sous-chefs/maintainers 2 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/.mdlrc: -------------------------------------------------------------------------------- 1 | rules "~MD013", "~MD024", "~MD025" 2 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/files/nvidia/nvidia.conf: -------------------------------------------------------------------------------- 1 | nvidia-uvm -------------------------------------------------------------------------------- /cookbooks/nfs/.mdlrc: -------------------------------------------------------------------------------- 1 | rules "~MD013", "~MD024", "~MD025", "~MD033" 2 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/files/cron/jobs.deny.weekly: -------------------------------------------------------------------------------- 1 | man-db 2 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/files/infiniband/infiniband.conf: -------------------------------------------------------------------------------- 1 | ib_umad -------------------------------------------------------------------------------- /cookbooks/iptables/.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @chef-cookbooks/cookbook_engineering_team 2 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/Berksfile: -------------------------------------------------------------------------------- 1 | source 'https://supermarket.chef.io' 2 | 3 | metadata 4 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/files/default/pmix/ld.so.conf.d/pmix.conf: -------------------------------------------------------------------------------- 1 | /opt/pmix/lib 2 | -------------------------------------------------------------------------------- /cookbooks/line/.envrc: -------------------------------------------------------------------------------- 1 | use chefworkstation 2 | export KITCHEN_GLOBAL_YAML=kitchen.global.yml 3 | -------------------------------------------------------------------------------- /cookbooks/line/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: line 3 | # Recipe:: default 4 | # 5 | -------------------------------------------------------------------------------- /cookbooks/openssh/.envrc: -------------------------------------------------------------------------------- 1 | use chefworkstation 2 | export KITCHEN_GLOBAL_YAML=kitchen.global.yml 3 | -------------------------------------------------------------------------------- /cookbooks/yum/.envrc: -------------------------------------------------------------------------------- 1 | use chefworkstation 2 | export KITCHEN_GLOBAL_YAML=kitchen.global.yml 3 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @aws/aws-parallelcluster-admins @aws/aws-parallelcluster-maintainers 2 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/files/cron/jobs.deny.daily: -------------------------------------------------------------------------------- 1 | mlocate 2 | man-db.cron 3 | man-db 4 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # Required for ChefSpec tests to be able to converge 2 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # Required for ChefSpec tests to be able to converge 2 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'test' 2 | version '0.1.0' 3 | depends 'line' 4 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # Required for ChefSpec tests to be able to converge 2 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # Required for ChefSpec tests to be able to converge 2 | -------------------------------------------------------------------------------- /cookbooks/iptables/test/cookbooks/test/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'test' 2 | version '0.0.1' 3 | 4 | depends 'iptables' 5 | -------------------------------------------------------------------------------- /cookbooks/line/spec/fixtures/cookbooks/spectest/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'spectest' 2 | version '1.0.0' 3 | depends 'line' 4 | -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | aws-parallelcluster-cookbook 2 | Copyright 2015-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/test/inspec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | maintainer: 'Amazon Web Services' 3 | license: 'Apache-2.0' 4 | -------------------------------------------------------------------------------- /cookbooks/nfs/test/integration/default/inspec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: default 3 | title: Integration tests for the nfs cookbook 4 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/sudo_access/99-parallelcluster-revoke-sudo.erb: -------------------------------------------------------------------------------- 1 | <%= @user_name %> ALL=(ALL) !ALL 2 | -------------------------------------------------------------------------------- /cookbooks/iptables/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | Please refer to the Chef Community Code of Conduct at 2 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/line_resources/controls/dummy: -------------------------------------------------------------------------------- 1 | # dummy control to make sure the controls directory is included in the repo 2 | -------------------------------------------------------------------------------- /cookbooks/iptables/TESTING.md: -------------------------------------------------------------------------------- 1 | Please refer to 2 | 3 | -------------------------------------------------------------------------------- /cookbooks/iptables/templates/default/iptables_load.erb: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | <%= @iptables_restore_binary %> < <%= @iptables_save_file %> 3 | exit 0 4 | -------------------------------------------------------------------------------- /cookbooks/nfs/Berksfile: -------------------------------------------------------------------------------- 1 | source 'https://supermarket.chef.io' 2 | 3 | metadata 4 | 5 | cookbook 'nfs_test', path: 'test/cookbooks/nfs_test' 6 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/sudo/99-parallelcluster-user-tty.erb: -------------------------------------------------------------------------------- 1 | Defaults:<%= node['cluster']['cluster_user'] %> !requiretty 2 | -------------------------------------------------------------------------------- /cookbooks/nfs/.markdownlint-cli2.yaml: -------------------------------------------------------------------------------- 1 | config: 2 | ul-indent: false # MD007 3 | line-length: false # MD013 4 | no-duplicate-heading: false # MD024 5 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-computefleet/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'chefspec' 2 | 3 | require_relative '../../aws-parallelcluster-shared/spec/spec_helper' 4 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-entrypoints/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'chefspec' 2 | 3 | require_relative '../../aws-parallelcluster-shared/spec/spec_helper' 4 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/files/redhat/dns_domain/99-disable-ipv6-metadata.cfg: -------------------------------------------------------------------------------- 1 | datasource: 2 | Ec2: 3 | metadata_urls: [ 'http://169.254.169.254' ] -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/files/rocky/dns_domain/99-disable-ipv6-metadata.cfg: -------------------------------------------------------------------------------- 1 | datasource: 2 | Ec2: 3 | metadata_urls: [ 'http://169.254.169.254' ] -------------------------------------------------------------------------------- /cookbooks/iptables/test/cookbooks/test/README.md: -------------------------------------------------------------------------------- 1 | # iptables_test 2 | This cookbook installs iptables and tests whether the iptables cookbook can add a rule. 3 | -------------------------------------------------------------------------------- /cookbooks/yum/test/cookbooks/test/recipes/test_globalconfig_one.rb: -------------------------------------------------------------------------------- 1 | # default configuration 2 | yum_globalconfig '/tmp/yum.conf' do 3 | action :create 4 | end 5 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/templates/spack/spack.sh.erb: -------------------------------------------------------------------------------- 1 | export SPACK_ROOT=<%= @spack_root %> 2 | source <%= @spack_root %>/share/spack/setup-env.sh 3 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/sudo/99-parallelcluster-secure-path.erb: -------------------------------------------------------------------------------- 1 | Defaults secure_path = <%= @secure_path_required_directories.join(':') %> 2 | -------------------------------------------------------------------------------- /cookbooks/iptables/.delivery/project.toml: -------------------------------------------------------------------------------- 1 | remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml" 2 | -------------------------------------------------------------------------------- /cookbooks/nfs/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Community Guidelines 2 | 3 | This project follows the Chef Community Guidelines 4 | -------------------------------------------------------------------------------- /cookbooks/nfs/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'chefspec' 2 | require 'chefspec/berkshelf' 3 | 4 | RSpec.configure do |config| 5 | config.log_level = :error 6 | end 7 | -------------------------------------------------------------------------------- /cookbooks/yum/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Community Guidelines 2 | 3 | This project follows the Chef Community Guidelines 4 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/files/centos-7/intel/intelpython2_modulefile: -------------------------------------------------------------------------------- 1 | #%Modulefile 2 | prepend-path PATH /opt/intel/intelpython2/bin -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/files/centos-7/intel/intelpython3_modulefile: -------------------------------------------------------------------------------- 1 | #%Modulefile 2 | prepend-path PATH /opt/intel/intelpython3/bin -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/compute_node_finalize/slurm/slurm.sysconfig.erb: -------------------------------------------------------------------------------- 1 | SLURMD_OPTIONS='-N <%= node.run_state['slurm_compute_nodename'] %>' 2 | -------------------------------------------------------------------------------- /cookbooks/line/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Community Guidelines 2 | 3 | This project follows the Chef Community Guidelines 4 | -------------------------------------------------------------------------------- /cookbooks/line/kitchen.exec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | driver: { name: exec } 3 | transport: { name: exec } 4 | 5 | platforms: 6 | - name: macos-latest 7 | - name: windows-latest 8 | -------------------------------------------------------------------------------- /cookbooks/openssh/Berksfile: -------------------------------------------------------------------------------- 1 | source 'https://supermarket.chef.io' 2 | 3 | metadata 4 | 5 | group :integration do 6 | cookbook 'apt' 7 | cookbook 'homebrew' 8 | end 9 | -------------------------------------------------------------------------------- /cookbooks/openssh/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Community Guidelines 2 | 3 | This project follows the Chef Community Guidelines 4 | -------------------------------------------------------------------------------- /cookbooks/yum/Berksfile: -------------------------------------------------------------------------------- 1 | source 'https://supermarket.chef.io' 2 | 3 | metadata 4 | 5 | group :integration do 6 | cookbook 'test', path: 'test/cookbooks/test' 7 | end 8 | -------------------------------------------------------------------------------- /cookbooks/yum/kitchen.exec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | driver: { name: exec } 3 | transport: { name: exec } 4 | 5 | platforms: 6 | - name: macos-latest 7 | - name: windows-latest 8 | -------------------------------------------------------------------------------- /cookbooks/iptables/Berksfile: -------------------------------------------------------------------------------- 1 | source 'https://supermarket.chef.io' 2 | 3 | metadata 4 | 5 | group :integration do 6 | cookbook 'test', path: 'test/cookbooks/test' 7 | end 8 | -------------------------------------------------------------------------------- /cookbooks/iptables/templates/default/iptables-config.erb: -------------------------------------------------------------------------------- 1 | # This file managed by Chef. Do not hand edit 2 | <% @config.each do |k,v| -%> 3 | <%= k %>="<%= v %>" 4 | <% end -%> 5 | -------------------------------------------------------------------------------- /cookbooks/openssh/kitchen.exec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | driver: { name: exec } 3 | transport: { name: exec } 4 | 5 | platforms: 6 | - name: macos-latest 7 | - name: windows-latest 8 | -------------------------------------------------------------------------------- /cookbooks/iptables/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Please refer to 4 | 5 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/nvidia/amazon/dkms/nvidia.conf.erb: -------------------------------------------------------------------------------- 1 | MAKE[0]="'make' -j2 NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=${kernelver} modules <%= @compiler_path %>" 2 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/templates/samplefile1.erb: -------------------------------------------------------------------------------- 1 | HI THERE I AM DANGERFILE 2 | HI THERE I AM DANGERFILE 3 | # UNCOMMENT ME 4 | int main(void){ for i=0; i<100; i++ }; 5 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/templates/text_file.erb: -------------------------------------------------------------------------------- 1 | Data line 2 | Alt data line extended 3 | Third line 4 | Identical line 5 | Identical line 6 | Penultimate 7 | Last line 8 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/files/nvidia/blacklist-nouveau.conf: -------------------------------------------------------------------------------- 1 | blacklist nouveau 2 | blacklist lbm-nouveau 3 | options nouveau modeset=0 4 | alias nouveau off 5 | alias lbm-nouveau off -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/compute/slurmd_nvidia_persistenced.conf.erb: -------------------------------------------------------------------------------- 1 | [Unit] 2 | After=parallelcluster_nvidia.service 3 | Wants=parallelcluster_nvidia.service 4 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-awsbatch/templates/default/awsbatch/awsbatch-cli.cfg.erb: -------------------------------------------------------------------------------- 1 | [main] 2 | cluster_name = <%= node['cluster']['stack_name'] %> 3 | region = <%= node['cluster']['region'] %> 4 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/suspend_program.erb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo -u <%= node['cluster']['cluster_admin_user'] %> <%= node_virtualenv_path %>/bin/slurm_suspend "$@" 3 | -------------------------------------------------------------------------------- /cookbooks/line/spec/fixtures/cookbooks/spectest/README.md: -------------------------------------------------------------------------------- 1 | # Place holder for recipes tested using rspec 2 | 3 | The tests to this point are used for verifying the resource's ignore_missing property. 4 | -------------------------------------------------------------------------------- /cookbooks/nfs/test/integration/server/inspec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: server 3 | title: Integration tests for the nfs cookbook 4 | 5 | depends: 6 | - name: default 7 | path: test/integration/default 8 | -------------------------------------------------------------------------------- /cookbooks/yum/TESTING.md: -------------------------------------------------------------------------------- 1 | # Testing 2 | 3 | Please refer to [the community cookbook documentation on testing](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/main/TESTING.MD). 4 | -------------------------------------------------------------------------------- /cookbooks/line/TESTING.md: -------------------------------------------------------------------------------- 1 | # Testing 2 | 3 | Please refer to [the community cookbook documentation on testing](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/main/TESTING.MD). 4 | -------------------------------------------------------------------------------- /cookbooks/nfs/TESTING.md: -------------------------------------------------------------------------------- 1 | # Testing 2 | 3 | Please refer to [the community cookbook documentation on testing](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/TESTING.MD). 4 | -------------------------------------------------------------------------------- /cookbooks/openssh/TESTING.md: -------------------------------------------------------------------------------- 1 | # Testing 2 | 3 | Please refer to [the community cookbook documentation on testing](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/main/TESTING.MD). 4 | -------------------------------------------------------------------------------- /cookbooks/line/spec/fixtures/cookbooks/spectest/recipes/delete_lines_missing_file.rb: -------------------------------------------------------------------------------- 1 | delete_lines 'missing_file fail' do 2 | path '/tmp/nofilehere' 3 | pattern '^#.*' 4 | ignore_missing false 5 | end 6 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/resources/efs/partial/_get_package_version_rpm.rb: -------------------------------------------------------------------------------- 1 | def get_package_version_command(package_name) 2 | "rpm -qi #{package_name} | grep Version | awk '{print $3}'" 3 | end 4 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/files/cookbook_virtualenv/requirements.txt: -------------------------------------------------------------------------------- 1 | awscli 2 | boto3 3 | supervisor 4 | requests 5 | jsonschema 6 | jinja2 7 | requests 8 | PyYAML 9 | retrying 10 | click 11 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/test/inspec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | maintainer: 'Amazon Web Services' 3 | license: 'Apache-2.0' 4 | 5 | depends: 6 | - name: shared 7 | path: cookbooks/aws-parallelcluster-shared/test 8 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-awsbatch/test/inspec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | maintainer: 'Amazon Web Services' 3 | license: 'Apache-2.0' 4 | 5 | depends: 6 | - name: shared 7 | path: cookbooks/aws-parallelcluster-shared/test 8 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/resources/raid/raid.rb: -------------------------------------------------------------------------------- 1 | provides :raid 2 | 3 | use 'partial/_raid_common' 4 | 5 | action_class do 6 | def raid_superblock_version 7 | '0.90' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/templates/cfn_hup_configuration/cfn-hup.conf.erb: -------------------------------------------------------------------------------- 1 | [main] 2 | stack=<%= @stack_id %> 3 | region=<%= @region %> 4 | url=<%= @cloudformation_url %> 5 | role=<%= @cfn_init_role %> 6 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/test/inspec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | maintainer: 'Amazon Web Services' 3 | license: 'Apache-2.0' 4 | 5 | depends: 6 | - name: shared 7 | path: cookbooks/aws-parallelcluster-shared/test 8 | -------------------------------------------------------------------------------- /cookbooks/nfs/spec/unit/recipes/default_spec.rb: -------------------------------------------------------------------------------- 1 | require_relative '../../spec_helper' 2 | 3 | describe 'nfs::default' do 4 | platform 'centos' 5 | 6 | it { is_expected.to include_recipe('nfs::_common') } 7 | end 8 | -------------------------------------------------------------------------------- /cookbooks/nfs/spec/unit/resources/export_spec.rb: -------------------------------------------------------------------------------- 1 | require_relative '../../spec_helper' 2 | 3 | describe 'nfs_export' do 4 | platform 'centos' 5 | 6 | recipe do 7 | nfs_export 'test' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-computefleet/test/inspec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | maintainer: 'Amazon Web Services' 3 | license: 'Apache-2.0' 4 | 5 | depends: 6 | - name: shared 7 | path: cookbooks/aws-parallelcluster-shared/test 8 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-entrypoints/test/inspec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | maintainer: 'Amazon Web Services' 3 | license: 'Apache-2.0' 4 | 5 | depends: 6 | - name: shared 7 | path: cookbooks/aws-parallelcluster-shared/test 8 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/test/inspec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | maintainer: 'Amazon Web Services' 3 | license: 'Apache-2.0' 4 | 5 | depends: 6 | - name: shared 7 | path: cookbooks/aws-parallelcluster-shared/test 8 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/files/dcv/10_org.gnome.desktop.screensaver.gschema.override: -------------------------------------------------------------------------------- 1 | [org.gnome.desktop.screensaver] 2 | lock-enabled = false 3 | 4 | [org.gnome.desktop.lockdown] 5 | disable-lock-screen = true 6 | -------------------------------------------------------------------------------- /cookbooks/line/spec/fixtures/cookbooks/spectest/recipes/append_if_no_line_missing_file.rb: -------------------------------------------------------------------------------- 1 | append_if_no_line 'missing_file fail' do 2 | path '/tmp/nofilehere' 3 | line 'add this line' 4 | ignore_missing false 5 | end 6 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/templates/samplefile.erb: -------------------------------------------------------------------------------- 1 | HELLO THERE I AM DANGERFILE 2 | # UNCOMMENT ME YOU FOOL 3 | COMMENT ME AND I STOP YELLING I PROMISE 4 | int main(void){ for i=0; i<100; i++ }; 5 | last line 6 | -------------------------------------------------------------------------------- /cookbooks/nfs/templates/default/exports.erb: -------------------------------------------------------------------------------- 1 | # Generated by Chef for <%= node["fqdn"] %> 2 | # Local modifications will be overwritten. 3 | <%- node["nfs"]["exports"].each do |export_line| %> 4 | <%= export_line %> 5 | <% end %> 6 | -------------------------------------------------------------------------------- /cookbooks/openssh/templates/ca_keys.erb: -------------------------------------------------------------------------------- 1 | # This file was generated by Chef 2 | # Do NOT modify this file by hand! 3 | 4 | # One CA public key per line 5 | <% node['openssh']['ca_keys'].each do |key| -%> 6 | <%=key %> 7 | <% end -%> 8 | -------------------------------------------------------------------------------- /cookbooks/yum/test/cookbooks/test/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'test' 2 | maintainer 'Chef Software, Inc.' 3 | maintainer_email 'cookbooks@chef.io' 4 | license 'Apache-2.0' 5 | version '1.0.0' 6 | 7 | depends 'yum' 8 | depends 'yum-remi-chef' 9 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/recipes/test/mock_cfnconfig.rb: -------------------------------------------------------------------------------- 1 | return if on_docker? 2 | 3 | directory '/etc/parallelcluster/' 4 | 5 | file '/etc/parallelcluster/cfnconfig' do 6 | content "cfn_ephemeral_dir=/scratch" 7 | end 8 | -------------------------------------------------------------------------------- /cookbooks/line/spec/fixtures/cookbooks/spectest/recipes/replace_or_add_missing_file.rb: -------------------------------------------------------------------------------- 1 | replace_or_add 'missing_file fail' do 2 | path '/tmp/nofilehere' 3 | pattern 'multi = ' 4 | line 'add this line' 5 | ignore_missing false 6 | end 7 | -------------------------------------------------------------------------------- /cookbooks/yum/spec/unit/recipes/default_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'yum::default' do 4 | platform 'centos' 5 | 6 | it do 7 | expect(chef_run).to create_yum_globalconfig('/etc/yum.conf') 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/parallelcluster_slurm_suspend.conf.erb: -------------------------------------------------------------------------------- 1 | [slurm_suspend] 2 | clustermgtd_heartbeat_file_path = <%= node['cluster']['slurm']['install_dir'] %>/etc/pcluster/.slurm_plugin/clustermgtd_heartbeat 3 | -------------------------------------------------------------------------------- /cookbooks/line/.markdownlint-cli2.yaml: -------------------------------------------------------------------------------- 1 | config: 2 | ul-indent: false # MD007 3 | line-length: false # MD013 4 | no-duplicate-heading: false # MD024 5 | reference-links-images: false # MD052 6 | ignores: 7 | - .github/copilot-instructions.md 8 | -------------------------------------------------------------------------------- /cookbooks/line/Berksfile: -------------------------------------------------------------------------------- 1 | source 'https://supermarket.chef.io' 2 | 3 | metadata 4 | 5 | group :integration do 6 | cookbook 'test', path: 'test/fixtures/cookbooks/test' 7 | cookbook 'spectest', path: 'spec/fixtures/cookbooks/spectest' 8 | end 9 | -------------------------------------------------------------------------------- /cookbooks/yum/.markdownlint-cli2.yaml: -------------------------------------------------------------------------------- 1 | config: 2 | ul-indent: false # MD007 3 | line-length: false # MD013 4 | no-duplicate-heading: false # MD024 5 | reference-links-images: false # MD052 6 | ignores: 7 | - .github/copilot-instructions.md 8 | -------------------------------------------------------------------------------- /cookbooks/nfs/templates/default/mountd.erb: -------------------------------------------------------------------------------- 1 | # Generated by Chef for <%= node['fqdn'] %> 2 | # Local modifications will be overwritten. 3 | 4 | mountd_enable="YES" 5 | mountd_flags="<%=node['nfs']['mountd_flags']%> -p <%=node['nfs']['port']['mountd']%>" 6 | -------------------------------------------------------------------------------- /cookbooks/openssh/.markdownlint-cli2.yaml: -------------------------------------------------------------------------------- 1 | config: 2 | ul-indent: false # MD007 3 | line-length: false # MD013 4 | no-duplicate-heading: false # MD024 5 | reference-links-images: false # MD052 6 | ignores: 7 | - .github/copilot-instructions.md 8 | -------------------------------------------------------------------------------- /cookbooks/openssh/templates/revoked_keys.erb: -------------------------------------------------------------------------------- 1 | # This file was generated by Chef 2 | # Do NOT modify this file by hand! 3 | 4 | # One certificate/public key per line 5 | <% node['openssh']['revoked_keys'].each do |key| -%> 6 | <%=key %> 7 | <% end -%> 8 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/gres.conf.erb: -------------------------------------------------------------------------------- 1 | # WARNING!!! The slurm_parallelcluster_gres.conf file included below can be updated by the pcluster process. 2 | # Please do not edit it. 3 | include slurm_parallelcluster_gres.conf 4 | -------------------------------------------------------------------------------- /cookbooks/nfs/templates/default/nfs-common.erb: -------------------------------------------------------------------------------- 1 | # Generated by Chef for <%= node['fqdn'] -%> 2 | # Local modifications will be overwritten. 3 | STATDOPTS="--port <%= node['nfs']['port']['statd'] -%> --outgoing-port <%= node['nfs']['port']['statd_out'] -%>" 4 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/health_check/health_check_manager.conf.erb: -------------------------------------------------------------------------------- 1 | [health_check_manager] 2 | managed_health_check_dir = <%= node['cluster']['slurm']['install_dir'] %>/etc/pcluster/.slurm_plugin/scripts/health_checks 3 | -------------------------------------------------------------------------------- /cookbooks/line/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Please refer to 4 | [https://github.com/chef-cookbooks/community_cookbook_documentation/blob/main/CONTRIBUTING.MD](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/main/CONTRIBUTING.MD) 5 | -------------------------------------------------------------------------------- /cookbooks/line/spec/fixtures/cookbooks/spectest/recipes/delete_from_list_missing_file.rb: -------------------------------------------------------------------------------- 1 | delete_from_list 'missing_file fail' do 2 | path '/tmp/nofilehere' 3 | pattern 'multi = ' 4 | delim [', ', '[', ']'] 5 | entry '425' 6 | ignore_missing false 7 | end 8 | -------------------------------------------------------------------------------- /cookbooks/yum/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Please refer to 4 | [https://github.com/chef-cookbooks/community_cookbook_documentation/blob/main/CONTRIBUTING.MD](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/main/CONTRIBUTING.MD) 5 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/resources/c_states/partial/_c_states_redhat_9_based.rb: -------------------------------------------------------------------------------- 1 | action :setup do 2 | return if !x86_instance? || on_docker? 3 | shell_out!('grubby --update-kernel=ALL --args="intel_idle.max_cstate=1 processor.max_cstate=1"') 4 | end 5 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/pyxis/plugstack.conf.erb: -------------------------------------------------------------------------------- 1 | # THIS IS AN EXAMPLE OF Spank config file 2 | # When you want to enable please move this to /opt/slurm/etc/plugstack.conf 3 | include <%= node['cluster']['slurm']['spank_config_dir'] %>/* 4 | -------------------------------------------------------------------------------- /cookbooks/nfs/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Please refer to 4 | [https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD) 5 | -------------------------------------------------------------------------------- /cookbooks/openssh/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Please refer to 4 | [https://github.com/chef-cookbooks/community_cookbook_documentation/blob/main/CONTRIBUTING.MD](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/main/CONTRIBUTING.MD) 5 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/resources/cloudwatch/partial/_cloudwatch_install_package_rhel.rb: -------------------------------------------------------------------------------- 1 | action :cloudwatch_install_package do 2 | package package_path 3 | end 4 | 5 | action_class do 6 | def package_extension 7 | 'rpm' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/resources/c_states/partial/_c_states_debian.rb: -------------------------------------------------------------------------------- 1 | action_class do 2 | def grub_variable 3 | 'GRUB_CMDLINE_LINUX' 4 | end 5 | 6 | def grub_regenerate_boot_menu_command 7 | '/usr/sbin/update-grub' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/intel_mpi/qt_source_code.erb: -------------------------------------------------------------------------------- 1 | You can get Qt source code here: 2 | 3 | https://<%= @aws_region %>-aws-parallelcluster.s3.<%= @aws_region %>.<%= @aws_domain %>/archives/impi/qt-src-<%= @intelmpi_qt_version %>-linux.src.tgz 4 | -------------------------------------------------------------------------------- /cookbooks/openssh/templates/port_ssh.erb: -------------------------------------------------------------------------------- 1 | # SSH 2 | <% if @port.kind_of? Array -%> 3 | <% @port.each do |item| -%> 4 | -A FWR -p tcp -m tcp --dport <%= item %> -j ACCEPT 5 | <% end -%> 6 | <% else -%> 7 | -A FWR -p tcp -m tcp --dport <%= @port %> -j ACCEPT 8 | <% end -%> 9 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/fleet_status_manager_program.erb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source /etc/profile.d/aws-cli-default-config.sh 3 | sudo -u <%= node['cluster']['cluster_admin_user'] %> <%= node_virtualenv_path %>/bin/slurm_fleet_status_manager "$@" 4 | -------------------------------------------------------------------------------- /cookbooks/nfs/test/cookbooks/nfs_test/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # This service is loaded lazily and wait until a connection is attempted to 2 | # start so, manually start them here so that Kitchen can test for them 3 | 4 | service 'rpcbind' do 5 | action [:enable, :start] 6 | end 7 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-computefleet/attributes/computefleet.rb: -------------------------------------------------------------------------------- 1 | default['cluster']['computefleet_status_path'] = "#{node['cluster']['shared_dir']}/computefleet-status.json" 2 | 3 | # Compute nodes bootstrap timeout 4 | default['cluster']['compute_node_bootstrap_timeout'] = 1800 5 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/spec/unit/recipes/config_login.rb: -------------------------------------------------------------------------------- 1 | require_relative '../../spec_helper' 2 | 3 | describe 'config_login' do 4 | %w(aws-parallelcluster-platform::loginmgtd).each do |component| 5 | it { is_expected.to include_recipe(component) } 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/parallelcluster_slurm_fleet_status_manager.conf.erb: -------------------------------------------------------------------------------- 1 | [slurm_fleet_status_manager] 2 | cluster_name = <%= node['cluster']['stack_name'] %> 3 | region = <%= node['cluster']['region'] %> 4 | proxy = <%= node['cluster']['proxy'] %> 5 | -------------------------------------------------------------------------------- /cookbooks/line/.github/lock.yml: -------------------------------------------------------------------------------- 1 | --- 2 | daysUntilLock: 365 3 | exemptLabels: [] 4 | lockLabel: false 5 | lockComment: > 6 | This thread has been automatically locked since there has not been 7 | any recent activity after it was closed. Please open a new issue for 8 | related bugs. 9 | -------------------------------------------------------------------------------- /cookbooks/nfs/spec/unit/recipes/client4_spec.rb: -------------------------------------------------------------------------------- 1 | require_relative '../../spec_helper' 2 | 3 | describe 'nfs::client4' do 4 | platform 'centos' 5 | 6 | %w(nfs::_common nfs::_idmap).each do |component| 7 | it { is_expected.to include_recipe(component) } 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /cookbooks/yum/test/integration/default/inspec/default_spec.rb: -------------------------------------------------------------------------------- 1 | # The default recipe takes over yum_globalconfig[/etc/yum.conf] 2 | # Test to make sure the package manager still works. 3 | 4 | describe command('yum -y install emacs-nox') do 5 | its('exit_status') { should eq 0 } 6 | end 7 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-awsbatch/templates/default/awsbatch/pcluster_awsbatchcli.sh.erb: -------------------------------------------------------------------------------- 1 | # 2 | # pcluster_awsbatchcli.sh: 3 | # Setup ParallelCluster AWSBatch CLI environment variables 4 | # 5 | 6 | PATH=$PATH:<%= node['cluster']['awsbatch_virtualenv_path'] %>/bin 7 | 8 | export PATH 9 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/loginmgtd/99-parallelcluster-loginmgtd.erb: -------------------------------------------------------------------------------- 1 | Cmnd_Alias LOGINMGTD_HOOKS_COMMANDS = <%= node['cluster']['etc_dir'] %>/loginmgtd_on_termination.sh 2 | 3 | <%= node['cluster']['cluster_admin_user'] %> ALL = (root) NOPASSWD: LOGINMGTD_HOOKS_COMMANDS 4 | -------------------------------------------------------------------------------- /cookbooks/nfs/test/cookbooks/nfs_test/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'nfs_test' 2 | maintainer 'Eric G. Wolfe' 3 | maintainer_email 'wolfe21@marshall.edu' 4 | license 'Apache-2.0' 5 | description 'Tests NFS cookbook' 6 | version '0.0.2' 7 | 8 | depends 'apt' 9 | depends 'nfs' 10 | depends 'line' 11 | -------------------------------------------------------------------------------- /cookbooks/openssh/mlc_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignorePatterns": [ 3 | { 4 | "pattern": "^https://tickets.chef.io/browse/COOK" 5 | }, 6 | { 7 | "pattern": "^https://opencollective.com/sous-chefs/contributors.svg" 8 | } 9 | ] 10 | } -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/resources/stunnel/partial/_common.rb: -------------------------------------------------------------------------------- 1 | property :stunnel_version, String, default: '5.67' 2 | property :stunnel_checksum, String, default: '3086939ee6407516c59b0ba3fbf555338f9d52f459bcab6337c0f00e91ea8456' 3 | 4 | unified_mode true 5 | default_action :setup 6 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_cfn_init_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for cfn-init log %> 2 | /var/log/cfn-init.log { 3 | missingok 4 | notifempty 5 | nodateext 6 | size 10M 7 | rotate 1 8 | copytruncate 9 | } 10 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/nvidia-imex/nvidia-imex-nodes.erb: -------------------------------------------------------------------------------- 1 | ## Please replace below fake IP's with correct IP address of launched instances in Gb200 Capacity Block 2 | 0.0.0.0 3 | 0.0.0.0 4 | 0.0.0.0 5 | 0.0.0.0 6 | 0.0.0.0 7 | 0.0.0.0 8 | 0.0.0.0 9 | 0.0.0.0 10 | 0.0.0.0 -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/resources/raid/raid_rocky8.rb: -------------------------------------------------------------------------------- 1 | provides :raid, platform: 'rocky' do |node| 2 | node['platform_version'].to_i >= 8 3 | end 4 | 5 | use 'partial/_raid_common' 6 | 7 | action_class do 8 | def raid_superblock_version 9 | '1.2' 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/templates/setup-ephemeral.service.erb: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Setup ephemeral drives service 3 | After=<%= @network_target %> 4 | 5 | [Service] 6 | ExecStart=/usr/local/sbin/setup-ephemeral-drives.sh 7 | 8 | [Install] 9 | WantedBy=multi-user.target 10 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-tests/recipes/tear_down.rb: -------------------------------------------------------------------------------- 1 | node.default['cluster']['node_virtualenv_path'] = node_virtualenv_path 2 | node.default['cluster']['cookbook_virtualenv_path'] = cookbook_virtualenv_path 3 | node_attributes 'Save values for InSpec tests' 4 | 5 | include_recipe "::unmount_home" 6 | -------------------------------------------------------------------------------- /cookbooks/line/spec/fixtures/cookbooks/spectest/recipes/add_to_list_missing_file.rb: -------------------------------------------------------------------------------- 1 | add_to_list 'missing_file fail' do 2 | path '/tmp/nofilehere' 3 | pattern Regexp.escape('empty_delimited_list=(') 4 | delim [', ', '"'] 5 | ends_with ')' 6 | entry 'newentry' 7 | ignore_missing false 8 | end 9 | -------------------------------------------------------------------------------- /cookbooks/nfs/spec/unit/recipes/server4_spec.rb: -------------------------------------------------------------------------------- 1 | require_relative '../../spec_helper' 2 | 3 | describe 'nfs::server4' do 4 | platform 'centos' 5 | 6 | %w(nfs::_common nfs::_idmap nfs::server).each do |component| 7 | it { is_expected.to include_recipe(component) } 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/resources/raid/raid_redhat8.rb: -------------------------------------------------------------------------------- 1 | provides :raid, platform: 'redhat' do |node| 2 | node['platform_version'].to_i >= 8 3 | end 4 | 5 | use 'partial/_raid_common' 6 | 7 | action_class do 8 | def raid_superblock_version 9 | '1.2' 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/resources/raid/raid_ubuntu22+.rb: -------------------------------------------------------------------------------- 1 | provides :raid, platform: 'ubuntu' do |node| 2 | node['platform_version'].to_i >= 22 3 | end 4 | 5 | use 'partial/_raid_common' 6 | 7 | action_class do 8 | def raid_superblock_version 9 | '1.2' 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_chef_client_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for chef-client log %> 2 | /var/log/chef-client.log { 3 | rotate 1 4 | size 10M 5 | missingok 6 | notifempty 7 | copytruncate 8 | nodateext 9 | } 10 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'chefspec' 2 | 3 | require_relative '../../aws-parallelcluster-shared/spec/spec_helper' 4 | 5 | RSpec.configure do |c| 6 | c.before(:all) do 7 | ChefSpec::SoloRunner.new.converge('aws-parallelcluster-slurm') 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/resources/raid/raid_alinux2023.rb: -------------------------------------------------------------------------------- 1 | provides :raid, platform: 'amazon' do |node| 2 | node['platform_version'].to_i == 2023 3 | end 4 | 5 | use 'partial/_raid_common' 6 | 7 | action_class do 8 | def raid_superblock_version 9 | '1.2' 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/resources/c_states/partial/_c_states_redhat_based.rb: -------------------------------------------------------------------------------- 1 | action_class do 2 | def grub_variable 3 | 'GRUB_CMDLINE_LINUX_DEFAULT' 4 | end 5 | 6 | def grub_regenerate_boot_menu_command 7 | '/usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg' 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'chefspec' 2 | 3 | require_relative '../../aws-parallelcluster-shared/spec/spec_helper' 4 | 5 | RSpec.configure do |c| 6 | c.before(:all) do 7 | ChefSpec::SoloRunner.new.converge('aws-parallelcluster-platform') 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'chefspec' 2 | 3 | require_relative '../../aws-parallelcluster-shared/spec/spec_helper' 4 | 5 | RSpec.configure do |c| 6 | c.before(:all) do 7 | ChefSpec::SoloRunner.new.converge('aws-parallelcluster-environment') 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/pyxis/pyxis.conf.erb: -------------------------------------------------------------------------------- 1 | # THIS IS AN EXAMPLE OF pyxis.conf file 2 | # When you want to enable please move this to /opt/slurm/etc/plugstack.conf.d/pyxis.conf 3 | required /usr/local/lib/slurm/spank_pyxis.so runtime_path=<%= node['cluster']['pyxis']['runtime_path'] %> 4 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_cloud_init_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for cloud-init log %> 2 | /var/log/cloud-init.log { 3 | missingok 4 | notifempty 5 | nodateext 6 | size 10M 7 | rotate 1 8 | copytruncate 9 | nodateext 10 | } 11 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_cloud_init_output_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for cloud-init-output.log %> 2 | /var/log/cloud-init-output.log { 3 | missingok 4 | notifempty 5 | nodateext 6 | size 10M 7 | rotate 1 8 | copytruncate 9 | } 10 | -------------------------------------------------------------------------------- /cookbooks/iptables/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'chefspec' 2 | require 'chefspec/berkshelf' 3 | require_relative '../libraries/helpers' 4 | 5 | Dir['./spec/support/**/*.rb'].sort.each { |f| require f } 6 | 7 | RSpec.configure do |config| 8 | config.formatter = :documentation 9 | config.color = true 10 | end 11 | -------------------------------------------------------------------------------- /cookbooks/line/spec/rspec_helper.rb: -------------------------------------------------------------------------------- 1 | Dir.glob('libraries/*.rb').each do |lib| 2 | require_relative "../#{lib}" 3 | end 4 | 5 | RSpec.configure do |config| 6 | config.expose_dsl_globally = true 7 | config.mock_with :rspec do |mocks| 8 | mocks.allow_message_expectations_on_nil = true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/libraries/networking.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Retrieve list of macs of network interfaces 3 | # 4 | def network_interface_macs(token) 5 | uri = URI("http://169.254.169.254/latest/meta-data/network/interfaces/macs") 6 | res = get_metadata_with_token(token, uri) 7 | res.delete("/").split("\n") 8 | end 9 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/templates/cfn_bootstrap/pcluster_cookbook_environment.sh.erb: -------------------------------------------------------------------------------- 1 | # 2 | # pcluster_cookbook_environment.sh: 3 | # Setup ParallelCluster cookbook environment variables 4 | # 5 | 6 | CFN_BOOTSTRAP_VIRTUALENV_PATH=<%= @cfn_bootstrap_virtualenv_path %>/bin 7 | 8 | export CFN_BOOTSTRAP_VIRTUALENV_PATH 9 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/slurm.sh.erb: -------------------------------------------------------------------------------- 1 | # 2 | # slurm.sh: 3 | # Setup slurm environment variables 4 | # 5 | 6 | PATH=$PATH:<%= node['cluster']['slurm']['install_dir'] %>/bin 7 | MANPATH=$MANPATH:<%= node['cluster']['slurm']['install_dir'] %>/share/man 8 | 9 | export PATH MANPATH 10 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'chefspec' 2 | require 'chefspec/berkshelf' 3 | 4 | RSpec.configure do |config| 5 | config.color = true # Use color in STDOUT 6 | config.formatter = :documentation # Use the specified formatter 7 | config.log_level = :error # Avoid deprecation notice SPAM 8 | end 9 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/attributes/users_ubuntu.rb: -------------------------------------------------------------------------------- 1 | return unless platform?('ubuntu') 2 | 3 | default['cluster']['cluster_user'] = 'ubuntu' 4 | default['cluster']['cluster_user_home'] = "/home/#{node['cluster']['cluster_user']}" 5 | default['cluster']['cluster_user_local_home'] = "/local#{node['cluster']['cluster_user_home']}" 6 | -------------------------------------------------------------------------------- /cookbooks/iptables/test/integration/all-tables/rules_spec.rb: -------------------------------------------------------------------------------- 1 | describe command('/sbin/iptables-save') do 2 | its(:stdout) { should match /\*filter/ } 3 | its(:stdout) { should match /\*mangle/ } 4 | its(:stdout) { should match /\*nat/ } 5 | its(:stdout) { should match /\*raw/ } 6 | its(:stdout) { should match /\*security/ } 7 | end 8 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/loginmgtd/loginmgtd_config.json.erb: -------------------------------------------------------------------------------- 1 | { 2 | "termination_script_path": "<%= node['cluster']['etc_dir'] %>/loginmgtd_on_termination.sh", 3 | "termination_message": "The system will be terminated within <%= @gracetime_period %> minutes.", 4 | "gracetime_period": "<%= @gracetime_period %>" 5 | } 6 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/templates/profile/path.sh.erb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PATH_REQUIRED_DIRECTORIES=(<%= @path_required_directories.join(' ') %>) 4 | 5 | for directory in "${PATH_REQUIRED_DIRECTORIES[@]}"; do 6 | [[ ":$PATH:" == *":$directory:"* ]] || PATH="${PATH:+"$PATH:"}$directory" 7 | done 8 | 9 | export PATH 10 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/files/default/head_node_slurm/slurm/templates/slurm_parallelcluster_gres.conf: -------------------------------------------------------------------------------- 1 | # slurm_parallelcluster_gres.conf is managed by the pcluster processes. 2 | # Do not modify. 3 | 4 | {% for queue in queues %} 5 | include {{ output_dir }}/pcluster/slurm_parallelcluster_{{ queue.Name }}_gres.conf 6 | {% endfor %} 7 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/templates/samplefile2.erb: -------------------------------------------------------------------------------- 1 | # authorized_keys 2 | ssh-rsa AAAAB3NzaC1yc2EAAAADA1F45ADMVN24QFL123LPPEQWERWWEWO keepme@yourfile 3 | ssh-dsa AAAAB3NzaC1yc2EAAAADDEADBEEFDERPDERPDERPILIKESSHTOO skelator@grayskull 4 | ssh-rsa AAAAB3NzaC1yc2EAAAADAKHASDKJHSDKHASDHK1231235KJASD0 keepmetoo@yourfile 5 | last line 6 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/cgroup.conf.erb: -------------------------------------------------------------------------------- 1 | ### 2 | # Slurm cgroup support configuration file 3 | ### 4 | ConstrainCores=yes 5 | # 6 | # WARNING!!! The slurm_parallelcluster_cgroup.conf file included below can be updated by the pcluster process. 7 | # Please do not edit it. 8 | include slurm_parallelcluster_cgroup.conf 9 | -------------------------------------------------------------------------------- /cookbooks/iptables/test/cookbooks/test/recipes/centos-6-helper.rb: -------------------------------------------------------------------------------- 1 | # CentOS 6 on Bento requires the iptables modules loading 2 | 3 | %w(ip_tables iptable_filter iptable_mangle iptable_nat).each do |mod| 4 | next if node['kernel']['modules'].keys.include?(mod) 5 | 6 | execute "modprobe #{mod}" do 7 | returns [0, 1] 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_bootstrap_error_msg_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for bootstrap error log %> 2 | /var/log/parallelcluster/bootstrap_error_msg { 3 | rotate 1 4 | size 10M 5 | missingok 6 | notifempty 7 | copytruncate 8 | su root root 9 | nodateext 10 | } 11 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/libraries/networking.rb: -------------------------------------------------------------------------------- 1 | 2 | # Return the VPC CIDR list from node info 3 | def get_vpc_cidr_list 4 | if node['ec2'] 5 | mac = node['ec2']['mac'] 6 | vpc_cidr_list = node['ec2']['network_interfaces_macs'][mac]['vpc_ipv4_cidr_blocks'] 7 | vpc_cidr_list.split(/\n+/) 8 | else 9 | [] 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /.isort.cfg: -------------------------------------------------------------------------------- 1 | [settings] 2 | line_length=120 3 | known_third_party=assertpy,boto3,botocore,dcv,gnupg,jinja2,jsonschema,pytest,requests,slurm,retrying,click 4 | # 3 - Vertical Hanging Indent 5 | # from third_party import ( 6 | # lib1, 7 | # lib2, 8 | # lib3, 9 | # lib4, 10 | # ) 11 | multi_line_output=3 12 | include_trailing_comma=true 13 | profile=black -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_pam_ssh_key_generator_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for pam_ssh_key_generator log %> 2 | /var/log/parallelcluster/pam_ssh_key_generator.log { 3 | rotate 1 4 | size 10M 5 | missingok 6 | notifempty 7 | su root root 8 | copytruncate 9 | nodateext 10 | } 11 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_slurmd_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for slurmd log %> 2 | /var/log/slurmd.log { 3 | rotate 1 4 | size 10M 5 | missingok 6 | notifempty 7 | postrotate 8 | pkill --signal=SIGUSR2 slurmd 9 | echo 0 10 | endscript 11 | nodateext 12 | } 13 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/templates/imds/parallelcluster-iptables.service.erb: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Backup and restore iptables rules (both for IPv4 and IPv6) 3 | After=network-online.target 4 | 5 | [Service] 6 | ExecStart=/usr/local/sbin/restore_tables.sh 7 | ExecStop=/usr/local/sbin/save_tables.sh 8 | 9 | [Install] 10 | WantedBy=multi-user.target 11 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/attributes/users_amazon2.rb: -------------------------------------------------------------------------------- 1 | return unless platform?('amazon') && node['platform_version'] == "2" 2 | 3 | default['cluster']['cluster_user'] = 'ec2-user' 4 | default['cluster']['cluster_user_home'] = "/home/#{node['cluster']['cluster_user']}" 5 | default['cluster']['cluster_user_local_home'] = "/local#{node['cluster']['cluster_user_home']}" 6 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/attributes/users_rocky8.rb: -------------------------------------------------------------------------------- 1 | return unless platform?('rocky') && node['platform_version'].to_i >= 8 2 | 3 | default['cluster']['cluster_user'] = 'rocky' 4 | default['cluster']['cluster_user_home'] = "/home/#{node['cluster']['cluster_user']}" 5 | default['cluster']['cluster_user_local_home'] = "/local#{node['cluster']['cluster_user_home']}" 6 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/files/default/head_node_slurm/slurm/templates/slurm_parallelcluster_cgroup.conf: -------------------------------------------------------------------------------- 1 | # slurm_parallelcluster.conf is managed by the pcluster processes. 2 | # Do not modify. 3 | # Please add user-specific slurm configuration options in cgroup.conf 4 | 5 | {% if scaling_config.EnableMemoryBasedScheduling %} 6 | ConstrainRAMSpace=yes 7 | {% endif %} -------------------------------------------------------------------------------- /cookbooks/line/test/integration/line_resources/inspec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: line_resources 3 | title: InSpec 4 | maintainer: Sous Chefs 5 | copyright: Sous Chefs 6 | copyright_email: help@sous-chefs.org 7 | license: Apache-2.0 8 | summary: Custom inspec resources for the line cookbook 9 | version: 1.0.0 10 | supports: 11 | - os-family: unix 12 | - os-family: windows 13 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/resources/efs/partial/_get_package_version_dpkg.rb: -------------------------------------------------------------------------------- 1 | def get_package_version_command(package_name) 2 | # TODO: These commands do not fit all packages versions. e.g. dpkg-query --showformat='${Version}' --show stunnel4 | awk -F- '{print $1}' 3 | "dpkg-query --showformat='${Version}' --show #{package_name} | awk -F- '{print $1}'" 4 | end 5 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_clustermgtd_events_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for clustermgtd events log %> 2 | /var/log/parallelcluster/clustermgtd.events { 3 | rotate 1 4 | size 10M 5 | missingok 6 | notifempty 7 | copytruncate 8 | su pcluster-admin pcluster-admin 9 | nodateext 10 | } 11 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_slurm_resume_events_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for slurm resume events log %> 2 | /var/log/parallelcluster/slurm_resume.events { 3 | rotate 1 4 | size 10M 5 | missingok 6 | notifempty 7 | copytruncate 8 | su pcluster-admin pcluster-admin 9 | nodateext 10 | } 11 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_slurmdbd_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for slurmdbd log %> 2 | /var/log/slurmdbd.log { 3 | rotate 1 4 | size 10M 5 | missingok 6 | notifempty 7 | postrotate 8 | pkill -x --signal SIGUSR2 slurmdbd 9 | exit 0 10 | endscript 11 | nodateext 12 | } 13 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/attributes/users_redhat8.rb: -------------------------------------------------------------------------------- 1 | return unless platform?('redhat') && node['platform_version'].to_i >= 8 2 | 3 | default['cluster']['cluster_user'] = 'ec2-user' 4 | default['cluster']['cluster_user_home'] = "/home/#{node['cluster']['cluster_user']}" 5 | default['cluster']['cluster_user_local_home'] = "/local#{node['cluster']['cluster_user_home']}" 6 | -------------------------------------------------------------------------------- /cookbooks/line/.yamllint: -------------------------------------------------------------------------------- 1 | --- 2 | extends: default 3 | rules: 4 | line-length: 5 | max: 256 6 | level: warning 7 | document-start: disable 8 | braces: 9 | forbid: false 10 | min-spaces-inside: 0 11 | max-spaces-inside: 1 12 | min-spaces-inside-empty: -1 13 | max-spaces-inside-empty: -1 14 | comments: 15 | min-spaces-from-content: 1 16 | -------------------------------------------------------------------------------- /cookbooks/nfs/.yamllint: -------------------------------------------------------------------------------- 1 | --- 2 | extends: default 3 | rules: 4 | line-length: 5 | max: 256 6 | level: warning 7 | document-start: disable 8 | braces: 9 | forbid: false 10 | min-spaces-inside: 0 11 | max-spaces-inside: 1 12 | min-spaces-inside-empty: -1 13 | max-spaces-inside-empty: -1 14 | comments: 15 | min-spaces-from-content: 1 16 | -------------------------------------------------------------------------------- /cookbooks/yum/.yamllint: -------------------------------------------------------------------------------- 1 | --- 2 | extends: default 3 | rules: 4 | line-length: 5 | max: 256 6 | level: warning 7 | document-start: disable 8 | braces: 9 | forbid: false 10 | min-spaces-inside: 0 11 | max-spaces-inside: 1 12 | min-spaces-inside-empty: -1 13 | max-spaces-inside-empty: -1 14 | comments: 15 | min-spaces-from-content: 1 16 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/templates/spack/packages-aarch64.yaml.erb: -------------------------------------------------------------------------------- 1 | --- # aarch64 packages (Basically only compiler) 2 | packages: 3 | gcc: 4 | compiler: [gcc] 5 | require: 6 | - one_of: ["gcc@12 +binutils ^binutils@2.37 target=aarch64"] 7 | all: 8 | compiler: [gcc, clang] 9 | permissions: 10 | read: world 11 | write: user 12 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_slurmctld_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for slurmctld log %> 2 | /var/log/slurmctld.log { 3 | rotate 1 4 | size 50M 5 | missingok 6 | notifempty 7 | postrotate 8 | pkill -x --signal SIGUSR2 slurmctld 9 | exit 0 10 | endscript 11 | nodateext 12 | } 13 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/attributes/users_alinux2023.rb: -------------------------------------------------------------------------------- 1 | return unless platform?('amazon') && node['platform_version'].to_i == 2023 2 | 3 | default['cluster']['cluster_user'] = 'ec2-user' 4 | default['cluster']['cluster_user_home'] = "/home/#{node['cluster']['cluster_user']}" 5 | default['cluster']['cluster_user_local_home'] = "/local#{node['cluster']['cluster_user_home']}" 6 | -------------------------------------------------------------------------------- /cookbooks/openssh/.yamllint: -------------------------------------------------------------------------------- 1 | --- 2 | extends: default 3 | rules: 4 | line-length: 5 | max: 256 6 | level: warning 7 | document-start: disable 8 | braces: 9 | forbid: false 10 | min-spaces-inside: 0 11 | max-spaces-inside: 1 12 | min-spaces-inside-empty: -1 13 | max-spaces-inside-empty: -1 14 | comments: 15 | min-spaces-from-content: 1 16 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/.yamllint: -------------------------------------------------------------------------------- 1 | --- 2 | extends: default 3 | rules: 4 | line-length: 5 | max: 256 6 | level: warning 7 | document-start: disable 8 | braces: 9 | forbid: false 10 | min-spaces-inside: 0 11 | max-spaces-inside: 1 12 | min-spaces-inside-empty: -1 13 | max-spaces-inside-empty: -1 14 | comments: 15 | min-spaces-from-content: 1 16 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/delete_lines/inspec/controls/delete_lines_empty.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Delete lines on empty file 3 | # 4 | 5 | control 'delete_lines_empty' do 6 | describe file('/tmp/emptyfile') do 7 | it { should exist } 8 | its('size') { should eq 0 } 9 | end 10 | 11 | describe file('/tmp/missingfile') do 12 | it { should_not exist } 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_compute_console_output_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for compute_console_output log %> 2 | /var/log/parallelcluster/compute_console_output.log { 3 | rotate 1 4 | size 10M 5 | missingok 6 | notifempty 7 | copytruncate 8 | su pcluster-admin pcluster-admin 9 | nodateext 10 | } 11 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-awsbatch/kitchen.awsbatch-config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | verifier: 3 | name: inspec 4 | inspec_tests: 5 | - cookbooks/aws-parallelcluster-awsbatch/test 6 | 7 | suites: 8 | 9 | # Recipes 10 | - name: awsbatch 11 | run_list: 12 | - recipe[aws-parallelcluster-awsbatch::config] 13 | verifier: 14 | controls: 15 | - /tag:config_awsbatch/ 16 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-computefleet/templates/clusterstatusmgtd/clusterstatusmgtd.conf.erb: -------------------------------------------------------------------------------- 1 | [clusterstatusmgtd] 2 | cluster_name = <%= node['cluster']['stack_name'] %> 3 | region = <%= node['cluster']['region'] %> 4 | proxy = <%= node['cluster']['proxy'] %> 5 | dynamodb_table = <%= node['cluster']['ddb_table'] %> 6 | computefleet_status_path = <%= node['cluster']['computefleet_status_path'] %> 7 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/filter_lines_comment.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Verify the results of using the comment filter 3 | # 4 | 5 | template '/tmp/comment' do 6 | source 'samplefile.erb' 7 | action :create_if_missing 8 | end 9 | 10 | filter_lines 'Change matching lines to comments' do 11 | path '/tmp/comment' 12 | sensitive false 13 | filters comment: [/I/] 14 | end 15 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/replace_or_add_change_line_eof.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Change the last line of a file 3 | # 4 | 5 | template '/tmp/change_line_eof' do 6 | source 'text_file.erb' 7 | action :create_if_missing 8 | end 9 | 10 | replace_or_add 'change_line_eof' do 11 | path '/tmp/change_line_eof' 12 | pattern 'Last line' 13 | line 'Last line changed' 14 | end 15 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/add_to_list/inspec/controls/add_to_list_empty.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Test for missing and empty file behavior 3 | # 4 | 5 | control 'add_to_list_empty' do 6 | describe file('/tmp/emptyfile') do 7 | it { should exist } 8 | its('size') { should eq 0 } 9 | end 10 | 11 | describe file('/tmp/missingfile') do 12 | it { should_not exist } 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/delete_from_list/inspec/controls/delete_from_list_empty.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Delete from empty file 3 | # 4 | 5 | control 'delete_from_list_empty' do 6 | describe file('/tmp/emptyfile') do 7 | it { should exist } 8 | its('size') { should eq 0 } 9 | end 10 | 11 | describe file('/tmp/missingfile') do 12 | it { should_not exist } 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_slurm_fleet_status_manager_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for slurm_fleet_status_manager log %> 2 | /var/log/parallelcluster/slurm_fleet_status_manager.log { 3 | rotate 1 4 | size 10M 5 | missingok 6 | notifempty 7 | su pcluster-admin pcluster-admin 8 | copytruncate 9 | nodateext 10 | } 11 | -------------------------------------------------------------------------------- /cookbooks/yum/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'chefspec' 2 | require 'chefspec/berkshelf' 3 | 4 | RSpec.configure do |config| 5 | config.color = true # Use color in STDOUT 6 | config.formatter = :documentation # Use the specified formatter 7 | config.log_level = :error # Avoid deprecation notice SPAM 8 | config.platform = 'centos' 9 | config.version = '8' 10 | end 11 | -------------------------------------------------------------------------------- /cookbooks/line/spec/chefspec_helper.rb: -------------------------------------------------------------------------------- 1 | Dir.glob('libraries/*.rb').each do |lib| 2 | require_relative "../#{lib}" 3 | end 4 | 5 | require 'berkshelf' 6 | require 'chefspec' 7 | require 'chefspec/berkshelf' 8 | 9 | RSpec.configure do |config| 10 | config.expose_dsl_globally = true 11 | config.mock_with :rspec do |mocks| 12 | mocks.allow_message_expectations_on_nil = true 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/resources/cloudwatch/partial/_cloudwatch_install_package_debian.rb: -------------------------------------------------------------------------------- 1 | action :cloudwatch_install_package do 2 | dpkg_package package_path do 3 | source package_path 4 | end unless on_docker? 5 | end 6 | 7 | action_class do 8 | def platform_url_component 9 | node['platform'] 10 | end 11 | 12 | def package_extension 13 | 'deb' 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /cookbooks/iptables/Gemfile: -------------------------------------------------------------------------------- 1 | # This gemfile provides additional gems for testing and releasing this cookbook 2 | # It is meant to be installed on top of ChefDK / Chef Workstation which provide the majority 3 | # of the necessary gems for testing this cookbook 4 | # 5 | # Run 'chef exec bundle install' to install these dependencies 6 | 7 | source 'https://rubygems.org' 8 | 9 | gem 'community_cookbook_releaser' 10 | -------------------------------------------------------------------------------- /cookbooks/line/documentation/resources/filters/comment.md: -------------------------------------------------------------------------------- 1 | # Examples for the comment filter 2 | 3 | ## Original file 4 | 5 | ```text 6 | line1 7 | line2 8 | line 9 | ``` 10 | 11 | ## Output file 12 | 13 | ```text 14 | # line1 15 | # line2 16 | line 17 | ``` 18 | 19 | ## Filter 20 | 21 | ```ruby 22 | filter_lines '/example/comment' do 23 | filters(comment: [/^line\d+$/, '#', ' ']) 24 | end 25 | -------------------------------------------------------------------------------- /cookbooks/yum/test/cookbooks/test/recipes/dnf_module.rb: -------------------------------------------------------------------------------- 1 | package 'nodejs' 2 | 3 | dnf_module 'ruby:2.7' do 4 | action :install 5 | end 6 | 7 | dnf_module 'mysql' do 8 | action :disable 9 | end 10 | 11 | # test cache flush 12 | yum_remi_modular 'default' 13 | dnf_module 'php:remi-8.1' 14 | 15 | # this would fail if cache is not reloaded 16 | # would still try to install stock php 7.2 17 | package 'php' 18 | -------------------------------------------------------------------------------- /cookbooks/iptables/test/cookbooks/test/recipes/install-and-remove.rb: -------------------------------------------------------------------------------- 1 | include_recipe '::centos-6-helper' if platform?('centos') && node['platform_version'].to_i == 6 2 | 3 | iptables_packages 'install iptables' 4 | iptables_service 'configure iptables services' 5 | 6 | iptables_service 'remove-services' do 7 | action :disable 8 | end 9 | 10 | iptables_packages 'remove-packages' do 11 | action :remove 12 | end 13 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/filter_lines_between.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Verify the results of using the between filter 3 | # 4 | 5 | template '/tmp/between' do 6 | source 'samplefile3.erb' 7 | action :create_if_missing 8 | end 9 | 10 | filter_lines 'Change lines between matches' do 11 | path '/tmp/between' 12 | sensitive false 13 | filters between: [/^empty/, /last_list/, ['add line']] 14 | end 15 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/filter_lines_substitute.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Verify the results of using the substitute filter 3 | # 4 | 5 | template '/tmp/substitute' do 6 | source 'samplefile3.erb' 7 | action :create_if_missing 8 | end 9 | 10 | filter_lines 'Substitute string for matching pattern' do 11 | path '/tmp/substitute' 12 | filters substitute: [/last/, /last_list/, 'start_list'] 13 | end 14 | -------------------------------------------------------------------------------- /cookbooks/line/documentation/resources/filters/replace.md: -------------------------------------------------------------------------------- 1 | # Examples for the replace filter 2 | 3 | ## Original file 4 | 5 | ```text 6 | line1 7 | line2 8 | ``` 9 | 10 | ## Output file 11 | 12 | ```texttext 13 | line1 14 | add1 15 | add2 16 | ``` 17 | 18 | ## Filter 19 | 20 | ```ruby 21 | addlines = "add1\nadd2\n" 22 | filter_lines '/example/replace' do 23 | filters(replace: [/^line2$/, addlines]) 24 | end 25 | ``` 26 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/filter_lines/inspec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: profile 3 | title: InSpec 4 | maintainer: Sous Chefs 5 | copyright: Sous Chefs 6 | copyright_email: help@sous-chefs.org 7 | license: Apache-2.0 8 | summary: Extends the file matcher 9 | version: 1.0.0 10 | supports: 11 | - os-family: unix 12 | - os-family: windows 13 | depends: 14 | - name: line_resources 15 | path: test/integration/line_resources 16 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/test/controls/sticky_bits_spec.rb: -------------------------------------------------------------------------------- 1 | control 'tag:config_sticky_bits_configured' do 2 | title 'Check sticky bits configuration' 3 | 4 | if os_properties.ubuntu? && !os_properties.on_docker? 5 | # This test passes on Mac but doesn't work as GitHub action. 6 | describe kernel_parameter('fs.protected_regular') do 7 | its('value') { should eq 0 } 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /cookbooks/line/documentation/resources/filters/missing.md: -------------------------------------------------------------------------------- 1 | # Examples for the missing filter 2 | 3 | ## Original file 4 | 5 | ```text 6 | line1 7 | line2 8 | ``` 9 | 10 | ## Output file 11 | 12 | ```texttext 13 | line1 14 | line2 15 | add1 16 | add2 17 | ``` 18 | 19 | ## Filter 20 | 21 | ```ruby 22 | addlines = "add1\nadd2\n" 23 | filter_lines '/example/missing' do 24 | filters(missing: [addlines, :after]) 25 | end 26 | ``` 27 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/replace_or_add/inspec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: profile 3 | title: InSpec 4 | maintainer: Sous Chefs 5 | copyright: Sous Chefs 6 | copyright_email: help@sous-chefs.org 7 | license: Apache-2.0 8 | summary: Extends the file matcher 9 | version: 1.0.0 10 | supports: 11 | - os-family: unix 12 | - os-family: windows 13 | depends: 14 | - name: line_resources 15 | path: test/integration/line_resources 16 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Documentation for all configuration options: 2 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 3 | 4 | version: 2 5 | updates: 6 | - package-ecosystem: "bundler" 7 | directory: "/" 8 | schedule: 9 | interval: "daily" 10 | - package-ecosystem: "pip" 11 | directory: "/files/default" 12 | schedule: 13 | interval: "daily" 14 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_dcv_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for dcv logs %> 2 | /var/log/dcv/server.log 3 | /var/log/dcv/sessionlauncher.log 4 | /var/log/dcv/agent.*.log 5 | /var/log/dcv/dcv-xsession.*.log 6 | /var/log/dcv/Xdcv.*.log 7 | { 8 | missingok 9 | notifempty 10 | size 10M 11 | copytruncate 12 | rotate 5 13 | su dcv dcv 14 | nodateext 15 | } 16 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_slurm_resume_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for slurm_resume log %> 2 | /var/log/parallelcluster/slurm_resume.log { 3 | rotate 1 4 | size 50M 5 | missingok 6 | notifempty 7 | postrotate 8 | pkill --signal=SIGUSR2 slurmctld 9 | echo 0 10 | endscript 11 | su pcluster-admin pcluster-admin 12 | nodateext 13 | } 14 | -------------------------------------------------------------------------------- /cookbooks/line/documentation/resources/filters/before.md: -------------------------------------------------------------------------------- 1 | # Examples for the before filter 2 | 3 | ## Original file 4 | 5 | ```text 6 | line1 7 | line2 8 | ``` 9 | 10 | ## Output file 11 | 12 | ```text 13 | line1 14 | add1 15 | add2 16 | line2 17 | ``` 18 | 19 | ## Filter 20 | 21 | ```ruby 22 | addlines = "add1\nadd2\n" 23 | filter_lines '/example/before' do 24 | filters(before: [/^line2$/, addlines, :last]) 25 | end 26 | ``` 27 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/add_to_list/inspec/inspec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: profile 3 | title: InSpec 4 | maintainer: Sous Chefs 5 | copyright: Sous Chefs 6 | copyright_email: help@sous-chefs.org 7 | license: Apache-2.0 8 | summary: Extends the file matcher 9 | version: 1.0.0 10 | supports: 11 | - os-family: unix 12 | - os-family: windows 13 | depends: 14 | - name: line_resources 15 | path: test/integration/line_resources 16 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/delete_lines/inspec/inspec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: profile 3 | title: InSpec 4 | maintainer: Sous Chefs 5 | copyright: Sous Chefs 6 | copyright_email: help@sous-chefs.org 7 | license: Apache-2.0 8 | summary: Extends the file matcher 9 | version: 1.0.0 10 | supports: 11 | - os-family: unix 12 | - os-family: windows 13 | depends: 14 | - name: line_resources 15 | path: test/integration/line_resources 16 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/recipes/test/mock_compute_raid.rb: -------------------------------------------------------------------------------- 1 | return if on_docker? 2 | 3 | raid_and_ebs_dirs = %w(/raid1) 4 | raid_and_ebs_dirs.each do |dir| 5 | directory dir do 6 | mode '1777' 7 | end 8 | end 9 | 10 | dirs_to_export = %w(/raid1) 11 | dirs_to_export.each do |dir| 12 | nfs_export dir do 13 | network '127.0.0.1/32' 14 | writeable true 15 | options ['no_root_squash'] 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_slurm_suspend_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for slurm_suspend log %> 2 | /var/log/parallelcluster/slurm_suspend.log { 3 | rotate 1 4 | size 10M 5 | missingok 6 | notifempty 7 | postrotate 8 | pkill --signal=SIGUSR2 slurmctld 9 | echo 0 10 | endscript 11 | su pcluster-admin pcluster-admin 12 | nodateext 13 | } 14 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/parallelcluster_computemgtd.conf.erb: -------------------------------------------------------------------------------- 1 | [computemgtd] 2 | cluster_name = <%= node['cluster']['stack_name'] %> 3 | region = <%= node['cluster']['region'] %> 4 | proxy = <%= node['cluster']['proxy'] %> 5 | clustermgtd_heartbeat_file_path = <%= node['cluster']['slurm']['install_dir'] %>/etc/pcluster/.slurm_plugin/clustermgtd_heartbeat 6 | dynamodb_table = <%= node['cluster']['slurm_ddb_table'] %> 7 | -------------------------------------------------------------------------------- /cookbooks/line/documentation/resources/filters/substitute.md: -------------------------------------------------------------------------------- 1 | # Examples for the substitute filter 2 | 3 | ## Original file 4 | 5 | ```text 6 | line1 text here 7 | line2 text here 8 | ``` 9 | 10 | ## Output file 11 | 12 | ```texttext 13 | line1 text here 14 | line2 text new 15 | ``` 16 | 17 | ## Filter 18 | 19 | ```ruby 20 | filter_lines '/example/substitute' do 21 | filters(substitute: [/^line2/, /here/, 'new']) 22 | end 23 | ``` 24 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/append_if_no_line/inspec/inspec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: profile 3 | title: InSpec 4 | maintainer: Sous Chefs 5 | copyright: Sous Chefs 6 | copyright_email: help@sous-chefs.org 7 | license: Apache-2.0 8 | summary: Extends the file matcher 9 | version: 1.0.0 10 | supports: 11 | - os-family: unix 12 | - os-family: windows 13 | depends: 14 | - name: line_resources 15 | path: test/integration/line_resources 16 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/delete_from_list/inspec/inspec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: profile 3 | title: InSpec 4 | maintainer: Sous Chefs 5 | copyright: Sous Chefs 6 | copyright_email: help@sous-chefs.org 7 | license: Apache-2.0 8 | summary: Extends the file matcher 9 | version: 1.0.0 10 | supports: 11 | - os-family: unix 12 | - os-family: windows 13 | depends: 14 | - name: line_resources 15 | path: test/integration/line_resources 16 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_clustermgtd_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for clustermgtd log %> 2 | /var/log/parallelcluster/clustermgtd { 3 | missingok 4 | notifempty 5 | nodateext 6 | size 50M 7 | rotate 1 8 | su root root 9 | postrotate 10 | pkill --signal=SIGUSR2 supervisord 11 | echo 0 12 | endscript 13 | create 0644 root root 14 | } 15 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_computemgtd_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for computemgtd log %> 2 | /var/log/parallelcluster/computemgtd { 3 | missingok 4 | notifempty 5 | nodateext 6 | size 10M 7 | rotate 1 8 | su root root 9 | postrotate 10 | pkill --signal=SIGUSR2 supervisord 11 | echo 0 12 | endscript 13 | create 0644 root root 14 | } 15 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/filter_lines_replace.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Verify the results of using the replace filter 3 | # 4 | 5 | template '/tmp/replace' do 6 | source 'samplefile.erb' 7 | sensitive true 8 | action :create_if_missing 9 | end 10 | 11 | filter_lines 'Replace the matched line' do 12 | sensitive false 13 | path '/tmp/replace' 14 | filters replace: [/^COMMENT ME|^HELLO/, %w(line1 line2 line3)] 15 | end 16 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/recipes/test/mock_compute_ebs.rb: -------------------------------------------------------------------------------- 1 | return if on_docker? 2 | 3 | raid_and_ebs_dirs = %w(ebs1 /ebs2) 4 | raid_and_ebs_dirs.each do |dir| 5 | directory dir do 6 | mode '1777' 7 | end 8 | end 9 | 10 | dirs_to_export = %w(/ebs1 /ebs2) 11 | dirs_to_export.each do |dir| 12 | nfs_export dir do 13 | network '127.0.0.1/32' 14 | writeable true 15 | options ['no_root_squash'] 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_supervisord_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for logs configured with supervisord %> 2 | /var/log/supervisord.log { 3 | missingok 4 | notifempty 5 | nodateext 6 | size 10M 7 | rotate 1 8 | su root root 9 | postrotate 10 | pkill --signal=SIGUSR2 supervisord 11 | echo 0 12 | endscript 13 | create 0644 root root 14 | } 15 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/kitchen.shared-config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | verifier: 3 | name: inspec 4 | inspec_tests: 5 | - cookbooks/aws-parallelcluster-shared/test 6 | 7 | suites: 8 | 9 | # Recipes 10 | - name: setup_envars 11 | run_list: 12 | - recipe[aws-parallelcluster-tests::setup] 13 | - recipe[aws-parallelcluster-shared::setup_envars] 14 | verifier: 15 | controls: 16 | - /tag:config_setup_envars/ 17 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/filter_lines_delete_between.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Verify the results of using the delete_between filter 3 | # 4 | 5 | template '/tmp/delete_between' do 6 | source 'samplefile3.erb' 7 | action :create_if_missing 8 | end 9 | 10 | filter_lines 'Delete lines between matches' do 11 | path '/tmp/delete_between' 12 | sensitive false 13 | filters delete_between: [/^empty_list/, /^list/, /kernel/] 14 | end 15 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/files/spack/modules.yaml: -------------------------------------------------------------------------------- 1 | modules: 2 | default: 3 | enable: 4 | - tcl 5 | tcl: 6 | projections: 7 | all: '{name}/{version}-{compiler.name}-{compiler.version}' 8 | all: 9 | conflict: 10 | - '{name}' 11 | environment: 12 | set: 13 | '{name}_ROOT': '{prefix}' 14 | # Automatically load dependencies 15 | autoload: all 16 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/log_rotation/parallelcluster_clusterstatusmgtd_log_rotation.erb: -------------------------------------------------------------------------------- 1 | <%# Logrotate file for clusterstatusmgtd log %> 2 | /var/log/parallelcluster/clusterstatusmgtd { 3 | missingok 4 | notifempty 5 | nodateext 6 | size 10M 7 | rotate 1 8 | su root root 9 | postrotate 10 | pkill --signal=SIGUSR2 supervisord 11 | echo 0 12 | endscript 13 | create 0640 root root 14 | } 15 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/slurm.csh.erb: -------------------------------------------------------------------------------- 1 | # 2 | # slurm.csh: 3 | # Sets the C shell user environment for slurm commands 4 | # 5 | set path = ($path <%= node['cluster']['slurm']['install_dir'] %>/bin) 6 | if ( ${?MANPATH} ) then 7 | setenv MANPATH ${MANPATH}:<%= node['cluster']['slurm']['install_dir'] %>/share/man 8 | else 9 | setenv MANPATH :<%= node['cluster']['slurm']['install_dir'] %>/share/man 10 | endif 11 | -------------------------------------------------------------------------------- /cookbooks/line/.editorconfig: -------------------------------------------------------------------------------- 1 | # https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root=true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | # 2 space indentation 12 | indent_style = space 13 | indent_size = 2 14 | 15 | # Avoid issues parsing cookbook files later 16 | charset = utf-8 17 | 18 | # Avoid cookstyle warnings 19 | trim_trailing_whitespace = true 20 | -------------------------------------------------------------------------------- /cookbooks/nfs/.editorconfig: -------------------------------------------------------------------------------- 1 | # https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root=true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | # 2 space indentation 12 | indent_style = space 13 | indent_size = 2 14 | 15 | # Avoid issues parsing cookbook files later 16 | charset = utf-8 17 | 18 | # Avoid cookstyle warnings 19 | trim_trailing_whitespace = true 20 | -------------------------------------------------------------------------------- /cookbooks/yum/.editorconfig: -------------------------------------------------------------------------------- 1 | # https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root=true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | # 2 space indentation 12 | indent_style = space 13 | indent_size = 2 14 | 15 | # Avoid issues parsing cookbook files later 16 | charset = utf-8 17 | 18 | # Avoid cookstyle warnings 19 | trim_trailing_whitespace = true 20 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/block_topology/slurm_parallelcluster_topology.conf.erb: -------------------------------------------------------------------------------- 1 | # slurm_parallelcluster_topology.conf is managed by the pcluster processes. 2 | # Do not modify. 3 | # Please use CustomSlurmSettings in the ParallelCluster configuration file to add user-specific slurm configuration 4 | # options 5 | # TOPOLOGY Plugin 6 | <% unless node['cluster']['p6egb200_block_sizes'].nil? -%> 7 | TopologyPlugin=topology/block 8 | <% end -%> 9 | -------------------------------------------------------------------------------- /cookbooks/iptables/.editorconfig: -------------------------------------------------------------------------------- 1 | # https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root=true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | # 2 space indentation 12 | indent_style = space 13 | indent_size = 2 14 | 15 | # Avoid issues parsing cookbook files later 16 | charset = utf-8 17 | 18 | # Avoid cookstyle warnings 19 | trim_trailing_whitespace = true 20 | -------------------------------------------------------------------------------- /cookbooks/openssh/.editorconfig: -------------------------------------------------------------------------------- 1 | # https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root=true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | # 2 space indentation 12 | indent_style = space 13 | indent_size = 2 14 | 15 | # Avoid issues parsing cookbook files later 16 | charset = utf-8 17 | 18 | # Avoid cookstyle warnings 19 | trim_trailing_whitespace = true 20 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/.editorconfig: -------------------------------------------------------------------------------- 1 | # https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root=true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | # 2 space indentation 12 | indent_style = space 13 | indent_size = 2 14 | 15 | # Avoid issues parsing cookbook files later 16 | charset = utf-8 17 | 18 | # Avoid cookstyle warnings 19 | trim_trailing_whitespace = true 20 | -------------------------------------------------------------------------------- /cookbooks/line/documentation/resources/filters/between.md: -------------------------------------------------------------------------------- 1 | # Examples for the between filter 2 | 3 | ## Original file 4 | 5 | ```text 6 | line1 7 | line2 8 | line3 9 | ``` 10 | 11 | ## Output file 12 | 13 | ```text 14 | line1 15 | line2 16 | add1 17 | add2 18 | line3 19 | ``` 20 | 21 | ## Filter 22 | 23 | ```ruby 24 | addlines = "add1\nadd2\n" 25 | filter_lines '/example/between' do 26 | filters(between: [/^line2$/, /^line3$/, addlines, :last]) 27 | end 28 | ``` 29 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/replace_or_add_add_a_line_matching_pattern.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Add a line that exactly matches the specified pattern. 3 | # 4 | 5 | template '/tmp/add_a_line_matching_pattern' do 6 | source 'text_file.erb' 7 | action :create_if_missing 8 | end 9 | 10 | replace_or_add 'add_a_line_matching_pattern' do 11 | path '/tmp/add_a_line_matching_pattern' 12 | pattern 'Add another line' 13 | line 'Add another line' 14 | end 15 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/libraries/test.rb: -------------------------------------------------------------------------------- 1 | def on_docker? 2 | # Check if we are running in a Docker System Tests 3 | node.include?('virtualized') and node['virtualized'] 4 | end 5 | 6 | def redhat_on_docker? 7 | on_docker? && platform?('redhat') 8 | end 9 | 10 | def rocky_on_docker? 11 | on_docker? && platform?('rocky') 12 | end 13 | 14 | def alinux2023_on_docker? 15 | on_docker? && platform?('amazon') && node['platform_version'].to_i == 2023 16 | end 17 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/libraries/fsx.rb: -------------------------------------------------------------------------------- 1 | def aws_domain_for_fsx(region) 2 | # DNS names have the default AWS domain (amazonaws.com) also in China and GovCloud. 3 | if region.start_with?("us-iso-") 4 | US_ISO_AWS_DOMAIN 5 | elsif region.start_with?("us-isob-") 6 | US_ISOB_AWS_DOMAIN 7 | else 8 | CLASSIC_AWS_DOMAIN 9 | end 10 | end 11 | 12 | def lustre_enabled? 13 | ['yes', true, 'true'].include?(node['cluster']['lustre']['enabled']) 14 | end 15 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/append_if_no_line_template.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Append to complex file 3 | # 4 | 5 | template '/tmp/add_line_file' do 6 | source 'samplefile.erb' 7 | action :create_if_missing 8 | end 9 | 10 | append_if_no_line 'Add a line' do 11 | path '/tmp/add_line_file' 12 | line 'HI THERE I AM STRING' 13 | end 14 | 15 | append_if_no_line 'with special chars' do 16 | path '/tmp/add_line_file' 17 | line 'AM I A STRING?+\'".*/-\(){}^$[]' 18 | end 19 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/filter_lines_replace_between.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Verify the results of using the replace_between filter 3 | # 4 | 5 | template '/tmp/replace_between' do 6 | source 'samplefile.erb' 7 | sensitive true 8 | action :create_if_missing 9 | end 10 | 11 | filter_lines 'Replace the lines between matches' do 12 | sensitive false 13 | path '/tmp/replace_between' 14 | filters replace_between: [/COMMENT/, /main/, %w(line1 line2 line3)] 15 | end 16 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/files/supervisord.conf: -------------------------------------------------------------------------------- 1 | [unix_http_server] 2 | file = /var/run/supervisord.sock 3 | 4 | [supervisord] 5 | logfile = /var/log/supervisord.log 6 | pidfile = /var/run/supervisord.pid 7 | 8 | [supervisorctl] 9 | serverurl = unix:///var/run/supervisord.sock 10 | 11 | [rpcinterface:supervisor] 12 | supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface 13 | 14 | [include] 15 | files = /etc/parallelcluster/parallelcluster_supervisord.conf -------------------------------------------------------------------------------- /cookbooks/iptables/test/cookbooks/test/recipes/rule-line.rb: -------------------------------------------------------------------------------- 1 | # This will create a rule using the line property 2 | 3 | include_recipe '::centos-6-helper' if platform?('centos') && node['platform_version'].to_i == 6 4 | 5 | iptables_packages 'install iptables' 6 | iptables_service 'configure iptables services' 7 | 8 | iptables_chain 'filter' do 9 | table :filter 10 | end 11 | 12 | iptables_rule 'insert line directly' do 13 | table :filter 14 | line '-A INPUT -i eth0 -j ACCEPT' 15 | end 16 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-computefleet/templates/clusterstatusmgtd/99-parallelcluster-clusterstatusmgtd.erb: -------------------------------------------------------------------------------- 1 | Cmnd_Alias CINC_COMMAND = /usr/bin/cinc-client --local-mode --config /etc/chef/client.rb --log_level auto --logfile /var/log/chef-client.log --force-formatter --no-color --chef-zero-port 8889 --json-attributes /etc/chef/dna.json --override-runlist aws-parallelcluster-entrypoints\:\:update_computefleet_status 2 | 3 | <%= node['cluster']['cluster_admin_user'] %> ALL = (root) NOPASSWD: CINC_COMMAND 4 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-computefleet/templates/compute_fleet_status/is_fleet_ready.erb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sinfo_output=$(<%= node['cluster']['slurm']['install_dir'] %>/bin/sinfo -h -o '%N %t' | grep -v -E '(idle|alloc|mix|maint)$') 4 | while IFS= read -r line; do 5 | nodelist=$(echo "$line" | awk '{print $1}') 6 | <%= node['cluster']['slurm']['install_dir'] %>/bin/scontrol show hostnames "$nodelist" | { grep -E '^[a-z0-9\-]+\-st\-[a-z0-9\-]+\-[0-9]+.*' || true; } 7 | done <<< "$sinfo_output" 8 | -------------------------------------------------------------------------------- /cookbooks/openssh/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'chefspec' 2 | require 'chefspec/berkshelf' 3 | 4 | RSpec.configure do |config| 5 | config.color = true # Use color in STDOUT 6 | config.formatter = :documentation # Use the specified formatter 7 | config.log_level = :error # Avoid deprecation notice SPAM 8 | config.platform = 'ubuntu' 9 | config.version = '18.04' 10 | end 11 | 12 | def join_path(*path) 13 | Chef::Util::PathHelper.cleanpath(::File.join(path)) 14 | end 15 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/metadata.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | name 'aws-parallelcluster-shared' 4 | maintainer 'Amazon Web Services' 5 | license 'Apache-2.0' 6 | description 'AWS ParallelCluster shared cookbook code' 7 | issues_url 'https://github.com/aws/aws-parallelcluster-cookbook/issues' 8 | source_url 'https://github.com/aws/aws-parallelcluster-cookbook' 9 | chef_version '>= 18' 10 | version '3.15.0' 11 | 12 | depends 'yum', '~> 7.4.20' 13 | depends 'yum-epel', '~> 5.0.8' 14 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-computefleet/metadata.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | name 'aws-parallelcluster-computefleet' 4 | maintainer 'Amazon Web Services' 5 | license 'Apache-2.0' 6 | description 'AWS ParallelCluster compute fleet management' 7 | issues_url 'https://github.com/aws/aws-parallelcluster-cookbook/issues' 8 | source_url 'https://github.com/aws/aws-parallelcluster-cookbook' 9 | chef_version '>= 18' 10 | version '3.15.0' 11 | 12 | depends 'aws-parallelcluster-shared', '~> 3.15.0' 13 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/libraries/kitchen.rb: -------------------------------------------------------------------------------- 1 | # Check if recipes are executed during kitchen tests. 2 | def kitchen_test? 3 | node['kitchen'] 4 | end 5 | 6 | def kitchen_root_path 7 | '/tmp/kitchen' 8 | end 9 | 10 | def kitchen_data_path 11 | "#{kitchen_root_path}/data" 12 | end 13 | 14 | def kitchen_cluster_config_path 15 | "#{kitchen_data_path}/cluster-config.yml" 16 | end 17 | 18 | def kitchen_instance_types_data_path 19 | "#{kitchen_data_path}/instance-types-data.json" 20 | end 21 | -------------------------------------------------------------------------------- /cookbooks/iptables/.github/workflows/branchcleanup.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Branch Cleanup 3 | # This workflow is triggered on all closed pull requests. 4 | # However the script does not do anything if a merge was not performed. 5 | "on": 6 | pull_request: 7 | types: [closed] 8 | 9 | env: 10 | NO_BRANCH_DELETED_EXIT_CODE: 0 11 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 12 | 13 | jobs: 14 | build: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: jessfraz/branch-cleanup-action@master 18 | -------------------------------------------------------------------------------- /cookbooks/iptables/test/integration/rule-line/rules_spec.rb: -------------------------------------------------------------------------------- 1 | describe command('/sbin/iptables-save') do 2 | its(:stdout) { should match /\*filter/ } 3 | its(:stdout) { should match /:INPUT\sACCEPT\s\[\d+\:\d+\]/ } 4 | its(:stdout) { should match /:FORWARD\sACCEPT\s\[\d+\:\d+\]/ } 5 | # eth 0 should be the first rule 6 | its(:stdout) { should match /:OUTPUT\sACCEPT\s\[\d+\:\d+\]/ } 7 | # lo should be the second rule 8 | its(:stdout) { should match /\-A\sINPUT\s\-i\seth0\s\-j\sACCEPT/ } 9 | end 10 | -------------------------------------------------------------------------------- /cookbooks/line/documentation/resources/filters/delete_between.md: -------------------------------------------------------------------------------- 1 | # Examples for the delete_between filter 2 | 3 | ## Original file 4 | 5 | ```text 6 | line1 7 | del1 8 | del2 9 | line2 10 | del1 11 | del2 12 | line3 13 | ``` 14 | 15 | ## Output file 16 | 17 | ```texttext 18 | line1 19 | del1 20 | del2 21 | line2 22 | line3 23 | ``` 24 | 25 | ## Filter 26 | 27 | ```ruby 28 | filter_lines '/example/delete_between' do 29 | filters(delete_between: [/^line2$/, /^line3$/, /del/, :last]) 30 | end 31 | ``` 32 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/append_if_no_line_single_line.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Append to simple file 3 | # 4 | 5 | file '/tmp/single_line_file' do 6 | content 'single line file' 7 | action :create_if_missing 8 | end 9 | 10 | append_if_no_line 'should go on its own line' do 11 | path '/tmp/single_line_file' 12 | line 'SHOULD GO ON ITS OWN LINE' 13 | end 14 | 15 | append_if_no_line 'should not edit the file' do 16 | path '/tmp/single_line_file' 17 | line 'single line file' 18 | end 19 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/files/default/install_slurm/slurm_patches/README.md: -------------------------------------------------------------------------------- 1 | # Slurm patches configuration 2 | 3 | This folder is for patch files for the Slurm source code. Patches must be produced by git 4 | (e.g. via `git diff` or by downloading the diff from a commit in GitHub). 5 | 6 | Patch files must be prepended with a zero-padded number in order to allow the cookbook to 7 | apply the patches in a defined order. For example: 8 | - 01_hashabc.diff 9 | - 02_hashdef.diff 10 | - 03_hash123.diff 11 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/filter_lines/controls/filter_lines_substitue.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Spec tests for the substitute filter 3 | # 4 | 5 | control 'filter_lines_substitute' do 6 | describe file('/tmp/substitute') do 7 | it { should exist } 8 | end 9 | describe matches('/tmp/substitute', /start_list/) do 10 | its('count') { should eq 1 } 11 | end 12 | describe file_ext('/tmp/substitute') do 13 | it { should have_correct_eol } 14 | its('size_lines') { should eq 20 } 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/delete_lines_empty.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Delete lines on an empty file 3 | # 4 | 5 | file '/tmp/emptyfile' 6 | 7 | delete_lines 'Empty file should not change' do 8 | path '/tmp/emptyfile' 9 | pattern /.*/ 10 | end 11 | 12 | delete_lines 'missing_file fail' do 13 | path '/tmp/missingfile' 14 | pattern '.*' 15 | ignore_missing false 16 | ignore_failure true 17 | end 18 | 19 | delete_lines 'missing_file' do 20 | path '/tmp/missingfile' 21 | pattern '.*' 22 | end 23 | -------------------------------------------------------------------------------- /cookbooks/iptables/resources/packages.rb: -------------------------------------------------------------------------------- 1 | unified_mode true 2 | 3 | include Iptables::Cookbook::Helpers 4 | 5 | property :packages, Array, 6 | default: lazy { package_names }, 7 | description: 'The packages to install for iptables' 8 | 9 | action :install do 10 | package 'iptables' do 11 | package_name new_resource.packages 12 | action :install 13 | end 14 | end 15 | 16 | action :remove do 17 | package 'iptables' do 18 | package_name new_resource.packages 19 | action :remove 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/add_to_list/inspec/controls/add_to_list_1d.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Test for lists with 1 delimitor , 3 | # 4 | 5 | control 'add_to_list_1d' do 6 | describe file('/tmp/1d') do 7 | it { should exist } 8 | its('content') { should match /^empty_list=newentry$/ } 9 | its('content') { should match /^People to call: Joe, Bobby, Karen, Harry$/ } 10 | end 11 | describe file_ext('/tmp/1d') do 12 | it { should have_correct_eol } 13 | its('size_lines') { should eq 20 } 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /.github/workflows/changelog_enforcer.yml: -------------------------------------------------------------------------------- 1 | name: Enforce Changelog Updates 2 | on: 3 | pull_request: 4 | types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] 5 | 6 | jobs: 7 | # Enforces the update of a changelog file on every pull request 8 | changelog: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@main 12 | - uses: dangoslen/changelog-enforcer@v1.4.0 13 | with: 14 | changeLogPath: CHANGELOG.md 15 | skipLabel: skip-changelog-update 16 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-computefleet/files/clusterstatusmgtd/clusterstatusmgtd_logging.conf: -------------------------------------------------------------------------------- 1 | [loggers] 2 | keys=root 3 | 4 | [handlers] 5 | keys=streamHandler 6 | 7 | [formatters] 8 | keys=defaultFormatter 9 | 10 | [logger_root] 11 | level=INFO 12 | handlers=streamHandler 13 | 14 | [formatter_defaultFormatter] 15 | format=%(asctime)s - [%(module)s:%(funcName)s] - %(levelname)s - %(message)s 16 | 17 | [handler_streamHandler] 18 | class=StreamHandler 19 | level=INFO 20 | formatter=defaultFormatter 21 | args=(sys.stdout,) 22 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/files/AWS-ParallelCluster-License-README.txt: -------------------------------------------------------------------------------- 1 | AWS ParallelCluster is licensed under the Apache License 2.0 (http://aws.amazon.com/apache2.0/). 2 | 3 | AWS ParallelCluster AMIs ship with the following independent packages, which are offered 4 | under separate terms. 5 | 6 | sge 7 | slurm 8 | torque 9 | 10 | For each package, the license is available in the /opt/parallelcluster/licenses/ 11 | directory, and the source code is available in the /opt/parallelcluster/sources directory. 12 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/metadata.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | name 'aws-parallelcluster-platform' 4 | maintainer 'Amazon Web Services' 5 | license 'Apache-2.0' 6 | description 'AWS ParallelCluster node platform' 7 | issues_url 'https://github.com/aws/aws-parallelcluster-cookbook/issues' 8 | source_url 'https://github.com/aws/aws-parallelcluster-cookbook' 9 | chef_version '>= 18' 10 | version '3.15.0' 11 | 12 | depends 'line', '~> 4.5.21' 13 | 14 | depends 'aws-parallelcluster-shared', '~> 3.15.0' 15 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/test/controls/node_attributes_spec.rb: -------------------------------------------------------------------------------- 1 | control 'tag:install_node_attributes_created' do 2 | title 'Test the generation of the node attributes json file' 3 | 4 | describe file('/etc/chef/node_attributes.json') do 5 | it { should exist } 6 | its('content') { should match(/^ "cluster": \{$/) } 7 | # its('content_as_json') { should include('cluster') } 8 | # its('content_as_json') { should include('cluster' => { 'base_dir' => '/opt/parallelcluster' }) } 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/add_to_list/inspec/controls/add_to_list_2d.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Test for lists with 2 delimitors ||, || 3 | # 4 | 5 | control 'add_to_list_2d' do 6 | describe file('/tmp/2d') do 7 | it { should exist } 8 | its('content') { should match /^wo2d_empty="single"$/ } 9 | its('content') { should match /^wo2d_list="first2","second2","third2"$/ } 10 | end 11 | describe file_ext('/tmp/2d') do 12 | it { should have_correct_eol } 13 | its('size_lines') { should eq 20 } 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/delete_from_list/inspec/controls/delete_from_list_3d.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Delete from list with 3 deliminators [], [] 3 | # 4 | 5 | control 'delete_from_list_3d' do 6 | describe file('/tmp/3d') do 7 | it { should exist } 8 | its('content') { should match /^multi = \(\[310\]\)$/ } 9 | its('content') { should match /^wo3d_list=\[second3\]$/ } 10 | end 11 | describe file_ext('/tmp/3d') do 12 | it { should have_correct_eol } 13 | its('size_lines') { should eq 20 } 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/replace_or_add/controls/replace_or_add_change_line_eof.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Change last line 3 | # 4 | 5 | control 'replace_or_add_change_line' do 6 | describe file('/tmp/change_line_eof') do 7 | it { should exist } 8 | end 9 | describe matches('/tmp/change_line_eof', /^Last line changed$/) do 10 | its('count') { should eq 1 } 11 | end 12 | describe file_ext('/tmp/change_line_eof') do 13 | it { should have_correct_eol } 14 | its('size_lines') { should eq 7 } 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source 'https://rubygems.org' 4 | 5 | group :style do 6 | gem 'cookstyle', '~> 7.25.9' 7 | gem 'rake', '~> 13.0.1' 8 | gem 'rubocop', '~> 1.22.3' 9 | gem 'rubocop-gitlab-security', '~> 0.1.1' 10 | end 11 | 12 | group :test do 13 | gem 'chefspec', '~> 9.3.0' 14 | gem 'kitchen-vagrant', '~> 1.12.0' 15 | gem 'safe_yaml', '~> 1.0.5' 16 | gem 'test-kitchen', '~> 3.0.0' 17 | end 18 | 19 | group :aws do 20 | gem 'kitchen-ec2' 21 | gem 'kitchen-transport-speedy' 22 | end 23 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/add_to_list/inspec/controls/add_to_list_3d.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Test for lists with 3 delimitors [], [] 3 | # 4 | 5 | control 'add_to_list_3d' do 6 | describe file('/tmp/3d') do 7 | it { should exist } 8 | its('content') { should match /^wo3d_empty=\[single\]$/ } 9 | its('content') { should match /^wo3d_list=\[first3\],\[second3\],\[third3\]$/ } 10 | end 11 | describe file_ext('/tmp/3d') do 12 | it { should have_correct_eol } 13 | its('size_lines') { should eq 20 } 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/delete_from_list/inspec/controls/delete_from_list_1d.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Delete from list with 1 deliminator , 3 | # 4 | 5 | control 'delete_from_list_1d' do 6 | describe file('/tmp/1d') do 7 | it { should exist } 8 | its('content') { should match /^People to call: Bobby, Karen$/ } 9 | its('content') { should_not match /^\s*kernel .*\s+rhgb\s+/ } 10 | end 11 | describe file_ext('/tmp/1d') do 12 | it { should have_correct_eol } 13 | its('size_lines') { should eq 20 } 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/recipes/test/mock_compute_shared_storages.rb: -------------------------------------------------------------------------------- 1 | return if on_docker? 2 | 3 | # We create an empty /opt/intel directory, because for the test we 4 | # only need the folder to be present, and this way we can speed 5 | # things up by avoiding the installation of Intel MPI 6 | directory '/opt/intel' 7 | 8 | dirs_to_export = %w(/opt/intel) 9 | dirs_to_export.each do |dir| 10 | nfs_export dir do 11 | network '127.0.0.1/32' 12 | writeable true 13 | options ['no_root_squash'] 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /cookbooks/line/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'line' 2 | maintainer 'Sous Chefs' 3 | maintainer_email 'help@sous-chefs.org' 4 | license 'Apache-2.0' 5 | description 'Provides line editing resources for use by recipes' 6 | 7 | version '4.5.21' 8 | 9 | source_url 'https://github.com/sous-chefs/line' 10 | issues_url 'https://github.com/sous-chefs/line/issues' 11 | chef_version '>= 15.3' 12 | 13 | %w(debian ubuntu centos redhat scientific oracle amazon windows).each do |os| 14 | supports os 15 | end 16 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/filter_lines/controls/filter_lines_comment.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Spec tests for the comment filter 3 | # 4 | 5 | control 'filter_lines_comment' do 6 | describe file('/tmp/comment') do 7 | it { should exist } 8 | its('content') { should_not match /^COMMENT ME/ } 9 | end 10 | describe matches('/tmp/comment', /^#/) do 11 | its('count') { should eq 3 } 12 | end 13 | describe file_ext('/tmp/comment') do 14 | it { should have_correct_eol } 15 | its('size_lines') { should eq 5 } 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /kitchen/kitchen.local-yml.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | KITCHEN_SCOPE=$1; shift; 4 | KITCHEN_SUBJECT=$(echo $KITCHEN_SCOPE | awk -F- '{print $1}') 5 | KITCHEN_PHASE=$(echo $KITCHEN_SCOPE | awk -F- '{print $2}') 6 | 7 | # ./kitchen.$driver.sh platform-install ... will run kitchen in aws-parallelcluster-cookbook/cookbooks/aws-parallelcluster-platform dir 8 | export KITCHEN_COOKBOOK_PATH="cookbooks/aws-parallelcluster-${KITCHEN_SUBJECT}" 9 | 10 | export KITCHEN_LOCAL_YAML="${KITCHEN_COOKBOOK_PATH}/kitchen.${KITCHEN_SCOPE}.yml" 11 | export KITCHEN_PHASE 12 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/templates/cfn_hup_configuration/cfn-hup-runner.sh.erb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | 4 | # This script is used to run cfn-hup is a way that is suitable to be managed by supervisord. 5 | # In particular, cfn-hup is executed in no-daemon mode. 6 | # 7 | # Usage: ./cfn-hup-runner.sh 8 | 9 | [ -f /etc/profile.d/proxy.sh ] && . /etc/profile.d/proxy.sh 10 | 11 | while true; do 12 | timeout <%= @node_bootstrap_timeout %> <%= @cfn_bootstrap_virtualenv_path %>/bin/cfn-hup --no-daemon --verbose 13 | sleep 60 14 | done 15 | -------------------------------------------------------------------------------- /cookbooks/line/spec/cookbook/documentation_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rspec_helper' 2 | require 'ostruct' 3 | 4 | link_lines = `egrep -R 'https:\/\/github.com\/sous-chefs\/line' *`.split("\n") 5 | line_files = link_lines.map do |line| 6 | md = %r{\]\(https://github.com/sous-chefs/line/blob/master/(.*)\)}.match(line) 7 | md ? md[1] : nil 8 | end 9 | 10 | describe 'linked documentation files exist' do 11 | line_files.compact.each do |file| 12 | it "File #{file} should exist" do 13 | expect(File.exist?(file)).to eq true 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/append_if_no_line/inspec/controls/append_if_no_line_single_line.rb: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Append to simple file 4 | # 5 | 6 | control 'append_if_no_line_single_line' do 7 | describe file('/tmp/single_line_file') do 8 | it { should exist } 9 | its('content') { should match /^single line file$/ } 10 | its('content') { should match /^SHOULD GO ON ITS OWN LINE$/ } 11 | end 12 | describe file_ext('/tmp/single_line_file') do 13 | it { should have_correct_eol } 14 | its('size_lines') { should eq 2 } 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/metadata.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | name 'aws-parallelcluster-environment' 4 | maintainer 'Amazon Web Services' 5 | license 'Apache-2.0' 6 | description 'AWS ParallelCluster node environment' 7 | issues_url 'https://github.com/aws/aws-parallelcluster-cookbook/issues' 8 | source_url 'https://github.com/aws/aws-parallelcluster-cookbook' 9 | chef_version '>= 18' 10 | version '3.15.0' 11 | 12 | depends 'line', '~> 4.5.21' 13 | depends 'nfs', '~> 5.1.5' 14 | 15 | depends 'aws-parallelcluster-shared', '~> 3.15.0' 16 | -------------------------------------------------------------------------------- /cookbooks/line/documentation/resources/filters/after.md: -------------------------------------------------------------------------------- 1 | # Examples for the after filter 2 | 3 | ## Original file 4 | 5 | ```text 6 | line1 7 | line2 8 | ``` 9 | 10 | ## Output file 11 | 12 | ```text 13 | line1 14 | line2 15 | add1 16 | add2 17 | ``` 18 | 19 | ## Filter 20 | 21 | ```ruby 22 | addlines = "add1\nadd2\n" 23 | or 24 | addlines = ['add1', 'add2'] 25 | or 26 | lines = <<~EOF 27 | add1 28 | add2 29 | EOF 30 | addlines= lines.gsub(/^\s+/,'') 31 | 32 | filter_lines '/example/after' do 33 | filters(after: [/^line2$/, addlines, :last]) 34 | end 35 | ``` 36 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/delete_from_list/inspec/controls/delete_from_list_2d.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Delete from list with 2 deliminators ||, || 3 | # 4 | 5 | control 'delete_from_list_2d' do 6 | describe file('/tmp/2d') do 7 | it { should exist } 8 | its('content') { should match %r{^my @net1918 = \("172.16.0.0/12", "192.168.0.0/16"\);$} } 9 | its('content') { should match /^last_delimited_list= \(\)$/ } 10 | end 11 | describe file_ext('/tmp/2d') do 12 | it { should have_correct_eol } 13 | its('size_lines') { should eq 20 } 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /cookbooks/line/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["config:base"], 4 | "packageRules": [ 5 | { 6 | "groupName": "Actions", 7 | "matchUpdateTypes": ["minor", "patch", "pin"], 8 | "automerge": true, 9 | "addLabels": ["Release: Patch", "Skip: Announcements"] 10 | }, 11 | { 12 | "groupName": "Actions", 13 | "matchUpdateTypes": ["major"], 14 | "automerge": false, 15 | "addLabels": ["Release: Patch", "Skip: Announcements"] 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /cookbooks/yum/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["config:base"], 4 | "packageRules": [ 5 | { 6 | "groupName": "Actions", 7 | "matchUpdateTypes": ["minor", "patch", "pin"], 8 | "automerge": true, 9 | "addLabels": ["Release: Patch", "Skip: Announcements"] 10 | }, 11 | { 12 | "groupName": "Actions", 13 | "matchUpdateTypes": ["major"], 14 | "automerge": false, 15 | "addLabels": ["Release: Patch", "Skip: Announcements"] 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/spec/unit/libraries/volume_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'aws-parallelcluster-environment:libraries:format_directory' do 4 | it 'adds / at the beginning if not starting with /' do 5 | expect(format_directory('any')).to eq('/any') 6 | end 7 | 8 | it 'does not add / at the beginning if already starting with /' do 9 | expect(format_directory('/any')).to eq('/any') 10 | end 11 | 12 | it 'strips whitespaces from directory' do 13 | expect(format_directory(' any ')).to eq('/any') 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/attributes/environment.rb: -------------------------------------------------------------------------------- 1 | default['cluster']['region'] = 'us-east-1' 2 | 3 | # AWS domain 4 | default['cluster']['aws_domain'] = aws_domain 5 | 6 | # URL for ParallelCluster Artifacts stored in public S3 buckets 7 | # ['cluster']['region'] will need to be defined by image_dna.json during AMI build. 8 | default['cluster']['s3_url'] = "https://#{node['cluster']['region']}-aws-parallelcluster.s3.#{node['cluster']['region']}.#{node['cluster']['aws_domain']}" 9 | default['cluster']['artifacts_s3_url'] = "#{node['cluster']['s3_url']}/archives" 10 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/add_to_list/inspec/controls/add_to_list_1d_terminal.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Test for lists with 1 delimitor and a terminal " , " 3 | # 4 | 5 | control 'add_to_list_1d_terminal' do 6 | describe file('/tmp/1d_term') do 7 | it { should exist } 8 | its('content') { should match /^DEFAULT_APPEND_EMPTY="first"$/ } 9 | its('content') { should match /^DEFAULT_APPEND="resume.*showopts newopt"$/ } 10 | end 11 | describe file_ext('/tmp/1d_term') do 12 | it { should have_correct_eol } 13 | its('size_lines') { should eq 20 } 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /cookbooks/nfs/.overcommit.yml: -------------------------------------------------------------------------------- 1 | --- 2 | PreCommit: 3 | TrailingWhitespace: 4 | enabled: true 5 | YamlLint: 6 | enabled: true 7 | ChefSpec: 8 | enabled: true 9 | command: ["chef", "exec", "rspec"] 10 | include: ["**/*.rb"] 11 | Cookstyle: 12 | enabled: true 13 | required_executable: "cookstyle" 14 | command: ["cookstyle"] 15 | include: ["**/*.rb"] 16 | MarkdownLint: 17 | enabled: true 18 | command: ["npx", "markdownlint-cli2", "'**/*.md'"] 19 | include: ["**/*.md"] 20 | CommitMsg: 21 | HardTabs: 22 | enabled: true 23 | -------------------------------------------------------------------------------- /cookbooks/openssh/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["config:base"], 4 | "packageRules": [ 5 | { 6 | "groupName": "Actions", 7 | "matchUpdateTypes": ["minor", "patch", "pin"], 8 | "automerge": true, 9 | "addLabels": ["Release: Patch", "Skip: Announcements"] 10 | }, 11 | { 12 | "groupName": "Actions", 13 | "matchUpdateTypes": ["major"], 14 | "automerge": false, 15 | "addLabels": ["Release: Patch", "Skip: Announcements"] 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/add_to_list/inspec/controls/add_to_list_3d_terminal.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Test for lists with 3 delimitors and a terminal ([], []) 3 | # 4 | 5 | control 'add_to_list_3d_terminal' do 6 | describe file('/tmp/3d_term') do 7 | it { should exist } 8 | its('content') { should match /^multi = \(\[310\], \[323\], \[789\]\)$/ } 9 | its('content') { should match /^empty_3delim=\(\[3_with_end\]\)$/ } 10 | end 11 | describe file_ext('/tmp/3d_term') do 12 | it { should have_correct_eol } 13 | its('size_lines') { should eq 20 } 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'yum-epel' 2 | maintainer 'Sous Chefs' 3 | maintainer_email 'help@sous-chefs.org' 4 | license 'Apache-2.0' 5 | description 'Installs and configures the EPEL Yum repository' 6 | version '5.0.8' 7 | source_url 'https://github.com/sous-chefs/yum-epel' 8 | issues_url 'https://github.com/sous-chefs/yum-epel/issues' 9 | chef_version '>= 12.15' 10 | 11 | supports 'amazon' 12 | supports 'centos' 13 | supports 'oracle' 14 | supports 'redhat' 15 | supports 'scientific' 16 | supports 'zlinux' 17 | -------------------------------------------------------------------------------- /cookbooks/iptables/test/integration/rule-line-number/rules_spec.rb: -------------------------------------------------------------------------------- 1 | describe command('/sbin/iptables-save') do 2 | its(:stdout) { should match /\*filter/ } 3 | its(:stdout) { should match /:INPUT\sACCEPT\s\[\d+\:\d+\]/ } 4 | its(:stdout) { should match /:FORWARD\sACCEPT\s\[\d+\:\d+\]/ } 5 | # eth 0 should be the first rule 6 | its(:stdout) { should match /:OUTPUT\sACCEPT\s\[\d+\:\d+\]\s+\-A\sINPUT\s\-i\seth0\s\-j\sACCEPT/m } 7 | # lo should be the second rule 8 | its(:stdout) { should match /\-A\sINPUT\s\-i\seth0\s\-j\sACCEPT\s+\-A\sINPUT\s\-i\slo\s\-j\sACCEPT/m } 9 | end 10 | -------------------------------------------------------------------------------- /cookbooks/nfs/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'nfs' 2 | maintainer 'Sous Chefs' 3 | maintainer_email 'help@sous-chefs.org' 4 | license 'Apache-2.0' 5 | description 'Installs and configures NFS, and NFS exports' 6 | version '5.1.5' 7 | source_url 'https://github.com/sous-chefs/nfs' 8 | issues_url 'https://github.com/sous-chefs/nfs/issues' 9 | chef_version '>= 15.3' 10 | 11 | supports 'centos' 12 | supports 'debian' 13 | supports 'oracle' 14 | supports 'redhat' 15 | supports 'scientific' 16 | supports 'ubuntu' 17 | 18 | depends 'line' 19 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/spec/unit/recipes/ami_cleanup_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'aws-parallelcluster-platform::ami_cleanup' do 4 | cached(:chef_run) do 5 | ChefSpec::Runner.new.converge(described_recipe) 6 | end 7 | 8 | it 'Creates ami_cleanup.sh under /usr/local/sbin' do 9 | is_expected.to create_cookbook_file("ami_cleanup.sh") 10 | .with(source: 'ami_cleanup.sh') 11 | .with(path: '/usr/local/sbin/ami_cleanup.sh') 12 | .with(owner: 'root') 13 | .with(group: 'root') 14 | .with(mode: '0755') 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/delete_lines_regexp.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Delete lines using a regex pattern 3 | # 4 | 5 | template '/tmp/regexp_pattern_1' do 6 | source 'samplefile.erb' 7 | action :create_if_missing 8 | end 9 | 10 | template '/tmp/regexp_pattern_2' do 11 | source 'samplefile.erb' 12 | action :create_if_missing 13 | end 14 | 15 | delete_lines 'Delete Regex Pattern 1' do 16 | path '/tmp/regexp_pattern_1' 17 | pattern /^HELLO.*/ 18 | end 19 | 20 | delete_lines 'Delete Regex Pattern 1' do 21 | path '/tmp/regexp_pattern_2' 22 | pattern /^#.*/ 23 | end 24 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/filter_lines/controls/filter_lines_between.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Spec tests for the between filter 3 | # 4 | 5 | control 'filter_lines_between' do 6 | describe file('/tmp/between') do 7 | it { should exist } 8 | its('content') { should match /^empty_list=\r?\nadd line\r?\nempty_delimited_list=\(\)$/ } 9 | end 10 | describe matches('/tmp/between', /^add line$/) do 11 | its('count') { should eq 1 } 12 | end 13 | describe file_ext('/tmp/between') do 14 | it { should have_correct_eol } 15 | its('size_lines') { should eq 21 } 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/filter_lines/controls/filter_lines_delete_between.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Spec tests for the delete_between filter 3 | # 4 | 5 | control 'filter_lines_delete_between' do 6 | describe file('/tmp/delete_between') do 7 | it { should exist } 8 | its('content') { should_not match /^kernel/ } 9 | end 10 | describe matches('/tmp/delete_between', /crashkernel/) do 11 | its('count') { should eq 1 } 12 | end 13 | describe file_ext('/tmp/delete_between') do 14 | it { should have_correct_eol } 15 | its('size_lines') { should eq 18 } 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /cookbooks/nfs/Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | 3 | # chefspec task against spec/*_spec.rb 4 | require 'rspec/core/rake_task' 5 | RSpec::Core::RakeTask.new(:chefspec) 6 | 7 | # cookstyle 8 | desc 'Ruby style guide linter' 9 | task :cookstyle do 10 | sh 'cookstyle --fail-level W' 11 | end 12 | 13 | # test-kitchen task 14 | begin 15 | require 'kitchen/rake_tasks' 16 | Kitchen::RakeTasks.new 17 | rescue LoadError 18 | puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI'] 19 | end 20 | 21 | # default tasks are quick, commit tests 22 | task default: %w(cookstyle chefspec) 23 | -------------------------------------------------------------------------------- /cookbooks/iptables/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'iptables' 2 | maintainer 'Chef Software, Inc.' 3 | maintainer_email 'cookbooks@chef.io' 4 | license 'Apache-2.0' 5 | description 'Installs the iptables daemon and provides resources for managing rules' 6 | source_url 'https://github.com/chef-cookbooks/iptables' 7 | issues_url 'https://github.com/chef-cookbooks/iptables/issues' 8 | chef_version '>= 15.3' 9 | version '8.0.0' 10 | 11 | %w(redhat centos debian ubuntu amazon scientific oracle amazon zlinux).each do |os| 12 | supports os 13 | end 14 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/add_to_list/inspec/controls/add_to_list_2d_terminal.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Test for lists with 2 delimitors and a terminal (||, ||) 3 | # 4 | 5 | control 'add_to_list_2d_terminal' do 6 | describe file('/tmp/2d_term') do 7 | it { should exist } 8 | its('content') { should match /^empty_delimited_list=\(\|empty\|\)$/ } 9 | its('content') { should match /^last_delimited_list= \(\|single\|, \|double\|\)$/ } 10 | end 11 | describe file_ext('/tmp/2d_term') do 12 | it { should have_correct_eol } 13 | its('size_lines') { should eq 20 } 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /cookbooks/yum/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'yum' 2 | maintainer 'Sous Chefs' 3 | maintainer_email 'help@sous-chefs.org' 4 | license 'Apache-2.0' 5 | description 'Configures various yum components on Red Hat-like systems' 6 | version '7.4.20' 7 | source_url 'https://github.com/sous-chefs/yum' 8 | issues_url 'https://github.com/sous-chefs/yum/issues' 9 | chef_version '>= 15.3' 10 | 11 | supports 'amazon' 12 | supports 'centos' 13 | supports 'fedora' 14 | supports 'oracle' 15 | supports 'redhat' 16 | supports 'scientific' 17 | supports 'zlinux' 18 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/external_slurmdbd/slurm_external_slurmdbd.conf.erb: -------------------------------------------------------------------------------- 1 | # slurm_external_slurmdbd.conf is managed by external configuration. 2 | # Do not modify. 3 | # Please add user-specific slurmdbd configuration options in slurmdbd.conf 4 | DbdHost=localhost 5 | DbdPort=<%= node['slurmdbd_port'] %> 6 | DbdAddr=<%= node['slurmdbd_ip'] %> 7 | StorageHost=<%= node['dbms_uri'] %> 8 | StoragePort=3306 9 | StorageLoc=<%= node['dbms_database_name'] %> 10 | StorageUser=<%= node['dbms_username'] %> 11 | StoragePass=dummy 12 | DebugLevel=verbose 13 | DebugFlags=Network 14 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/replace_or_add/controls/replace_or_add_add_a_line_matching_pattern.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Add a line matching pattern 3 | # 4 | 5 | control 'replace_or_add_add_a_line_matching_pattern' do 6 | describe file('/tmp/add_a_line_matching_pattern') do 7 | it { should exist } 8 | end 9 | describe matches('/tmp/add_a_line_matching_pattern', /^Add another line$/) do 10 | its('count') { should eq 1 } 11 | end 12 | describe file_ext('/tmp/add_a_line_matching_pattern') do 13 | it { should have_correct_eol } 14 | its('size_lines') { should eq 8 } 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /cookbooks/line/documentation/resources/filters/stanza.md: -------------------------------------------------------------------------------- 1 | # Examples for the stanza filter 2 | 3 | ## Original file 4 | 5 | ```text 6 | [first] 7 | line1 = value1 8 | [second] 9 | line2 = vaule2 10 | ``` 11 | 12 | ## Output file 13 | 14 | ```text 15 | [first] 16 | line2 = addme 17 | line1 = new1 18 | [second] 19 | line3 = add3 20 | line2 = value2 21 | ``` 22 | 23 | ## Filter 24 | 25 | ```ruby 26 | filter_lines '/example/stanza' do 27 | filters([ 28 | { stanza: ['first', { line1: 'new1', line2: 'addme'}] }, 29 | { stanza: ['second', { line3: 'add3' }] }, 30 | ]) 31 | end 32 | ``` 33 | -------------------------------------------------------------------------------- /cookbooks/nfs/test/cookbooks/nfs_test/recipes/issue46.rb: -------------------------------------------------------------------------------- 1 | %w(share1 share2 share3).each do |share| 2 | directory "/tmp/#{share}" 3 | end 4 | 5 | %w(user1 user2 user3).each do |u| 6 | group u if platform_family?('suse') 7 | user u 8 | end 9 | 10 | nfs_export '/tmp/share1' do 11 | network '127.0.0.1' 12 | anonuser 'user1' 13 | anongroup 'user1' 14 | end 15 | 16 | nfs_export '/tmp/share2' do 17 | network '127.0.0.1' 18 | anonuser 'user2' 19 | anongroup 'user2' 20 | end 21 | 22 | nfs_export '/tmp/share3' do 23 | network '127.0.0.1' 24 | anonuser 'user3' 25 | anongroup 'user3' 26 | end 27 | -------------------------------------------------------------------------------- /cookbooks/openssh/test/integration/iptables/default_spec.rb: -------------------------------------------------------------------------------- 1 | service_name = case os[:family] 2 | when 'ubuntu', 'debian' 3 | 'ssh' 4 | else 5 | 'sshd' 6 | end 7 | 8 | describe service(service_name) do 9 | it { should be_enabled } 10 | it { should be_running } 11 | end 12 | 13 | describe port(22) do 14 | it { should be_listening } 15 | end 16 | 17 | describe iptables do 18 | it { should have_rule('-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT') } 19 | it { should have_rule('-A OUTPUT -p tcp -m tcp --sport 22 -j ACCEPT') } 20 | end 21 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/delete_lines_string.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Delete lines using a string regex pattern 3 | # 4 | 5 | template '/tmp/string_pattern_1' do 6 | source 'samplefile.erb' 7 | action :create_if_missing 8 | end 9 | 10 | template '/tmp/string_pattern_2' do 11 | source 'samplefile.erb' 12 | action :create_if_missing 13 | end 14 | 15 | delete_lines 'Delete String Pattern 1' do 16 | path '/tmp/string_pattern_1' 17 | pattern '^HELLO.*' 18 | backup true 19 | end 20 | 21 | delete_lines 'Delete String Pattern 2' do 22 | path '/tmp/string_pattern_2' 23 | pattern '^#.*' 24 | end 25 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/append_if_no_line/inspec/controls/append_if_no_line_template.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Append to complex file 3 | # 4 | 5 | control 'append_if_no_line_teplate' do 6 | describe file('/tmp/add_line_file') do 7 | it { should exist } 8 | its('content') { should match /^HI THERE I AM STRING$/ } 9 | its('content') { should match /^last line$/ } 10 | its('content') { should match %r{^AM I A STRING\?\+\'\"\.\*/\-\\\(\)\{\}\^\$\[\]$} } 11 | end 12 | describe file_ext('/tmp/add_line_file') do 13 | it { should have_correct_eol } 14 | its('size_lines') { should eq 7 } 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /cookbooks/line/.overcommit.yml: -------------------------------------------------------------------------------- 1 | --- 2 | PreCommit: 3 | TrailingWhitespace: 4 | enabled: true 5 | YamlLint: 6 | enabled: true 7 | required_executable: "yamllint" 8 | ChefSpec: 9 | enabled: true 10 | required_executable: "chef" 11 | command: ["chef", "exec", "rspec"] 12 | Cookstyle: 13 | enabled: true 14 | required_executable: "cookstyle" 15 | command: ["cookstyle"] 16 | MarkdownLint: 17 | enabled: false 18 | required_executable: "npx" 19 | command: ["npx", "markdownlint-cli2", "'**/*.md'"] 20 | include: ["**/*.md"] 21 | 22 | CommitMsg: 23 | HardTabs: 24 | enabled: true 25 | -------------------------------------------------------------------------------- /cookbooks/yum/.overcommit.yml: -------------------------------------------------------------------------------- 1 | --- 2 | PreCommit: 3 | TrailingWhitespace: 4 | enabled: true 5 | YamlLint: 6 | enabled: true 7 | required_executable: "yamllint" 8 | ChefSpec: 9 | enabled: true 10 | required_executable: "chef" 11 | command: ["chef", "exec", "rspec"] 12 | Cookstyle: 13 | enabled: true 14 | required_executable: "cookstyle" 15 | command: ["cookstyle"] 16 | MarkdownLint: 17 | enabled: false 18 | required_executable: "npx" 19 | command: ["npx", "markdownlint-cli2", "'**/*.md'"] 20 | include: ["**/*.md"] 21 | 22 | CommitMsg: 23 | HardTabs: 24 | enabled: true 25 | -------------------------------------------------------------------------------- /cookbooks/yum/test/integration/dnf_module/inspec/module_spec.rb: -------------------------------------------------------------------------------- 1 | describe command('dnf module list') do 2 | its('stdout') { should match /nodejs +12 \[e\]/ } 3 | its('stdout') { should match /ruby +2.7 \[e\]/ } 4 | its('stdout') { should match /php +remi-8.1 \[e\]/ } 5 | its('stdout') { should match /mysql.+\[x\]/ } 6 | end 7 | 8 | describe command('node --version') do 9 | its('stdout') { should match /v12/ } 10 | end 11 | 12 | describe command('ruby --version') do 13 | its('stdout') { should match /ruby 2.7/ } 14 | end 15 | 16 | describe command('php --version') do 17 | its('stdout') { should match /PHP 8.1/ } 18 | end 19 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/resources/alinux_extras_topic.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | provides :alinux_extras_topic 4 | unified_mode true 5 | 6 | # Resource:: to install a package via the Amazon Linux Extras package manager, 7 | # available starting in Amazon Linux 2. 8 | 9 | property :topic, String, name_property: true 10 | 11 | default_action :install 12 | 13 | action :install do 14 | execute "amazon-linux-extras install -y #{new_resource.topic}" do 15 | user 'root' 16 | retries 3 17 | retry_delay 5 18 | not_if "amazon-linux-extras | grep #{new_resource.topic} | grep enabled" 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/files/default/head_node_slurm/slurm/templates/slurm_external_slurmdbd.conf: -------------------------------------------------------------------------------- 1 | {# Adding comments at the beginning of each line is a trick to indent the template without affecting the output #} 2 | {##}# slurm_external_slurmdbd.conf is managed by external configuration. 3 | {##}# Do not modify. 4 | {##}# Please add user-specific slurmdbd configuration options in slurmdbd.conf 5 | {##}DbdHost={{ nlb_dns_name }} 6 | {##}StorageHost={{ dbms_uri | uri_host }} 7 | {##}StoragePort={{ dbms_uri | uri_port }} 8 | {##}StorageLoc={{ dbms_database_name }} 9 | {##}StorageUser={{ dbms_username }} 10 | {##}StoragePass=dummy 11 | -------------------------------------------------------------------------------- /cookbooks/openssh/.overcommit.yml: -------------------------------------------------------------------------------- 1 | --- 2 | PreCommit: 3 | TrailingWhitespace: 4 | enabled: true 5 | YamlLint: 6 | enabled: true 7 | required_executable: "yamllint" 8 | ChefSpec: 9 | enabled: true 10 | required_executable: "chef" 11 | command: ["chef", "exec", "rspec"] 12 | Cookstyle: 13 | enabled: true 14 | required_executable: "cookstyle" 15 | command: ["cookstyle"] 16 | MarkdownLint: 17 | enabled: false 18 | required_executable: "npx" 19 | command: ["npx", "markdownlint-cli2", "'**/*.md'"] 20 | include: ["**/*.md"] 21 | 22 | CommitMsg: 23 | HardTabs: 24 | enabled: true 25 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/.overcommit.yml: -------------------------------------------------------------------------------- 1 | --- 2 | PreCommit: 3 | TrailingWhitespace: 4 | enabled: true 5 | YamlLint: 6 | enabled: true 7 | required_executable: "yamllint" 8 | ChefSpec: 9 | enabled: true 10 | required_executable: "chef" 11 | command: ["chef", "exec", "rspec"] 12 | Cookstyle: 13 | enabled: true 14 | required_executable: "cookstyle" 15 | command: ["cookstyle"] 16 | MarkdownLint: 17 | enabled: false 18 | required_executable: "npx" 19 | command: ["npx", "markdownlint-cli2", "'**/*.md'"] 20 | include: ["**/*.md"] 21 | 22 | CommitMsg: 23 | HardTabs: 24 | enabled: true 25 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/recipes/test/mock_export_directories.rb: -------------------------------------------------------------------------------- 1 | return if on_docker? 2 | 3 | directory '/fake_headnode_home' 4 | directory '/fake_headnode_shared' 5 | 6 | bash 'rsync /home' do 7 | code "rsync -avz /home/* /fake_headnode_home/" 8 | end 9 | 10 | nfs_export "/fake_headnode_home" do 11 | network '127.0.0.1/32' 12 | writeable true 13 | options ['no_root_squash'] 14 | end 15 | 16 | nfs_export "/fake_headnode_shared" do 17 | network '127.0.0.1/32' 18 | writeable true 19 | options ['no_root_squash'] 20 | end 21 | 22 | bash 'Disable selinux if exist' do 23 | code "setenforce 0 || echo 'KO'" 24 | end 25 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/files/dcv/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. A copy of the License is located at 5 | # 6 | # http://aws.amazon.com/apache2.0/ 7 | # 8 | # or in the "LICENSE.txt" file accompanying this file. 9 | # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. 10 | # See the License for the specific language governing permissions and limitations under the License. 11 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/recipes/test/mock_slurm_dir.rb: -------------------------------------------------------------------------------- 1 | slurm_install_dir = '/opt/slurm' 2 | slurm_plugin_dir = '/etc/parallelcluster/slurm_plugin' 3 | 4 | # Ensure slurm plugin directory is in place for tests that require it 5 | directory slurm_plugin_dir do 6 | user 'root' 7 | group 'root' 8 | mode '0755' 9 | action :create 10 | recursive true 11 | end 12 | 13 | # skips the fake export on docker 14 | return if on_docker? 15 | 16 | directory slurm_install_dir do 17 | mode '1777' 18 | end 19 | 20 | nfs_export slurm_install_dir do 21 | network '127.0.0.1/32' 22 | writeable true 23 | options ['no_root_squash'] 24 | end 25 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/parallelcluster_slurm_resume.conf.erb: -------------------------------------------------------------------------------- 1 | [slurm_resume] 2 | cluster_name = <%= @cluster_name %> 3 | region = <%= @region %> 4 | proxy = <%= @proxy %> 5 | dynamodb_table = <%= @dynamodb_table %> 6 | hosted_zone = <%= @hosted_zone %> 7 | dns_domain = <%= @dns_domain %> 8 | use_private_hostname = <%= @use_private_hostname %> 9 | head_node_private_ip = <%= @head_node_private_ip %> 10 | head_node_hostname = <%= @head_node_hostname %> 11 | clustermgtd_heartbeat_file_path = <%= @clustermgtd_heartbeat_file_path %> 12 | instance_id = <%= @instance_id %> 13 | scaling_strategy = <%= @scaling_strategy %> 14 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/recipes/test/mock_login_node_keys.rb: -------------------------------------------------------------------------------- 1 | return if on_docker? 2 | 3 | keys_dir = "#{node['cluster']['shared_dir_login_nodes']}" 4 | script_name = "keys-manager.sh" 5 | script_dir = "#{keys_dir}/scripts" 6 | 7 | directory keys_dir 8 | directory script_dir 9 | 10 | cookbook_file "#{script_dir}/#{script_name}" do 11 | source 'login_nodes/keys-manager.sh' 12 | owner 'root' 13 | group 'root' 14 | mode '0744' 15 | action :create_if_missing 16 | end 17 | 18 | execute 'Initialize Login Nodes keys' do 19 | command "bash #{script_dir}/#{script_name} --create --folder-path #{keys_dir}" 20 | user 'root' 21 | end 22 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/filter_lines/controls/filter_lines_replace_between.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Spec tests for the replace_between filter 3 | # 4 | 5 | control 'filter_lines_replace_between' do 6 | describe file('/tmp/replace_between') do 7 | it { should exist } 8 | its('content') { should match(/FOOL\r?\nline1\r?\nline2\r?\nline3\r?\nint/) } 9 | end 10 | describe matches('/tmp/replace_between', /FOOL\r?\nline1\r?\nline2\r?\nline3\r?\nint/) do 11 | its('count') { should eq 1 } 12 | end 13 | describe file_ext('/tmp/replace_between') do 14 | it { should have_correct_eol } 15 | its('size_lines') { should eq 7 } 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/files/default/head_node_checks/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with 4 | # the License. A copy of the License is located at 5 | # 6 | # http://aws.amazon.com/apache2.0/ 7 | # 8 | # or in the "LICENSE.txt" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES 9 | # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/files/default/head_node_slurm/slurm/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). 4 | # You may not use this file except in compliance with the License. A copy of the License is located at 5 | # 6 | # http://aws.amazon.com/apache2.0/ 7 | # 8 | # or in the "LICENSE.txt" file accompanying this file. 9 | # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. 10 | # See the License for the specific language governing permissions and limitations under the License. 11 | -------------------------------------------------------------------------------- /cookbooks/iptables/test/integration/rules/rules.rb: -------------------------------------------------------------------------------- 1 | case os.family 2 | when 'debian', 'ubuntu' 3 | describe file('/etc/iptables/rules.v4') do 4 | it { should exist } 5 | end 6 | describe service('netfilter-persistent') do 7 | it { should be_installed } 8 | it { should be_running } 9 | it { should be_enabled } 10 | end 11 | when 'redhat', 'fedora' 12 | describe file('/etc/sysconfig/iptables-config') do 13 | its(:content) { should match /IPTABLES_STATUS_VERBOSE="no"/ } 14 | end 15 | describe service('iptables') do 16 | it { should be_installed } 17 | it { should be_running } 18 | it { should be_enabled } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/templates/stanza.erb: -------------------------------------------------------------------------------- 1 | 2 | [libdefaults] 3 | default_realm = DOMAIN.NET 4 | forwardable = true 5 | default_keytab_name = /etc/opt/quest/vas/host.keytab 6 | default_etypes = arcfour-hmac-md5 7 | default_etypes_des = des-cbc-crc 8 | 9 | [domain_realm] 10 | server.domain.net = DOMAIN.NET 11 | 12 | [libvas] 13 | smb-dialect-range = 2.0.2-3 14 | enable-smb3-encryption = false 15 | use-dns-srv = true 16 | 17 | mscldap-timeout = 3 18 | vascache-ipc-timeout = 7 19 | [vasd] 20 | workstation-mode = false 21 | 22 | ldap-timeout = 45 23 | username-attr-name = sAMAccountName 24 | [nss_vas] 25 | lowercase-names = true 26 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/files/default/head_node_checks/common/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with 4 | # the License. A copy of the License is located at 5 | # 6 | # http://aws.amazon.com/apache2.0/ 7 | # 8 | # or in the "LICENSE.txt" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES 9 | # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/filter_lines/controls/filter_lines_multi.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Spec tests for the multiple filters 3 | # 4 | 5 | control 'filter_lines_multi' do 6 | describe file('/tmp/multiple_filters') do 7 | it { should exist } 8 | its('content') { should match(/^HELLO THERE I AM DANGERFILE\r?\nline1\r?\nline2\r?\nline3$/) } 9 | its('content') { should match(/^COMMENT ME AND I STOP YELLING I PROMISE\r?\nline1\r?\nline2\r?\nline3$/) } 10 | its('content') { should_not match(/^#/) } 11 | end 12 | describe file_ext('/tmp/multiple_filters') do 13 | it { should have_correct_eol } 14 | its('size_lines') { should eq 10 } 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /cookbooks/iptables/test/integration/install-and-remove/install-and-remove.rb: -------------------------------------------------------------------------------- 1 | case os.family 2 | when 'debian', 'ubuntu' 3 | describe file('/etc/iptables/rules.v4') do 4 | it { should exist } 5 | end 6 | describe service('netfilter-persistent') do 7 | it { should be_installed } 8 | it { should_not be_running } 9 | it { should_not be_enabled } 10 | end 11 | when 'redhat', 'fedora' 12 | describe file('/etc/sysconfig/iptables-config') do 13 | it { should_not exist } 14 | end 15 | describe service('iptables') do 16 | it { should_not be_installed } 17 | it { should_not be_running } 18 | it { should_not be_enabled } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /cookbooks/iptables/test/integration/rule-line/rule-line.rb: -------------------------------------------------------------------------------- 1 | case os.family 2 | when 'debian', 'ubuntu' 3 | describe file('/etc/iptables/rules.v4') do 4 | it { should exist } 5 | end 6 | describe service('netfilter-persistent') do 7 | it { should be_installed } 8 | it { should be_running } 9 | it { should be_enabled } 10 | end 11 | when 'redhat', 'fedora' 12 | describe file('/etc/sysconfig/iptables-config') do 13 | its(:content) { should match /IPTABLES_STATUS_VERBOSE="no"/ } 14 | end 15 | describe service('iptables') do 16 | it { should be_installed } 17 | it { should be_running } 18 | it { should be_enabled } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/filter_lines/controls/filter_lines_replace.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Spec tests for the replace filter 3 | # 4 | 5 | control 'filter_lines_replace' do 6 | describe file('/tmp/replace') do 7 | it { should exist } 8 | its('content') { should_not match /^HELLO THERE I AM DANGERFILE/ } 9 | its('content') { should_not match /^COMMENT ME AND I STOP YELLING I PROMISE/ } 10 | end 11 | describe matches('/tmp/replace', /line1\r?\nline2\r?\nline3\r?\n/) do 12 | its('count') { should eq 2 } 13 | end 14 | describe file_ext('/tmp/replace') do 15 | it { should have_correct_eol } 16 | its('size_lines') { should eq 9 } 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/attributes/versions.rb: -------------------------------------------------------------------------------- 1 | # Python Version 2 | default['cluster']['python-version'] = '3.12.11' 3 | default['cluster']['python-major-minor-version'] = '3.12' 4 | if platform?('amazon') && node['platform_version'] == "2" 5 | default['cluster']['python-version'] = '3.9.23' 6 | default['cluster']['python-major-minor-version'] = '3.9' 7 | end 8 | 9 | # ParallelCluster versions 10 | default['cluster']['parallelcluster-version'] = '3.15.0' 11 | default['cluster']['parallelcluster-cookbook-version'] = '3.15.0' 12 | default['cluster']['parallelcluster-node-version'] = '3.15.0' 13 | default['cluster']['parallelcluster-awsbatch-cli-version'] = '1.5.0' 14 | -------------------------------------------------------------------------------- /cookbooks/iptables/test/integration/all-tables/all_tables_spec.rb: -------------------------------------------------------------------------------- 1 | case os.family 2 | when 'debian', 'ubuntu' 3 | describe file('/etc/iptables/rules.v4') do 4 | it { should exist } 5 | end 6 | describe service('netfilter-persistent') do 7 | it { should be_installed } 8 | it { should be_running } 9 | it { should be_enabled } 10 | end 11 | when 'redhat', 'fedora' 12 | describe file('/etc/sysconfig/iptables-config') do 13 | its(:content) { should match /IPTABLES_STATUS_VERBOSE="no"/ } 14 | end 15 | describe service('iptables') do 16 | it { should be_installed } 17 | it { should be_running } 18 | it { should be_enabled } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /cookbooks/iptables/test/integration/default/inspec/default_spec.rb: -------------------------------------------------------------------------------- 1 | if os[:family] == 'redhat' && os[:release].start_with?('6') 2 | describe command('/etc/init.d/iptables status') do 3 | its(:stdout) { should match /Table: filter/ } 4 | end 5 | end 6 | 7 | %w(iptables ip6tables).each do |variant| 8 | if %w(debian ubuntu).include?(os[:family]) 9 | describe file("/etc/network/if-pre-up.d/#{variant}_load") do 10 | it { should exist } 11 | end 12 | elsif %w(redhat fedora).include?(os[:family]) 13 | describe file("/etc/sysconfig/#{variant}-config") do 14 | its(:content) { should match /IPTABLES_STATUS_VERBOSE="yes"/ } 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/delete_from_list_empty.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Delete from a list on an empty file 3 | # 4 | 5 | file '/tmp/emptyfile' 6 | 7 | delete_from_list 'Empty file' do 8 | path '/tmp/emptyfile' 9 | pattern /list=/ 10 | delim [' '] 11 | entry 'not_there' 12 | end 13 | 14 | delete_from_list 'missing_file' do 15 | path '/tmp/missingfile' 16 | pattern /multi = / 17 | delim [', ', '[', ']'] 18 | entry '425' 19 | end 20 | 21 | delete_from_list 'missing_file fail' do 22 | path '/tmp/missingfile' 23 | pattern /multi = / 24 | delim [', ', '[', ']'] 25 | entry '425' 26 | ignore_missing false 27 | ignore_failure true 28 | end 29 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/templates/directory_service/sssd.conf.erb: -------------------------------------------------------------------------------- 1 | [domain/default] 2 | <%# Domain properties are added in lexicographic order to make the resulting configuration easier to navigate %> 3 | <% @domain_properties.sort_by { |key| key }.to_h.each_pair do |param, value| %> 4 | <%= "#{param} = #{value}" %> 5 | <% end %> 6 | 7 | [domain/local] 8 | id_provider = files 9 | enumerate = True 10 | 11 | [sssd] 12 | config_file_version = 2 13 | services = nss, pam, ssh 14 | domains = default, local 15 | full_name_format = %1$s 16 | 17 | [nss] 18 | filter_users = nobody,root 19 | filter_groups = nobody,root 20 | 21 | [pam] 22 | offline_credentials_expiration = 7 23 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/slurmdbd.service.erb: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Slurm DBD accounting daemon 3 | After=network-online.target munge.service mysql.service mysqld.service mariadb.service remote-fs.target 4 | Wants=network-online.target 5 | ConditionPathExists=<%= node['cluster']['slurm']['install_dir'] %>/etc/slurmdbd.conf 6 | 7 | [Service] 8 | Type=simple 9 | EnvironmentFile=-/etc/sysconfig/slurmdbd 10 | ExecStart=<%= node['cluster']['slurm']['install_dir'] %>/sbin/slurmdbd -D -s $SLURMDBD_OPTIONS 11 | ExecReload=/bin/kill -HUP $MAINPID 12 | LimitNOFILE=65536 13 | TimeoutStartSec=5000 14 | 15 | [Install] 16 | WantedBy=multi-user.target 17 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/attributes/epel-next.rb: -------------------------------------------------------------------------------- 1 | default['yum']['epel-next']['repositoryid'] = 'epel-next' 2 | default['yum']['epel-next']['gpgcheck'] = true 3 | default['yum']['epel-next']['description'] = 'Extra Packages for $releasever - Next - $basearch' 4 | default['yum']['epel-next']['mirrorlist'] = 5 | "https://mirrors.fedoraproject.org/mirrorlist?repo=epel-next-#{yum_epel_release}&arch=$basearch" 6 | default['yum']['epel-next']['gpgkey'] = 7 | "https://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{yum_epel_release}" 8 | default['yum']['epel-next']['enabled'] = true 9 | default['yum']['epel-next']['managed'] = true 10 | default['yum']['epel-next']['make_cache'] = true 11 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-awsbatch/metadata.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | name 'aws-parallelcluster-awsbatch' 4 | maintainer 'Amazon Web Services' 5 | license 'Apache-2.0' 6 | description 'Manages AWS Batch in AWS ParallelCluster' 7 | issues_url 'https://github.com/aws/aws-parallelcluster/issues' 8 | source_url 'https://github.com/aws/aws-parallelcluster-cookbook' 9 | chef_version '>= 18' 10 | version '3.15.0' 11 | 12 | depends 'iptables', '~> 8.0.0' 13 | depends 'nfs', '~> 5.1.5' 14 | depends 'line', '~> 4.5.21' 15 | depends 'openssh', '~> 2.11.14' 16 | depends 'yum', '~> 7.4.20' 17 | depends 'yum-epel', '~> 5.0.8' 18 | depends 'aws-parallelcluster-shared', '~> 3.15.0' 19 | -------------------------------------------------------------------------------- /cookbooks/iptables/test/integration/rule-line-number/rule-line-number.rb: -------------------------------------------------------------------------------- 1 | case os.family 2 | when 'debian', 'ubuntu' 3 | describe file('/etc/iptables/rules.v4') do 4 | it { should exist } 5 | end 6 | describe service('netfilter-persistent') do 7 | it { should be_installed } 8 | it { should be_running } 9 | it { should be_enabled } 10 | end 11 | when 'redhat', 'fedora' 12 | describe file('/etc/sysconfig/iptables-config') do 13 | its(:content) { should match /IPTABLES_STATUS_VERBOSE="no"/ } 14 | end 15 | describe service('iptables') do 16 | it { should be_installed } 17 | it { should be_running } 18 | it { should be_enabled } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/resources/mysql_client/partial/_setup_ubuntu.rb: -------------------------------------------------------------------------------- 1 | action :setup do 2 | # Add MySQL source file 3 | action_create_source_link 4 | 5 | # An apt update is required to align the apt cache with the current list of available package versions. 6 | apt_update 7 | 8 | package repository_packages do 9 | retries 3 10 | retry_delay 5 11 | end 12 | end 13 | 14 | action_class do 15 | def repository_packages 16 | %w(libmysqlclient-dev libmysqlclient21) 17 | end 18 | 19 | def package_platform 20 | if arm_instance? 21 | 'el/7/aarch64' 22 | else 23 | "ubuntu/#{node['platform_version']}/x86_64" 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/line_resources/README.md: -------------------------------------------------------------------------------- 1 | # Custom inspec resources 2 | 3 | These inspec resources were written to facilitate converting rspec unit tests to inspec integration tests. The resources may be shared by including an inspec.yml profile that specifies 4 | 5 | ```ruby 6 | depends: 7 | - name: line_resources 8 | path: ../line_resources 9 | ``` 10 | 11 | The test directory structure should be: 12 | 13 | ```text 14 | ../integration -line_resources inspec.yml profile for the line custom inspec resources -controls dummy control 15 | -libraries custom resources -test_suite_name inspec.yml profile for the specific test suite -controls test suite inspec tests 16 | ``` 17 | -------------------------------------------------------------------------------- /cookbooks/nfs/templates/default/nfs.conf.erb: -------------------------------------------------------------------------------- 1 | # Generated by Chef for <%= node['fqdn'] -%> 2 | # Local modifications will be overwritten. 3 | # 4 | # This is a general configuration for the 5 | # NFS daemons and tools 6 | [general] 7 | pipefs-directory=<%= node['nfs']['idmap']['pipefs_directory'] %> 8 | 9 | [gssd] 10 | use-gss-proxy=1 11 | 12 | [lockd] 13 | port=<%= node['nfs']['port']['lockd'] %> 14 | udp-port=<%= node['nfs']['port']['lockd'] %> 15 | 16 | [mountd] 17 | port=<%= node['nfs']['port']['mountd'] %> 18 | 19 | [nfsd] 20 | threads=<%= node['nfs']['threads'] %> 21 | 22 | [statd] 23 | port=<%= node['nfs']['port']['statd'] %> 24 | outgoing-port=<%= node['nfs']['port']['statd_out'] %> 25 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/delete_from_list_3d.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Delete from list with 3 deliminators [], [] 3 | # 4 | 5 | template '/tmp/3d' do 6 | source 'samplefile3.erb' 7 | action :create_if_missing 8 | end 9 | 10 | delete_from_list 'Delete entry' do 11 | path '/tmp/3d' 12 | pattern /wo3d_list=/ 13 | delim [',', '[', ']'] 14 | entry 'first3' 15 | end 16 | 17 | delete_from_list 'Delete entry terminal' do 18 | path '/tmp/3d' 19 | pattern /multi = / 20 | delim [', ', '[', ']'] 21 | entry '323' 22 | end 23 | 24 | delete_from_list 'Delete not exists' do 25 | path '/tmp/3d' 26 | pattern /multi = / 27 | delim [', ', '[', ']'] 28 | entry '425' 29 | end 30 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/slurmctld.service.erb: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Slurm controller daemon 3 | After=network-online.target munge.service remote-fs.target 4 | Wants=network-online.target 5 | ConditionPathExists=<%= node['cluster']['slurm']['install_dir'] %>/etc/slurm.conf 6 | 7 | [Service] 8 | Type=simple 9 | EnvironmentFile=-/etc/sysconfig/slurmctld 10 | ExecStart=<%= node['cluster']['slurm']['install_dir'] %>/sbin/slurmctld -D -s $SLURMCTLD_OPTIONS 11 | ExecReload=/bin/kill -HUP $MAINPID 12 | LimitNOFILE=562930 13 | LimitMEMLOCK=infinity 14 | LimitSTACK=infinity 15 | Restart=on-failure 16 | RestartSec=1s 17 | 18 | [Install] 19 | WantedBy=multi-user.target 20 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/delete_from_list_2d.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Delete from list with 2 deliminators ||, || 3 | # 4 | 5 | template '/tmp/2d' do 6 | source 'samplefile3.erb' 7 | action :create_if_missing 8 | end 9 | 10 | delete_from_list 'Delete one' do 11 | path '/tmp/2d' 12 | pattern /my @net1918 =/ 13 | delim [', ', '"'] 14 | entry '10.0.0.0/8' 15 | end 16 | 17 | delete_from_list 'Delete only' do 18 | path '/tmp/2d' 19 | pattern /last_delimited_list= \(/ 20 | delim [', ', '|'] 21 | entry 'single' 22 | end 23 | 24 | delete_from_list 'Delete not exists' do 25 | path '/tmp/2d' 26 | pattern /my @net1918 =/ 27 | delim [', ', '"'] 28 | entry '10.0.0.1/8' 29 | end 30 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/resources/munge/munge_amazon2.rb: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"). 2 | # You may not use this file except in compliance with the License. 3 | # A copy of the License is located at 4 | # 5 | # http://aws.amazon.com/apache2.0/ 6 | # 7 | # or in the "LICENSE.txt" file accompanying this file. 8 | # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. 9 | # See the License for the specific language governing permissions and limitations under the License. 10 | 11 | provides :munge, platform: 'amazon', platform_version: '2' 12 | 13 | use 'partial/_munge_actions' 14 | use 'partial/_munge_rhel' 15 | -------------------------------------------------------------------------------- /cookbooks/iptables/test/cookbooks/test/recipes/all-tables.rb: -------------------------------------------------------------------------------- 1 | # This will create all tables possible on the server 2 | # and validate that they are all there with the correct default chains 3 | 4 | include_recipe '::centos-6-helper' if platform?('centos') && node['platform_version'].to_i == 6 5 | 6 | iptables_packages 'install iptables' 7 | iptables_service 'configure iptables services' 8 | 9 | iptables_chain 'filter' do 10 | table :filter 11 | end 12 | 13 | iptables_chain 'mangle' do 14 | table :mangle 15 | end 16 | 17 | iptables_chain 'nat' do 18 | table :nat 19 | end 20 | 21 | iptables_chain 'raw' do 22 | table :raw 23 | end 24 | 25 | iptables_chain 'security' do 26 | table :security 27 | end 28 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/add_to_list_1d.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Test for lists with 1 delimitor , 3 | # 4 | 5 | template '/tmp/1d' do 6 | source 'samplefile3.erb' 7 | action :create_if_missing 8 | end 9 | 10 | add_to_list 'Add to an empty list, seperator' do 11 | path '/tmp/1d' 12 | pattern /empty_list=/ 13 | delim [' '] 14 | entry 'newentry' 15 | end 16 | 17 | add_to_list 'Add a duplicate entry to a list, seperator' do 18 | path '/tmp/1d' 19 | pattern /People to call:/ 20 | delim [', '] 21 | entry 'Bobby' 22 | end 23 | 24 | add_to_list 'Add a new entry to a list, seperator' do 25 | path '/tmp/1d' 26 | pattern /People to call:/ 27 | delim [', '] 28 | entry 'Harry' 29 | end 30 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/resources/jwt_dependencies/jwt_dependencies_amazon2.rb: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"). 2 | # You may not use this file except in compliance with the License. 3 | # A copy of the License is located at 4 | # 5 | # http://aws.amazon.com/apache2.0/ 6 | # 7 | # or in the "LICENSE.txt" file accompanying this file. 8 | # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. 9 | # See the License for the specific language governing permissions and limitations under the License. 10 | 11 | provides :jwt_dependencies, platform: 'amazon', platform_version: '2' 12 | 13 | use 'partial/_jwt_dependencies_common' 14 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/attributes/epel-source.rb: -------------------------------------------------------------------------------- 1 | default['yum']['epel-source']['repositoryid'] = 'epel-source' 2 | default['yum']['epel-source']['description'] = 3 | "Extra Packages for #{yum_epel_release} - $basearch - Source" 4 | default['yum']['epel-source']['mirrorlist'] = 5 | "https://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-#{yum_epel_release}&arch=$basearch" 6 | default['yum']['epel-source']['gpgkey'] = 7 | "https://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{yum_epel_release}" 8 | default['yum']['epel-source']['gpgcheck'] = true 9 | default['yum']['epel-source']['enabled'] = false 10 | default['yum']['epel-source']['managed'] = false 11 | default['yum']['epel-source']['make_cache'] = true 12 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/spec/unit/recipes/efs_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'aws-parallelcluster-environment::efs' do 4 | for_all_oses do |platform, version| 5 | context "on #{platform}#{version}" do 6 | cached(:chef_run) do 7 | runner = runner( 8 | platform: platform, version: version 9 | ) do |node| 10 | node.override['cluster']['fsx_fs_ids'] = "lustre_id_1,lustre_id_2" 11 | end 12 | runner.converge(described_recipe) 13 | end 14 | cached(:node) { chef_run.node } 15 | 16 | describe 'call efs for mounting' do 17 | it { is_expected.to mount_efs('mount efs') } 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-tests/metadata.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | name 'aws-parallelcluster-tests' 4 | maintainer 'Amazon Web Services' 5 | license 'Apache-2.0' 6 | description 'Common AWS ParallelCluster resources and attributes' 7 | issues_url 'https://github.com/aws/aws-parallelcluster-cookbook/issues' 8 | source_url 'https://github.com/aws/aws-parallelcluster-cookbook' 9 | chef_version '>= 18' 10 | version '3.15.0' 11 | 12 | depends 'aws-parallelcluster-shared', '~> 3.15.0' 13 | depends 'aws-parallelcluster-platform', '~> 3.15.0' 14 | depends 'aws-parallelcluster-environment', '~> 3.15.0' 15 | depends 'aws-parallelcluster-computefleet', '~> 3.15.0' 16 | depends 'aws-parallelcluster-slurm', '~> 3.15.0' 17 | -------------------------------------------------------------------------------- /kitchen.docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source kitchen/kitchen.local-yml.sh 4 | 5 | THIS_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) 6 | export KITCHEN_YAML="${THIS_DIR}/kitchen.docker.yml" 7 | export KITCHEN_GLOBAL_YAML="${THIS_DIR}/kitchen.global.yml" 8 | export KITCHEN_DRIVER=dokken 9 | 10 | # Export DOCKER_HOST variable when using Colima 11 | if [[ $(command -v colima) ]]; then 12 | colima status || colima start 13 | export DOCKER_HOST=unix://${HOME}/.colima/default/docker.sock 14 | fi 15 | 16 | echo "** KITCHEN_LOCAL_YAML: $KITCHEN_LOCAL_YAML" 17 | echo "** KITCHEN_YAML: $KITCHEN_YAML" 18 | echo "** KITCHEN_GLOBAL_YAML: $KITCHEN_GLOBAL_YAML" 19 | echo "kitchen $*" 20 | 21 | kitchen "$@" 22 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/nvidia/parallelcluster_nvidia_service.erb: -------------------------------------------------------------------------------- 1 | # This systemd service file, designed to trigger the creation device block file /dev/nvidia0 2 | # The service start nvidia-persistenced if it is not already started or execute the command nvidia-smi. 3 | 4 | [Unit] 5 | Description=ParallelCluster NVIDIA Daemon 6 | Wants=syslog.target 7 | 8 | [Service] 9 | <% if @is_nvidia_persistenced_running -%> 10 | Type=simple 11 | ExecStart=/usr/bin/nvidia-smi 12 | RemainAfterExit=yes 13 | <% else %> 14 | Type=forking 15 | ExecStart=/usr/bin/nvidia-persistenced --user root 16 | ExecStopPost=/bin/rm -rf /var/run/nvidia-persistenced 17 | <% end %> 18 | 19 | [Install] 20 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /cookbooks/iptables/test/integration/default/inspec/rules_spec.rb: -------------------------------------------------------------------------------- 1 | if os[:family] == 'redhat' && os[:release].start_with?('6') 2 | describe command('/etc/init.d/iptables status') do 3 | its(:stdout) { should match /ACCEPT.*tcp dpt:22/ } 4 | end 5 | 6 | describe command('/etc/init.d/ip6tables status') do 7 | its(:stdout) { should match /ACCEPT.*tcp dpt:22/ } 8 | end 9 | 10 | else 11 | describe iptables do 12 | it { should have_rule('-A FWR -p tcp -m tcp --dport 22 -j ACCEPT') } 13 | end 14 | 15 | describe command('/sbin/ip6tables-save') do 16 | its(:stdout) { should match %r{\-A\sINPUT\s\-d\sfe80\:\:/\d+\s\-p\sudp\s\-m\sudp\s\-\-dport\s546\s\-m\sstate\s\-\-state\sNEW\s\-j\sACCEPT} } 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/filter_lines/controls/filter_lines_misc.rb: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Spec tests for the nonstatdard properties 4 | # 5 | 6 | control 'filter_lines_other_props' do 7 | describe file('/tmp/missingfile') do 8 | it { should_not exist } 9 | end 10 | 11 | describe file('/tmp/emptyfile') do 12 | it { should exist } 13 | its('size') { should eq 0 } 14 | end 15 | 16 | describe file('/tmp/safe_bypass') do 17 | it { should exist } 18 | end 19 | describe matches('/tmp/safe_bypass', /^line1$/) do 20 | its('count') { should eq 3 } 21 | end 22 | describe file_ext('/tmp/safe_bypass') do 23 | it { should have_correct_eol } 24 | its('size_lines') { should eq 3 } 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/attributes/epel-testing.rb: -------------------------------------------------------------------------------- 1 | default['yum']['epel-testing']['repositoryid'] = 'epel-testing' 2 | default['yum']['epel-testing']['description'] = 3 | "Extra Packages for #{yum_epel_release} - $basearch - Testing " 4 | default['yum']['epel-testing']['mirrorlist'] = 5 | "https://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel#{yum_epel_release}&arch=$basearch" 6 | default['yum']['epel-testing']['gpgkey'] = 7 | "https://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{yum_epel_release}" 8 | default['yum']['epel-testing']['gpgcheck'] = true 9 | default['yum']['epel-testing']['enabled'] = false 10 | default['yum']['epel-testing']['managed'] = false 11 | default['yum']['epel-testing']['make_cache'] = true 12 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/supervisord/supervisord-service.erb: -------------------------------------------------------------------------------- 1 | # Downloaded from: 2 | # https://git.launchpad.net/ubuntu/+source/supervisor/tree/debian/supervisor.service 3 | [Unit] 4 | Description=Supervisor process control system for UNIX 5 | Documentation=http://supervisord.org 6 | After=network.target 7 | 8 | [Service] 9 | ExecStart=<%= @cookbook_virtualenv_path %>/bin/supervisord -n -c /etc/supervisord.conf 10 | ExecStop=<%= @cookbook_virtualenv_path %>/bin/supervisorctl $OPTIONS shutdown 11 | ExecReload=<%= @cookbook_virtualenv_path %>/bin/supervisorctl -c /etc/supervisord.conf $OPTIONS reload 12 | KillMode=process 13 | Restart=on-failure 14 | RestartSec=50s 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/files/default/config_slurm/scripts/epilog.d/90_pcluster_noop: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"). 5 | # You may not use this file except in compliance with the 6 | # License. A copy of the License is located at 7 | # 8 | # http://aws.amazon.com/apache2.0/ 9 | # 10 | # or in the "LICENSE.txt" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES 11 | # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | # noop epilog 15 | exit 0 16 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/resources/dns_domain/dns_domain_amazon2.rb: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"). 2 | # You may not use this file except in compliance with the License. 3 | # A copy of the License is located at 4 | # 5 | # http://aws.amazon.com/apache2.0/ 6 | # 7 | # or in the "LICENSE.txt" file accompanying this file. 8 | # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. 9 | # See the License for the specific language governing permissions and limitations under the License. 10 | 11 | provides :dns_domain, platform: 'amazon', platform_version: '2' 12 | 13 | use 'partial/_dns_domain_common' 14 | use 'partial/_dns_domain_redhat' 15 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | # frozen_string_literal: true 3 | 4 | # chefspec task against spec/*_spec.rb 5 | require 'rspec/core/rake_task' 6 | RSpec::Core::RakeTask.new(:chefspec) 7 | 8 | # cookstyle rake task 9 | desc 'Cookstyle linter' 10 | task :cookstyle do 11 | sh 'cookstyle .' 12 | end 13 | 14 | # rubocop rake task 15 | desc 'Ruby style guide linter' 16 | task :rubocop do 17 | sh 'rubocop --fail-level W' 18 | end 19 | 20 | # test-kitchen task 21 | begin 22 | require 'kitchen/rake_tasks' 23 | Kitchen::RakeTasks.new 24 | rescue LoadError 25 | puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI'] 26 | end 27 | 28 | # default tasks are quick, commit tests 29 | task default: %w(cookstyle rubocop chefspec) 30 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/compute/slurm_node_spec.json.erb: -------------------------------------------------------------------------------- 1 | { 2 | "region": "<%= @region %>", 3 | "cluster_name": "<%= @cluster_name %>", 4 | "scheduler": "<%= @scheduler %>", 5 | "node_role": "<%= @node_role %>", 6 | "instance_id": "<%= @instance_id %>", 7 | "compute": { 8 | "queue-name": "<%= @queue_name %>", 9 | "compute-resource": "<%= @compute_resource %>", 10 | "name": "<%= @node_name %>", 11 | "node-type": "<%= @node_type %>", 12 | "instance-id": "<%= @instance_id %>", 13 | "instance-type": "<%= @instance_type %>", 14 | "availability-zone": "<%= @availability_zone %>", 15 | "address": "<%= @ip_address %>", 16 | "hostname": "<%= @hostname %>" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/attributes/epel-debuginfo.rb: -------------------------------------------------------------------------------- 1 | default['yum']['epel-debuginfo']['repositoryid'] = 'epel-debuginfo' 2 | default['yum']['epel-debuginfo']['description'] = 3 | "Extra Packages for #{yum_epel_release} - $basearch - Debug" 4 | default['yum']['epel-debuginfo']['mirrorlist'] = 5 | "https://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-#{yum_epel_release}&arch=$basearch" 6 | default['yum']['epel-debuginfo']['gpgkey'] = 7 | "https://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{yum_epel_release}" 8 | default['yum']['epel-debuginfo']['gpgcheck'] = true 9 | default['yum']['epel-debuginfo']['enabled'] = false 10 | default['yum']['epel-debuginfo']['managed'] = false 11 | default['yum']['epel-debuginfo']['make_cache'] = true 12 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/templates/nvidia-imex/nvidia-imex.service.erb: -------------------------------------------------------------------------------- 1 | # This file is created by ParallelCluster by following default settings 2 | # as given by official NVIDIA docs https://docs.nvidia.com/multi-node-nvlink-systems/imex-guide/gettingstarted.html#on-linux-based-systems 3 | 4 | [Unit] 5 | Description=NVIDIA IMEX service 6 | After=network-online.target 7 | Requires=network-online.target 8 | 9 | [Service] 10 | User=root 11 | PrivateTmp=false 12 | Type=forking 13 | TimeoutStartSec=infinity 14 | 15 | ExecStart=/usr/bin/nvidia-imex -c <%= @imex_main_config_file_path %> 16 | 17 | LimitCORE=infinity 18 | 19 | Restart=on-failure 20 | RestartSec=1s 21 | 22 | [Install] 23 | WantedBy=multi-user.target 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/replace_or_add_replace_only.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Test replace_or_add with the replace_only flag set to true 3 | # 4 | 5 | template '/tmp/replace_only' do 6 | source 'text_file.erb' 7 | action :create_if_missing 8 | end 9 | 10 | template '/tmp/replace_only_nomatch' do 11 | source 'text_file.erb' 12 | action :create_if_missing 13 | end 14 | 15 | replace_or_add 'replace_only' do 16 | path '/tmp/replace_only' 17 | pattern 'Penultimate' 18 | line 'Penultimate Replacement' 19 | replace_only true 20 | end 21 | 22 | replace_or_add 'replace_only_nomatch' do 23 | path '/tmp/replace_only_nomatch' 24 | pattern 'Does not match' 25 | line 'Penultimate Replacement' 26 | replace_only true 27 | end 28 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/delete_lines/inspec/controls/delete_lines_regexp.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Delete lines using regex pattern 3 | # 4 | 5 | control 'delete_lines_regexp' do 6 | describe file('/tmp/regexp_pattern_1') do 7 | it { should exist } 8 | its('content') { should_not match /^HELLO.*/ } 9 | end 10 | describe file_ext('/tmp/regexp_pattern_1') do 11 | it { should have_correct_eol } 12 | its('size_lines') { should eq 4 } 13 | end 14 | 15 | describe file('/tmp/regexp_pattern_2') do 16 | it { should exist } 17 | its('content') { should_not match /^#.*/ } 18 | end 19 | describe file_ext('/tmp/regexp_pattern_2') do 20 | it { should have_correct_eol } 21 | its('size_lines') { should eq 4 } 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/delete_lines/inspec/controls/delete_lines_string.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Delete lines using string pattern 3 | # 4 | 5 | control 'delete_lines_string' do 6 | describe file('/tmp/string_pattern_1') do 7 | it { should exist } 8 | its('content') { should_not match /^HELLO.*/ } 9 | end 10 | describe file_ext('/tmp/string_pattern_1') do 11 | it { should have_correct_eol } 12 | its('size_lines') { should eq 4 } 13 | end 14 | 15 | describe file('/tmp/string_pattern_2') do 16 | it { should exist } 17 | its('content') { should_not match /^#.*/ } 18 | end 19 | describe file_ext('/tmp/string_pattern_2') do 20 | it { should have_correct_eol } 21 | its('size_lines') { should eq 4 } 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-computefleet/recipes/config.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the 6 | # License. A copy of the License is located at 7 | # 8 | # http://aws.amazon.com/apache2.0/ 9 | # 10 | # or in the "LICENSE.txt" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES 11 | # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | include_recipe 'aws-parallelcluster-computefleet::fleet_status' 15 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/templates/ec2_udev_rules/ec2-volid.rules.erb: -------------------------------------------------------------------------------- 1 | KERNEL=="xvd*", KERNEL!="xvda*", ENV{DEVTYPE}=="disk", PROGRAM="<%= @cookbook_virtualenv_path %>/bin/python /sbin/ec2_dev_2_volid.py %k", SYMLINK+="disk/by-ebs-volumeid/%c" 2 | KERNEL=="xvd*", KERNEL!="xvda*", ENV{DEVTYPE}=="partition", PROGRAM="<%= @cookbook_virtualenv_path %>/bin/python /sbin/ec2_dev_2_volid.py %k", SYMLINK+="disk/by-ebs-volumeid/%c-p%n" 3 | KERNEL=="nvme*", ENV{DEVTYPE}=="disk", PROGRAM="<%= @cookbook_virtualenv_path %>/bin/python /sbin/ec2_dev_2_volid.py %k", SYMLINK+="disk/by-ebs-volumeid/%c" 4 | KERNEL=="nvme*", ENV{DEVTYPE}=="partition", PROGRAM="<%= @cookbook_virtualenv_path %>/bin/python /sbin/ec2_dev_2_volid.py %k", SYMLINK+="disk/by-ebs-volumeid/%c-p%n" 5 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/test/controls/network_service_spec.rb: -------------------------------------------------------------------------------- 1 | # Test restart 2 | control 'network_service_running' do 3 | only_if { !os_properties.on_docker? } 4 | title "Check the network service is running" 5 | network_service_name = case node['platform'] 6 | when 'amazon', 'centos' 7 | 'network' 8 | when 'redhat' 9 | 'NetworkManager' 10 | when 'ubuntu' 11 | 'systemd-resolved' 12 | end 13 | describe service(network_service_name) do 14 | it { should be_installed } 15 | it { should be_enabled } 16 | it { should be_running } 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/resources/jwt_dependencies/jwt_dependencies_rocky8.rb: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"). 2 | # You may not use this file except in compliance with the License. 3 | # A copy of the License is located at 4 | # 5 | # http://aws.amazon.com/apache2.0/ 6 | # 7 | # or in the "LICENSE.txt" file accompanying this file. 8 | # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. 9 | # See the License for the specific language governing permissions and limitations under the License. 10 | 11 | provides :jwt_dependencies, platform: 'rocky' do |node| 12 | node['platform_version'].to_i >= 8 13 | end 14 | 15 | use 'partial/_jwt_dependencies_common' 16 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/resources/munge/munge_alinux2023.rb: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"). 2 | # You may not use this file except in compliance with the License. 3 | # A copy of the License is located at 4 | # 5 | # http://aws.amazon.com/apache2.0/ 6 | # 7 | # or in the "LICENSE.txt" file accompanying this file. 8 | # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. 9 | # See the License for the specific language governing permissions and limitations under the License. 10 | 11 | provides :munge, platform: 'amazon' do |node| 12 | node['platform_version'].to_i == 2023 13 | end 14 | 15 | use 'partial/_munge_actions' 16 | use 'partial/_munge_rhel' 17 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/attributes/default.rb: -------------------------------------------------------------------------------- 1 | default['yum-epel']['repos'] = 2 | value_for_platform( 3 | %w(almalinux redhat centos oracle rocky) => { 4 | '>= 8.0' => epel_repos, 5 | '~> 7.0' => 6 | %w( 7 | epel 8 | epel-debuginfo 9 | epel-source 10 | epel-testing 11 | epel-testing-debuginfo 12 | epel-testing-source 13 | ), 14 | }, 15 | 'amazon' => { 16 | 'default' => 17 | %w( 18 | epel 19 | epel-debuginfo 20 | epel-source 21 | epel-testing 22 | epel-testing-debuginfo 23 | epel-testing-source 24 | ), 25 | }, 26 | # No-op on non-yum systems 27 | 'default' => [] 28 | ) 29 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/spec/unit/recipes/sudo_config_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'aws-parallelcluster-platform::sudo_config' do 4 | for_all_oses do |platform, version| 5 | context "on #{platform}#{version}" do 6 | cached(:chef_run) do 7 | runner(platform: platform, version: version).converge(described_recipe) 8 | end 9 | 10 | it 'creates the sudoers template with the correct attributes' do 11 | is_expected.to create_template('/etc/sudoers.d/99-parallelcluster-user-tty').with( 12 | source: 'sudo/99-parallelcluster-user-tty.erb', 13 | owner: 'root', 14 | group: 'root', 15 | mode: '0600' 16 | ) 17 | end 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/spec/unit/resources/node_attributes_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'aws-parallelcluster-shared::node_attributes' do 4 | context 'Sets up environment variables' do 5 | cached(:chef_run) do 6 | runner = ChefSpec::Runner.new(step_into: ['node_attributes']) do |node| 7 | node.override['test']['attr'] = 'attr_value' 8 | end 9 | runner.converge_dsl do 10 | node_attributes 'write file' 11 | end 12 | end 13 | 14 | it 'creates file /etc/chef/node_attributes.json with all the node attributes' do 15 | is_expected.to render_file('/etc/chef/node_attributes.json') 16 | .with_content(/"test": {\s*"attr": "attr_value"\s*}/) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/resources/jwt_dependencies/jwt_dependencies_redhat8.rb: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"). 2 | # You may not use this file except in compliance with the License. 3 | # A copy of the License is located at 4 | # 5 | # http://aws.amazon.com/apache2.0/ 6 | # 7 | # or in the "LICENSE.txt" file accompanying this file. 8 | # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. 9 | # See the License for the specific language governing permissions and limitations under the License. 10 | 11 | provides :jwt_dependencies, platform: 'redhat' do |node| 12 | node['platform_version'].to_i >= 8 13 | end 14 | 15 | use 'partial/_jwt_dependencies_common' 16 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/99-parallelcluster-slurm.erb: -------------------------------------------------------------------------------- 1 | Cmnd_Alias SLURM_COMMANDS = <%= node['cluster']['slurm']['install_dir'] %>/bin/scontrol, <%= node['cluster']['slurm']['install_dir'] %>/bin/sinfo 2 | Cmnd_Alias SLURM_HOOKS_COMMANDS = <%= node_virtualenv_path %>/bin/slurm_suspend, <%= node_virtualenv_path %>/bin/slurm_resume, <%= node_virtualenv_path %>/bin/slurm_fleet_status_manager 3 | Cmnd_Alias SHUTDOWN = /usr/sbin/shutdown 4 | 5 | <%= node['cluster']['cluster_admin_user'] %> ALL = (root) NOPASSWD: SLURM_COMMANDS 6 | <%= node['cluster']['cluster_admin_user'] %> ALL = (root) NOPASSWD: SHUTDOWN 7 | 8 | <%= node['cluster']['slurm']['user'] %> ALL = (<%= node['cluster']['cluster_admin_user'] %>) NOPASSWD:SETENV: SLURM_HOOKS_COMMANDS 9 | -------------------------------------------------------------------------------- /cookbooks/line/test/integration/filter_lines/controls/filter_lines_stanza.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Spec tests for the stanza filter 3 | # 4 | 5 | control 'filter_lines_stanza' do 6 | describe file('/tmp/stanza') do 7 | it { should exist } 8 | end 9 | describe ini('/tmp/stanza') do 10 | its('libvas.use-dns-srv') { should cmp 'false' } 11 | its('libvas.mscldap-timeout') { should cmp 5 } 12 | its('nss_vas.addme') { should cmp 'option' } 13 | its('nss_vas.lowercase-names') { should cmp 'false' } 14 | its('test1.line1') { should cmp 'true' } 15 | its('test2/test.line1') { should cmp 'false' } 16 | end 17 | describe file_ext('/tmp/stanza') do 18 | it { should have_correct_eol } 19 | its('size_lines') { should eq 30 } 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /kitchen.global.yml: -------------------------------------------------------------------------------- 1 | verifier: 2 | name: inspec 3 | reporter: 4 | - cli 5 | - junit2:.kitchen/inspec/results/%{platform}_%{suite}_inspec.xml 6 | 7 | provisioner: 8 | data_path: test/data 9 | environments_path: test/environments 10 | client_rb: 11 | environment: kitchen 12 | attributes: 13 | kitchen: true 14 | cluster: 15 | # right now tests depend on this parameter: we will try to remove the dependency later 16 | region: us-east-1 17 | 18 | lifecycle: 19 | <% %w(pre post).each do |prefix| %> 20 | <% %w(create converge verify destroy).each do |phase| %> 21 | <% op = "#{prefix}_#{phase}" %> 22 | <%= op %>: 23 | - local: bash ./kitchen/kitchen.run-hook.sh <%= op %> $(dirname "$0") 24 | <% end %> 25 | <% end %> -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-computefleet/recipes/init.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the 6 | # License. A copy of the License is located at 7 | # 8 | # http://aws.amazon.com/apache2.0/ 9 | # 10 | # or in the "LICENSE.txt" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES 11 | # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | include_recipe 'aws-parallelcluster-computefleet::clusterstatusmgtd_config' 15 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/resources/jwt_dependencies/jwt_dependencies_alinux2023.rb: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"). 2 | # You may not use this file except in compliance with the License. 3 | # A copy of the License is located at 4 | # 5 | # http://aws.amazon.com/apache2.0/ 6 | # 7 | # or in the "LICENSE.txt" file accompanying this file. 8 | # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. 9 | # See the License for the specific language governing permissions and limitations under the License. 10 | 11 | provides :jwt_dependencies, platform: 'amazon' do |node| 12 | node['platform_version'].to_i == 2023 13 | end 14 | 15 | use 'partial/_jwt_dependencies_common' 16 | -------------------------------------------------------------------------------- /cookbooks/iptables/test/integration/disabled/inspec/disabled_spec.rb: -------------------------------------------------------------------------------- 1 | if %w(redhat fedora amazon).include?(os[:family]) 2 | describe service('iptables') do 3 | it { should be_installed } 4 | it { should_not be_enabled } 5 | it { should_not be_running } 6 | end 7 | end 8 | # some RHEL/CentOS versions use these files to persist rules. disable recipe 9 | # "clears" these files out. 10 | %w(/etc/sysconfig/iptables /etc/sysconfig/iptables.fallback).each do |file| 11 | describe file(file) do 12 | before :each do 13 | skip if os[:family] != 'redhat' 14 | end 15 | it { should exist } 16 | it { should be_file } 17 | its(:content) { should match(/^# iptables rules files cleared by chef via iptables::disabled$/) } 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-environment/recipes/finalize.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Copyright:: 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the 6 | # License. A copy of the License is located at 7 | # 8 | # http://aws.amazon.com/apache2.0/ 9 | # 10 | # or in the "LICENSE.txt" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES 11 | # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | include_recipe 'aws-parallelcluster-environment::finalize_directory_service' 15 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/libraries/pyxis.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Copyright:: 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"). 6 | # You may not use this file except in compliance with the License. 7 | # A copy of the License is located at 8 | # 9 | # http://aws.amazon.com/apache2.0/ 10 | # 11 | # or in the "LICENSE.txt" file accompanying this file. 12 | # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. 13 | # See the License for the specific language governing permissions and limitations under the License. 14 | 15 | def pyxis_installed? 16 | ::Dir.exist?('/usr/local/share/pyxis') 17 | end 18 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/resources/dns_domain/partial/_dns_domain_redhat.rb: -------------------------------------------------------------------------------- 1 | action :update_search_domain_redhat do 2 | Chef::Log.info("Appending search domain '#{node['cluster']['dns_domain']}' to #{search_domain_config_path}") 3 | replace_or_add "append Route53 search domain in #{search_domain_config_path}" do 4 | path search_domain_config_path 5 | pattern append_pattern 6 | line append_line 7 | end 8 | end 9 | 10 | def search_domain_config_path 11 | # Configure dhclient to automatically append Route53 search domain in resolv.conf 12 | '/etc/dhcp/dhclient.conf' 13 | end 14 | 15 | def append_pattern 16 | 'append domain-name*' 17 | end 18 | 19 | def append_line 20 | "append domain-name \" #{node['cluster']['dns_domain']}\";" 21 | end 22 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/add_to_list_empty.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Add to list in an empty file 3 | # 4 | 5 | file '/tmp/emptyfile' 6 | 7 | add_to_list 'Empty files that are not changed should stay empty' do 8 | path '/tmp/emptyfile' 9 | pattern /line=/ 10 | delim [' '] 11 | entry 'should_not_be_added' 12 | end 13 | 14 | add_to_list 'missing_nothing' do 15 | path '/tmp/missingfile' 16 | pattern /empty_delimited_list=\(/ 17 | delim [', ', '"'] 18 | ends_with ')' 19 | entry 'newentry' 20 | end 21 | 22 | add_to_list 'missing_file fail' do 23 | path '/tmp/missingfile' 24 | pattern /empty_delimited_list=\(/ 25 | delim [', ', '"'] 26 | ends_with ')' 27 | entry 'newentry' 28 | ignore_missing false 29 | ignore_failure true 30 | end 31 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-awsbatch/kitchen.awsbatch-install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | verifier: 3 | name: inspec 4 | inspec_tests: 5 | - cookbooks/aws-parallelcluster-awsbatch/test 6 | 7 | suites: 8 | 9 | # Recipes 10 | - name: awsbatch_virtualenv 11 | run_list: 12 | - recipe[aws-parallelcluster-awsbatch::awsbatch_virtualenv] 13 | verifier: 14 | controls: 15 | - /awsbatch_virtualenv_created/ 16 | - name: custom_awsbatchcli_package 17 | run_list: 18 | - recipe[aws-parallelcluster-awsbatch::install] 19 | verifier: 20 | controls: 21 | - /custom_awsbatchcli_package_installed/ 22 | attributes: 23 | cluster: 24 | custom_awsbatchcli_package: https://github.com/aws/aws-parallelcluster/archive/develop.tar.gz 25 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/add_to_list_3d.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Test for lists with 3 delimitors [], [] 3 | # 4 | 5 | template '/tmp/3d' do 6 | source 'samplefile3.erb' 7 | action :create_if_missing 8 | end 9 | 10 | add_to_list 'Add first entry to a list, seperator, item delimiters' do 11 | path '/tmp/3d' 12 | pattern /wo3d_empty=/ 13 | delim [',', '[', ']'] 14 | entry 'single' 15 | end 16 | 17 | add_to_list 'Add an existing entry, seperator, item delimiters' do 18 | path '/tmp/3d' 19 | pattern /wo3d_list/ 20 | delim [',', '[', ']'] 21 | entry 'first3' 22 | end 23 | 24 | add_to_list 'Add a new entry, seperator, item delimiters' do 25 | path '/tmp/3d' 26 | pattern /wo3d_list/ 27 | delim [',', '[', ']'] 28 | entry 'third3' 29 | end 30 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/test/controls/c_states_spec.rb: -------------------------------------------------------------------------------- 1 | 2 | control 'tag:install_c_states_kernel_configured' do 3 | title 'Check the configuration to disable c states' 4 | only_if { !os_properties.on_docker? && os_properties.x86? } 5 | ## cpupower is installed for Ubuntu >=22 6 | describe bash('cpupower idle-info') do 7 | its('stdout') { should match(/Number of idle states: 2|No idle states/) } 8 | its('stdout') { should match(/Available idle states: POLL C1|No idle states/) } 9 | end 10 | end 11 | 12 | control 'tag:config_c_states_disabled' do 13 | only_if { os_properties.x86? && !os_properties.on_docker? } 14 | 15 | describe bash("cat /sys/module/intel_idle/parameters/max_cstate") do 16 | its('stdout') { should cmp 1 } 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-shared/spec/unit/recipes/setup_envars_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'aws-parallelcluster-shared::setup_envars' do 4 | context 'Sets up environment variables' do 5 | cached(:chef_run) do 6 | ChefSpec::ServerRunner.converge(described_recipe) 7 | end 8 | 9 | it 'Creates path.sh under /etc/profile.d' do 10 | is_expected.to create_template("/etc/profile.d/path.sh") 11 | .with(source: 'profile/path.sh.erb') 12 | .with(owner: 'root') 13 | .with(group: 'root') 14 | .with(mode: '0755') 15 | .with(variables: { 16 | path_required_directories: %w(/usr/local/sbin /usr/local/bin /sbin /bin /usr/sbin /usr/bin /opt/aws/bin), 17 | }) 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/compute/slurmd.service.erb: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Slurm node daemon 3 | After=munge.service network-online.target remote-fs.target 4 | Wants=network-online.target 5 | ConditionPathExists=<%= node['cluster']['slurm']['install_dir'] %>/etc/slurm.conf 6 | 7 | [Service] 8 | Type=simple 9 | EnvironmentFile=-/etc/sysconfig/slurmd 10 | ExecStart=<%= node['cluster']['slurm']['install_dir'] %>/sbin/slurmd -D -s $SLURMD_OPTIONS --instance-id <%= node['ec2']['instance_id'] %> --instance-type <%= node['ec2']['instance_type'] %> 11 | ExecReload=/bin/kill -HUP $MAINPID 12 | KillMode=process 13 | LimitNOFILE=131072 14 | LimitMEMLOCK=infinity 15 | LimitSTACK=infinity 16 | Delegate=yes 17 | 18 | [Install] 19 | WantedBy=multi-user.target 20 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/attributes/epel-next-source.rb: -------------------------------------------------------------------------------- 1 | default['yum']['epel-next-source']['repositoryid'] = 'epel-next-source' 2 | default['yum']['epel-next-source']['description'] = 3 | "Extra Packages for #{yum_epel_release} $basearch - Next -Source" 4 | default['yum']['epel-next-source']['mirrorlist'] = 5 | "https://mirrors.fedoraproject.org/mirrorlist?repo=epel-next-source-#{yum_epel_release}&arch=$basearch" 6 | default['yum']['epel-next-source']['gpgkey'] = 7 | "https://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{yum_epel_release}" 8 | default['yum']['epel-next-source']['gpgcheck'] = true 9 | default['yum']['epel-next-source']['enabled'] = false 10 | default['yum']['epel-next-source']['managed'] = false 11 | default['yum']['epel-next-source']['make_cache'] = true 12 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-entrypoints/metadata.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | name 'aws-parallelcluster-entrypoints' 4 | maintainer 'Amazon Web Services' 5 | license 'Apache-2.0' 6 | description 'AWS ParallelCluster cookbooks entrypoints' 7 | issues_url 'https://github.com/aws/aws-parallelcluster-cookbook/issues' 8 | source_url 'https://github.com/aws/aws-parallelcluster-cookbook' 9 | chef_version '>= 18' 10 | version '3.15.0' 11 | 12 | depends 'aws-parallelcluster-shared', '~> 3.15.0' 13 | depends 'aws-parallelcluster-platform', '~> 3.15.0' 14 | depends 'aws-parallelcluster-environment', '~> 3.15.0' 15 | depends 'aws-parallelcluster-computefleet', '~> 3.15.0' 16 | depends 'aws-parallelcluster-slurm', '~> 3.15.0' 17 | depends 'aws-parallelcluster-awsbatch', '~> 3.15.0' 18 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/filter_lines_multi.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Test combinations of filters and edge cases 3 | # 4 | 5 | template '/tmp/multiple_filters' do 6 | source 'samplefile.erb' 7 | sensitive true 8 | action :create_if_missing 9 | end 10 | 11 | filter_lines 'Multiple before and after match' do 12 | path '/tmp/multiple_filters' 13 | sensitive false 14 | filters( 15 | [ 16 | # insert lines before the last match 17 | { before: [/^COMMENT ME|^HELLO/, %w(line1 line2 line3), :last] }, 18 | # insert lines after the last match 19 | { after: [/^COMMENT ME|^HELLO/, %w(line1 line2 line3), :last] }, 20 | # delete comment lines 21 | proc { |current| current.select { |line| line !~ /^#/ } }, 22 | ] 23 | ) 24 | end 25 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-platform/test/controls/directories_spec.rb: -------------------------------------------------------------------------------- 1 | control 'tag:install_pcluster_directories_exist' do 2 | title 'Setup of ParallelCluster directories' 3 | 4 | base_dir = "/opt/parallelcluster" 5 | dirs = [ base_dir, "#{base_dir}/sources", "#{base_dir}/scripts", "#{base_dir}/licenses", "#{base_dir}/configs", "#{base_dir}/shared" ] 6 | dirs.each do |path| 7 | describe directory(path) do 8 | it { should exist } 9 | end 10 | end 11 | end 12 | 13 | control 'tag:install_pcluster_log_dir_is_configured' do 14 | title 'Setup of ParallelCluster log folder' 15 | 16 | describe directory("/var/log/parallelcluster") do 17 | it { should exist } 18 | its('owner') { should eq 'root' } 19 | its('mode') { should cmp '01777' } 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/add_to_list_2d.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Test for lists with 2 delimitors ||, || 3 | # 4 | 5 | template '/tmp/2d' do 6 | source 'samplefile3.erb' 7 | action :create_if_missing 8 | end 9 | 10 | add_to_list 'Add an item to an empty list, seperator and item delimiters' do 11 | path '/tmp/2d' 12 | pattern /wo2d_empty=/ 13 | delim [',', '"'] 14 | entry 'single' 15 | end 16 | 17 | add_to_list 'Add an existing entry to a list, seperator and item delimiters' do 18 | path '/tmp/2d' 19 | pattern /wo2d_list/ 20 | delim [',', '"'] 21 | entry 'first2' 22 | end 23 | 24 | add_to_list 'Add a new entry to a list, seperator and item delimiters' do 25 | path '/tmp/2d' 26 | pattern /wo2d_list/ 27 | delim [',', '"'] 28 | entry 'third2' 29 | end 30 | -------------------------------------------------------------------------------- /cookbooks/line/test/fixtures/cookbooks/test/recipes/append_if_no_line_empty.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Append to empty file 3 | # 4 | 5 | user 'test_user' 6 | 7 | file '/tmp/emptyfile' 8 | 9 | append_if_no_line 'should add to empty file' do 10 | path '/tmp/emptyfile' 11 | line 'added line' 12 | end 13 | 14 | append_if_no_line 'missing_file' do 15 | path '/tmp/missing_create' 16 | line 'added line' 17 | end 18 | 19 | append_if_no_line 'missing_file with owner, group, mode' do 20 | path '/tmp/missing_create_owner' 21 | line 'Owned by test_user' 22 | owner 'test_user' 23 | group 'test_user' 24 | mode '0600' 25 | end 26 | 27 | append_if_no_line 'missing_file fail' do 28 | path '/tmp/missing_fail' 29 | line 'added line' 30 | ignore_missing false 31 | ignore_failure true 32 | end 33 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | pull_request: 6 | schedule: 7 | - cron: '0 10 * * 2' 8 | 9 | jobs: 10 | analyze: 11 | name: Analyze 12 | runs-on: ubuntu-latest 13 | permissions: 14 | actions: read 15 | contents: read 16 | security-events: write 17 | strategy: 18 | fail-fast: false 19 | matrix: 20 | language: [ 'python' ] 21 | steps: 22 | - name: Checkout repository 23 | uses: actions/checkout@main 24 | - name: Initialize CodeQL 25 | uses: github/codeql-action/init@v2 26 | with: 27 | languages: ${{ matrix.language }} 28 | queries: +security-and-quality 29 | - name: Perform CodeQL Analysis 30 | uses: github/codeql-action/analyze@v2 31 | -------------------------------------------------------------------------------- /cookbooks/yum-epel/attributes/epel-next-testing.rb: -------------------------------------------------------------------------------- 1 | default['yum']['epel-next-testing']['repositoryid'] = 'epel-next-testing' 2 | default['yum']['epel-next-testing']['description'] = 3 | "Extra Packages for #{yum_epel_release} - $basearch - Next - Testing" 4 | default['yum']['epel-next-testing']['mirrorlist'] = 5 | "https://mirrors.fedoraproject.org/mirrorlist?repo=epel-testing-next-#{yum_epel_release}&arch=$basearch" 6 | default['yum']['epel-next-testing']['gpgkey'] = 7 | "https://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{yum_epel_release}" 8 | default['yum']['epel-next-testing']['gpgcheck'] = true 9 | default['yum']['epel-next-testing']['enabled'] = false 10 | default['yum']['epel-next-testing']['managed'] = false 11 | default['yum']['epel-next-testing']['make_cache'] = true 12 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/resources/munge/munge_rocky8.rb: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"). 2 | # You may not use this file except in compliance with the License. 3 | # A copy of the License is located at 4 | # 5 | # http://aws.amazon.com/apache2.0/ 6 | # 7 | # or in the "LICENSE.txt" file accompanying this file. 8 | # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. 9 | # See the License for the specific language governing permissions and limitations under the License. 10 | 11 | provides :munge, platform: 'rocky' do |node| 12 | node['platform_version'].to_i >= 8 13 | end 14 | 15 | use 'partial/_munge_actions' 16 | use 'partial/_munge_rhel' 17 | 18 | def munge_libdir 19 | '/usr/lib64' 20 | end 21 | -------------------------------------------------------------------------------- /cookbooks/aws-parallelcluster-slurm/templates/default/slurm/resume_program.erb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ResumeProgram should read SLURM_RESUME_FILE within ten seconds of starting to guarantee that it still exists. 3 | # ref https://slurm.schedmd.com/power_save.html#tolerance 4 | 5 | source /etc/profile.d/aws-cli-default-config.sh 6 | 7 | trap "rm -f ${SLURM_RESUME_FILE_TMP}" EXIT 8 | 9 | SLURM_RESUME_FILE_TMP=$(mktemp) 10 | cp ${SLURM_RESUME_FILE} ${SLURM_RESUME_FILE_TMP} 11 | 12 | chgrp <%= node['cluster']['cluster_admin_slurm_share_group'] %> ${SLURM_RESUME_FILE_TMP} 13 | chmod g+r ${SLURM_RESUME_FILE_TMP} 14 | 15 | sudo -u <%= node['cluster']['cluster_admin_user'] %> SLURM_RESUME_FILE=${SLURM_RESUME_FILE_TMP} <%= node_virtualenv_path %>/bin/slurm_resume "$@" 16 | 17 | rm -f ${SLURM_RESUME_FILE_TMP} 18 | --------------------------------------------------------------------------------