Skip to content

Add other backends (HTTP/WebDAV, Globus, S3/blob) to internal Pelican#3234

Open
bbockelm wants to merge 10 commits into
PelicanPlatform:mainfrom
bbockelm:native-s3-https-globus-backends
Open

Add other backends (HTTP/WebDAV, Globus, S3/blob) to internal Pelican#3234
bbockelm wants to merge 10 commits into
PelicanPlatform:mainfrom
bbockelm:native-s3-https-globus-backends

Conversation

@bbockelm

Copy link
Copy Markdown
Collaborator

This is an initial draft of moving other backends to be embedded inside the Pelican process. Quite a bit left to go for code review and testing - but I thought it'd be good to open for other eyeballs ASAP.

@whwjiang - thought you'd have fun playing with this one.

Comment thread origin_serve/backend_blob.go Fixed
Comment thread origin_serve/handlers.go Fixed
Comment thread origin_serve/handlers.go Fixed
Comment thread origin_serve/handlers.go Fixed
Comment thread origin_serve/handlers.go Fixed
Comment thread origin_serve/handlers.go Fixed
Comment thread origin_serve/handlers.go Fixed
Comment thread origin_serve/handlers.go Fixed
@bbockelm bbockelm linked an issue Mar 14, 2026 that may be closed by this pull request
@bbockelm bbockelm added enhancement New feature or request origin Issue relating to the origin component labels Mar 14, 2026
Comment thread origin_serve/backend_blob.go Fixed
@bbockelm bbockelm requested a review from whwjiang March 14, 2026 21:52
@bbockelm bbockelm force-pushed the native-s3-https-globus-backends branch 2 times, most recently from fd6656b to 188f86d Compare March 21, 2026 13:35
Comment thread origin_serve/handlers.go Fixed
Comment thread origin_serve/handlers.go Fixed
Comment thread origin_serve/handlers.go Fixed
Comment thread origin_serve/handlers.go Fixed
@bbockelm bbockelm force-pushed the native-s3-https-globus-backends branch from a05ebe9 to efff8da Compare March 21, 2026 16:45
@bbockelm bbockelm force-pushed the native-s3-https-globus-backends branch from efff8da to bd2536c Compare April 6, 2026 00:42
@bbockelm bbockelm requested review from turetske and removed request for whwjiang April 28, 2026 11:39
@bbockelm bbockelm force-pushed the native-s3-https-globus-backends branch 2 times, most recently from b4baff2 to dc87f72 Compare May 2, 2026 14:03

@turetske turetske left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please deal with the merge conflicts as well.

Comment thread origin_serve/backend_blob.go Outdated
// If per-export S3 credentials were provided, set them in the environment
// so the gocloud AWS credential chain picks them up.
//
// FIXME(deploy): this mutates global process environment, which has two

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an existing issue for this FIXME? Otherwise please create one as I worry this will just get lost.

Comment thread origin/globus.go

if server_structs.OriginStorageType(param.Origin_StorageType.GetString()) != server_structs.OriginStorageGlobus {
return errors.Errorf("failed to initialize Globus backend: Origin.StorageType is not Globus: %s",
ost := server_structs.OriginStorageType(param.Origin_StorageType.GetString())

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nitpick, but xrootdGid doesn't apply if using OriginStorageGlobusv2 and should be behind a conditional, I think.

oldKey := blobKey(oldName)
newKey := blobKey(newName)

if err := fs.bucket.Copy(ctx, newKey, oldKey, nil); err != nil {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a recursive copy. I believe this will rename oldKey to newKey, but any child objects in the collection will be under oldKey. Which is obviously bad. If this will ever be used on a collection rather than an individual "leaf" object, it needs to iterate recursively through and do a copy/delete.

Comment thread launchers/origin_serve.go Outdated
// Handle POSIXv2 and SSH-specific initialization now that the web server is running
storageType := param.Origin_StorageType.GetString()
useXRootD := storageType != string(server_structs.OriginStoragePosixv2) && storageType != string(server_structs.OriginStorageSSH)
useXRootD := storageType != string(server_structs.OriginStoragePosixv2) &&

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an identical repeated code segment to lines 59-63. Should useXRootD become part of a helper function to avoid repeated code?

Comment thread origin/globus_client.go

// globusIssuerURL returns the configurable Globus OIDC issuer URL.
func globusIssuerURL() string {
if v := param.Origin_GlobusIssuerURL.GetString(); v != "" {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is set in defaults.yaml, is it possible for it to be an empty string? Unless someone sets it explicitly, which seems odd.

Comment thread origin/globus_client.go

// globusTransferAPIBaseURL returns the configurable Globus Transfer API base URL.
func globusTransferAPIBaseURL() string {
if v := param.Origin_GlobusTransferAPIBaseUrl.GetString(); v != "" {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above.

Comment thread go.mod
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a
github.com/zsais/go-gin-prometheus v0.1.0
go.uber.org/atomic v1.11.0
gocloud.dev v0.45.0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I think this is pretty large. Since we are splitting the client/server binaries (and that's merged into main already, but may not be part of this PR) and this should only be in the server binaries, make sure this dependency is only pulled in there as the whole point of the split is to reduce the client binary size.

Comment thread origin_serve/backend_blob.go Outdated
if _, peekErr := peekIter.Next(ctx); peekErr == nil {
// It is a directory — return a lazy dir handle (a fresh iterator
// will be created when Readdir is called).
return &blobDirFile{name: name, bucket: fs.bucket, prefix: dirPrefix}, nil

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this store the context for the later Readdir call?


func (fi *blobFileInfo) Name() string { return fi.name }
func (fi *blobFileInfo) Size() int64 { return fi.size }
func (fi *blobFileInfo) Mode() os.FileMode { return 0444 }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we always read only? If so, this is fine, but I want to check.

@bbockelm bbockelm force-pushed the native-s3-https-globus-backends branch from dc87f72 to 330d1b0 Compare June 17, 2026 00:02
@bbockelm bbockelm force-pushed the native-s3-https-globus-backends branch from 1532734 to 2222182 Compare June 18, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request origin Issue relating to the origin component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert other backends to be embedded inside the Pelican process

3 participants