You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -11,15 +11,10 @@ import { ImageAnnotation } from "@site/src/components/ImageAnnotation";
11
11
Components are the building blocks of your ML pipelines in TangleML. This guide covers the different methods to add components to your pipeline workspace.
12
12
13
13
14
-
### 1. Upload Component File
14
+
### Upload component file
15
15
16
16
Upload a YAML component file directly from your computer to add it to your user components library.
17
17
18
-
:::tip
19
-
Uploaded components are immediately available in your User Components library and can be reused across different pipelines.
20
-
:::
21
-
22
-
23
18
<ImageAnnotationsrc={require("./assets/AddingComponents_File.png").default}alt="Import from URL screenshot">
24
19
25
20
1. Click on the **File** option in the component panel
@@ -29,81 +24,71 @@ Uploaded components are immediately available in your User Components library an
Access components from the Standard Library for tasks shared within the TangleML instance.
90
-
91
-
:::tip
92
-
All components in the Standard Library are well documented with implementation details you can inspect by clicking the component info dialog and checking the **Implementation** tab.
93
-
:::
78
+
Access components from the standard library for tasks shared within the TangleML instance:
94
79
95
-
<ImageAnnotationsrc={require("./assets/AddingComponents_StandardLibrary.png").default}alt="Import from Standard Library screenshot">
80
+
<ImageAnnotationsrc={require("./assets/AddingComponents_StandardLibrary.png").default}alt="Import from standard library screenshot">
96
81
97
-
1. Expand the **Standard Library** folder in the left panel, Components section.
82
+
1. Expand the **Standard Library** folder in the left panel, **Components** section.
98
83
2. Select the component you want to add.
99
84
3. Drag the component onto the canvas.
100
85
101
-
</ImageAnnotation>
86
+
:::tip
87
+
Components in the standard library are documented with implementation details you can inspect by clicking the component info dialog and checking the **Implementation** tab.
88
+
:::
102
89
103
-
### 7. Shared Components Library
90
+
</ImageAnnotation>
104
91
105
-
Access components from the Shared Components Library for tasks shared within the TangleML instance.
92
+
### Shared components library
106
93
107
-
:::info
108
-
Learn more about the [Shared Components Library](/docs/component-development/published-components-library).
109
-
:::
94
+
Access components from the [shared components library](/docs/component-development/published-components-library) for tasks shared within the TangleML instance.
Copy file name to clipboardExpand all lines: docs/component-development/creating-components-generic.mdx
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Creating Components
3
-
description: A comprehensive guide to building pipeline components using different programming languages
3
+
description: Complete guide to create TangleML components using Python, JavaScript, or any containerized language with YAML specifications.
4
4
---
5
5
6
6
importTabsfrom"@theme/Tabs";
@@ -24,7 +24,7 @@ A component consists of two essential parts:
24
24
Components can be written in any language that runs in a container. The key is proper containerization and defining clear input/output interfaces.
25
25
:::
26
26
27
-
## Step 1. Designing a Component
27
+
## Step 1. Designing a component
28
28
29
29
When TangleML executes a component, it starts a container image in a Kubernetes Pod.
30
30
Your component’s inputs are passed in as command-line arguments.
@@ -53,9 +53,9 @@ It is recommended that you use this pattern only when the data must be put into
53
53
If your component is built with Python, libraries such as [argparse](https://docs.python.org/3/library/argparse.html) and [absl.flags](https://abseil.io/docs/python/guides/flags) make it easier to read your component's inputs.
54
54
- Your component's code can be implemented in any language, as long as it can run in a container image.
55
55
56
-
### Component Design Principles
56
+
### Component design principles
57
57
58
-
So as a summary, when designing components, remember these core principles:
58
+
So as a summary, when designing Components, remember these core principles:
59
59
60
60
1.**Composability** - Design your components with composability in mind:
61
61
- Think about upstream and downstream components
@@ -79,7 +79,7 @@ So as a summary, when designing components, remember these core principles:
79
79
- Your code must accept arguments from the command line.
80
80
- Use standard argument parsing libraries for your language.
81
81
82
-
### Example Component Design
82
+
### Example component design
83
83
84
84
TangleML supports any language that can run in a container. This example demonstrates how to create a component in multiple languages.
85
85
This program reads from an input file and writes lines which pass a threshold to an output file.
@@ -348,9 +348,9 @@ You can skip building the container image eveyr time you make a code change by u
348
348
necessary, revise your application and Dockerfile until your application
349
349
works as expected in the container.
350
350
351
-
### Local Testing
351
+
### Local testing
352
352
353
-
Test your component locally before deploying:
353
+
Test your Component locally before deploying:
354
354
355
355
```bash
356
356
docker run -v $(pwd)/test-data:/data \
@@ -360,9 +360,9 @@ docker run -v $(pwd)/test-data:/data \
360
360
--threshold 0.5
361
361
```
362
362
363
-
## Step 3: Define Component Specification
363
+
## Step 3: Define Component specification
364
364
365
-
### Define Component Metadata
365
+
### Define Component metadata
366
366
367
367
Start your component specification by defining basic metadata. This helps users understand what your component does.
368
368
@@ -382,13 +382,13 @@ Use clear, descriptive names that indicate the component's purpose. Include vers
382
382
383
383
### Define Component Inputs
384
384
385
-
Inputs are the data and parameters your component needs to function. Each input must specify its name and can include type, description, and default values.
385
+
Inputs are the data and parameters your Component needs to function. Each input must specify its name and can include type, description, and default values.
386
386
387
387
:::info
388
388
[Read more about the Full InputSpec schema](/docs/reference/schema#inputspec).
389
389
:::
390
390
391
-
#### Basic Input Definition
391
+
#### Basic Input definition
392
392
393
393
```yaml
394
394
inputs:
@@ -397,7 +397,7 @@ inputs:
397
397
type: Data
398
398
```
399
399
400
-
#### Input with Default Value
400
+
#### Input with default value
401
401
402
402
```yaml
403
403
inputs:
@@ -424,9 +424,9 @@ Large datasets should always be passed as [file paths](/docs/reference/schema#in
424
424
425
425
### Define Component Outputs
426
426
427
-
Outputs define what your component produces. Unlike inputs, outputs don't have default values, but they must specify where the component will write its results.
427
+
Outputs define what your Component produces. Unlike inputs, outputs don't have default values, but they must specify where the component will write its results.
428
428
429
-
#### Basic Output Definition
429
+
#### Basic Output definition
430
430
431
431
```yaml
432
432
outputs:
@@ -435,7 +435,7 @@ outputs:
435
435
type: Data
436
436
```
437
437
438
-
#### Multiple Outputs Example
438
+
#### Multiple Outputs example
439
439
440
440
```yaml
441
441
outputs:
@@ -456,15 +456,15 @@ outputs:
456
456
type: Data
457
457
```
458
458
459
-
### Define Container Implementation
459
+
### Define Container implementation
460
460
461
-
The implementation section specifies how to execute your component. It includes the container image and the command to run.
461
+
The implementation section specifies how to execute your Component. It includes the container image and the command to run.
462
462
463
463
:::info
464
464
[Read more about the Full ContainerImplementation schema](/docs/reference/schema#containerspec).
465
465
:::
466
466
467
-
#### Basic Container Implementation
467
+
#### Basic Container implementation
468
468
469
469
```yaml
470
470
implementation:
@@ -473,7 +473,7 @@ implementation:
473
473
command: ["python", "/app/process.py"]
474
474
```
475
475
476
-
#### Container with Input/Output Placeholders
476
+
#### Container with Input/Output placeholders
477
477
478
478
The command section uses placeholders that are replaced at runtime with actual values:
479
479
@@ -500,7 +500,7 @@ implementation:
500
500
]
501
501
```
502
502
503
-
#### Understanding Placeholders
503
+
#### Understanding placeholders
504
504
505
505
There are three types of placeholders you can use in the command:
506
506
@@ -540,7 +540,7 @@ There are three types of placeholders you can use in the command:
540
540
The placeholder names must exactly match the input/output names defined in your component's interface.
541
541
:::
542
542
543
-
#### Container with Arguments
543
+
#### Container with arguments
544
544
545
545
Sometimes you need to separate the command from its arguments:
546
546
@@ -560,9 +560,9 @@ implementation:
560
560
]
561
561
```
562
562
563
-
#### Container with Environment Variables
563
+
#### Container with environment variables
564
564
565
-
You can also pass inputs through environment variables:
565
+
You can also pass Inputs through environment variables:
566
566
567
567
```yaml
568
568
implementation:
@@ -581,9 +581,9 @@ implementation:
581
581
```
582
582
583
583
584
-
## Component Specification
584
+
## Component specification
585
585
586
-
Regardless of the implementation language, all components share the same YAML specification format.
586
+
Regardless of the implementation language, all Components share the same YAML specification format.
587
587
588
588
:::info
589
589
[Read more about the Full ComponentSpec schema](/docs/reference/schema).
@@ -11,12 +12,12 @@ For Python developers, TangleML offers a special feature - **lightweight compone
11
12
Learn more about the Oasis CLI tool in the [Oasis CLI Manual](/docs/component-development/oasis-cli-manual) section.
12
13
:::
13
14
14
-
## Lightweight Python Components
15
+
## Lightweight Python components
15
16
16
17
Instead of [the conventional approach](/docs/component-development/creating-components-generic) where you write code, containerize it, publish to a registry, and manually create YAML configuration files, Oasis CLI tool automates this entire process.
17
18
You simply write your Python code and run a single command - the system automatically generates the YAML specification running code as a command, eliminating the need to manage Docker images or registries.
18
19
19
-
This approach called "Lightweight Python Components" and it dramatically reduces the time from code to component, allowing you to iterate faster and focus on the code logic rather than infrastructure.
20
+
This approach called "Lightweight Python components" and it dramatically reduces the time from code to component, allowing you to iterate faster and focus on the code logic rather than infrastructure.
20
21
21
22
22
23
```yaml
@@ -32,15 +33,15 @@ implementation:
32
33
# Generated wrapper code handles I/O
33
34
```
34
35
35
-
## Tutorial: Creating a Lightweight Python Component
36
+
## Tutorial: Creating a lightweight Python component
36
37
37
38
This guide walks you through creating a TangleML component that performs regex-based text replacement. The component reads an input text file, replaces all substrings matching a given regex pattern, and writes the result to an output file.
38
39
39
40
:::info
40
-
To learn more about Components in TangleML, check the [Component Architecture](/docs/core-concepts/what-are-components) page.
41
+
To learn more about components in TangleML, check the [component architecture](/docs/core-concepts/what-are-components) page.
41
42
:::
42
43
43
-
### Step 1: Create the Component Function
44
+
### Step 1: Create the component function
44
45
45
46
:::info
46
47
You may use a [quick start](/docs/component-development/oasis-cli-manual#quick-start) from the Oasis CLI Manual.
@@ -144,7 +145,7 @@ This notation is used by the Oasis CLI tool to generate the proper component spe
@@ -382,7 +383,7 @@ Notice, that Oasis CLI tool generated additional code to handle component inputs
382
383
```
383
384
384
385
385
-
### Step 3: Running the Component
386
+
### Step 3: Running the component
386
387
387
388
To use the component, drop it into your pipeline and configure the inputs. Click "Submit Run" to execute the pipeline.
388
389
@@ -518,7 +519,7 @@ def some_func(
518
519
...
519
520
```
520
521
521
-
### Input and Output Types
522
+
### Input and Output types
522
523
523
524
While low-level TangleML does not enforce any types, the Oasis CLI generator (`components.create_component_from_func`) provides support for six basic Python types:
0 commit comments