Seed Content

Finally, now that we’ve created and tested a Workflow that’s ready to be deployed in our production L7|ESP instance, we can update our production configuration to import the Workflow. There are two components to this process:

  1. Add configuration to a new or existing seed file that can be imported on install/update.

  2. If necessary, add a reference to the seed file in our production configuration file, roles/packages.yml.

Step 1: Create Seed File to Load Content

As a first step, we’ll need to create a seed file to reference our configuration. In the L7|ESP SDK, a seed file is a file used by the client to import configuration for specific models. In the file, for each item to import into the system, you specify configuration and a model that the configuration describes.

Create this example seed file for importing our Workflow, Protocols, and Pipeline defined above:

# Contents of: roles/workflows.yml

- model: Workflow
  data: $LAB7DATA/content/workflows/QC-Workflow.yml

- model: Protocol
  data: $LAB7DATA/content/protocols/QC-Quantification.yml

- model: Protocol
  data: $LAB7DATA/content/protocols/QC-Report.yml

- model: Pipeline
  data: $LAB7DATA/content/pipelines/QC-Report-Pipeline.yml

In the file above, $LAB7DATA is an environment variable referencing the L7|ESP SDK root directory. It can be used both in development and production deployments to reference the same location.

Step 2: Update Deployment Config to Use Seed Data

Once we’ve created our seed file, update the shared configuration file, roles/packages.yml, to reference that seed file for the content L7|ESP will load into the system by default:

---

biobuilds:
  - bwa

seed:
  - '{{ sdk }}/roles/workflows.yml'

In the file above, {{ sdk }} is an Ansible variable referencing the L7|ESP SDK root directory. It can be used both in development and production deployments to reference the same location.

Step 3: Test Seeding Content Locally

Before deploying changes, we’ll want to test that the seed files and changes to production configuration are properly imported by the software.

To do so, use the import make target:

~$ make import

Since the same commands are used to seed the content in development as in production, this practice is sufficient for ensuring that content will be imported the next time you update your production instance.