BCDA-APS / bluesky_training

Bluesky training, including instrument package
https://bcda-aps.github.io/bluesky_training/
Other
11 stars 0 forks source link

changes to configure new installation #213

Closed prjemian closed 4 months ago

prjemian commented 11 months ago

These are the git diff to configure a new default installation at 2-ID-D:

2iddnx% git diff | cat
diff --git a/blueskyStarter.sh b/blueskyStarter.sh
index e1ee007..2c9d3ee 100755
--- a/blueskyStarter.sh
+++ b/blueskyStarter.sh
@@ -6,7 +6,7 @@
 # define fallback if BLUESKY_CONDA_ENV is not found
 DEFAULT_ENV=bluesky_2023_2
 export ENV_NAME="${BLUESKY_CONDA_ENV:-${DEFAULT_ENV}}"
-export IPYTHON_PROFILE=bluesky
+export IPYTHON_PROFILE=bluesky_nx
 export IPYTHONDIR="${HOME}/.ipython-bluesky"

diff --git a/instrument/iconfig.yml b/instrument/iconfig.yml
index cb5fd28..40eb12c 100644
--- a/instrument/iconfig.yml
+++ b/instrument/iconfig.yml
@@ -3,16 +3,16 @@
 # configuration for the instrument package
 # simple key:value pairs

-ADSIM_IOC_PREFIX: "ad:"
-GP_IOC_PREFIX: "gp:"
+# ADSIM_IOC_PREFIX: "ad:"
+# GP_IOC_PREFIX: "gp:"

-DATABROKER_CATALOG: &databroker_catalog EDIT_CATALOG_NAME_HERE
+DATABROKER_CATALOG: &databroker_catalog 2iddnx

 # default RunEngine metadata
 RUNENGINE_METADATA:
-  beamline_id: Bluesky_training
-  instrument_name: BCDA EPICS Bluesky training
-  proposal_id: training
+  beamline_id: 2-ID-D-NX
+  instrument_name: 2IDDNX
+  proposal_id: development
   databroker_catalog: *databroker_catalog

 # Uncomment and edit to define a PV to use for the `scan_id`.
@@ -20,19 +20,19 @@ RUNENGINE_METADATA:
 # RUN_ENGINE_SCAN_ID_PV: "IOC:integer"

-# area detector paths used by training IOC
-# These are examples for other use of this instrument.
-# see: https://bcda-aps.github.io/apstools/latest/examples/de_0_adsim_hdf5_basic.html#File-Directories
-AD_IMAGE_DIR: "adsimdet/%Y/%m/%d"
-AD_MOUNT_PATH: /tmp
-BLUESKY_MOUNT_PATH: /tmp/docker_ioc/iocad/tmp
+# # area detector paths used by training IOC
+# # These are examples for other use of this instrument.
+# # see: https://bcda-aps.github.io/apstools/latest/examples/de_0_adsim_hdf5_basic.html#File-Directories
+# AD_IMAGE_DIR: "adsimdet/%Y/%m/%d"
+# AD_MOUNT_PATH: /tmp
+# BLUESKY_MOUNT_PATH: /tmp/docker_ioc/iocad/tmp

 # permissions
-ALLOW_AREA_DETECTOR_WARMUP: true
-ENABLE_AREA_DETECTOR_IMAGE_PLUGIN: true
-ENABLE_CALCS: true
+# ALLOW_AREA_DETECTOR_WARMUP: true
+# ENABLE_AREA_DETECTOR_IMAGE_PLUGIN: true
+# ENABLE_CALCS: true
 USE_PROGRESS_BAR: false
-WRITE_SPEC_DATA_FILES: true
+WRITE_SPEC_DATA_FILES: false

 # ----------------------------------
prjemian commented 11 months ago

The bluesky_nx profile name was used since bluesky was already in use and an existing instrument package within (the old way).

prjemian commented 10 months ago

Many of these items are now edited by the new_bluesky_instrument.py code. Here is a version of the iconfig.yml file as installed now:

# configuration.yml

# configuration for the instrument package
# simple key:value pairs

ADSIM_IOC_PREFIX: "ad:"
GP_IOC_PREFIX: "gp:"

DATABROKER_CATALOG: &databroker_catalog EDIT_CATALOG_NAME_HERE

# default RunEngine metadata
RUNENGINE_METADATA:
  beamline_id: Bluesky_training
  instrument_name: BCDA EPICS Bluesky training
  proposal_id: training
  databroker_catalog: *databroker_catalog

# Uncomment and edit to define a PV to use for the `scan_id`.
# The default behavior is to use `RE.md["scan_id"]`.
# RUN_ENGINE_SCAN_ID_PV: "IOC:integer"

# area detector paths used by training IOC
# These are examples for other use of this instrument.
# see: https://bcda-aps.github.io/apstools/latest/examples/de_0_adsim_hdf5_basic.html#File-Directories
AD_IMAGE_DIR: "adsimdet/%Y/%m/%d"
AD_MOUNT_PATH: /tmp
BLUESKY_MOUNT_PATH: /tmp/docker_ioc/iocad/tmp

# permissions
ALLOW_AREA_DETECTOR_WARMUP: true
ENABLE_AREA_DETECTOR_IMAGE_PLUGIN: true
ENABLE_CALCS: true
USE_PROGRESS_BAR: false
WRITE_SPEC_DATA_FILES: true

# ----------------------------------

# Directory to "autosave" the RE.md dictionary (uses PersistentDict)
# Uncomment and modify to change from the default.
# RUNENGINE_MD_PATH: /home/USERNAME/Bluesky_RunEngine_md

# override default control layer for ophyd
# if undefined, defaults to PyEpics
# OPHYD_CONTROL_LAYER: PyEpics
# OPHYD_CONTROL_LAYER: caproto

# Uncomment any of these to override the defaults
LOGGING:
  # MAX_BYTES: 1000000
  NUMBER_OF_PREVIOUS_BACKUPS: 9
  # LOG_PATH: /tmp
  # If LOG_PATH undefined, this session will log into PWD/logs/
  # where PWD is present working directory when session is started

# default timeouts (seconds)
PV_READ_TIMEOUT: &TIMEOUT 15
PV_WRITE_TIMEOUT: *TIMEOUT
PV_CONNECTION_TIMEOUT: *TIMEOUT

XMODE_DEBUG_LEVEL: Minimal

# Minimum software package version checks: MAJOR.minor (no .patch).
# These will be converted to tuple() for comparisons.
MINIMUM_PYTHON_VERSION:
  - 3
  - 8
MINIMUM_BLUESKY_VERSION:
  - 1
  - 10
MINIMUM_OPHYD_VERSION:
  - 1
  - 7
MINIMUM_DATABROKER_VERSION:
  - 1
  - 2

# identify the version of this iconfig.yml file
ICONFIG_VERSION: 1.0.1
prjemian commented 4 months ago

Change default location of RunEngine metadata PersistentDict directory: https://github.com/BCDA-APS/bluesky_training/blob/153352e5b91c82cb0869891df89081bde1141a35/bluesky/instrument/iconfig.yml#L42-L44 https://github.com/BCDA-APS/bluesky_training/blob/153352e5b91c82cb0869891df89081bde1141a35/bluesky/instrument/framework/initialize.py#L47-L59

New default location: ${HOME}/.config/Bluesky_RunEngine_md

prjemian commented 4 months ago

motive: Move clutter out of user's home directory. This is application configuration, appropriate for the ~/.config directory.

prjemian commented 4 months ago

local change only for 2-ID: export IPYTHON_PROFILE=bluesky_nx