Here’s a guide to deploying JATOS on Akash using the jatos/jatos Docker image.
What is JATOS?
JATOS (Just Another Tool for Online Studies) is an open-source software designed to run online studies, often used in psychology, social sciences, and behavioral research.
Prerequisites
- Akash Account: Ensure you have an Akash account and wallet set up.
- AKT Tokens: Sufficient tokens for deployment.
- Akash CLI: Installed and configured.
- Akash SDL Template: A customizable SDL file for deploying the
jatos/jatosimage. - Docker Image:
jatos/jatosis the official Docker image for JATOS. - Domain/Static IP: Optional, but helpful if you want to expose the JATOS instance publicly.
Steps to Deploy JATOS on Akash
1. Prepare Your Akash SDL File
Create an SDL file (deploy.yaml) that defines your JATOS deployment. Below is an example configuration:
---version: "2.0"
services: jatos: image: jatos/jatos env: - JATOS_IP=0.0.0.0 - JATOS_PORT=80 expose: - port: 80 as: 80 to: - global accept: [ "http" ] resources: cpu: units: 1 memory: size: 512Mi storage: size: 1Gi
profiles: compute: jatos: resources: cpu: units: 1 memory: size: 512Mi storage: size: 1Gi
placement: westcoast: attributes: region: us-west signedBy: anyOf: - akash1abcdefghijklmnopqrstu # Replace with the provider's public key pricing: jatos: denom: uakt amount: 100
deployment: jatos: westcoast: profile: jatos count: 12. Configure JATOS
Update the following variables in the SDL file if needed:
- Environment Variables:
JATOS_IP: Set to0.0.0.0to listen on all interfaces.JATOS_PORT: Set the port JATOS will run on.- Add more environment variables if needed (e.g.,
DB_HOST,DB_PORTfor an external database).
3. Deploy to Akash
- Validate SDL File: Use the Akash CLI to validate your SDL file.
provider-services tx deployment create deploy.yaml --from <wallet-name>
- Query Deployment: Check the status of your deployment.
provider-services query market lease list --owner <your-address>
- Accept a Bid: Once a provider submits a bid, accept it.
4. Access JATOS
- Once deployed, JATOS will be accessible via the endpoint provided by the Akash provider.
- You can access the application by navigating to
http://<akash-provider-ip>:<port>in your browser.
5. Persisting Data
To ensure persistent data storage:
- Use Akash’s persistent storage options (modify the SDL file under
storage). - Alternatively, connect JATOS to an external database like MySQL or PostgreSQL. Update the environment variables in the SDL file to point to the database.
Post-Deployment Tasks
- Secure JATOS:
- Use HTTPS for secure communication. Consider using a reverse proxy (e.g., Traefik or NGINX) with SSL certificates.
- Monitor Resource Usage:
- Adjust the CPU and memory limits in the SDL file as per your workload.
- Scaling:
- If needed, you can scale JATOS instances by increasing the
countvalue in the deployment section of the SDL file.
- If needed, you can scale JATOS instances by increasing the
Troubleshooting
-
Deployment Fails:
- Ensure the Akash provider supports the required resources.
- Check for errors in the deployment logs.
-
JATOS Not Accessible:
- Verify that the
exposesection in the SDL file is correctly configured. - Ensure the provider has opened the necessary ports.
- Verify that the
-
Database Issues:
- Confirm that the database is accessible from the Akash deployment.
- Double-check the database credentials in the environment variables.
Useful Links
By following this guide, you should be able to deploy JATOS on Akash and run your online studies effectively.