-
Notifications
You must be signed in to change notification settings - Fork 161
Pub/slurm gpu #3650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Rohith-Ravut
wants to merge
4
commits into
dell:pub/slurm_gpu
Choose a base branch
from
Rohith-Ravut:pub/slurm_gpu
base: pub/slurm_gpu
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+464
−0
Open
Pub/slurm gpu #3650
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| --- | ||
|
|
||
| - name: Prepare the cluster with passwordless ssh from manager to compute | ||
| hosts: localhost | ||
| gather_facts: false | ||
| any_errors_fatal: true | ||
| roles: | ||
| - create_slurm_repo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| --- | ||
| - name: Verify Slurm tarball exists | ||
| ansible.builtin.stat: | ||
| path: "{{ slurm_base }}/{{ slurm_tarball }}" | ||
| register: slurm_tarball_check | ||
|
|
||
| - name: Fail if Slurm tarball is missing | ||
| ansible.builtin.fail: | ||
| msg: "Slurm source tarball not found at {{ slurm_base }}/{{ slurm_tarball }}." | ||
| when: not slurm_tarball_check.stat.exists | ||
|
|
||
| - name: Run rpmbuild for Slurm (This task may take few minutes) | ||
| ansible.builtin.shell: > | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is ARM also considered for build |
||
| rpmbuild -ta {{ slurm_base }}/{{ slurm_tarball }} | ||
| --define "_topdir {{ rpmbuild_dir }}" | ||
| --define "_configure_args {{ slurm_configure_args | join(' ') }} | ||
| --with-nvml={{ slurm_nvml_config.path }}" | ||
| > "{{ log_dir }}/rpm_build.log" 2>&1 | ||
| args: | ||
| chdir: "{{ slurm_base }}" | ||
| register: rpmbuild_result | ||
| changed_when: rpmbuild_result.rc == 0 | ||
| failed_when: rpmbuild_result.rc != 0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| --- | ||
| - name: Announce cleanup | ||
| ansible.builtin.debug: | ||
| msg: "Cleaning up Slurm build environment at {{ slurm_base }}" | ||
|
|
||
| - name: Check if Slurm base directory exists | ||
| ansible.builtin.stat: | ||
| path: "{{ slurm_base }}" | ||
| register: slurm_dir | ||
|
|
||
| - name: Remove Slurm base directory | ||
| ansible.builtin.file: | ||
| path: "{{ slurm_base }}" | ||
| state: absent | ||
| when: slurm_dir.stat.exists | ||
|
|
||
| - name: Confirm cleanup complete | ||
| ansible.builtin.debug: | ||
| msg: "Cleanup complete." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| --- | ||
| - name: Remove existing destination directory if present | ||
| ansible.builtin.file: | ||
| path: "{{ dest_repo_path }}" | ||
| state: absent | ||
|
|
||
| - name: Create destination directory | ||
| ansible.builtin.file: | ||
| path: "{{ dest_repo_path }}" | ||
| state: directory | ||
| owner: apache | ||
| group: apache | ||
| mode: "{{ repo_dir_mode }}" | ||
|
|
||
| - name: Copy RPMs from source to destination | ||
| ansible.builtin.copy: | ||
| src: "{{ source_rpm_path }}/" | ||
| dest: "{{ dest_repo_path }}/" | ||
| owner: apache | ||
| group: apache | ||
| mode: '0644' | ||
| remote_src: false | ||
|
|
||
| - name: Install createrepo if not installed | ||
| ansible.builtin.dnf: | ||
| name: createrepo | ||
| state: present | ||
|
|
||
| - name: Create repo metadata | ||
| ansible.builtin.command: createrepo --update "{{ dest_repo_path }}" | ||
| args: | ||
| creates: "{{ dest_repo_path }}/repodata" | ||
|
|
||
| - name: Display success message | ||
| ansible.builtin.debug: | ||
| msg: "Slurm RPM repository successfully created and accessible at http://{{ ansible_host | default(inventory_hostname) }}/slurm_rpms/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| --- | ||
| - name: Ensure base, rpmbuild, and log directories exist | ||
| ansible.builtin.file: | ||
| path: "{{ item }}" | ||
| state: directory | ||
| mode: "{{ repo_dir_mode }}" | ||
| loop: | ||
| - "{{ slurm_base }}" | ||
| - "{{ rpmbuild_dir }}" | ||
| - "{{ log_dir }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| --- | ||
| - name: Ensure Slurm base directory exists | ||
| ansible.builtin.file: | ||
| path: "{{ slurm_base }}" | ||
| state: directory | ||
| mode: "{{ repo_dir_mode }}" | ||
|
|
||
| - name: Download Slurm source tarball | ||
| ansible.builtin.get_url: | ||
| url: "{{ slurm_download_url }}" | ||
| dest: "{{ slurm_base }}/{{ slurm_tarball }}" | ||
| mode: '0644' | ||
| force: true | ||
| register: download_result | ||
|
|
||
| - name: Verify download success | ||
| ansible.builtin.fail: | ||
| msg: "Failed to download {{ slurm_tarball }} from {{ slurm_download_url }}" | ||
| when: download_result is failed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| --- | ||
| - name: Ensure Apache (httpd) is installed | ||
| ansible.builtin.dnf: | ||
| name: httpd | ||
| state: present | ||
|
|
||
| - name: Enable and start Apache service | ||
| ansible.builtin.service: | ||
| name: httpd | ||
| state: started | ||
| enabled: true | ||
|
|
||
| - name: Allow HTTP service in the firewall | ||
| ansible.posix.firewalld: | ||
| service: http | ||
| permanent: true | ||
| state: enabled | ||
| immediate: true | ||
|
|
||
| - name: Confirm Apache is listening on port 80 | ||
| ansible.builtin.wait_for: | ||
| port: "{{ apache_config.port | int }}" | ||
| state: started | ||
| timeout: 10 | ||
| changed_when: false | ||
|
|
||
| - name: Ensure Apache is installed and running | ||
| ansible.builtin.dnf: | ||
| name: httpd | ||
| state: present | ||
|
|
||
| - name: Ensure /var/www/html exists | ||
| ansible.builtin.file: | ||
| path: "{{ html_repo_path }}" | ||
| state: directory | ||
| owner: apache | ||
| group: apache | ||
| mode: "{{ repo_dir_mode }}" | ||
|
|
||
| - name: Restore SELinux context on /var/www/html (if enabled) | ||
| ansible.builtin.command: restorecon -Rv {{ html_repo_path }} | ||
| when: ansible_selinux is defined and ansible_selinux.status == "enabled" | ||
| changed_when: false | ||
|
|
||
| - name: Display success message | ||
| ansible.builtin.debug: | ||
| msg: "Apache successfully installed and serving" |
31 changes: 31 additions & 0 deletions
31
utils/roles/create_slurm_repo/tasks/install_dependencies.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| --- | ||
| - name: Update package metadata | ||
| ansible.builtin.dnf: | ||
| name: "*" | ||
| state: latest | ||
| update_only: true | ||
|
|
||
| - name: Install Slurm build dependencies | ||
| ansible.builtin.yum: | ||
| name: "{{ slurm_dependencies.common_pkg + slurm_dependencies.tools_pkg + slurm_dependencies.slurm_pkg }}" | ||
| state: present | ||
| register: install_result | ||
|
|
||
| - name: Fail play if dependency installation failed | ||
| ansible.builtin.fail: | ||
| msg: "Slurm dependency installation failed on {{ inventory_hostname }}!" | ||
| when: install_result is failed |
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this file if not used |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| --- | ||
| - name: Install sshpass | ||
| ansible.builtin.dnf: | ||
| name: sshpass | ||
| state: present | ||
|
|
||
| - name: Verify sshpass installation | ||
| ansible.builtin.command: sshpass -V | ||
| register: sshpass_version | ||
| changed_when: false | ||
|
|
||
| - name: Display sshpass installation status | ||
| ansible.builtin.debug: | ||
| msg: "sshpass installed successfully" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| --- | ||
| # Play 1 Tasks - Executed on localhost (Control Node) | ||
| - name: Install sshpass | ||
| ansible.builtin.include_tasks: install_sshpass.yml | ||
|
|
||
| - name: Clean up previous build | ||
| ansible.builtin.include_tasks: clean_up.yml | ||
|
|
||
| - name: Create directory structure | ||
| ansible.builtin.include_tasks: create_dirs.yml | ||
|
|
||
| - name: Install dependencies | ||
| ansible.builtin.include_tasks: install_dependencies.yml | ||
|
|
||
| - name: Download Slurm source tarball | ||
| ansible.builtin.include_tasks: download_tarball.yml | ||
|
|
||
| - name: Build Slurm RPM package | ||
| ansible.builtin.include_tasks: build_rpm.yml | ||
|
|
||
| # Play 2 Tasks - Executed on Delegated Apache Host | ||
| - name: Collect installed rpm package facts | ||
| delegate_to: "{{ groups['apache_server'][0] }}" | ||
| run_once: true | ||
| ansible.builtin.package_facts: | ||
|
|
||
| - name: Check if Apache is already installed on apache_server | ||
| ansible.builtin.set_fact: | ||
| apache_installed: "{{ apache_pkg in ansible_facts.packages }}" | ||
| delegate_to: "{{ groups['apache_server'][0] }}" | ||
| run_once: true | ||
|
|
||
| - name: Slurm Repo creation tasks on Apache Server | ||
| delegate_to: "{{ groups['apache_server'][0] }}" | ||
| run_once: true | ||
| block: | ||
|
|
||
| - name: Install and configure Apache (only if not installed) | ||
| ansible.builtin.include_tasks: install_apache.yml | ||
| when: not apache_installed | bool | ||
|
|
||
| - name: Copy Slurm RPMs and create repository | ||
| ansible.builtin.include_tasks: copy_rpms.yml |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a example for inventory