Doing DevOps Your Way On SaaS Solutions: Custom Plugins Come to JFrog Cloud with Workers Service

JFrog Workers - custom plugins in the cloud

To no one’s surprise, cloud adoption continues to be a focus for organizations of all sizes and verticals. However, for those who are used to the flexibility and adaptability that comes with customizing self-hosted software, moving to a SaaS offering and losing some of that customization can be a deal breaker.

At JFrog, giving developers the freedom – and flexibility – to work however they want to has always been a central tenet to our offering. That’s why we’re excited to introduce a new service to our SaaS offering that we call JFrog Workers.

Introducing JFrog Workers

Currently in open Beta, Workers is a JFrog Cloud Platform service that you can use to create and run Plugins that extend JFrog Platform functionality via a built-in serverless execution environment. You can create Workers that are triggered when events occur in the JFrog Platform – similar to the behavior of AWS Lambda functions.

Benefits of Workers

The Workers service provides functionality that greatly increases the flexibility of the SaaS JFrog Platform by providing:

  • Improved workflow automation – Synchronized hooks integrate custom code which can manage JFrog and third-party execution flows.
  • Low maintenance – No infrastructure required. Workers run on JFrog nodes with auto-scaling support to provide Function-as-a Service in a serverless experience.
  • Easy setup – A built-in code editor with code auto-complete offers pre-configured functions and parameters to accelerate your code development.
  • Seamless experience – Built-in connectivity to JFrog Platform services uses pre-authenticated API calls.

JFrog’s Worker service offers flexibility while maintaining security and today offers you the capability of running scripts written in TypeScript.

Accessing Workers in your JFrog Instance

To find, edit, and create new workers you must be logged in as an admin user. Select the Administration tab. There you’ll see a new button called “Workers” as shown in the figure below:

Figure 1 - Access the worker service by selecting Administration tab > Workers.

Figure 1 – Access the worker service by selecting Administration tab >  Workers

If you are using the new JFrog interface, use the button with the settings icon located in the top right corner and click on “Workers”:

Figure 2 - In JFrog’s new interface access workers by selecting Settings > Workers.

Figure 2 – In JFrog’s new interface access workers by selecting Settings > Workers

In the Workers section, you will see a set of cards representing actions upon which you can create workers. The Worker service is currently in BETA with a limited set of actions to trigger workers, but this set will expand as we move towards GA.

Putting Workers to Work – Sample Use Cases to Try Out

The workflow to use Workers may remind you of JFrog’s webhook service but there are a few differences between Events and Workers:

  • A worker is a script hosted on the JFrog Platform
  • The script is provided with support tools to make workers easy to use (a topic for another article)
  • The service that launches an action that triggers a worker will wait for the worker’s completion, so a worker can perform activities on the platform before the action actually occurs and is thus able to impact the result of the action.

The worker flow is summarized in the following figure:

Figure 3 - Workflow of a worker service

Figure 3 – Workflow of a worker service

Here are just a few use cases workers can help support, with endless possibilities:

  1. Prevent downloads of insecure artifacts – As an added security layer, a worker can be written to perform a request to Xray and get data on the artifact’s known vulnerabilities. The worker can prevent download if there are critical vulnerabilities present or an artifact has not yet been scanned.
  2. Artifact cleanup- You can create a worker that deletes all artifacts that have not been downloaded within a set amount of time.
  3. Trace artifact downloads with an external service – After download is performed a worker can send a REST request to an external service with details of downloaded artifact.

For a step-by-step guide to implementing your first worker, check out this knowledge base article.

Get Working Today!

Workers help you manage operations by providing an easy, flexible way to add customizable and pre-integrated scripts to your JFrog Platform procedures. Workers complement the existing automation and integration functionality in the JFrog Platform such as webhooks, the CLI, JFrog Pipelines, and more to allow unparalleled flexibility and depth in how you automate and connect your developer workflows and ecosystem.

For more on workers, visit our technical documentation, request a demo, or start a trial to see it in action.