Workflow: AWS¶
This workflow is based on setting up the action server and client for an AWS cluster created as explained in the Cloud AWS Workflow.
Server Setup¶
Install Action Server¶
To install the action server on CentOS 7 x86_64, simply install the package with yum:
yum install flight-action-api
Note
This assumes that the OpenFlight Package Repositories are configured on the node
Install Power Scripts¶
To install the power scripts to jumpstart research environment management, install with yum:
yum install flight-action-api-power
Install AWS CLI¶
For managing the power state of the nodes, the AWS CLI will need to be installed with:
$ yum install awscli
Once installed, authenticate with AWS details:
$ aws configure
Add Nodes¶
Nodes are added to the config file at /opt/flight/opt/action-api/config/nodes.yaml
, below is an example of the node configuration for a simple 3 node cluster consisting of a gateway and two compute nodes:
gateway1:
ranks: [aws]
ec2_id: i-1234567890
aws_region: eu-west-2
node01:
ranks: [aws]
ec2_id: i-2345678901
aws_region: eu-west-2
node02:
ranks: [aws]
ec2_id: i-3456789012
aws_region: eu-west-2
Start Service¶
The OpenFlight Service utility is used to start the service:
$ flight service start action-api
Note
The general OpenFlight webserver service also needs to be running, this can be launched with flight service start www
Enable Service¶
The OpenFlight Service utility is used to enable the service:
$ flight service enable action-api
Note
In order to integrate the service enabling with systemd (to ensure the service starts at boot), the flight-plugin-system-systemd-service
package will need to be installed
Generate Token¶
To generate a 30-day authentication token for the client, run:
$ flight action-api generate-token
eyJhbGciOiJIUzI1NiJ9.eyJhZG1pbiI6bnVsbCwiZXhwIjoxNTgxODcyNjA2fQ.WXm-F07bAl78UTZHAsFKLXzYokBwVfgMabzIMgNfc5Y
This will return a token that can be entered into the config of a power client to authenticate against this server.
Client Setup¶
Install Action Client¶
To install the action client on CentOS 7 x86_64, simply install the package with yum:
yum install flight-action
Note
This assumes that the OpenFlight Package Repositories are configured on the node
Add Security Token¶
Add security token to /opt/flight/opt/action/etc/config.yaml
so the file looks similar to the following:
base_url: https://gateway1/action
jwt_token: eyJhbGciOiJIUzI1NiJ9.eyJhZG1pbiI6bnVsbCwiZXhwIjoxNTgxODcyNjA2fQ.WXm-F07bAl78UTZHAsFKLXzYokBwVfgMabzIMgNfc5Y
Note
If using a self-signed certificate then add verify_ssl: false
to the config
List Available Nodes¶
A list of the configured nodes can be seen from the client as so:
$ flight action estate-list
gateway1
node01
node02
Note
The flight
command can be executed with it’s full path (/opt/flight/bin/flight
) in the case that flight-starter
has not been installed to add the command to the environment.
Check Power Status of Nodes¶
To check the power status of all nodes, simply:
$ flight power status -g gateway1,node0[1-2]
gateway1: ON
node01: ON
node02: ON
Power Off a Node¶
A node can be powered off as follows:
$ flight power off node02
Power off node02, confirm to proceed [y/n]?
y
OK
Restart a Node¶
To power cycle a node, simply:
$ flight power cycle node02
Power cycle node02, confirm to proceed [y/n]?
y
OK