Creating Templates for GROBID
This guide will give an example as to how you can find and configure a template for GROBID. This is an extension of our Create Templates With Custom Templates. We will be using the image from GROBID on dockerhub.
There are multiple GROBID images in dockerhub, but for this guide we will be using the official GROBID image.

If you don't already have a version you intend to use, we recommend selecting the latest stable version.

At the time of writing, the current stable version is 0.8.0, so that is the version we'll be using here.
In the Docker Repository And Environment section, you will enter your image path and tag.

The overview page for this image at dockerhub has a link to their guide to using GROBID with containers, which you can read to get their recommendations for containerizing GROBID.
As we follow their guide to containerizing GROBID, we'll need to make sure the container's port 8070 is set to the host machine's port 8070. We will do that in the Vast.ai template. We use -p 8070:8070 as one of the docker run options.

Note: Vast only allows -e and -p docker run options to set environment variables and expose ports.

Here we will select the SSH launch mode.


To find this for the template we are creating, we searched the image's page in Dockerhub and found the CMD command in the Tags tab under the link "0.8.0" highlighted in blue.

Next, we add that contents of the CMD command to the end of the bash commands section of the On-start Script fields.
Also, appended environment variables to /etc/environment file in our on-start section.

This makes environment variables available to all users and processes and ensures they are persistant even if our instance/docker container is rebooted. We suggest doing the same for your templates.

When you are finished setting up your template, If you haven't already done so, specify the template name and description.
Finally, click Create & Use to save the template and navigate to the GPU offers search page. You'll notice that your template is selected and ready to be used.
Once you have selected an instance offer, You'll click on the INSTANCES link in the left menu and see your rented GPU instance that has your template applied.

When the instance is done loading and the >_CONNECT state on the blue button appears, you should be able to see the ip range button at the top of the instance card.

If you click the IP range button you will see a new modal has the IP and port information for your instance. You'll see the port 8070 that we set listed in Open Ports.

You can copy the machine IP and port and load the address (in this example: 195.0.159.206:55734) in a new browser tab or window. This address will load the GROBID web app.
