Hammertrack is a custom file metadata integration between Hammerspace and Ftrack allowing simple selection of files for instantiation in other sites
Hammertrack is a Ftrack listener that monitors changes to custom location fields in the Ftrack application. Changes to location settings triggers updates to custom metadata on files and directories associated with specific tasks within Ftrack. This metadata can be used to drive data placement and location using SmartObjectives on a Hammerspace Global Data Environment.
Currently, hammertrack.py watches for location fields to be added to or removed from Tasks in Ftrack. When it sees a location label in the custom field it adds them as Hammerspace labels to the root of the specified task folders on a Hammerspace file system. The label schema is configured in Ftrack to match the configuration in hammertrack.py, and the label names are passed through directly as Hammerspace labels.
Here are some basics on getting up and running. Everyone's Ftrack instance is configured a bit differently and will require some configuration.
- Ftrack API installed and configured
$ pip install ftrack-python-api
- Hammerspace Toolkit (hstk) installed:
$ pip install hstk
- Dotenv Installed - https://pypi.org/project/python-dotenv/
- Hammerspace file system mounted
- Clone this repository
git clone https://github.com/kircktd/hsft.git
- Copy or link hammertrack.py to the working directory on your server
-
You first need to setup your storage location and storage senerio and define the centralized storage senerio using your Hammerspace fileshare.
-
Go to the setting page with in Ftrack and selctect "Custom Attributes"
-
Create a new Custom Attribute where you define the locations of your Hammerspace clusters. You must enter a "menu' name that is normally the location, and then for each menu name you have to add a value which in this example the value is the 3 letter acronym for the local airport associated with the city name.
-
Next you need to add the custom attribute to your Ftrack project. Select Attributes, Custom Attributes, Task.
-
Edit the hammertrack.py script to set the location sites using a key word value and menu name to match the settings in Ftrack for the site locations (line 90).
-
One or more Hammerspace clusters set up with label-based objectives to drive data placement (e.g.
IF HAS_LABEL("LOCATION") THEN {SLO('place-on-local-volumes)}
) -
Add the value labels to each Hammerspace cluster by logging into each Hammerspace primary anvil and adding the associated labels. Once completed do a "label-list" to verify all the required labels are defined. Repeat this step on all primary Anvil servers.
-
Install dotenv and configure a .env file in the same working directory where the hammertrack.py script is installed. Below is an example of a .env file configured for use with Hammertrack.
- Launch the hammpertrack.py script in the backround on your Windows or Linux server. The listener will monitor for location changes in Ftrack project and will update the metatdata for the files on the Hammerspace fileshare with the appropiate labels. Once these labels are detected by the Hammerspace sweeper as valid objectives the files associated with the labels will be placed-on the Hammerspace cluster that is associated with the specified location.
Once the Ftrack instance and the hammertrack.py script have been configured it will recognize location change events on Tasks and act accordingly. Launch the hammertrack.py script on your windows or linux server where the Hammerspace Fileshare is mounted. With in the project view select a task and update the location field (make sure you hit the save button after the update). Once that is done the script will pick-up on the event and will update the directory for the specified project with the unique location metadata.
This project wouldn't exist without these folks' contributions:
- Patrick Boucher of LAIKA Studios for creating the baseline python code that integrates with Ftrack.
- Kyla Lebon of Ftrack for technical support and Ftrack access.
- Tram Le-Jones of Ftrack for technical support and Ftrack access.
- Mike Bott of Hammerspace for Python support.