flux-framework Cluster
The flux-cluster.yaml blueprint describes a flux-framework cluster where flux is deployed as the native resource manager as described in the Flux Administrator's Guide.
The cluster includes
- A management node
- A login node
- Four compute nodes each of which is an instance of the c2-standard-16 machine type
NOTE: prior to running this Cluster Toolkit example the Flux Framework GCP Images must be created in your project.
Before provisioning any infrastructure in this project you should follow the Toolkit guidance to enable APIs and establish minimum resource quotas. In particular, the following APIs should be enabled
- compute.googleapis.com (Google Compute Engine)
- secretmanager.googleapis.com (Secret manager, for secure mode)
Use gcluster to provision the blueprint
gcluster create community/examples/flux-framework --vars project_id=<<PROJECT_ID>>This will create a directory containing Terraform modules.
Follow gcluster instructions to deploy the cluster
terraform -chdir=flux-fw-cluster/primary init
terraform -chdir=flux-fw-cluster/primary validate
terraform -chdir=flux-fw-cluster/primary apply
Access the cluster via the login node from the command line.
gcloud compute ssh gfluxfw-login-001Or via the Google Cloud Console
-
Open the following URL in a new tab.
https://console.cloud.google.com/compute
This will take you to Compute Engine > VM instances in the Google Cloud Console.
Select the project in which the flux-framework cluster was provisioned.
-
Click on the SSH button associated with the gfluxfw-login-001 instance to open a window with a terminal into the cluster login node.
View the cluster resources
flux resource listThe output will look similar to
STATE PROPERTIES NNODES NCORES NODELIST
free x86-64,e2 1 2 gfluxfw-login-001
free x86-64,c2 4 32 gfluxfw-compute-[001-004]
allocated 0 0
down 0 0
Run a simple job that executes the hostname command on each of the cluster compute nodes
flux run -N4 --requires=c2 hostnameThe output will be something like
gfluxfw-compute-001
gfluxfw-compute-004
gfluxfw-compute-003
gfluxfw-compute-002
Create a two node allocation
flux alloc -N2 --requires=c2View the resources associated with the allocation
flux resource listThe output will look similar to
STATE PROPERTIES NNODES NCORES NODELIST
free x86-64,c2 2 16 gfluxfw-compute-[003-004]
allocated 0 0
down 0 0
Observe the impact on cluster resources
flux --parent resource listYields output like
STATE PROPERTIES NNODES NCORES NODELIST
free x86-64,e2 1 2 gfluxfw-login-001
free x86-64,c2 2 16 gfluxfw-compute-[001-002]
allocated x86-64,c2 2 16 gfluxfw-compute-[003-004]
down 0 0
Use ^d to release the resources in the allocation and return to the login node.
To learn how to make the best use of flux follow the Introduction to Flux tutorial.