Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #87 from jsteel44/readme
Browse files Browse the repository at this point in the history
Change some variables to user-defined options
  • Loading branch information
jsteel44 authored Sep 2, 2019
2 parents 28a2648 + ba917a4 commit 9e3d596
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
27 changes: 14 additions & 13 deletions dac-ansible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,26 @@

Install data-acc demo with ansible. It creates a bunch of OpenStack VMs, then uses ansible to install a development data-acc enviroment.

To run this set of playbooks, first we create some VMs in OpenStack.
## Setup

Install Ansible and the OpenStack SDK, eg in a Python virtual environment:

virtualenv .venv
. .venv/bin/activate
pip install -U pip
pip install -U ansible openstacksdk

Pull in Ansible role dependencies:

ansible-galaxy install -r requirements.yml

Source your OpenStack RC, eg:

. openrc

Edit create-servers.py to set your NETWORK_NAME and KEYPAIR_NAME and then run:
Create OpenStack VMs:

./create-servers.py > hosts
./create-servers.py -k KEYPAIR_NAME -n NETWORK_NAME > hosts

Once the VMs are created, you can now use ansible to deploy the dev environment:

Expand All @@ -33,16 +44,6 @@ Once the ansible has finished, you can login and try a slurm test:
squeue
scontrol show burstbuffer

## Install notes

You may find this useful to run the above ansible-playbook command:

virtualenv .venv
. .venv/bin/activate
pip install -U pip
pip install -U ansible openstacksdk
ansible-galaxy install -r requirements.yml

## Debugging Guide

When trying slurm-test.sh or similar, here are some debugging tips.
Expand Down
12 changes: 9 additions & 3 deletions dac-ansible/create-servers.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
#!/usr/bin/env python

import openstack
from optparse import OptionParser

parser = OptionParser()
parser.add_option("-k", "--key", dest="key",
help="SSH key pair name", metavar="KEYPAIR_NAME")
parser.add_option("-n", "--network", dest="network",
help="Network name", metavar="NETWORK_NAME")
(options, args) = parser.parse_args()

IMAGE_NAME = "CentOS-7-x86_64-GenericCloud"
FLAVOR_NAME = "C1.vss.tiny"
NETWORK_NAME = "WCDC-Data43"
KEYPAIR_NAME = "usual"

NETWORK_NAME = options.network
KEYPAIR_NAME = options.key

def get_connection():
# openstack.enable_logging(debug=True)
Expand Down

0 comments on commit 9e3d596

Please sign in to comment.