You need a file called a **Makefile** to tell make what to do.
The makefile tells make how to compile and link a program, it can also tell make how to run miscellaneous commands when explicitly asked (for example, to remove certain files as a clean-up operation)
Lab_Instance dependencies. **"runbefore"** allows you to automatically pull-in other dependencies when using a Lab_Instance service.
**Makefile** is executed with the make command, e.g.
This file should contain a list of tasks and parameters to insert before the specified repos are executed on Lab_Instance.
.make all
[source,bash]
===== run
----
if [ -d swarmlab ]; then
Contains the main list of tasks to be executed by the Lab_Instance service.
cd swarmlab
make all
===== runafter
fi
----
**"runafter"** is the machanism that allows you to to permanently save your data.
===== Makefile
Lab_Instances are mortal, and it’s pretty much routine them to be stoped and deleted.
Lab_Instance dependencies. **"Makefile"** allows you to automatically pull-in other dependencies when using a Lab_Instance service.
If you have something like a data/log file that needs to be saved then at this point make sure to back it up!
This file should contain a list of tasks and parameters to insert before the specified repos are executed on Lab_Instance and a list of tasks to be executed by the Lab_Instance service.
[NOTE]
.Directory_Structure
====
You can use any Script Programming Language you want to automate the execution of Lab_Instance service
The shebang **MUST** be in the first line
.e.g.
[source,bash]
[source,bash]
----
----
#!/usr/bin/perl
all: hello_world generate clean
hello_world:
@echo "Hello World"
use strict;
generate:
use warnings;
@echo "Creating empty text files..."
touch file-{1..10}.txt
print "hello world!\n";
clean:
@echo "Cleaning up..."
rm *.txt
----
----
more info https://www.gnu.org/software/make/manual/html_node/index.html#toc-Overview-of-make[Gnu make]
[NOTE]
====
A simple example can be found https://git.swarmlab.io:3000/swarmlab/examples-mpi[here]