Skip to content

Sample code for Dell EMC DataIQ plugins. DataIQ provides a plugin ready API to enable on the spot management decisions about the data to be enacted. This API provides ability to enhance workflows and provide additional functionality in DataIQ.

License

Notifications You must be signed in to change notification settings

dell/dataiq-autodesk-shotgun-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The shotgun plug-in connects to the shotgun API and applies tag to the shots found on the filesystem

Prerequisite

Have DataIQ running on the host machine.

Must have Python-pip and git installed. May require the epel-release package for Red Hat.

Installation

Create directories to host plug-in

(shotgun) $ mkdir "build"
(shotgun) $ mkdir "dist"

Migrate Host Storage

(shotgun) $ cp -rv "hoststorage/." "build"

Pull Dependencies

(shotgun) $ cd "build"
(build) $ python2 -m pip download -d deps2 -r requirements.txt

Build Host Storage

We are packaging the hoststorage and Python dependencies into a single archive file so that this plug-in can be installed on any DataIQ host. It is self-contained so that running the plug-in does not require a connection to the outside internet to download dependencies at runtime.

(build) $ tar -czvf "../dist/shotgun-plugin-1.0.0.tar.gz" *

Initialize Plug-in Manager

(shotgun) $ /opt/dataiq/plugin_manager/bin/plugin_manager init

Install the plug-in using the host storage archive

(shotgun) $ /opt/dataiq/plugin_manager/bin/plugin_manager install shotgun-plugin plugin-centos-base
-f "dist/shotgun-plugin-1.0.0.tar.gz"

Start the installed plug-in

~ $ /opt/dataiq/plugin_manager/bin/plugin_manager start shotgun-plugin

Plug-in configuration

Configure autotagging

Shotgun plug-in needs tags to identify shotgun shots. This is done using the autotagging feature.

The shotgun plug-in assumes the following directory structure on filesystem.

/volumename/showname/sequences/sequencename/shots/shotnumber/

Where volumename, showname, sequencename, and shotnumber are variable.

A /sequences directory (case sensitive) must exist at the third level depth and a /shots directory must exist at the fifth level depth.

Notes:

  • This directory pattern is hard-coded into the example shotgun plugin.
  • If your actual production directory structure varies from the above example, both the DataIQ regular expression autotag rule and the actual python API to Shotgun will need to be modified to match actual directory structure in production.
  • shownames can actual span multiple filesystem volumes (example: production storage and archive storage) if first level autotag regular expression matches on multiple volumes
  • The python API call to Shotgun can then also be refined for further efficiencies

In DataIQ go to settings > data management configuration > Other settings > Autotagging configuration file

Add at the end of file the following: Replace the with your volume name

match /<VOLUME NAME>/([^/]+)/sequences/([^/]+)/shots/([^/]+)
   max_depth 6
   apply_tag shot/$1_$2_$3

Configure Shotgun plug-in

In DataIQ go to settings > data management configuration > plugins > Select Shotgun plugin > Edit configuration

and edit the global configuration:

"Global Configurations":
  shotgunAPIUrl: "YourShotgunAPIUrl"
  shotgunAPIScriptName: "YourShotgunAPIScriptName"
  shotgunAPIKey: "YourShotgunAPIKey"
  expirationDelay: 7

Enable Shotgun plug-in

Once configured you can enable the plugin by going to: settings > data management configuration > plugins > Select Shotgun plugin > Enable

The plugin is automatically executed everyday at 1:00 AM (You can also edit the Cron jobs in the configuration file)

settings > data management configuration > plugins > Select Shotgun plugin > Edit configuration

Trigger Shotgun plug-in manually

You can trigger the plug-in manually by selecting a folder on DataIQ dashboard

Select the "Actions" tab and click Run shotgun plugin

Configure Shotgun

Register on Shotgun

Create an account on https://www.shotgunsoftware.com/ and signin

You have access to a free 30 days trial

Create a new project

Create a new sequence

Add a a new shot

Attach the shot to the create sequence

Create a new API

Go to Scripts

Once created edit the global configuration with the API credentials

Create the folder hierarchy

On the host machine go to your mounted volume and create the following folders:

$ mkdir -p dataiqtest/sequences/sequence/shots/shot

If you look carefully, our hierarchy is composed of the following:

<PROJECT_NAME>/SEQUENCES/<SEQUENCE_FOLDERS>/SHOTS/<SHOT_FOLDERS>

.
`-- sequences
    `-- sequence
        `-- shots
            `-- shot
  • The sequences folder is composed of folders within the same name of the sequences created on Shotgun
  • The shots folder is composed of folders within the same name of the shots created on Shotgun

For instance if we have a shot named 'test' we will have the following tree:

.
`-- sequences
    `-- sequence
        `-- shots
            `-- shot
            `-- test

Run Shotgun plug-in

Now you can re-scan volumes and trigger Shotgun manually

If everything worked correctly you will have your shots tagged!

View plug-in logs

From the command line of the DataIQ server run the following to see a list of pods and their names:

~ $ kubectl -ndataiq get pods

Then run the following substituting the name of the plug-in pod.

~ $ kubectl -ndataiq log <NAME OF POD>

See this example:

Uninstall the plug-in

Disable the plug-in in DataIQ, go to settings > data management configuration > plugins > Select Shotgun plugin > Disable

Stop the plug-in

~ $ /opt/dataiq/plugin_manager/bin/plugin_manager stop shotgun-plugin

Delete plug-in componenets

~ $ /opt/dataiq/plugin_manager/bin/plugin_manager rm shotgun-plugin
~ $ rm -rf /opt/dataiq/maunakea/data/plugins/shotgun-plugin/

About

Sample code for Dell EMC DataIQ plugins. DataIQ provides a plugin ready API to enable on the spot management decisions about the data to be enacted. This API provides ability to enhance workflows and provide additional functionality in DataIQ.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published