Skip to content

Commit

Permalink
add aws readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ryichando committed Dec 24, 2024
1 parent 2653f7f commit 587446a
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 5 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Published in [ACM Transactions on Graphics (TOG)](https://dl.acm.org/doi/abs/10.
- [📦 Deploying on vast.ai](#-deploying-on-vastai)
- [📦 Deploying on RunPod](#-deploying-on-runpod)
- [📦 Deploying on Scaleway](#-deploying-on-scaleway)
- [📦 Deploying on Amazon Web Services](#-deploying-on-amazon-web-services)
- [📦 Deploying on Google Compute Engine](#-deploying-on-google-compute-engine)
- [🧑‍💻 Setting Up Your Development Environment](#-setting-up-your-development-environment)
- [📃 License](#-license)
Expand Down Expand Up @@ -85,7 +86,7 @@ Our Python interface is designed with the following principles in mind:

- **🚫 No Mesh Data**: Preparing mesh data using external tools can be cumbersome. Our frontend minimizes this effort by allowing meshes to be created on the fly or downloaded when needed.

- **🔗 Method Chaining**: We adopt the method chaining style from JavaScript, making the API intuitive and easy to use.
- **🔗 Method Chaining**: We adopt the method chaining style from JavaScript, making the API intuitive and easy to understand.

- **📦 Single Import for Everything**: All frontend features are accessible by simply importing with `from frontend import App`.

Expand Down Expand Up @@ -399,9 +400,17 @@ You can deploy our solver on a RunPod instance. To do this, we need to select an
- Select type `L4-1-24G` or `GPU-3070-S`
- Choose `Ubuntu Jammy GPU OS 12`
- *Do not skip* the Docker container creation in the installation process; it is required.
- This setup costs approximately €0.76 per hour.
- CLI instructions are described in [[Markdown]](./articles/cloud.md#-scaleway).
### 📦 Deploying on [Amazon Web Services](https://aws.amazon.com/en/)
- Amazon Machine Image (AMI): `Deep Learning Base OSS Nvidia Driver GPU AMI (Ubuntu 22.04)`
- Instance Type: `g6.2xlarge` (Recommended)
- This setup costs around $1 per hour.
- *Do not skip* the Docker container creation in the installation process; it is required.
### 📦 Deploying on [Google Compute Engine](https://cloud.google.com/products/compute)
- Select `GPUs`. We recommend the GPU type `NVIDIA L4` because it's affordable and accessible, as it does not require a high quota. You may select `T4` instead for testing purposes.
Expand Down
2 changes: 1 addition & 1 deletion articles/cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ rm -rf .runpod
Set up your Scaleway CLI by following 📚 [this guide](https://www.scaleway.com/en/cli/).
Also, register your public SSH key.
Here’s how to create a GPU instance and SSH into the instance with port forwarding.
As of late 2024, this setup costs approximately €0.76 per hour.
This setup costs approximately €0.76 per hour.

```bash
# set zone
Expand Down
48 changes: 46 additions & 2 deletions examples/hang.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@
"param = app.session.param().set(\"dt\",0.001)\n",
"param.set(\"strain-limit-eps\", 0.005).set(\"strain-limit-tau\", 0.005)\n",
"param.set(\"frames\",200)\n",
"param.dyn(\"gravity\").time(1).hold().time(1.1).change(9.8).time(2.0).change(-9.8)\n",
"\n",
"param.dyn(\"gravity\").time(1).hold().time(1.1).change(9.8).time(2.0).change(-9.8);"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7284cf76-4110-41a0-88d2-6e028fe45aba",
"metadata": {},
"outputs": [],
"source": [
"session = app.session.create(\"two-pins-hang\").init(fixed)\n",
"session.start(param).preview();\n",
"session.stream();"
Expand Down Expand Up @@ -72,6 +80,42 @@
"# export all simulated frames\n",
"session.export_animation(f\"export/{session.info.name}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b318af59-58be-4ad4-ae4b-63af01e225fe",
"metadata": {},
"outputs": [],
"source": [
"param.set(\"dt\",0.1).set(\"enable-retry\",True)\n",
"\n",
"session = app.session.create(\"two-pins-hang-dt-01\").init(fixed)\n",
"session.start(param).preview();\n",
"session.stream();"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2887e9da-aa29-4468-9ace-62c93a7c25ef",
"metadata": {},
"outputs": [],
"source": [
"# run this cell after sufficnt frames are simulated\n",
"session.animate();"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9105a519-6aaa-4b59-9c5c-0bf96c081fc3",
"metadata": {},
"outputs": [],
"source": [
"# this is for CI\n",
"assert session.finished()"
]
}
],
"metadata": {
Expand Down
5 changes: 4 additions & 1 deletion src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ impl Backend {
}

pub fn run(&mut self, args: &Args, dataset: DataSet, mut param: ParamSet, scene: Scene) {
let finished_path = std::path::Path::new(args.output.as_str()).join("finished.txt");
if finished_path.exists() {
std::fs::remove_file(finished_path.clone()).unwrap();
}
unsafe {
initialize(&dataset, &param);
}
Expand Down Expand Up @@ -232,7 +236,6 @@ impl Backend {
}
}
let _ = result_receiver.try_recv();
let finished_path = std::path::Path::new(args.output.as_str()).join("finished.txt");
write_current_time_to_file(finished_path.to_str().unwrap()).unwrap();
}
}
Expand Down

0 comments on commit 587446a

Please sign in to comment.