Client-level interface for interacting with ET Engine
Project description
ET Engine Python SDK
The official SDK for building ET Engine applications.
Resource | Link |
---|---|
Command-Line Interface (CLI) tool | https://github.com/exploretech-ai/et-engine-cli |
ET Engine Web App | https://engine.exploretech.ai |
Comprehensive Documentation | https://docs.exploretech.ai |
About ExploreTech | https://exploretech.ai |
Quick Start
First, make sure you have an account on the ET Engine Web App and that you have a valid API key exported to the environment variable ET_ENGINE_API_KEY
. See the tutorial for more details.
Once you have your API key set, ensure your Python version is >=3.11.9 and install the package using pip.
pip install et-engine
Open up the Python interpreter or create a new script and run the following commands.
import et_engine as et
# Connect to the client
engine = et.Engine()
# Create a filesystem
my_first_filesystem = et.filesystems.create("my-first-filesystem")
# Upload any text file to the filesystem
my_first_filesystem.upload("path/to/local/file.txt", "hello-world.txt")
# Check to see if the "hello-world.txt" file was uploaded
filesystem_contents = my_first_filesystem.ls()
print(filesystem_contents)
In your browser nagivate to https://engine.exploretech.ai/filesystems to see your new filesystem with a file named hello-world.txt
.
Creating and Running Tools
We suggest you create and push tools using the ET Engine CLI. For this section, we'll assume you have created a tool named hello-world-tool
that takes a name
argument and writes a text file named hello.txt
with the contents f"Hello, {name}"
import et_engine as et
engine = et.Engine()
# Create and connect to a filesystem
my_filesystem = engine.filesystems.create("hello-world-filesystem")
# Connect to the tool
hello = engine.tools.connect("hello-world-tool")
# Define the hardware connection that lets the tool talk to the filesystem
hello_world_hardware = et.Hardware(filesystem_list=[my_filesystem])
# Run the tool, setting the 'name' argument and connecting to your filesystem
job = hello(name="John", hardware=hello_world_hardware)
# Wait for the job to finish
job.wait()
If everything went well, your hello-world-filesystem
will contain a file named hello.txt
with the contents Hello, John!
Running a Monte Carlo simulation
Let's assume you have a tool named navier-stokes-simulation
that performs a complex fluid dynamics simulation, and 100 configuration files in a filesystem named config/configuration_${i}.txt
. To perform a parallelized Monte Carlo simulation on these 100 configuration files, you can use the run_batch
feature. An example script might look something like this.
import et_engine as et
engine = et.Engine()
# Connect to your Engine resources
monte_carlo_filesystem = et.filesystems.create("monte-carlo")
navier_stokes = engine.tools.connect("navier-stokes-simulation")
# Run each simulation with 16 vCPU & 64 GB Memory
monte_carlo_hardware = et.Hardware(
filesystem_list=[
monte_carlo_filesystem
],
cpu=16, # vCPU
memory=64*1024 # MB
)
# Define the configuration files
configuration_files = [f"config/configuration_{i}.txt" for i in range(100)]
monte_carlo_parameters = [{"config": c} for c in configuration_files]
# Launch the Monte Carlo simulation
batch = navier_stokes.run_batch(
variable_kwargs=monte_carlo_parameters,
hardware=monte_carlo_hardware
)
batch.wait()
Contributing
We welcome contributions from the community. See CONTRIBUTING.md
for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file et_engine-0.0.0.tar.gz
.
File metadata
- Download URL: et_engine-0.0.0.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 776eaa7960fa6fb236b8ce57f5e06b9b2c60eb3d61f15b5bb0bf4ae156de70b7 |
|
MD5 | 675bb64490fcd7fc980b8ac0dcbe8471 |
|
BLAKE2b-256 | b4f0f40880bc3c3b6f6a1e8c57d82a12390552d4078cd467d9491738ea51f3e7 |
File details
Details for the file et_engine-0.0.0-py3-none-any.whl
.
File metadata
- Download URL: et_engine-0.0.0-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3dd19785145e15b268fcfa735cfe3e7364962158676561220112c5d855e7b92 |
|
MD5 | aa7db6823411a5be20ea2e59334c0a3b |
|
BLAKE2b-256 | d20c61ebe7c734bed059e807c8f1cd17fbb8b6754ab61b29c654414f5e69492f |