Skip to content

Instantly share code, notes, and snippets.

@cgpu
Forked from alanbchristie/packer-nextflow.yaml
Created March 17, 2021 20:50
Show Gist options
  • Save cgpu/bbb2eec7470d66ea43f1b80115c083b0 to your computer and use it in GitHub Desktop.
Save cgpu/bbb2eec7470d66ea43f1b80115c083b0 to your computer and use it in GitHub Desktop.
An example of a Nextflow Packer file in YAML
---
# Packer machine image configuration for a Nextflow/Docker machine.
#
# To use this file (Packer expects a JSON file) you need to
# use the project's yaml2json module to convert it to JSON.
# From this directory and a Suitable Python (see root's requirements.txt)
# you can run...
#
# ../../../yaml2json.py < nextflow.yml > nextflow.json
#
# Then, to create the AMI for later use, run Packer...
#
# packer build nextflow.json
#
# Your AMI will be seen and available at the end of the Packer run.
variables:
aws_access_key: "{{env `TF_VAR_aws_access_key`}}"
aws_secret_key: "{{env `TF_VAR_aws_secret_key`}}"
aws_user: ec2-user
aws_i_type: t2.micro
our_name: Nextflow Base Image
nextflow_dir: ../../nextflow
base_ami_name: Nextflow
base_description: |-
Amazon Linux 2018.03.0 HVM EBS with Nextflow & Docker
builders:
# AWS Builder - Ireland
- access_key: "{{user `aws_access_key`}}"
secret_key: "{{user `aws_secret_key`}}"
type: amazon-ebs
region: eu-west-1
# Amazon Linux AMI 2018.03.0 (HVM), SSD Volume Type...
source_ami: ami-e4515e0e
instance_type: "{{user `aws_i_type`}}"
ssh_username: "{{user `aws_user`}}"
name: "{{user `our_name`}} Ireland"
ami_name: "{{user `base_ami_name`}}"
ami_description: "{{user `description`}}"
provisioners:
- type: shell
inline:
- sudo yum update -y
# Cloud-Init and Docker
# and nfs-utils for EFS mounting and git...
- sudo yum install -y cloud-init docker nfs-utils git
- sudo service docker start
- sudo usermod -a -G docker ec2-user
# Now move to Java 8...
- sudo yum install -y java-1.8.0
- sudo yum remove -y java-1.7.0-openjdk
# And install Nextflow...
- sudo wget -qO- https://get.nextflow.io | bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment