A service for data files produced by operation systems running by NWPC.
Build from source code.
Use Makefile in project root directory to build nwpc_data_server in Linux.
Start the data server on port 33483:
nwpc_data_server serve --address ":33483" --config-dir=some/config/dir
Use nwpc_data_client service to connect to nwpc_data_server.
Use --action to specify remote action. There are three actions.
Get data path on server.
nwpc_data_client service --address=data-service-address \
--action findDataPath \
--data-type=some/data/type \
start_time forecast_timeOutput is same as nwpc_data_client hpc command.
Get data file information on server.
nwpc_data_client service --address=data-service-address \
--action getDataFileInfo \
--data-type=some/data/type \
--start-time=start_time \
--forecast-time=forecast_timeWhen data file is found, two lines are printed: one for data file path and the other for data file size.
/g2/nwp/OPER_ARCH_TEST/nwp/GRAPES_GFS/GMF_GRAPES_GFS/Prod-grib/2019061621/ORIG/gmf.gra.2019061700000.grb2
303997137
When data file is not found or there is some error, error message is printed stderr. Such as
check file error: stat NOTFOUND: no such file or directory
Download data file from server.
nwpc_data_client service --address=data-service-address \
--action downloadDataFile \
--output-dir=outout/dir \
--data-type=some/data/type \
--start-time=start_time \
--forecast-time=forecast_timeData file is saved on output dir with original file name on remote server.
Prepare build environment.
Download and build gPRC library.
Get gRPC plugin for golang.
The following commands can be used in Windows.
go get -u google.golang.org/grpc
go get -u github.com/golang/protobuf/protoc-gen-go
set PATH=%PATH%;%GOPATH%/binRun the following codes to re-generate gRPC codes after change data_service.proto.
cd data_service
protoc.exe ^
-I data_service ^
data_service/data_service.proto ^
--go_out=plugins=grpc:.Copyright © 2019 Perilla Roc at nwpc-oper.
nwpc-data-service is licensed under The MIT License.