List of changes in the v0.10.1 release
Table of contents
- [Upload input files once, reuse in multiple Tasks](inputreuse)
- [List the available computational resources](listmachines)
Upload input files once, reuse in multiple Tasks <a name="inputreuse"></a>
It’s common that users need to set large files as inputs to multiple simulations (for example, the bathymetry of a coastal area, or the shape of an object they are studying under CFD), requiring them to upload these large files repeatedly.
As a way to save time and costs, a new feature allows users to upload some input files once and reuse them in multiple Tasks:
1. Upload the files to a remote location;
2. Run the task using the stored input files (can also be combined with files uploaded in the moment);
3. Maintenance.
**1. Upload the files to a remote location**
Two new methods are available, to upload from a local folder or a remote one.
For local sources, the user must use the upload method, whose first parameter local_path accepts a directory or a file (.zip or other):
inductiva.storage.upload(
local_path="gromacs-input-example/",
remote_dir="my_remote_directory",
)
If the user wishes to upload files that are stored in a remote location, then they must use upload_from_url method, whose first parameter url accepts only a single file (.zip or other):
inductiva.storage.upload_from_url(
url="https://storage.googleapis.com/inductiva-api-demo-files/test_assets/files.zip",
remote_dir="my_remote_directory",
)
Where Remote_dir is the remote directory where the files will be stored.
**2. Run the task using the stored input files**
The simulator.run includes an extra parameter to point to the remote location where the input files were uploaded to. Here’s an example for Gromacs simulator:
task = gromacs.run(
input_dir="empty_folder",
commands=commands,
on=machine,
remote_assets=["my_remote_directory"]
)
The new parameter remote_assets sets the remote storage location, which must be one of the remote locations that the user previously set as remote_dir in the first step.
The input_dir parameter works the same way as before, meaning that if no remote locations are provided, the input files used come from the local directory in input_dir.
If both parameters are provided and file names in different locations overlap, the input_dir files take priority.
Only one of these parameters is required
More than one source can be provided, as this parameter is a list, and it could be directories or files:
task = gromacs.run(
input_dir="empty_folder",
commands=commands,
on=machine,
remote_assets=["gromacs_bucket/file1.txt", "gromacs_bucket/file2.txt"])
**3. Maintenance**
Finally, here’s how to look into the remote files stored and clean up:
- List the remote files:
- In CLI: inductiva storage ls
- Python instruction: inductiva.storage.listdir()
- Remove the full remote directory:
inductiva.storage.remove_workspace(remote_dir="gromacs_bucket")
- Remove a single file from a remote directory
inductiva.storage.remove_workspace(remote_dir="gromacs_bucket/file1.txt")
List the available computational resources <a name="listmachines"></a>
The user was already able to list the the available computational resources in Inductiva’s cloud, but new Python methods were created to facilitate going through the list of hundreds of options and help the user select the most suitable machine for their tasks, based on their attributes ( vCPUs, memory) and price per hour.
The [Console](https://console.inductiva.ai/machine-groups) offers a user interface to search the available machines by filtering the list by:
- Family - Cloud provider classification based on hardware configurations
- Type - [RAM-to-vCPU ratio](https://docs.inductiva.ai/intro_to_api/computational-infrastructure.html#available-computational-resources)
- Spot - Cheaper options that in return could be [auto shutdown by Cloud provider](https://tutorials.inductiva.ai/generating-synthetic-data/synthetic-data-generation-6.html#spot-instances-one-more-cost-saving-strategy)
- Price per hour for Spot and non-Spot
- Range of number of vCPUs
- Range of memory (GB)
Here’s an example in Python:
machines = inductiva.resources.machine_types.get_available_machine_types(
provider="GCP",
machine_families=["c2", "c2d"],
machine_configs=["standard", "highcpu"],
vcpus_range=(16, 32),
memory_range=(50, 100),
price_range=(0, 0.8),
spot=False)
for m in machines:
print(m.machine_type)
print(m.price)