The Akash Network provides a decentralized cloud platform where you can deploy containerized applications. This guide will walk you through deploying MATLAB on Akash using the official MathWorks MATLAB Docker image.
Prerequisites
-
MATLAB License:
- MATLAB requires a valid license. You will need your license server information or network license key for deployment.
-
Akash CLI Setup:
- Install and configure the Akash CLI.
- Fund your Akash wallet with AKT tokens for deployment.
-
Docker Knowledge:
- Familiarity with Docker containers is recommended.
-
Access to MATLAB Docker Image:
- MathWorks provides the MATLAB Docker image on Docker Hub.
- You need Docker Hub credentials to access the image.
Step 1: Pull the MATLAB Docker Image
-
Log in to Docker Hub with your credentials:
docker login -
Pull the MATLAB Docker image:
docker pull mathworks/matlab:latest
Step 2: Prepare the SDL File for Akash Deployment
-
Create an SDL file (
deploy.yml
) for MATLAB. Use the following template:version: "2.0"services:matlab:image: mathworks/matlab:latestargs:- --licenseserver <LICENSE_SERVER_HOST>:<LICENSE_SERVER_PORT>env:- MATHWORKS_LICENSE_FILE=<LICENSE_SERVER_HOST>:<LICENSE_SERVER_PORT>expose:- port: 8888as: 8888to:- globalresources:cpu:units: 500memory:size: 512Mistorage:size: 1Giprofiles:compute:matlab:resources:cpu:units: 500memory:size: 512Mistorage:size: 1Gideployment:matlab:matlab:profile: matlabcount: 1```- Replace `<LICENSE_SERVER_HOST>` and `<LICENSE_SERVER_PORT>` with your MATLAB license server details.
Step 3: Deploy to Akash
-
Create a Deployment:
- Submit your SDL file to Akash:
provider-services tx deployment create deploy.yml --from <your_account>
- Submit your SDL file to Akash:
-
Find a Provider:
- Query for providers willing to host your deployment:
provider-services query market bid list --owner <your_account>
- Query for providers willing to host your deployment:
-
Accept a Lease:
- Accept a lease from a provider:
provider-services tx market lease create --from <your_account> --dseq <deployment_sequence>
- Accept a lease from a provider:
-
Access Your Deployment:
-
Get the public endpoint of your deployment:
provider-services query market lease get --dseq <deployment_sequence> -
Use the endpoint to access your MATLAB application.
-
Step 4: Verify MATLAB Deployment
- Open a browser and navigate to the public endpoint (e.g.,
http://<endpoint>:8888
). - Verify that MATLAB is running and functional.
Step 5: Monitor and Manage Deployment
-
Use the Akash CLI to check logs and manage your deployment:
provider-services logs --dseq <deployment_sequence> --from <your_account> -
If you need to update or terminate the deployment:
provider-services tx deployment close --dseq <deployment_sequence> --from <your_account>
Notes
-
Firewall Configuration: Ensure the port
8888
is accessible globally or restrict it based on your needs. -
MATLAB Licensing: MATLAB requires a valid license at runtime. The deployment will fail if the license is invalid or inaccessible.
-
Resource Optimization: Adjust CPU, memory, and storage in the
resources
section of the SDL file based on your workload.
This guide provides a basic setup to deploy MATLAB on Akash. Depending on your specific use case, you can further customize the deployment by modifying the SDL file or integrating additional services.