Skip to content
Snippets Groups Projects
Commit e434339c authored by Janet Goldstein's avatar Janet Goldstein
Browse files

WS-308: demonstrate that we can get an ALMA BDF out of ALMA's NGAS cluster

parent 5a168076
No related branches found
No related tags found
1 merge request!208WS-308: demonstrate that we can get an ALMA BDF out of ALMA's NGAS cluster
Pipeline #1454 waiting for manual action
""" Proof of concept: stream an ALMA BDF out of ALMA's NGAS cluster """
import logging
import pytest
from datafetcher.locations_report import NgasFileSchema, NgasFile, NgasTarget
from datafetcher.retrieve_launcher import ParallelRetrieverLauncher
logger = logging.getLogger(__name__)
@pytest.mark.skip("for demonstration only")
def test_fake_alma_fetch():
"""
Create a fake locations report "files" instance containing the information
needed to fetch it. Filename is sanitized ngas_file_id with the .bdf file extension.
The sanitized ngas_id can be obtained from archive.files like this:
SELECT ngas_id, filename FROM files WHERE ngas_id LIKE '%A002%Xd0adbe%X10f.bdf';
:return:
"""
fake_loc_rpt = {
"ngas_file_id": "A002/Xd0adbe/X10f",
"subdirectory": "afa/2018-08-13/1/A002:Xd0adbe:X10f.09970384d205b6de5558146b388ba7dd___X10",
"relative_path": "afa/2018-08-13/1/uid___A002_Xd0adbe_X10f.bdf",
"checksum": "1632201880",
"checksum_type": "ngamsGenCrc32",
"version": 1,
"size": 1536802,
"server": {
"server": "nangas06.cv.nrao.edu:7771",
"location": "NAASC",
"cluster": "NAASC",
},
}
schema = NgasFileSchema()
ngas_file = schema.load(fake_loc_rpt)
assert isinstance(ngas_file, NgasFile)
target = NgasTarget(ngas_file, "DSOC")
launcher = ParallelRetrieverLauncher([target], False, False)
retrieved_count = launcher.launch_retrievers()
assert retrieved_count == 1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment