-
Notifications
You must be signed in to change notification settings - Fork 19
Allow arbitrary hostnames #35
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4a885dd
allow arbitrary hostnames
sjpb 0acba02
WIP (sinfo shows no nodes)
sjpb e231c24
add network and verification
sjpb d265714
add no-group tests
sjpb f644c6e
add tests 2, 3 and local install instructions
sjpb 43cd283
Merge pull request #37 from stackhpc/molecule
sjpb 5df8df8
add molecule config to travis
sjpb c2e0b5d
fix travis config typo
sjpb b7df98a
fix py2/py3 issue
sjpb 136adf7
address @brtknr on molecule requirements
sjpb a97118f
set RealMemory to slurm default to avoid falling through from previou…
sjpb 919f0b2
Merge pull request #38 from stackhpc/molecule-travis
sjpb d987433
Merge branch 'master' into anyhostname
sjpb f49db32
tweak molecule test descriptions in README
sjpb 5483689
add note re. ram_mb default
sjpb 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
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,33 @@ | ||
--- | ||
# Based on ansible-lint config | ||
extends: default | ||
|
||
rules: | ||
braces: | ||
max-spaces-inside: 1 | ||
level: error | ||
brackets: | ||
max-spaces-inside: 1 | ||
level: error | ||
colons: | ||
max-spaces-after: -1 | ||
level: error | ||
commas: | ||
max-spaces-after: -1 | ||
level: error | ||
comments: disable | ||
comments-indentation: disable | ||
document-start: disable | ||
empty-lines: | ||
max: 3 | ||
level: error | ||
hyphens: | ||
level: error | ||
indentation: disable | ||
key-duplicates: enable | ||
line-length: disable | ||
new-line-at-end-of-file: disable | ||
new-lines: | ||
type: unix | ||
trailing-spaces: disable | ||
truthy: disable |
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
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
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,39 @@ | ||
Molecule tests for the role. | ||
|
||
# Test Matrix | ||
|
||
Test options "flow down" through table unless changed. | ||
|
||
Test | # Partitions | Groups in partitions? | Other | ||
--- | --- | --- | --- | ||
test1 | 1 | N | 2x compute node, sequential names (default test) | ||
test1b | 1 | N | 1x compute node | ||
test1c | 1 | N | 2x compute nodes, nonsequential names | ||
test2 | 2 | N | 4x compute node, sequential names | ||
test3 | 1 | Y | - | ||
|
||
# Local Installation & Running | ||
|
||
Local installation on a Centos7 machine looks like: | ||
|
||
sudo yum install -y gcc python3-pip python3-devel openssl-devel python3-libselinux | ||
sudo yum install -y docker-ce docker-ce-cli containerd.io | ||
sudo yum install -y yum-utils | ||
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | ||
sudo yum install -y docker-ce docker-ce-cli containerd.io | ||
pip3 install -r molecule/requirements.txt --user | ||
|
||
sudo systemctl start docker | ||
sudo usermod -aG docker ${USER} | ||
newgrp docker | ||
docker run hello-world # test docker works without sudo | ||
|
||
sudo yum install -y git | ||
git clone git@github.com:stackhpc/ansible-role-openhpc.git | ||
cd ansible-role-openhpc/ | ||
|
||
Then to run all tests: | ||
|
||
cd ansible-role-openhpc/ | ||
molecule test --all | ||
|
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 @@ | ||
test1 |
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,4 @@ | ||
pip | ||
setuptools | ||
molecule[lint] | ||
docker |
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,22 @@ | ||
******* | ||
Docker driver installation guide | ||
******* | ||
|
||
Requirements | ||
============ | ||
|
||
* Docker Engine | ||
|
||
Install | ||
======= | ||
|
||
Please refer to the `Virtual environment`_ documentation for installation best | ||
practices. If not using a virtual environment, please consider passing the | ||
widely recommended `'--user' flag`_ when invoking ``pip``. | ||
|
||
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/ | ||
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site | ||
|
||
.. code-block:: bash | ||
|
||
$ python3 -m pip install 'molecule[docker]' |
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,22 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: Install OpenHPC repository | ||
yum: | ||
name: "https://github.com/openhpc/ohpc/releases/download/v1.3.GA/ohpc-release-1.3-1.el7.x86_64.rpm" | ||
state: present | ||
- name: "Include ansible-role-openhpc" | ||
include_role: | ||
name: "ansible-role-openhpc/" | ||
vars: | ||
openhpc_enable: | ||
control: "{{ inventory_hostname in groups['testohpc_login'] }}" | ||
batch: "{{ inventory_hostname in groups['testohpc_compute'] }}" | ||
runtime: true | ||
openhpc_slurm_service_enabled: true | ||
openhpc_slurm_control_host: "{{ groups['testohpc_login'] | first }}" | ||
openhpc_slurm_partitions: | ||
- name: "compute" | ||
openhpc_cluster_name: testohpc | ||
|
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,48 @@ | ||
--- | ||
name: single partition, group is partition | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: testohpc-login-0 | ||
image: docker.io/pycontribs/centos:7 | ||
pre_build_image: true | ||
groups: | ||
- testohpc_login | ||
command: /sbin/init | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
networks: | ||
- name: net1 | ||
- name: testohpc-compute-0 | ||
image: docker.io/pycontribs/centos:7 | ||
pre_build_image: true | ||
groups: | ||
- testohpc_compute | ||
command: /sbin/init | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
networks: | ||
- name: net1 | ||
- name: testohpc-compute-1 | ||
image: docker.io/pycontribs/centos:7 | ||
pre_build_image: true | ||
groups: | ||
- testohpc_compute | ||
command: /sbin/init | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
networks: | ||
- name: net1 | ||
provisioner: | ||
name: ansible | ||
verifier: | ||
name: ansible |
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,12 @@ | ||
--- | ||
|
||
- name: Check slurm hostlist | ||
hosts: testohpc_login | ||
tasks: | ||
- name: Get slurm partition info | ||
command: sinfo -h | ||
register: sinfo | ||
- name: | ||
assert: # PARTITION AVAIL TIMELIMIT NODES STATE NODELIST | ||
that: "sinfo.stdout_lines == ['compute* up 60-00:00:0 2 idle testohpc-compute-[0-1]']" | ||
fail_msg: "FAILED - actual value: {{ sinfo.stdout_lines }}" |
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,22 @@ | ||
******* | ||
Docker driver installation guide | ||
******* | ||
|
||
Requirements | ||
============ | ||
|
||
* Docker Engine | ||
|
||
Install | ||
======= | ||
|
||
Please refer to the `Virtual environment`_ documentation for installation best | ||
practices. If not using a virtual environment, please consider passing the | ||
widely recommended `'--user' flag`_ when invoking ``pip``. | ||
|
||
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/ | ||
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site | ||
|
||
.. code-block:: bash | ||
|
||
$ python3 -m pip install 'molecule[docker]' |
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,22 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: Install OpenHPC repository | ||
yum: | ||
name: "https://github.com/openhpc/ohpc/releases/download/v1.3.GA/ohpc-release-1.3-1.el7.x86_64.rpm" | ||
state: present | ||
- name: "Include ansible-role-openhpc" | ||
include_role: | ||
name: "ansible-role-openhpc/" | ||
vars: | ||
openhpc_enable: | ||
control: "{{ inventory_hostname in groups['testohpc_login'] }}" | ||
batch: "{{ inventory_hostname in groups['testohpc_compute'] }}" | ||
runtime: true | ||
openhpc_slurm_service_enabled: true | ||
openhpc_slurm_control_host: "{{ groups['testohpc_login'] | first }}" | ||
openhpc_slurm_partitions: | ||
- name: "compute" | ||
openhpc_cluster_name: testohpc | ||
|
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,37 @@ | ||
--- | ||
name: single partition, group is partition, single node | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: testohpc-login-0 | ||
image: docker.io/pycontribs/centos:7 | ||
pre_build_image: true | ||
groups: | ||
- testohpc_login | ||
command: /sbin/init | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
networks: | ||
- name: net1 | ||
- name: testohpc-compute-0 | ||
image: docker.io/pycontribs/centos:7 | ||
pre_build_image: true | ||
groups: | ||
- testohpc_compute | ||
command: /sbin/init | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
networks: | ||
- name: net1 | ||
provisioner: | ||
name: ansible | ||
verifier: | ||
name: ansible |
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,12 @@ | ||
--- | ||
|
||
- name: Check slurm hostlist | ||
hosts: testohpc_login | ||
tasks: | ||
- name: Get slurm partition info | ||
command: sinfo -h | ||
register: sinfo | ||
- name: | ||
assert: # PARTITION AVAIL TIMELIMIT NODES STATE NODELIST | ||
that: "sinfo.stdout_lines == ['compute* up 60-00:00:0 1 idle testohpc-compute-0']" | ||
fail_msg: "FAILED - actual value: {{ sinfo.stdout_lines }}" |
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,22 @@ | ||
******* | ||
Docker driver installation guide | ||
******* | ||
|
||
Requirements | ||
============ | ||
|
||
* Docker Engine | ||
|
||
Install | ||
======= | ||
|
||
Please refer to the `Virtual environment`_ documentation for installation best | ||
practices. If not using a virtual environment, please consider passing the | ||
widely recommended `'--user' flag`_ when invoking ``pip``. | ||
|
||
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/ | ||
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site | ||
|
||
.. code-block:: bash | ||
|
||
$ python3 -m pip install 'molecule[docker]' |
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.
Uh oh!
There was an error while loading. Please reload this page.