Services

Services are containerized programs that are meant to be long running processes, usually web services or interactive applications, and that can be launched by a user into different environments.

Note

Dockstore Services is currently in beta mode. Also note that the screenshots below were taken on our staging site.

Tutorial Goals

  • Get familiarized with the concept of services on Dockstore

  • Learn the basics of creating a service using a .dockstore.yml file

  • Learn how to register a service and create versions for it

  • Publish your service to Dockstore

Services are meant to be long running processes, usually web services or interactive applications, that can be launched by a user. The entire process for creating a service that can launch successfully is complex and dependent on the service or application you are trying to describe; so it is beyond the scope of this tutorial. However, this document will outline what is needed to register, update, and publish a service onto Dockstore. Also, please keep in mind that service functionality is currently in beta mode.

Create Your Service

The first step is to create a file named .dockstore.yml which acts as a configuration file used to describe your service. Technically, having a valid YAML and the right version is all that is required for your service to appear on Dockstore. But, we will briefly cover an example .dockstore.yml written for the Xena Hub to show what will generally be needed to create a working service. You can also view template .dockstore.yml files here.

../_images/service-example-1.2.png

Line 1 specifies the .dockstore.yml version. The latest version you should use is 1.2.

Next is a required key named service where your service description will lie.

Within this, you should specify the type which can be DOCKER_COMPOSE, KUBERNETES, HELM, SWARM, NOT_APPLICABLE.

Following lines 4-9, it is good practice to include the name, author, and a description of your service.

Next, is the files key. Here you can specify a list of other files (like scripts, READmes, and test parameter files) for Dockstore to index that are contained in your repository and are needed for your service.

Following that is a scripts section. Here you denote the script files or commands to be used for steps like starting, provisioning, specifying the port, and stopping for your service. Other possible keys not listed above include preprovision, prestart, and healthcheck.

Next is a section where you can list any environment variables a service needs to be passed into its scripts by the launcher. In this example, we provide a default HTTP port.

Finally, if your service needs to have data provisioned locally, you should include a data section in your .dockstore.yml.

Registering Your Service

Note

You do not need an account to search for workflows on Dockstore or to launch them with our compute partners. However, to register content on Dockstore, you must have an account on Dockstore and link the necessary third-party accounts. Once this is done you can register workflows from the My Workflows page, tools from the My Tools page, or services from the My Services page.

Registering your service works differently than tools and workflows on Dockstore. For services, you need to install our Dockstore GitHub application into at least one of your organizations. By doing so, Dockstore will automatically register the services you create by keeping track of the releases and pre-releases you make on GitHub. This makes getting your service registered to Dockstore easy! You do not need the service to be fully working, and you can start experimenting on Dockstore while you write it. The following steps walk you through the installation process.

Note

Our docs sometimes use “GitHub App registration” and “registration with a .dockstore.yml file” interchangeably, as they are equivalent terms. The Dockstore GitHub App and a .dockstore.yml file are two components of the same registration method.

Install the Dockstore GitHub App

Installing the GitHub App is simple. Navigate to /my-tools, /my-workflows, or /my-services using the drop down menu in the top right. In these screenshots, we will go via /my-tools, but the process is essentially the same for any of the other options.

../_images/my-tools.png

Click the + button on the left hand sidebar.

../_images/add-tool-button.png

A window will appear asking how you would like to register your tool, workflow, or service. Select Register using GitHub Apps.

../_images/register-tool-github-apps.png

Click + Manage Dockstore Installation on GitHub. You’ll then be redirected to GitHub where you can select which repositories can be accessed by the GitHub app.

../_images/manage-gh-app-installation.png

You’ll then be redirected to GitHub where you can grant the app access to specific repositories within whatever organization you are installing into. Note that GitHub treats your username as its own “organization.” For instance, my GitHub username is aofarrel. If I want to install the GitHub App so it could access aofarrel/mycoolrepo, I would choose the first option here.

../_images/gh-app-install-where.png

Install our GitHub App on either all repositories in an organization or on specific repositories

After selection of an organization, you can select whether to give access to all repositories or only select ones. If the organization you choose is intended to be just for Dockstore tools/workflows/services, you may want to allow access to all repositories. Otherwise, it is may be more intuitive to select only certain repositories. Click save and you will be taken back to the page you started on in Dockstore – either /my-tools, /my-workflows, or /my-services, depending where you started.

Important

The GitHub user who first adds a workflow onto Dockstore must correspond to a user on Dockstore.

You should now see the organization and the repositories you chose to keep track of in the “unpublished” tab. Here’s an example involving /my-services:

../_images/my-services-filled.png

A note on permissions

If you are adding the GitHub App to an organization for which you are not an admin, GitHub may block your ability to install the app, even if you have maintainer access to the repository you are hoping to give the GitHub App permission to view. Please see this FAQ entry for more information.

See also

Ensuring sychronization

Once the GitHub App is installed and a .dockstore.yml is present, please make sure to push one additional commit to your repository. This helps make sure your workflows, tools, and services show up in Dockstore.

Publishing Your Service

When you select a repository from this panel to view, you will notice that information is missing. Clicking the Versions tab, you will see an info box letting you know that this service does not have any versions. When your service is in this state, the publish button is disabled.

To add a version, get the information to populate, and gain the ability to publish, all you need to do is create a release or prerelease on GitHub on a repository that has a valid .dockstore.yml located in its root directory. Any time this is done, Dockstore will automatically create versions for you.

../_images/services-versions-tab.png

Now the Files tab will have your .dockstore.yml under the Primary Descriptor. Additionally, the files you choose to list in the in the files section of the .dockstore.yml will also be visible in the Files tab.

Once you have a version, you can now publish your service! Publishing will create a public page that is very similar to the ones we have for tools and workflows.

../_images/services-public-page.png

Now other users can view and star your service. You will also have the option to add published services to a collection.