feature/globus - #251
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8af218063
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if method.AccessUrl != nil && strings.TrimSpace(method.AccessUrl.Url) != "" { | ||
| return &drsapi.AccessURL{Headers: method.AccessUrl.Headers, Url: strings.TrimSpace(method.AccessUrl.Url)}, nil |
There was a problem hiding this comment.
Keep resolving provider access URLs through DRS
When a record was created by add-url/push with an inline provider URL, this branch returns the raw s3:///gs:// value stored in AccessMethod.AccessUrl (see internal/drsobject/object.go:125-130 and docs/adding-s3-files.md:7-11). DownloadResolvedToPath then hands that URL to Syfon's GenericDownload, whose implementation only treats file paths specially and otherwise performs an HTTP GET (https://github.com/calypr/syfon/blob/development/client/transfer/http.go#L676-L804), so normal provider-backed pulls fail with an unsupported protocol scheme instead of asking the DRS server for a presigned URL. Restrict direct returns to schemes the downloader handles, or continue resolving storage-provider URLs through DRS.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
|
@chatgpt-codex-connector review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe920e3e84
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
matthewpeterkort
left a comment
There was a problem hiding this comment.
This PR introduces alot of engineering choices to overengineer around a fundamentally lacking DRS schema. Instead of overengineering, DRS should be changed to support this new multiple auth multiple access methods real world use case.
Below is an attempt at finding faults and proposing solutions to the current DRS schema. This is a first attempt that probably needs some refining.
#253
| 1. a single `DrsObject` with several possible access methods, such as `https`, `s3`, and `globus`; and | ||
| 2. a collection of `DrsObject` values whose available access methods and authorization requirements differ from object to object. | ||
|
|
||
| DRS does not define a priority among access method types. An access method `type` identifies how the bytes can be transferred; it does **not** uniquely identify how the transfer must be authenticated. |
There was a problem hiding this comment.
this does not really flow. You go from taling about basic drs concepts into this "access method" concept. Perhaps a paragraph talking about access methods first is needed here.
|
|
||
| | Interaction | DRS mechanism | | ||
| | --- | --- | | ||
| | Retrieve `DrsObject` metadata | Authorization discovery for the object endpoint, including `OPTIONS /objects/{object_id}` | |
There was a problem hiding this comment.
yeah like this section probably goes before the paragraphs above it
| 4. select the highest-priority usable method according to client configuration; and | ||
| 5. allow the user to override automatic selection explicitly. | ||
|
|
||
| Each transfer handler owns the protocol-specific logic needed to resolve and execute its transfer. Authentication is determined from the DRS authorization information and the selected handler's capabilities, not inferred solely from `AccessMethod.type`. |
There was a problem hiding this comment.
maybe give an example here?? "Authentication is determined from the DRS authorization information and the selected handler's capabilities, not inferred solely from AccessMethod.type" this is pretty important and appears to be glossed over here.
| DRS defines no preferred ordering, so git-drs will provide a configurable client-side priority. For example: | ||
|
|
||
| ```yaml | ||
| access_method_priority: |
There was a problem hiding this comment.
this only matters if there is more than 1 access method provided right?
| GIT_DRS_ACCESS_METHOD=globus git drs pull | ||
| ``` | ||
|
|
||
| The preference is evaluated per object. If an object does not advertise the |
There was a problem hiding this comment.
If an access method is configured then it should be useable. If it cannot be used to create a download/upload then it should not be tried. Like having globus at the top of the priority and then the access method doesn't produce a object, can quickly lead to performance losses from repeatedly trying access methods that do not lead to a successful result.
|
|
||
| For Globus in particular, objects that resolve to compatible Globus endpoints and authorization contexts should be grouped into one batch transfer where possible. | ||
|
|
||
| DRS bulk-access authorization imposes an additional constraint: a bulk request may require a common passport or bearer token for the requested objects. git-drs must therefore partition heterogeneous objects into authorization-compatible groups or resolve them individually rather than assuming a single credential applies to the entire collection. |
There was a problem hiding this comment.
well a dynamic mapping would fix this problem. This quickly becomes more complexity than anyone wants to deal with.
You say drs doesn't support a fixed mapping but this is because it assumes that one auth will be used for all the data sources. This is not the case in the real world. I suspect this a DRS shortcoming and folllowing the drs spec here will prove to be a detriment in the long run.
|
|
||
| ### Positive | ||
|
|
||
| - Adding Globus does not require special authentication semantics in the DRS core. |
There was a problem hiding this comment.
Sure. but Globus has its own auth. I'm not sure if an auth abstraction is really what is needed here.
| Export these environment variables before running `git drs pull`: | ||
|
|
||
| ```bash | ||
| export GIT_DRS_GLOBUS_TRANSFER_TOKEN='<globus-transfer-api-access-token>' |
There was a problem hiding this comment.
Just use globus login command and then read from the globus config file? Messing with env vars is making it more difficult for the user than it needs to be. This is not a script, this is a CLI.
| Verify the token before pulling: | ||
|
|
||
| ```bash | ||
| git drs auth globus |
| return nil | ||
| } | ||
| methods := *obj.AccessMethods | ||
| preferred := strings.TrimSpace(strings.ToLower(os.Getenv("GIT_DRS_ACCESS_METHOD"))) |
There was a problem hiding this comment.
this is pretty hackish. This needs to be scallable across more than just a CLI. There should be a default access method that is intelligently configured depending on if there is more than one access method specified. Like ideally the files on Globus eventually make it to synapse aws s3 bucket once the paper is published, etc so certain access methods would have higher priority over others ,etc.
Summary
Adds Globus Transfer support for hydrating DRS objects into the Git LFS cache.
Configuration
The destination Globus collection must expose the repository root.
To prefer Globus when available:
Testing
All tests pass.
Reviewer note
Please pay particular attention to the documentation changes:
ADR: docs/access-method-selection-and-authentication.md
Developer architecture: docs/globus-notes-high-level.md
User documentation: docs/globus.md
Troubleshooting: docs/troubleshooting.md