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
Copy file name to clipboardexpand all lines: compute_transfer_examples/README.md
+28-19
Original file line number
Diff line number
Diff line change
@@ -21,36 +21,31 @@ and save the Compute function's UUID.
21
21
22
22
### The `do_tar` Compute function
23
23
24
-
`do_tar` takes four parameters that the flow will need to provide:
24
+
`do_tar` takes three parameters that the flow will need to provide:
25
25
26
26
| Parameter | Description |
27
27
|-----------|-------------|
28
-
|`src_paths`| String or list of path(s) to files/directories to archive |
29
-
|`dest_path`| Where to write the tar.gz archive (directory or file path) |
30
-
|`transform_from`| The path prefix to replace (default: "/") |
31
-
|`transform_to`| The prefix to use for absolute paths (default: "/") |
28
+
|`src_paths`| List of paths to the files/directories to be archived |
29
+
|`dest_path`| Where to write the tar archive (directory or file path) |
30
+
|`gcs_base_path`| The shared GCS collection's configured base path. (default: "/") |
32
31
33
-
### Path Transformation Explained
32
+
### GCS Collection Base Paths
34
33
35
-
The parameters `transform_from` and `transform_to` handle differences between paths as exposed by the GCS collection and paths on the underlying filesystem.
34
+
The parameter `gcs_base_path` is provided to the compute function to allow it to transform the user input paths to absolute paths. This is needed when the shared GCS instance has [configured the collection's base path](https://docs.globus.org/globus-connect-server/v5/data-access-guide/#configure_collection_base_path).
36
35
37
36
**Example scenario:**
38
-
- Your GCS collection maps its root to the absolute path `/path/to/root/`.
37
+
- Your GCS collection has configured its base path to`/path/to/root/`.
39
38
- A user wants to tar the files at the absolute path `/path/to/root/input_files/`.
40
39
- To both the user and Flows service, this path appears as `/input_files/` on the GCS collection.
41
-
- However, the Compute function running on the GCS collection**does not know** about the mapping and can only find the files with the absolute paths.
40
+
- However, the Compute function running on the shared GCS instance**does not know** about the collection's configured base path and can only find the files using absolute paths.
42
41
43
-
Thus, the Compute function must be provided with the GCS root mapping to do any needed transformations. In this example:
44
-
- Set `transform_to` to the mapped root path (`/path/to/root/`) to transform the input `src_paths` to absolute paths.
45
-
- Set `transform_from` to the root directory (`/`) to transform the absolute paths to the paths in the GCS collection.
46
-
47
-
These transformations ensure the Compute function can correctly locate and access files regardless of how collection paths are mapped.
42
+
Thus, the Compute function must be provided with the GCS collection's configured base path to do the necessary transformations. In this example, `gcs_base_path` would need to be set to `/path/to/root/`.
48
43
49
44
## Compute and Transfer Flow: Example 1
50
-
In the first example, the Compute and Transfer flow takes a user-provided source file that already exists in the co-located GCS collection, creates a tarfile from it, and transfers the tarfile to a userprovided destination collection. Specifically, the flow will:
45
+
In the first example, the Compute and Transfer flow takes a user-provided list of source files that **already** exists in the co-located GCS collection, creates a tarfile from them, and transfers the tarfile to a user-provided destination collection. Specifically, the flow will:
51
46
1. Set constants for the run
52
47
2. Create an output directory named after the flow's run ID on your GCS collection
53
-
3. Invoke the Compute function `do_tar` on the source endpoint to create a tar archive from the input source file and save it in the output directory
48
+
3. Invoke the Compute function `do_tar` on the source endpoint to create a tar archive from the input source files and save it in the output directory
54
49
4. Transfer the resulting tarfile to the destination collection provided in the flow input
55
50
5. Delete the output directory
56
51
@@ -60,7 +55,9 @@ In the first example, the Compute and Transfer flow takes a user-provided source
60
55
-`gcs_endpoint_id`: Your GCS Collection ID
61
56
-`compute_endpoint_id`: Your Compute Endpoint ID
62
57
-`compute_function_id`: The UUID of the registered `do_tar` function
63
-
-`compute_transform_from` and `compute_transform_to`: If your GCS collection uses [base path mapping](https://docs.globus.org/globus-connect-server/v5/data-access-guide/#configure_collection_base_path)
58
+
59
+
If your GCS collection has a configured base path, also edit `gcs_base_path`.
60
+
64
61
65
62
2. Register the flow:
66
63
```bash
@@ -76,7 +73,7 @@ In the first example, the Compute and Transfer flow takes a user-provided source
@@ -94,9 +91,15 @@ In the first example, the Compute and Transfer flow takes a user-provided source
94
91
```bash
95
92
globus flows run show <RUN_ID>
96
93
```
94
+
At this point, you might see that your flow has gone INACTIVE. This is because you need to give data access consents for any GCS collection that your flow is interacting with. Run the command:
95
+
96
+
```bash
97
+
globus flows run resume <RUN_ID>
98
+
```
99
+
And you will be prompted to run a `globus session consent`. After granting the requested consent, try resuming the run once again and your flow should be able to proceed. As your flow encounters more required data access consents, you might need to repeat this step multiple times, however once you have granted a consent, it will remain for all future runs of that flow.
97
100
98
101
## Compute and Transfer Flow: Example 2
99
-
In the second example, the Compute and Transfer flow takes in a user-provided list source files that exists on a userprovided source collection, creates a tarfile from it, and transfers the tarfile to a userprovided destination collection. Specifically, the flow will:
102
+
In the second example, the Compute and Transfer flow takes in a user-provided list of source files that exist on a user-provided source collection, creates a tarfile from it, and transfers the tarfile to a user-provided destination collection. Specifically, the flow will:
100
103
1. Set constants for the run
101
104
2. Create an output directory named after the flow's run ID on your GCS collection
102
105
3. Iterate through the list of input source files and create the destination paths for files on your GCS collection
@@ -154,3 +157,9 @@ In the second example, the Compute and Transfer flow takes in a user-provided li
154
157
```bash
155
158
globus flows run show <RUN_ID>
156
159
```
160
+
161
+
Remember, if your flow has gone inactive, run:
162
+
```bash
163
+
globus flows run resume <RUN_ID>
164
+
```
165
+
and then run the prompted `globus session consent` command and try resuming the run again.
0 commit comments