Share and Reuse Your Argo Workflows with the Codefresh Argo Hub.
Anyone who builds many Argo workflows knows that after a while you end up reusing the same basic steps over and over again. While Argo Workflows has a great mechanism to prevent repetitive work using templates, these templates remain in private user repositories that have not been shared with the broader community.
Get a full-featured visualized experience here https://codefresh.io/argo/hub/
argo-hub.{NAME}.{VERSION}
To build an extensive UI while still using use of the original Kubernetes manifest, we are leverging annotations.
argo-hub/version
- sem version (0.0.2)argo-hub/description
- description to be shownargo-hub/license
- license (MIT)argo-hub/owner_name
- github user name to appear in the siteargo-hub/owner_email
- email for contactargo-hub/owner_avatar
- github user avatar iconargo-hub/owner_url
- github user profileargo-hub/categories
- categories to appear in the siteargo-hub/icon_url
- svg (only) iconargo-hub/icon_background
- background color for the iconargo-hub-template/description
- description for specific templateargo-hub-template/icon_url
- icon for specific templateargo-hub-template/icon_background
- background for icon The main folder of the Argo Hub repository is workflows
Each folder represents a workflowTemplate (group of templates), and appears as a unique item in the main list of the argo hub site
Every workflowTemplate folder has the following structure and files:
CHANGELOG.md
- a shared changelog md file between all the versionsassets
folder - where you can store the icons to reference from within the workflowTemplateversions
folder - contains all supported versionsEvery version folder has the following structure and files:
workflowTemplate.yaml
- the main manifest that follows the conventionsrbac.yaml
- a single file with 3 required manifests that provides the permissions for workflow templateimages
folder - each sub-folder results in a docker build according to the inner Dockerfile, and is automatically built scanned and pushed to argo-hub registry: quay.io/codefreshplugins/argo-hub-{NAME}:${VERSION}-main
docs
folder - contains documentation for every template within the workflowTemplate (name be identical to the template name)Each workflow template is versioned and can be referenced by specific versions. The Codefresh Hub provides a clear structure for both owners and consumers to pick and use the versions that make sense for their use cases. Users can also use multiple versions to test changes, without fully upgrading. Check out the file system structure, and the workflow template conventions.
A full release life cycle has been built to do the following:
image
folder (#Automatic-image-building-and-security-scanning)Workflow tasks often involve complex scripts with dependencies that have to be installed manually, wasting valuable execution time and complexing the workflow.
Many developers overcome this complexity by building a Docker image that contains all required dependencies (i.e npm install
), plus the scripts themselves.
The usual problem that developers will notice is that the work on the workflowTemplate itself is detached from the release life cycle and development of the Docker image.
Argo Hub solves this issue by taking a modern approach, and maintaining all required dependencies and scripts alongside the workflowTemplate, and Argo Hub doing all the heavy lifting for you with its release life cycle.
Templates in the hub must specify their required permissions, which are then enforced within Kubernetes. Using default permissions is considered an anti-pattern for workflow templates and they are not supported out of the box. Defining clear permissions creates a clear contract between consumers and their templates.
Eventually Argo Hub is simple, being a set of reusable Kubernetes manifests (workflowTemplates and RBAC related resources).
There are different ways to be able to consume the workflowTemplates:
Applying a workflow template directly to your Kubernetes cluster
just use kubectl apply -f {file}
and apply a specific filer or folder
Using Argo CD you can easily get the entire argo hub by getting it automatically applied to your cluster using the GitOps approach.
Using Argo CD application set with following config file
{
"appName": "marketplace-git-source",
"userGivenName": "marketplace-git-source",
"destNamespace": "codefresh-v2-production",
"destServer": "https://kubernetes.default.svc",
"srcPath": ".",
"srcRepoURL": "https://github.com/codefresh-io/argo-hub.git",
"srcTargetRevision": "",
"labels": { "codefresh_io_entity": "git-source" },
"exclude": "**/images/**/*",
"include": "workflows/**/*.yaml"
}
The easiest way to contribute is by writing a new workflow or enhancing an existing workflowTemplate by adding additional tasks (templates).
First thing to do is to fork the repository.
utils/starting-template
folder into the main workflows
folder.starting-template
and starting template
with your workflowTemplate name.Please fill a github issue or thumb up an existing one