You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 20, 2025. It is now read-only.
With our code complete, we can write a dockerfile that our batch job will run in. Start with the base image that copies our application code and resolves the dependencies using `uv`.
451
450
@@ -686,17 +685,17 @@ nitric.yaml
686
685
README.md
687
686
```
688
687
689
-
We can update the `nitric.yaml` file to use the correct dockerfiles when running and deploying our applications.
688
+
We can update the `nitric.yaml` file to allow our services and batch jobs to use the custom docker runtime we set up and point to the services directly.
We can test the application locally using the following code:
736
+
We can test our application locally using:
738
737
739
-
```
738
+
```bash
740
739
nitric run
741
740
```
741
+
742
+
You can then use any HTTP client capable of posting binary in the request, like the Nitric [local dashboard](/get-started/foundations/projects/local-development#local-dashboard).
743
+
744
+
```bash
745
+
curl --request POST --data-binary "@cube.blend" http://localhost:4001/cube
746
+
```
747
+
748
+
## Deploy to the cloud
749
+
750
+
At this point, you can deploy what you've built to any of the supported cloud providers. In this example we'll deploy to AWS. Start by setting up your credentials and configuration for the [nitric/aws provider](/providers/pulumi/aws).
751
+
752
+
Next, we'll need to create a stack file (deployment target). A stack is a deployed instance of an application. You might want separate stacks for each environment, such as stacks for `dev`, `test`, and `prod`. For now, let's start by creating a file for the `dev` stack.
753
+
754
+
The `stack new` command below will create a stack named `dev` that uses the `aws` provider.
755
+
756
+
```
757
+
nitric stack new dev aws
758
+
```
759
+
760
+
Edit the stack file `nitric.dev.yaml` and set your preferred AWS region, for example `us-east-1`.
761
+
762
+
<Note>
763
+
You are responsible for staying within the limits of the free tier or any
764
+
costs associated with deployment.
765
+
</Note>
766
+
767
+
Let's try deploying the stack with the `up` command:
768
+
769
+
```bash
770
+
nitric up
771
+
```
772
+
773
+
When the deployment is complete, go to the relevant cloud console and you'll be able to see and interact with your Blender rendering application.
774
+
775
+
To tear down your application from the cloud, use the `down` command:
776
+
777
+
```bash
778
+
nitric down
779
+
```
780
+
781
+
## Summary
782
+
783
+
In this guide, we've created a remote Blender Renderer using Python and Nitric. We showed how to use batch jobs to run long-running workloads and connect these jobs to buckets to store rendered output. We also demonstrated how to expose buckets using simple CRUD routes on a cloud API. Finally, we were able to create dockerfiles with GPU support for optimal Blender rendering speeds.
784
+
785
+
For more information and advanced usage, refer to the [Nitric documentation](/docs).
0 commit comments