Part 1: Running a simple helloworld
Setting up a Crypto Wallet
Before using the platform, you need to set up a crypto wallet to manage your credits. We recommend using either MetaMask or Core Wallet.
Acquiring Free Credits
To get started, you can acquire some free credits by applying through our form.
Hello World workflow
A DeepSquare workflow file serves as the blueprint of your operations, detailing the resources your application needs and the sequence of steps it must follow to execute its tasks. As the core of running workloads on DeepSquare, these workflow files form the backbone of any operation within the platform.
## Allow DeepSquare logging
enableLogging: true
## Allocate resources
resources:
## A task is one process. Multiple task will allocate multiple processes.
tasks: 1
## Number of cpu physical thread per process.
cpusPerTask: 1
## Memory (MB) per cpu physical thread.
memPerCpu: 1024
## GPU (graphical process unit) for the whole job.
gpus: 0
## The job content
steps:
## The steps of the jobs which are run sequentially.
- name: 'hello-world'
run:
command: echo "hello world"
resources
: This initial block in the workflow file dictates the resource allocation for the entire job. It represents a high-level request for computational resources you'll need for all your tasks.tasks
: Within theresources
block, the tasks field specifies the number of independent units of work, or tasks, your application needs to run. Each task runs in parallel, and the scheduler assigns it to the available computational resources.cpusPerTask
: This field determines the number of CPU resources each task will have access to.memPerCpu
: This represents the amount of memory (in MB) allocated for each CPU.gpus
: This field designates the number of GPU resources for the whole job. If your tasks don't require GPU processing power, this can be set to 0.steps
: This block is where you outline the specific actions your tasks will take. Steps can be thought of as individual instructions that will be executed by your tasks, utilizing the resources defined above.command
: Within each step, you specify a command. This is the exact operation that should be performed during the step. It could be a script to run, a function to call, or any other operation your application requires.
The enableLogging
field, when set to true, sends the application logs to the DeepSquare logging system. This allows you to monitor the progress of your tasks.
So, in a nutshell, a workflow file in DeepSquare provides a structured way for you to define what resources you need, how many parallel tasks you want to run, and what each task should do.
Executing the workflow
To launch a workflow file, you have a couple of choices:
- Use the DeepSquare CLI which a TUI or CLI or Go library, that can be used to interact with the DeepSquare Grid.
- Visit DeepSquare Dev App, paste the workflow, and run it.
- Use the DeepSquare SDK which provides a simple and abstracted interface from web3 to the DeepSquare Grid.
With the DeepSquare portal
Use the Dev App
- Visit DeepSquare Dev App.
- Log-in using your crypto wallet.
- Make sure you have some credits (100 is the minimum entry cost) and some SQUARE tokens to pay for transactions.
- In the Workflow Editor, write or paste your workflow.
- If your workflow is valid, click Submit to run the job.
Downloading Results and Review Logs
- In the Job Status page, locate your job based on its name.
- Monitor the progress of your job by checking its status.
- Click on the Logs button in order to read the real-time logs.
- Once your job completes, you can view the results, logs, and other output files in the designated output storage.
With DeepSquare's Dev application, you can efficiently create, manage, and run custom workflows to cater to a wide range of high-performance computing demands.
With the SDK
Visit the DeepSquare SDK documentation page for a detailed walkthrough on setting up and getting started with your first SDK-based application.