Worker Pro!
Worker Pro (@graphile-pro/worker
) is a proprietary (not open source) preset
for Graphile Worker that adds advanced and quality-of-life features. Graphile
Worker existed for 5 years without these features, so they are definitely not
essential, but they are things your team is likely to appreciate:
- Live migration — remove the need to scale to zero to safely upgrade Worker versions
- Crashed worker recovery — track running workers and unlock jobs automatically when a worker seems to have unexpectedly stopped
- More features planned
Worker Pro is priced at USD $100/mo and helps to fund the ongoing maintenance
of Graphile Worker and other Graphile projects. It is also available
free to sponsors on the $100/mo tier
or above.
Worker Pro is in early access with a limited feature set; during this period get access by sponsoring at just $25+/mo and, as a thank you for being an early adopter, keep this preferential rate for at least 18 months after the launch offer ends.
Getting access
Worker Pro is currently in sponsors-only early access; any
sponsor on $100/mo $25+/mo may request
access from @jemgillam or @benjie via the Discord, or email team
at the domain
graphile.com
.
The module is stored on and access is managed through GitHub Packages. We will need to know the GitHub username(s) of the person(s) that will need access so that we can add them to the repository. We strongly recommend that you also send us the GitHub username of a GitHub "service account" (see below) that you can use to generate an access token which can be shared across your various environments.
The usernames will be added to a team within the https://github.com/graphile-pro organization. This will grant access to the GitHub Packages module and the source code repository on GitHub, including the ability to file issues and open discussions about Worker Pro. Though the repositories are currently private, any content posted to them via issues, discussions, PRs or otherwise may be made public in future, so post accordingly.
Service account
Access to GitHub Packages requires a (highly restricted) security token. Despite the very limited scope of these tokens, using your own security credentials for shared systems (production, staging, development) isn't ideal; we therefore suggest that you create (if you haven't already) a separate GitHub user account that is granted minimal privileges, and this account can be used to generate a token that can be shared between the team and production environments. The service account you create on GitHub likely doesn't even need access to your source code.
Send us the username of the service account and we can invite it to the https://github.com/graphile-pro organization.
Source available
Worker Pro is not open source, but it is “source available”; the source code is licensed in a way that forbids publishing and redistribution but is otherwise very flexible, allowing you to make your own modifications for internal usage should you need to do so:
Copyright © 2023 Benjie Gillam
Use and modification of this software and associated documentation files (the
“Software”) is permitted, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. The Software is not to be
distributed, published, sold, or sub-licensed.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Installation
Worker Pro can be installed from GitHub Packages using
an authenticated authToken
or npm login --scope=@graphile-pro
.
Create a .npmrc
in your project directory containing:
@graphile-pro:registry=https://npm.pkg.github.com
This will tell npm
(and yarn
, etc) that any @graphile-pro/*
package should
instead be installed from the GitHub Packages package registry rather than from
the regular npm package registry.
You need to authenticate to GitHub packages, one way to do this is to create a
.npmrc
file in your home directory (this is different to the .npmrc
in
your project folder mentioned above), and enter into it:
//npm.pkg.github.com/:_authToken=TOKEN
Replace TOKEN
with a GitHub personal access token with the read:packages
scope (it might be nested under write:packages
); you can generate a personal
access token at
https://github.com/settings/tokens.
Then (assuming you have your GitHub Packages authentication configured) you can install as you would any other module:
- npm
- Yarn
- pnpm
npm install --save @graphile-pro/worker
yarn add @graphile-pro/worker
pnpm add @graphile-pro/worker
For more help installing from GitHub packages, see the GitHub Packages documentation, in particular:
If you still need help, ask in #help-and-support on the Graphile Discord.
Usage
Load @graphile-pro/worker
as a preset into your
graphile.config.ts or similar file via the extends
key:
import type {} from "graphile-config";
import type {} from "graphile-worker";
import { WorkerProPreset } from "@graphile-pro/worker";
const preset: GraphileConfig.Preset = {
extends: [WorkerProPreset],
worker: {
/* Your worker config options here */
},
};
FAQ
If I pay for Worker Pro, am I a sponsor?
If you sponsor Graphile at $100+/mo via GitHub Sponsors then Worker Pro is included as one of the many perks to sponsorship.
Paying $100/mo for Worker Pro via Graphile Store (not available at time of writing) gives you access to Worker Pro but that is all, you are not a sponsor and you are not entitled to other sponsor perks. We strongly encourage you to sponsor Graphile instead, there's only upsides!
Why? Some companies claim they “cannot” use sponsorship platforms; if your company is one of these then either you need to make do without the additional sponsor perks, or you need to help your organization to see the value of supporting the software that their business relies upon. Once you've successfully gained approval for sponsorship, you may discover other valuable open source projects within your stack that you could benefit from supporting. Ready to enhance the entire open source ecosystem together?
Is Worker Pro needed for production usage?
No, absolutely not! Graphile Worker existed without these features for 5 years so they are not “essential”; they're “nice to have” features, especially for larger teams or systems with more complex deployments.
Can I implement these features myself instead?
Sure! Worker Pro is just a preset for the open source Graphile Worker, so you have all the same interfaces that we do! Hopefully it will work out significantly cheaper and easier to use Worker Pro than to build the solution yourself, and Worker Pro has been designed by the maintainer of Graphile Worker so it thinks carefully about all the edge cases, but if your needs are limited or your budget is constrained then please go ahead and use the plugin and events system to implement a similar solution. (Please note that it's extremely unlikely we'll accept your solution as a pull request.)
If your budget is constrained because you're a charity or non-profit organization (including community projects such as Makerspaces) please get in touch and we may be able to offer you a discount.
Want to open source your own alternative, or maybe even build a business around it? You're entirely welcome to do so — that is the open source way! But, please consider sponsoring us anyway, to support us to keep improving the underlying open source project for you and your users.
We retain copyright in Worker Pro, so if you are going to implement and distribute your own solution, ensure that you do it without using or being “inspired by” the source code to Graphile Pro. Figure out your own independent solution, please.