Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVENT-49: replace argo-dataflow to numaflow #49

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
10 changes: 10 additions & 0 deletions lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,19 @@ const constants = {
ARGO_CRON_WORKFLOW_PLURAL: "cronworkflows",

// dataflow
/**
* @deprecated please remove this in next stable release
*/
ARGO_DATAFLOW_K8S_API_GROUP: "dataflow.argoproj.io",
/**
* @deprecated please remove this in next stable release
*/
ARGO_PIPELINES_PLURAL: "pipelines",

// numaflow
NUMAFLOW_K8S_API_GROUP: "numaflow.numaproj.io",
NUMAFLOW_K8S_API_VERSION: "v1alpha1",

// atlan-defaults configmap details
ATLAN_DEFAULTS_CONFIGMAP_NAME: "atlan-defaults",
ATLAN_DEFAULTS_CONFIGMAP_NAMESPACE: "default",
Expand Down
2 changes: 1 addition & 1 deletion lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const system = require("system-commands");
const utils = require("./utils");

/**
* Init an Aro package inside the folder
* Init an Argo package inside the folder
* Steps:
* 1. Check if folder is empty
* 2. Package.json should not be present (unless force is set to true)
Expand Down
2 changes: 1 addition & 1 deletion lib/k8s.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class K8sInstaller {
dirPath,
false,
constants.ARGO_DATAFLOW_KIND,
constants.ARGO_DATAFLOW_K8S_API_GROUP,
constants.NUMAFLOW_K8S_API_GROUP,
K8sInstaller.upsertTemplate
);
}
Expand Down
8 changes: 4 additions & 4 deletions lib/models/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ class Package {
let plural = `${constants.ARGO_DATAFLOW_KIND.toLowerCase()}s`;
return customK8sApi
.listNamespacedCustomObject(
constants.ARGO_DATAFLOW_K8S_API_GROUP,
constants.ARGO_K8S_API_VERSION,
constants.NUMAFLOW_K8S_API_GROUP,
constants.NUMAFLOW_K8S_API_VERSION,
namespace,
plural,
null,
Expand All @@ -315,8 +315,8 @@ class Package {
return Promise.each(pipelines, function (pipeline) {
const metadata = pipeline.metadata;
return customK8sApi.deleteNamespacedCustomObject(
constants.ARGO_DATAFLOW_K8S_API_GROUP,
constants.ARGO_K8S_API_VERSION,
constants.NUMAFLOW_K8S_API_GROUP,
constants.NUMAFLOW_K8S_API_VERSION,
metadata.namespace,
plural,
metadata.name
Expand Down
56 changes: 41 additions & 15 deletions lib/static/package/pipelines/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,59 @@
## Pipelines

The yaml files in this directory are installed as dataflow pipelines on the Argo instance in the cluster.
> The yaml files in this directory are installed as pipelines on the [numaflow](https://numaflow.numaproj.io/) instance in the cluster.

### Sample Pipeline

```yaml
apiVersion: dataflow.argoproj.io/v1alpha1
apiVersion: numaflow.numaproj.io/v1alpha1
kind: Pipeline
metadata:
annotations:
dataflow.argoproj.io/description: |-
# Modify your pipeline name here
numaflow.numaproj.io/pipeline-name: 101-hello
# Modify your vertex name here
numaflow.numaproj.io/vertex-name: in
# Modify your pipeline description here
numaflow.numaproj.io/description: |-
This is the hello world of pipelines.

It uses a cron schedule as a source and then just cat the message to a log
dataflow.argoproj.io/owner: argoproj-labs
dataflow.argoproj.io/test: 'true'
numaflow.numaproj.io/owner: altanhq
numaflow.numaproj.io/test: 'true'
# Modify your pipeline name here
name: 101-hello
namespace: argo-dataflow-system
namespace: numaflow-system
spec:
steps:
- cat: {}
name: main
sinks:
- log: {}
sources:
- cron:
schedule: '*/3 * * * * *'
# Data processing tasks
vertices:
# Sources / Inputs
- name: in
source:
generator:
rpu: 5
duration: 1s
# User-defined functions
- name: cat
udf:
builtin:
name: cat
containerTemplate:
env:
# This flag will enable debug for `numaflow`, please remove this if it's production
- name: NUMAFLOW_DEBUG
value: "true"
# Sinks
- name: out
sink:
log: {}
# The relationship between the vertices
edges:
- from: in
to: cat
- from: cat
to: out
```

### Useful Links

- https://github.com/argoproj-labs/argo-dataflow
- https://numaflow.numaproj.io/pipeline
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"eslint": "eslint --fix .",
"lint-staged": "lint-staged"
},
"engines" : {
"npm" : ">=8.0.0",
"node" : ">=16.0.0"
},
"author": "Atlan",
"license": "MIT",
"dependencies": {
Expand Down