Categorygithub.com/sagecontinuum/sage-storage-loader
modulepackage
0.0.0-20240719192807-41b0ed68778c
Repository: https://github.com/sagecontinuum/sage-storage-loader.git
Documentation: pkg.go.dev

# README

Sage Storage Loader

This service loads files staged in a directory (on Beehive) into OSN or Pelican. Based on env variable STORAGE_TYPE it will use OSN or Pelican.

The expected data flow is:

          rsync uploads                   sage storage loader
[ node ] --------------> [ staging dir ] --------------------> [ storage ]

Architecture

       scanner process walks staging dir
       and puts ready uploads into channel

                                          +--> [ worker ] --> [         ]
[ staging dir ] -----------> [|||] -------+--> [ worker ] --> [ storage ]
                                          +--> [ worker ] --> [         ]

                                        workers upload files to STORAGE_TYPE
                                        and clean them up afterwards

Integration testing for OSN with Minio

We can stand up an integration testing environment using Docker Compose in /test/s3:

docker-compose up -d --build
docker-compose logs -f

Test uploads can be generated using tools/generate-data-dir.py.

# generate 100 test uploads
python3 tools/generate-data-dir.py --data-dir test/s3/test-data 100

You can open the Minio UI at http://localhost:9001.

Integration testing for Pelican

We can stand up an integration testing environment using Docker Compose in /test/pelican:

docker-compose up -d --build
docker-compose logs -f

'issuer-key.pem' for use with Pelican can be retrieved here Pelican Config or generated using the SciTokens Python library and tools. More information can be found here Pelican Config.

Test uploads can be generated using tools/generate-data-dir.py.

# generate 10 test uploads
python3 tools/generate-data-dir.py --data-dir test/pelican/test-data 10

You can check the uploads by curling for them in LOADER_PELICAN_ENDPOINT. For example:

#create jwt token first then run:
curl -v -H "Authorization: Bearer $(cat token)" $(LOADER_PELICAN_ENDPOINT)/$(LOADER_PELICAN_BUCKET)/

# Functions

Initialize a new file uploader for Pelican by passing in a config, an initliaze JwtManager, and public key's id.
No description provided by the author
No description provided by the author

# Constants

No description provided by the author

# Structs

No description provided by the author
Jwks represents the JSON Web Key Set response structure.
JwtManager manages operations related to JWT tokens.
No description provided by the author
No description provided by the author
No description provided by the author
PublicKeyConfig represents the public key config response structure.
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author
NOTE(sean) Not a big deal but we can probably just use the FileUploader as the primary abstraction rather than introducing UploaderConfig.