GithubHelp home page GithubHelp logo

rajibhossen / flux-terraform-ami Goto Github PK

View Code? Open in Web Editor NEW

This project forked from converged-computing/flux-terraform-ami

0.0 0.0 0.0 48 KB

Terraform + packer build setup for Flux Framework deployment on AWS (under development)

License: MIT License

Shell 69.35% Makefile 6.40% HCL 24.25%

flux-terraform-ami's Introduction

Flux Terraform AMI

Terraform module to create Amazon Machine Images (AMI) for Flux Framework HashiCorp Packer and AWS CodeBuild. We are mirroring functionality from GoogleCloudPlatform/scientific-computing-examples. Thank you Google, we love you!

Usage

Build Images with Packer

Let's first go into build-images to use packer to build our images. You'll need to export your AWS credentials in the environment:

export AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

You'll need to first install packer You can use the Makefile there to build all (or a select set of) images.

cd ./build-images
$ make
# this builds a shared node setup
$ make node

Note that the build takes about 50 minutes (why we use an AMI and don't build Flux on the fly!

==> flux-compute.amazon-ebs.flux-compute: Deleting temporary keypair...
Build 'flux-compute.amazon-ebs.flux-compute' finished after 50 minutes 39 seconds.

==> Wait completed after 50 minutes 39 seconds

==> Builds finished. The artifacts of successful builds are:
--> flux-compute.amazon-ebs.flux-compute: AMIs were created:
us-east-1: ami-0ff535566e7c13e8c

make[1]: Leaving directory '/home/vanessa/Desktop/Code/flux/terraform-ami/build-images/node'

A previous design (building separate images for login, compute, and manager) was started, but not finished in lieu of the simpler design. It's included in build-images/multi for those interested.

Deploy with Terraform

Once you have images, choose a directory under examples to deploy from:

$ cd examples/autoscale

And then init and build:

$ make init
$ make fmt
$ make validate
$ make build

And they all can be run with make:

$ make

You can then shell into any node, and check the status of Flux. I usually grab the instance name via "Connect" in the portal, but you could likely use the AWS client for this too.

$ ssh -o 'IdentitiesOnly yes' -i "mykey.pem" [email protected]

Check the cluster status, the overlay status, and try running a job:

$ flux resource list
     STATE NNODES   NCORES NODELIST
      free      2        2 i-012fe4a110e14da1b.ec2.internal,i-0354d878a3fd6b017.ec2.internal
 allocated      0        0 
      down      0        0 
[rocky@i-012fe4a110e14da1b ~]$ flux run -N 2 hostname
i-012fe4a110e14da1b.ec2.internal
i-0354d878a3fd6b017.ec2.internal

You can look at the startup script logs like this if you need to debug.

$ cat /var/log/cloud-init-output.log

That's it. Enjoy!

License

HPCIC DevTools is distributed under the terms of the MIT license. All new contributions must be made under this license.

See LICENSE, COPYRIGHT, and NOTICE for details.

SPDX-License-Identifier: (MIT)

LLNL-CODE- 842614

flux-terraform-ami's People

Contributors

rajibhossen avatar vsoch avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.