From 54fda2508b813153a2eb3d3932151c7a9c1d736a Mon Sep 17 00:00:00 2001 From: David Perl Date: Tue, 20 May 2025 09:35:46 +0200 Subject: [PATCH 1/2] chore: migrate to copier template v1.0.0 --- .copier-answers.yml | 9 +++++ .git_hooks/post-commit | 3 ++ .git_hooks/pre-commit | 3 ++ .gitignore | 3 ++ .gitlab-ci.yml | 12 +++---- LICENSE | 5 +-- bin/.gitignore | 1 + .../bec_widgets/auto_updates/__init__.py | 0 pxiii_bec/bec_widgets/widgets/__init__.py | 0 pxiii_bec/deployments/__init__.py | 0 .../deployments/device_server/__init__.py | 0 .../deployments/device_server/startup.py | 11 ++++++ pxiii_bec/scans/metadata_schema/__init__.py | 0 .../metadata_schema_registry.py | 12 +++++++ .../metadata_schema_template.py | 34 +++++++++++++++++++ pxiii_bec/services/__init__.py | 0 pyproject.toml | 16 ++++++--- tests/tests_bec_ipython_client/README.md | 21 +++++++----- tests/tests_bec_widgets/README.md | 21 +++++++----- tests/tests_dap_services/README.md | 21 +++++++----- tests/tests_devices/README.md | 21 +++++++----- tests/tests_file_writer/README.md | 34 +++++++++++++++++++ tests/tests_scans/README.md | 21 +++++++----- 23 files changed, 191 insertions(+), 57 deletions(-) create mode 100644 .copier-answers.yml create mode 100644 .git_hooks/post-commit create mode 100644 .git_hooks/pre-commit create mode 100644 bin/.gitignore create mode 100644 pxiii_bec/bec_widgets/auto_updates/__init__.py create mode 100644 pxiii_bec/bec_widgets/widgets/__init__.py create mode 100644 pxiii_bec/deployments/__init__.py create mode 100644 pxiii_bec/deployments/device_server/__init__.py create mode 100644 pxiii_bec/deployments/device_server/startup.py create mode 100644 pxiii_bec/scans/metadata_schema/__init__.py create mode 100644 pxiii_bec/scans/metadata_schema/metadata_schema_registry.py create mode 100644 pxiii_bec/scans/metadata_schema/metadata_schema_template.py create mode 100644 pxiii_bec/services/__init__.py create mode 100644 tests/tests_file_writer/README.md diff --git a/.copier-answers.yml b/.copier-answers.yml new file mode 100644 index 0000000..a903601 --- /dev/null +++ b/.copier-answers.yml @@ -0,0 +1,9 @@ +# Do not edit this file! +# It is needed to track the repo template version, and editing may break things. +# This file will be overwritten by copier on template updates. + +_commit: v1.0.0 +_src_path: https://gitea.psi.ch/bec/bec_plugin_copier_template.git +make_commit: false +project_name: pxiii_bec +widget_plugins_input: null diff --git a/.git_hooks/post-commit b/.git_hooks/post-commit new file mode 100644 index 0000000..3fe80fe --- /dev/null +++ b/.git_hooks/post-commit @@ -0,0 +1,3 @@ +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +semantic-release changelog -D version_variable=$SCRIPT_DIR/../../semantic_release/__init__.py:__version__ +semantic-release version -D version_variable=$SCRIPT_DIR/../../semantic_release/__init__.py:__version__ \ No newline at end of file diff --git a/.git_hooks/pre-commit b/.git_hooks/pre-commit new file mode 100644 index 0000000..392493b --- /dev/null +++ b/.git_hooks/pre-commit @@ -0,0 +1,3 @@ +black --line-length=100 $(git diff --cached --name-only --diff-filter=ACM -- '*.py') +isort --line-length=100 --profile=black --multi-line=3 --trailing-comma $(git diff --cached --name-only --diff-filter=ACM -- '*.py') +git add $(git diff --cached --name-only --diff-filter=ACM -- '*.py') diff --git a/.gitignore b/.gitignore index 74235c6..f4c73aa 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ **/.pytest_cache **/*.egg* +# recovery_config files +recovery_config_* + # file writer data **.h5 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ebb2568..d7c61d2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ include: - - project: bec/awi_utils - file: /templates/plugin-repo-template.yml - inputs: - name: "pxiii" - target: "pxiii_bec" - branch: $CHILD_PIPELINE_BRANCH +- file: /templates/plugin-repo-template.yml + inputs: + name: pxiii_bec + target: pxiii_bec + branch: $CHILD_PIPELINE_BRANCH + project: bec/awi_utils diff --git a/LICENSE b/LICENSE index 06070a5..f9b721a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ + BSD 3-Clause License -Copyright (c) 2024, Paul Scherrer Institute +Copyright (c) 2025, Paul Scherrer Institute Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -25,4 +26,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..20a11ba --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1 @@ +# Add anything you don't want to check in to git, e.g. very large files \ No newline at end of file diff --git a/pxiii_bec/bec_widgets/auto_updates/__init__.py b/pxiii_bec/bec_widgets/auto_updates/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pxiii_bec/bec_widgets/widgets/__init__.py b/pxiii_bec/bec_widgets/widgets/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pxiii_bec/deployments/__init__.py b/pxiii_bec/deployments/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pxiii_bec/deployments/device_server/__init__.py b/pxiii_bec/deployments/device_server/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pxiii_bec/deployments/device_server/startup.py b/pxiii_bec/deployments/device_server/startup.py new file mode 100644 index 0000000..c4b1f88 --- /dev/null +++ b/pxiii_bec/deployments/device_server/startup.py @@ -0,0 +1,11 @@ +import os + + +def setup_epics_ca(): + # os.environ["EPICS_CA_AUTO_ADDR_LIST"] = "NO" + # os.environ["EPICS_CA_ADDR_LIST"] = "129.129.122.255 sls-x12sa-cagw.psi.ch:5836" + os.environ["PYTHONIOENCODING"] = "latin1" + + +def run(): + setup_epics_ca() diff --git a/pxiii_bec/scans/metadata_schema/__init__.py b/pxiii_bec/scans/metadata_schema/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pxiii_bec/scans/metadata_schema/metadata_schema_registry.py b/pxiii_bec/scans/metadata_schema/metadata_schema_registry.py new file mode 100644 index 0000000..deb6ef4 --- /dev/null +++ b/pxiii_bec/scans/metadata_schema/metadata_schema_registry.py @@ -0,0 +1,12 @@ +# from .metadata_schema_template import ExampleSchema + +METADATA_SCHEMA_REGISTRY = { + # Add models which should be used to validate scan metadata here. + # Make a model according to the template, and import it as above + # Then associate it with a scan like so: + # "example_scan": ExampleSchema +} + +# Define a default schema type which should be used as the fallback for everything: + +DEFAULT_SCHEMA = None diff --git a/pxiii_bec/scans/metadata_schema/metadata_schema_template.py b/pxiii_bec/scans/metadata_schema/metadata_schema_template.py new file mode 100644 index 0000000..c12e364 --- /dev/null +++ b/pxiii_bec/scans/metadata_schema/metadata_schema_template.py @@ -0,0 +1,34 @@ +# # By inheriting from BasicScanMetadata you can define a schema by which metadata +# # supplied to a scan must be validated. +# # This schema is a Pydantic model: https://docs.pydantic.dev/latest/concepts/models/ +# # but by default it will still allow you to add any arbitrary information to it. +# # That is to say, when you run a scan with which such a model has been associated in the +# # metadata_schema_registry, you can supply any python dictionary with strings as keys +# # and built-in python types (strings, integers, floats) as values, and these will be +# # added to the experiment metadata, but it *must* contain the keys and values of the +# # types defined in the schema class. +# # +# # +# # For example, say that you would like to enforce recording information about sample +# # pretreatment, you could define the following: +# # +# +# from bec_lib.metadata_schema import BasicScanMetadata +# +# +# class ExampleSchema(BasicScanMetadata): +# treatment_description: str +# treatment_temperature_k: int +# +# +# # If this was used according to the example in metadata_schema_registry.py, +# # then when calling the scan, the user would need to write something like: +# >>> scans.example_scan( +# >>> motor, +# >>> 1, +# >>> 2, +# >>> 3, +# >>> metadata={"treatment_description": "oven overnight", "treatment_temperature_k": 575}, +# >>> ) +# +# # And the additional metadata would be saved in the HDF5 file created for the scan. diff --git a/pxiii_bec/services/__init__.py b/pxiii_bec/services/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml index 1297ab6..f030919 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] name = "pxiii_bec" version = "0.0.0" -description = "Custom device implementations based on the ophyd hardware abstraction layer" +description = "A plugin repository for BEC" requires-python = ">=3.10" classifiers = [ "Development Status :: 3 - Alpha", @@ -28,19 +28,21 @@ dependencies = [ [project.optional-dependencies] dev = [ "black", + "copier", "isort", "coverage", "pylint", "pytest", "pytest-random-order", - "pytest-redis", + "ophyd_devices", + "bec_server", ] [project.entry-points."bec"] plugin_bec = "pxiii_bec" [project.entry-points."bec.deployment.device_server"] -plugin_ds_startup = "pxiii_bec.deployment.device_server.startup:run" +plugin_ds_startup = "pxiii_bec.deployments.device_server.startup:run" [project.entry-points."bec.file_writer"] plugin_file_writer = "pxiii_bec.file_writer" @@ -48,12 +50,18 @@ plugin_file_writer = "pxiii_bec.file_writer" [project.entry-points."bec.scans"] plugin_scans = "pxiii_bec.scans" +[project.entry-points."bec.scans.metadata_schema"] +plugin_metadata_schema = "pxiii_bec.scans.metadata_schema" + [project.entry-points."bec.ipython_client_startup"] plugin_ipython_client_pre = "pxiii_bec.bec_ipython_client.startup.pre_startup" plugin_ipython_client_post = "pxiii_bec.bec_ipython_client.startup" [project.entry-points."bec.widgets.auto_updates"] -plugin_widgets_update = "pxiii_bec.bec_widgets.auto_updates:PlotUpdate" +plugin_widgets_update = "pxiii_bec.bec_widgets.auto_updates" + +[project.entry-points."bec.widgets.user_widgets"] +plugin_widgets = "pxiii_bec.bec_widgets.widgets" [tool.hatch.build.targets.wheel] include = ["*"] diff --git a/tests/tests_bec_ipython_client/README.md b/tests/tests_bec_ipython_client/README.md index 5762245..63d535f 100644 --- a/tests/tests_bec_ipython_client/README.md +++ b/tests/tests_bec_ipython_client/README.md @@ -1,31 +1,34 @@ # Getting Started with Testing using pytest -BEC is using the [pytest](https://docs.pytest.org/en/8.0.x/) framework. -It can be install via -``` bash +BEC is using the [pytest](https://docs.pytest.org/en/latest/) framework. +It can be installed via + +```bash pip install pytest ``` -in your *python environment*. + +in your _python environment_. We note that pytest is part of the optional-dependencies `[dev]` of the plugin package. ## Introduction Tests in this package should be stored in the `tests` directory. We suggest to sort tests of different submodules, i.e. `scans` or `devices` in the respective folder structure, and to folow a naming convention of ``. +It is mandatory for test files to begin with `test_` for pytest to discover them. -To run all tests, navigate to the directory of the plugin from the command line, and run the command +To run all tests, navigate to the directory of the plugin from the command line, and run the command -``` bash +```bash pytest -v --random-order ./tests ``` + Note, the python environment needs to be active. The additional arg `-v` allows pytest to run in verbose mode which provides more detailed information about the tests being run. -The argument `--random-order` instructs pytest to run the tests in random order, which is the default in the CI pipelines. +The argument `--random-order` instructs pytest to run the tests in random order, which is the default in the CI pipelines. ## Test examples -Writing tests can be quite specific for the given function. +Writing tests can be quite specific for the given function. We recommend writing tests as isolated as possible, i.e. try to test single functions instead of full classes. A very useful class to enable isolated testing is [MagicMock](https://docs.python.org/3/library/unittest.mock.html). In addition, we also recommend to take a look at the [How-to guides from pytest](https://docs.pytest.org/en/8.0.x/how-to/index.html). - diff --git a/tests/tests_bec_widgets/README.md b/tests/tests_bec_widgets/README.md index 5762245..63d535f 100644 --- a/tests/tests_bec_widgets/README.md +++ b/tests/tests_bec_widgets/README.md @@ -1,31 +1,34 @@ # Getting Started with Testing using pytest -BEC is using the [pytest](https://docs.pytest.org/en/8.0.x/) framework. -It can be install via -``` bash +BEC is using the [pytest](https://docs.pytest.org/en/latest/) framework. +It can be installed via + +```bash pip install pytest ``` -in your *python environment*. + +in your _python environment_. We note that pytest is part of the optional-dependencies `[dev]` of the plugin package. ## Introduction Tests in this package should be stored in the `tests` directory. We suggest to sort tests of different submodules, i.e. `scans` or `devices` in the respective folder structure, and to folow a naming convention of ``. +It is mandatory for test files to begin with `test_` for pytest to discover them. -To run all tests, navigate to the directory of the plugin from the command line, and run the command +To run all tests, navigate to the directory of the plugin from the command line, and run the command -``` bash +```bash pytest -v --random-order ./tests ``` + Note, the python environment needs to be active. The additional arg `-v` allows pytest to run in verbose mode which provides more detailed information about the tests being run. -The argument `--random-order` instructs pytest to run the tests in random order, which is the default in the CI pipelines. +The argument `--random-order` instructs pytest to run the tests in random order, which is the default in the CI pipelines. ## Test examples -Writing tests can be quite specific for the given function. +Writing tests can be quite specific for the given function. We recommend writing tests as isolated as possible, i.e. try to test single functions instead of full classes. A very useful class to enable isolated testing is [MagicMock](https://docs.python.org/3/library/unittest.mock.html). In addition, we also recommend to take a look at the [How-to guides from pytest](https://docs.pytest.org/en/8.0.x/how-to/index.html). - diff --git a/tests/tests_dap_services/README.md b/tests/tests_dap_services/README.md index 5762245..63d535f 100644 --- a/tests/tests_dap_services/README.md +++ b/tests/tests_dap_services/README.md @@ -1,31 +1,34 @@ # Getting Started with Testing using pytest -BEC is using the [pytest](https://docs.pytest.org/en/8.0.x/) framework. -It can be install via -``` bash +BEC is using the [pytest](https://docs.pytest.org/en/latest/) framework. +It can be installed via + +```bash pip install pytest ``` -in your *python environment*. + +in your _python environment_. We note that pytest is part of the optional-dependencies `[dev]` of the plugin package. ## Introduction Tests in this package should be stored in the `tests` directory. We suggest to sort tests of different submodules, i.e. `scans` or `devices` in the respective folder structure, and to folow a naming convention of ``. +It is mandatory for test files to begin with `test_` for pytest to discover them. -To run all tests, navigate to the directory of the plugin from the command line, and run the command +To run all tests, navigate to the directory of the plugin from the command line, and run the command -``` bash +```bash pytest -v --random-order ./tests ``` + Note, the python environment needs to be active. The additional arg `-v` allows pytest to run in verbose mode which provides more detailed information about the tests being run. -The argument `--random-order` instructs pytest to run the tests in random order, which is the default in the CI pipelines. +The argument `--random-order` instructs pytest to run the tests in random order, which is the default in the CI pipelines. ## Test examples -Writing tests can be quite specific for the given function. +Writing tests can be quite specific for the given function. We recommend writing tests as isolated as possible, i.e. try to test single functions instead of full classes. A very useful class to enable isolated testing is [MagicMock](https://docs.python.org/3/library/unittest.mock.html). In addition, we also recommend to take a look at the [How-to guides from pytest](https://docs.pytest.org/en/8.0.x/how-to/index.html). - diff --git a/tests/tests_devices/README.md b/tests/tests_devices/README.md index 5762245..63d535f 100644 --- a/tests/tests_devices/README.md +++ b/tests/tests_devices/README.md @@ -1,31 +1,34 @@ # Getting Started with Testing using pytest -BEC is using the [pytest](https://docs.pytest.org/en/8.0.x/) framework. -It can be install via -``` bash +BEC is using the [pytest](https://docs.pytest.org/en/latest/) framework. +It can be installed via + +```bash pip install pytest ``` -in your *python environment*. + +in your _python environment_. We note that pytest is part of the optional-dependencies `[dev]` of the plugin package. ## Introduction Tests in this package should be stored in the `tests` directory. We suggest to sort tests of different submodules, i.e. `scans` or `devices` in the respective folder structure, and to folow a naming convention of ``. +It is mandatory for test files to begin with `test_` for pytest to discover them. -To run all tests, navigate to the directory of the plugin from the command line, and run the command +To run all tests, navigate to the directory of the plugin from the command line, and run the command -``` bash +```bash pytest -v --random-order ./tests ``` + Note, the python environment needs to be active. The additional arg `-v` allows pytest to run in verbose mode which provides more detailed information about the tests being run. -The argument `--random-order` instructs pytest to run the tests in random order, which is the default in the CI pipelines. +The argument `--random-order` instructs pytest to run the tests in random order, which is the default in the CI pipelines. ## Test examples -Writing tests can be quite specific for the given function. +Writing tests can be quite specific for the given function. We recommend writing tests as isolated as possible, i.e. try to test single functions instead of full classes. A very useful class to enable isolated testing is [MagicMock](https://docs.python.org/3/library/unittest.mock.html). In addition, we also recommend to take a look at the [How-to guides from pytest](https://docs.pytest.org/en/8.0.x/how-to/index.html). - diff --git a/tests/tests_file_writer/README.md b/tests/tests_file_writer/README.md new file mode 100644 index 0000000..63d535f --- /dev/null +++ b/tests/tests_file_writer/README.md @@ -0,0 +1,34 @@ +# Getting Started with Testing using pytest + +BEC is using the [pytest](https://docs.pytest.org/en/latest/) framework. +It can be installed via + +```bash +pip install pytest +``` + +in your _python environment_. +We note that pytest is part of the optional-dependencies `[dev]` of the plugin package. + +## Introduction + +Tests in this package should be stored in the `tests` directory. +We suggest to sort tests of different submodules, i.e. `scans` or `devices` in the respective folder structure, and to folow a naming convention of ``. +It is mandatory for test files to begin with `test_` for pytest to discover them. + +To run all tests, navigate to the directory of the plugin from the command line, and run the command + +```bash +pytest -v --random-order ./tests +``` + +Note, the python environment needs to be active. +The additional arg `-v` allows pytest to run in verbose mode which provides more detailed information about the tests being run. +The argument `--random-order` instructs pytest to run the tests in random order, which is the default in the CI pipelines. + +## Test examples + +Writing tests can be quite specific for the given function. +We recommend writing tests as isolated as possible, i.e. try to test single functions instead of full classes. +A very useful class to enable isolated testing is [MagicMock](https://docs.python.org/3/library/unittest.mock.html). +In addition, we also recommend to take a look at the [How-to guides from pytest](https://docs.pytest.org/en/8.0.x/how-to/index.html). diff --git a/tests/tests_scans/README.md b/tests/tests_scans/README.md index 5762245..63d535f 100644 --- a/tests/tests_scans/README.md +++ b/tests/tests_scans/README.md @@ -1,31 +1,34 @@ # Getting Started with Testing using pytest -BEC is using the [pytest](https://docs.pytest.org/en/8.0.x/) framework. -It can be install via -``` bash +BEC is using the [pytest](https://docs.pytest.org/en/latest/) framework. +It can be installed via + +```bash pip install pytest ``` -in your *python environment*. + +in your _python environment_. We note that pytest is part of the optional-dependencies `[dev]` of the plugin package. ## Introduction Tests in this package should be stored in the `tests` directory. We suggest to sort tests of different submodules, i.e. `scans` or `devices` in the respective folder structure, and to folow a naming convention of ``. +It is mandatory for test files to begin with `test_` for pytest to discover them. -To run all tests, navigate to the directory of the plugin from the command line, and run the command +To run all tests, navigate to the directory of the plugin from the command line, and run the command -``` bash +```bash pytest -v --random-order ./tests ``` + Note, the python environment needs to be active. The additional arg `-v` allows pytest to run in verbose mode which provides more detailed information about the tests being run. -The argument `--random-order` instructs pytest to run the tests in random order, which is the default in the CI pipelines. +The argument `--random-order` instructs pytest to run the tests in random order, which is the default in the CI pipelines. ## Test examples -Writing tests can be quite specific for the given function. +Writing tests can be quite specific for the given function. We recommend writing tests as isolated as possible, i.e. try to test single functions instead of full classes. A very useful class to enable isolated testing is [MagicMock](https://docs.python.org/3/library/unittest.mock.html). In addition, we also recommend to take a look at the [How-to guides from pytest](https://docs.pytest.org/en/8.0.x/how-to/index.html). - -- 2.49.1 From 6fedf7091f59eb1056f63718f55aac7ad6e17a4e Mon Sep 17 00:00:00 2001 From: David Perl Date: Tue, 20 May 2025 09:36:15 +0200 Subject: [PATCH 2/2] chore: remove out-of-date deployment dir --- deployment/autodeploy_versions | 11 ----------- deployment/bec-server-config.yaml | 18 ------------------ deployment/deploy.sh | 29 ----------------------------- 3 files changed, 58 deletions(-) delete mode 100644 deployment/autodeploy_versions delete mode 100644 deployment/bec-server-config.yaml delete mode 100755 deployment/deploy.sh diff --git a/deployment/autodeploy_versions b/deployment/autodeploy_versions deleted file mode 100644 index 44c018c..0000000 --- a/deployment/autodeploy_versions +++ /dev/null @@ -1,11 +0,0 @@ -# This file is used to select the BEC and Ophyd Devices version for the auto deployment process. -# Do not edit this file unless you know what you are doing! - -# The version can be a git tag, branch or commit hash. - -# BEC version to use -BEC_AUTODEPLOY_VERSION="master" - -# ophyd_devices version to use -OPHYD_DEVICES_AUTODEPLOY_VERSION="master" - diff --git a/deployment/bec-server-config.yaml b/deployment/bec-server-config.yaml deleted file mode 100644 index 7c0c7e7..0000000 --- a/deployment/bec-server-config.yaml +++ /dev/null @@ -1,18 +0,0 @@ -redis: - host: localhost - port: 6379 -mongodb: - host: localhost - port: 27017 -scibec: - host: http://[::1] - port: 3030 - beamline: "PXIII" -service_config: - general: - reset_queue_on_cancel: True - enforce_ACLs: False - file_writer: - plugin: default_NeXus_format - base_path: ./ - diff --git a/deployment/deploy.sh b/deployment/deploy.sh deleted file mode 100755 index 1f98e32..0000000 --- a/deployment/deploy.sh +++ /dev/null @@ -1,29 +0,0 @@ -# deployment script to be translated to Ansible - -# can be removed once we have the autodeployment in place -BEAMLINE_REPO=gitlab.psi.ch:bec/pxiii-bec.git -git clone git@$BEAMLINE_REPO - -module add psi-python311/2024.02 - -# start redis -docker run --network=host --name redis-bec -d redis -# alternative: -# conda install -y redis; redis-server & - - -# get the target versions for ophyd_devices and BEC -source ./pxiii-bec/deployment/autodeploy_versions - -git clone -b $OPHYD_DEVICES_AUTODEPLOY_VERSION https://gitlab.psi.ch/bec/ophyd_devices.git -git clone -b $BEC_AUTODEPLOY_VERSION https://gitlab.psi.ch/bec/bec.git - -# install BEC -cd bec -source ./bin/install_bec_dev.sh -cd ../ - -pip install -e ./pxiii-bec - -# start the BEC server -bec-server start --config ./pxiii-bec/deployment/bec-server-config.yaml -- 2.49.1