Getting Started
To use the MMBatch Engine with AWS Batch you need to deploy the MMBatch Managmenet Server (MMS) and ensure that your worker nodes fetch and install the agent and runtime at startup.
You can do this manually or using a CloudFormation template which we provide (we need to allowlist your AccountID).
MMBatch Management Server
How to install the MMS comes down to installing the package nativly or as docker container. After installation a service will be started on the host.
You can change the configuration using the API itself.
Change Port
You can change the port from https to http with this command:
# curl -skX PUT https://0.0.0.0/api/v1/configKV \
-H "Content-Type: application/json" \
-d "{\"kvMap\": {\"addr\":\"http://0.0.0.0:8080\"}}" |jq .
{
"addr": "http://0.0.0.0:8080",
"staticFolder": "mmabWeb",
"log": {
"file": "/var/log/memverge/mmab.log",
"level": "info",
"maxSizeMB": 10,
"maxBackups": 10
},
"security": {
"certFile": "/etc/memverge/mmab/server.crt",
"keyFile": "/etc/memverge/mmab/server.pem",
"cognito": {
"enabled": false,
"userPoolID": "",
"identityPoolID": "",
"clientID": ""
}
},
"ckpt": {
"ckptMode": "unknown",
"ckptImagePath": "",
"ckptInterval": 900000000000,
"ckptFiles": null,
"IRMapScanPaths": null,
"ckptOnSigTerm": false,
"rootFSDiff": true
},
"node": {
"heartbeat": 30000000000,
"ttl": 300000000000
}
}
Enable Checkpoints
After you changed the port (or not) you can enable checkpoints for all connected agents.
$ curl -sk -X PUT http://localhost:8080/api/v1/ckptConfig \
-H "Content-Type: application/json" \
-d '{"ckptMode":"iterative","ckptImagePath":"/mmc-checkpoint","ckptInterval":120000000000,"rootFSDiff":true,"diagnosisMode":true,"ckptOnSigTerm":true}'|jq .
{
"ckptMode": "iterative",
"ckptImagePath": "/mmc-checkpoint",
"ckptInterval": 120000000000,
"ckptFiles": null,
"IRMapScanPaths": null,
"ckptOnSigTerm": true,
"diagnosisMode": true,
"rootFSDiff": true
}
Shared Checkpoint Filesystem
For this little quickstart we use an EFS file-system. You'd need to create a filestem in the same VPC you host your Compute Environment in.
Suggested Filesystem is JuiceFS
EFS is easy to install and it makes for a short UserData in this quick start. Howerver, we recommend JuiceFS as the default checkpoint filesystem.
Install Agent
To install the agent, you need to change the include the UserData into the launch-template which is used within the Compute Enviroment. While we are at it we'll also install awscli which is needed for Nextflow runs.
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="//"
--//
Content-Type: text/cloud-config; charset="us-ascii"
#cloud-config
write_files:
- path: /root/mm-install.sh
permissions: 0744
owner: root
content: |
#!/bin/bash
# Install required dependencies
yum install -y amazon-efs-utils bzip2 wget unzip fuse gcc python3 bash jq
# Define Miniconda URL and installation path
MINICONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh"
INSTALL_PATH="/nextflow_awscli"
# Function to install Miniconda and AWS CLI
install_aws_cli() {
echo "Starting AWS CLI installation..."
wget -q $MINICONDA_URL -O Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -f -p $INSTALL_PATH
$INSTALL_PATH/bin/conda install -c conda-forge -y awscli
rm -f Miniconda3-latest-Linux-x86_64.sh
}
# Attempt AWS CLI installation
install_aws_cli
# Retry if installation fails
if ! $INSTALL_PATH/bin/aws --version &> /dev/null; then
echo "AWS CLI installation failed. Retrying..."
install_aws_cli
if ! $INSTALL_PATH/bin/aws --version &> /dev/null; then
echo "AWS CLI installation failed after retry. Exiting."
exit 1
fi
fi
echo "AWS CLI installed successfully."
mkdir -p /mmc-checkpoint
mount -t efs -o tls fs-03ae6723a107f8310:/ /mmc-checkpoint
# Install MM batch engine
curl -k http://18.143.94.11:8080/api/v1/scripts/install-pagent | bash
systemctl restart docker || true
systemctl restart --no-block ecs
echo "Setup complete."
runcmd:
- bash /root/mm-install.sh
Create CE
Please keep in mind that a Compute Environment (CE) creates a copy of the Launch Template it defined at creation time. If you alter an existing Launch Template you need to clone the CE with the new Launch Template and alter the Job Queue to pick up the new CE.