|
|
# 8-BM Deployment
|
|
|
|
|
|
## Quick Start Guide
|
|
|
In this section we illustrate typical system usage via the DM Station GUI (see the [Getting Started](https://git.aps.anl.gov/DM/dm-docs/-/blob/master/getting_started/getting-started.md) guide for more details). Note that /home/dm directory should be accessible on all 8-BM machines.
|
|
|
|
|
|
1. Setup environment by sourcing setup file.
|
|
|
`$ # After sourcing setup file, all DM commands will be in your path`
|
|
|
`$ source /home/dm/etc/dm.setup.csh`
|
|
|
2. Run the "dm-station-gui" command. This will allow you to create an experiment, upload data to the central storage system, see experiment files, etc.
|
|
|
`$ dm-station-gui`
|
|
|
3. Access files using Globus Online (see the [Getting Data From Globus](https://git.aps.anl.gov/DM/dm-docs/-/blob/master/getting_started/gettingDataFromGlobus.md) guide for more details). Note that experiment files can be read only by those DM usernames that have been assigned a role within a given experiment.
|
|
|
a. Using your browser, open https://www.globus.org/
|
|
|
b. Sign in with your Globus username
|
|
|
c. Under File Manager, chose "aps#data" as Collection and click "Continue" in order to authenticate.
|
|
|
d. Authenticate with your DM username (typically "d<badge number>"). Use the same password (APS Web Password) that you use to access APS Beamline User Portal.
|
|
|
e. Navigate to experiment folder. All experiments will be under the "/gdata/dm/LSCAT" directory (e.g. "/gdata/dm/LSCAT/test-12idf-01)".
|
|
|
f. At this point you should be able to transfer files to any Globus endpoint that you have access to. Note that downloading files to your desktop or laptop requires installing [Globus Connect Personal](https://www.globus.org/globus-connect-personal) endpoint.
|
|
|
|
|
|
## Command Lines
|
|
|
|
|
|
In this section we list few most important DM commands that can be used from a terminal session or in scripts.
|
|
|
|
|
|
1. Create an experiment and upload data to the central storage system:
|
|
|
```
|
|
|
$ # Experiment name must be unique and start with a letter.
|
|
|
$ # Users can be added to experiment by specifying Beamline Scheduling System proposal id (--proposal-id option),
|
|
|
$ # or a list of users directly (--users option)
|
|
|
$ dm-lscat-upload --experiment=test-lscat-01 --data-directory=/home/dm/test
|
|
|
```
|
|
|
2. Check status of your uploads:
|
|
|
```
|
|
|
$ dm-list-uploads
|
|
|
```
|
|
|
3. Start monitoring directory for new files (DAQ mode):
|
|
|
```
|
|
|
$ # Any files already present in the specified data directory will be ignored.
|
|
|
$ # The --dest-directory option indicates directory path relative to experiment root directory in storage
|
|
|
$ # Users can be added to experiment by specifying Beamline Scheduling System proposal id (--proposal-id option)
|
|
|
$ # or a list of users directly (--users option)
|
|
|
$ dm-lscat-daq --data-directory=/home/dm/test --experiment=test-lscat-01 --dest-directory=daqdata --duration=1h
|
|
|
```
|
|
|
4. Check status of your DAQs:
|
|
|
```
|
|
|
$ dm-list-daqs
|
|
|
```
|
|
|
5. Retrieve list of your cataloged file metadata, etc. Alternative way of viewing metadata catalog is via Mongo Express application ([https://s21iddm.xray.aps.anl.gov:8182/db/dm](https://s21iddm.xray.aps.anl.gov:8182/db/dm)).
|
|
|
```
|
|
|
$ dm-list-experiment-files --experiment=test-lscat-01
|
|
|
```
|
|
|
6. Add or remove users associated with your experiment.
|
|
|
```
|
|
|
$ # Use d<badge> when specifying usernames
|
|
|
$ dm-add-user-experiment-role --username=d225159 --experiment=test-lscat-01 --role=User
|
|
|
$ dm-delete-user-experiment-role --username=d225159 --experiment=test-lscat-01 --role=User
|
|
|
```
|
|
|
|
|
|
## Python API
|
|
|
|
|
|
The DM Python API documentation is located in the /home/dm/production/doc/html folder, while some simple examples can be found under the /home/dm/production/examples directory.
|
|
|
|
|
|
|
|
|
1. After sourcing the DM setup file, DM Python will be in user's path and DM Python APIs will be in user's PYTHONPATH environment variable.
|
|
|
```
|
|
|
$ # This command brings up the DM API documentation
|
|
|
$ firefox /home/dm/production/doc/html/index.html
|
|
|
$ # Retrieve list of existing experiments
|
|
|
$ python -c "from dm import ExperimentDsApi; api = ExperimentDsApi(); print(api.getExperimentsByStation())"
|
|
|
```
|
|
|
2. DM Python APIs can also be installed in a Conda environment:
|
|
|
```
|
|
|
$ # Install conda in a fresh terminal with a clean environment.
|
|
|
$ # Do NOT source regular DM setup file.
|
|
|
$ curl -o Miniconda3-latest-Linux-x86_64.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
|
|
|
$ sh Miniconda3-latest-Linux-x86_64.sh -b -p $PWD/CONDA
|
|
|
|
|
|
$ # Install conda DM API package
|
|
|
$ export PATH=$PWD/CONDA/bin:$PATH
|
|
|
$ conda install -c aps-anl-tag aps-dm-api
|
|
|
|
|
|
$ # Source dm.conda.setup.sh file, which does not modify PYTHONPATH environment variable
|
|
|
$ source /home/dm/etc/dm.conda.setup.sh
|
|
|
|
|
|
$ # Retrieve list of existing experiments
|
|
|
$ python -c "from dm import ExperimentDsApi; api = ExperimentDsApi(); print(api.getExperimentsByStation())"
|
|
|
```
|
|
|
|
|
|
|
|
|
## System Administration
|
|
|
|
|
|
DM services are controlled using standard RHEL daemon scripts located under the /home/dm/production/etc/init.d directory. Relevant scripts are:
|
|
|
|
|
|
- dm-daq-web-service (DAQ web service)
|
|
|
- dm-cat-web-service (Cataloging web service)
|
|
|
- dm-proc-web-service (Processing web service)
|
|
|
- dm-mongodb (MongoDB server)
|
|
|
- dm-mongo-express (Mongo Express web application)
|
|
|
- dm-nginx (Nginx server)
|
|
|
- dm-daq-services (controls all DAQ services)
|
|
|
|
|
|
Shown below is an example of DAQ Web Service restart:
|
|
|
```
|
|
|
$ # Control scripts can be found in /home/dm/production/etc/init.d directory.
|
|
|
$ # Usage:
|
|
|
$ /home/dm/production/etc/init.d/dm-daq-web-service
|
|
|
Usage: /home/dm/production/etc/init.d/dm-daq-web-service {start|stop|status|restart}
|
|
|
|
|
|
$ # Restart DAQ Web Service
|
|
|
$ /home/dm/production/etc/init.d/dm-daq-web-service restart
|
|
|
Stopping dm.DaqWebService daemon: [ OK ]
|
|
|
Starting dm.DaqWebService daemon: [ OK ]
|
|
|
$ /home/dm/production/etc/init.d/dm-daq-web-service status
|
|
|
dm.DaqWebService (pid 29314) is running...
|
|
|
```
|
|
|
|
|
|
|
|
|
## Deployment Details
|
|
|
|
|
|
- DM Station Name: LSCAT
|
|
|
- DM Software Version: [4.1.1](https://git.aps.anl.gov/DM/data-management/-/tree/4.1.1) ([Release Notes](https://git.aps.anl.gov/DM/data-management/blob/4.1.0/doc/RELEASE_NOTES.txt))
|
|
|
- Deployment Machine: s8bmdm.xray.aps.anl.gov
|
|
|
- Deployed Services:
|
|
|
- Data Acquisition Service (port 33336)
|
|
|
- Cataloging Service (port 44436)
|
|
|
- Processing Service (ports 55536, 55537)
|
|
|
- MongoDB Server (localhost, port 27017)
|
|
|
- Nginx (port 8182)
|
|
|
- Mongo Express (localhost, port 18182)
|
|
|
- DM Admin Unix Account: dmadmin
|
|
|
- DM Beamline System Account: user8bm
|
|
|
- Deployment Directory: /home/dm
|
|
|
- Support Software Directory: /home/dm/support
|
|
|
- System Configuration Files: /home/dm/etc
|
|
|
- Service Log Directories:
|
|
|
- DM Backend Services: /home/dm/var/log
|
|
|
- MongoDB Directory: /home/dm/support/opt/mongodb/linux-x86_64/data
|
|
|
- User Environment Setup File: /home/dm/etc/dm.setup.sh
|
|
|
- Service Control Scripts: /home/dm/production/etc/init.d
|
|
|
- DM Storage Service: xraydtn02.xray.aps.anl.gov:22236
|
|
|
- DM APS DB Service: xraydtn02.xray..aps.anl.gov:11236
|
|
|
- DM Web Portal: [https://xraydtn02.xray..aps.anl.gov:8181/dm](https://xraydtn02.xray..aps.anl.gov:8181/dm)
|
|
|
- Mongo Express: [https://8bmdm.xray.aps.anl.gov:8182/db/dm](https://s8bmdm.xray.aps.anl.gov:8182/db/dm)
|
|
|
- Globus Endpoint: aps#data
|
|
|
- Globus Folder: /gdata/dm/8BM |