nbs-pods 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. nbs_pods-0.2.2/.dockerignore +9 -0
  2. nbs_pods-0.2.2/.github/workflows/build-images.yml +159 -0
  3. nbs_pods-0.2.2/.github/workflows/python-publish.yml +70 -0
  4. nbs_pods-0.2.2/.gitignore +33 -0
  5. nbs_pods-0.2.2/PKG-INFO +165 -0
  6. nbs_pods-0.2.2/README.md +151 -0
  7. nbs_pods-0.2.2/docker-compose.build.yml +48 -0
  8. nbs_pods-0.2.2/images/bluesky/Containerfile +16 -0
  9. nbs_pods-0.2.2/images/gui/Containerfile +6 -0
  10. nbs_pods-0.2.2/images/nbs/Containerfile +4 -0
  11. nbs_pods-0.2.2/images/queueserver/Containerfile +6 -0
  12. nbs_pods-0.2.2/images/sim/Containerfile +6 -0
  13. nbs_pods-0.2.2/images/viewer/Containerfile +6 -0
  14. nbs_pods-0.2.2/pixi.lock +1838 -0
  15. nbs_pods-0.2.2/pyproject.toml +80 -0
  16. nbs_pods-0.2.2/scripts/build-images.sh +50 -0
  17. nbs_pods-0.2.2/scripts/create-beamline-pods.sh +51 -0
  18. nbs_pods-0.2.2/scripts/deploy.sh +19 -0
  19. nbs_pods-0.2.2/scripts/nbs-pods-lib.sh +194 -0
  20. nbs_pods-0.2.2/src/nbs_pods/__init__.py +8 -0
  21. nbs_pods-0.2.2/src/nbs_pods/cli.py +253 -0
  22. nbs_pods-0.2.2/src/nbs_pods/compose/bluesky-services/docker-compose.yml +88 -0
  23. nbs_pods-0.2.2/src/nbs_pods/compose/bsui/docker-compose.yml +20 -0
  24. nbs_pods-0.2.2/src/nbs_pods/compose/gui/docker-compose.development.yml +8 -0
  25. nbs_pods-0.2.2/src/nbs_pods/compose/gui/docker-compose.wayland.yml +28 -0
  26. nbs_pods-0.2.2/src/nbs_pods/compose/gui/docker-compose.x11.yml +24 -0
  27. nbs_pods-0.2.2/src/nbs_pods/compose/queueserver/docker-compose.development.yml +10 -0
  28. nbs_pods-0.2.2/src/nbs_pods/compose/queueserver/docker-compose.yml +19 -0
  29. nbs_pods-0.2.2/src/nbs_pods/compose/sim/docker-compose.development.yml +6 -0
  30. nbs_pods-0.2.2/src/nbs_pods/compose/sim/docker-compose.yml +14 -0
  31. nbs_pods-0.2.2/src/nbs_pods/compose/viewer/docker-compose.development.yml +7 -0
  32. nbs_pods-0.2.2/src/nbs_pods/compose/viewer/docker-compose.wayland.yml +23 -0
  33. nbs_pods-0.2.2/src/nbs_pods/compose/viewer/docker-compose.x11.yml +19 -0
  34. nbs_pods-0.2.2/src/nbs_pods/compose.py +174 -0
  35. nbs_pods-0.2.2/src/nbs_pods/config/bluesky/kafka.yml +8 -0
  36. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/pixi.lock +15838 -0
  37. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/pixi.toml +101 -0
  38. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/scripts/gui-dev.sh +6 -0
  39. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/scripts/gui-start.sh +4 -0
  40. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/scripts/qs-dev.sh +6 -0
  41. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/scripts/qs-start.sh +4 -0
  42. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/scripts/sim-dev.sh +6 -0
  43. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/scripts/sim-start.sh +5 -0
  44. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/scripts/viewer-dev.sh +5 -0
  45. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/scripts/viewer-start.sh +4 -0
  46. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/startup/00-startup.py +30 -0
  47. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/startup/README +11 -0
  48. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/startup/beamline.toml +48 -0
  49. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/startup/devices.toml +148 -0
  50. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/startup/example_load.csv +29 -0
  51. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/startup/example_load.toml +4 -0
  52. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/startup/existing_plans_and_devices.yaml +10294 -0
  53. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/startup/gui_config.toml +48 -0
  54. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/startup/regions.toml +101 -0
  55. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/startup/sim_conf.toml +30 -0
  56. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/startup/user_group_permissions.yaml +25 -0
  57. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/startup/viewer_config.toml +12 -0
  58. nbs_pods-0.2.2/src/nbs_pods/config/ipython/profile_default/startup/xas_queue.csv +2 -0
  59. nbs_pods-0.2.2/src/nbs_pods/config/pixi/config.toml +1 -0
  60. nbs_pods-0.2.2/src/nbs_pods/config/tiled/config/config.yml +7 -0
  61. nbs_pods-0.2.2/src/nbs_pods/config/tiled/profiles/profile.yml +9 -0
  62. nbs_pods-0.2.2/src/nbs_pods/config.py +67 -0
  63. nbs_pods-0.2.2/src/nbs_pods/create.py +223 -0
  64. nbs_pods-0.2.2/src/nbs_pods/display.py +34 -0
  65. nbs_pods-0.2.2/src/nbs_pods/services.py +116 -0
  66. nbs_pods-0.2.2/src/nbs_pods/templates/.gitignore +27 -0
  67. nbs_pods-0.2.2/src/nbs_pods/templates/MANIFEST.in +7 -0
  68. nbs_pods-0.2.2/src/nbs_pods/templates/README.md +103 -0
  69. nbs_pods-0.2.2/src/nbs_pods/templates/pyproject.toml +45 -0
  70. nbs_pods-0.2.2/src/nbs_pods/templates/src/beamline_pods/__init__.py +0 -0
  71. nbs_pods-0.2.2/src/nbs_pods/templates/src/beamline_pods/config/ipython/profile_default/startup/beamline.toml +28 -0
  72. nbs_pods-0.2.2/src/nbs_pods/templates/src/beamline_pods/config/ipython/profile_default/startup/devices.toml +6 -0
  73. nbs_pods-0.2.2/src/nbs_pods/templates/src/beamline_pods/config/ipython/profile_default/startup/user_group_permissions.yaml +25 -0
  74. nbs_pods-0.2.2/src/nbs_pods/templates/src/beamline_pods/deploy.py +35 -0
@@ -0,0 +1,9 @@
1
+ # Pixi cache directory
2
+ config/ipython/profile_default/.pixi/
3
+ **/.pixi/
4
+
5
+ # Other common exclusions
6
+ .git/
7
+ .gitignore
8
+ *.md
9
+ README*
@@ -0,0 +1,159 @@
1
+ name: Build and Push Container Images
2
+
3
+ on:
4
+ push:
5
+ tags: [ 'v*' ]
6
+ workflow_dispatch: # Manual trigger
7
+
8
+ env:
9
+ REGISTRY: ghcr.io
10
+ IMAGE_NAME: ${{ github.repository }}
11
+
12
+ jobs:
13
+ build:
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ contents: read
17
+ packages: write
18
+
19
+ steps:
20
+ - name: Checkout repository
21
+ uses: actions/checkout@v4
22
+
23
+ - name: Set up Docker Buildx
24
+ uses: docker/setup-buildx-action@v3
25
+
26
+ - name: Log in to Container Registry
27
+ uses: docker/login-action@v3
28
+ with:
29
+ registry: ${{ env.REGISTRY }}
30
+ username: ${{ github.actor }}
31
+ password: ${{ secrets.GITHUB_TOKEN }}
32
+
33
+ - name: Docker meta for bluesky
34
+ id: meta-bluesky
35
+ uses: docker/metadata-action@v5
36
+ with:
37
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/bluesky
38
+ tags: |
39
+ type=raw,value=latest
40
+ type=ref,event=branch
41
+ type=ref,event=pr
42
+ type=semver,pattern={{version}}
43
+ type=semver,pattern={{major}}.{{minor}}
44
+ type=sha
45
+
46
+ - name: Build and push bluesky image
47
+ uses: docker/build-push-action@v5
48
+ with:
49
+ context: .
50
+ file: ./images/bluesky/Containerfile
51
+ push: true
52
+ tags: ${{ steps.meta-bluesky.outputs.tags }}
53
+ labels: ${{ steps.meta-bluesky.outputs.labels }}
54
+ cache-from: type=gha
55
+ cache-to: type=gha,mode=max
56
+
57
+ - name: Docker meta for queueserver
58
+ id: meta-queueserver
59
+ uses: docker/metadata-action@v5
60
+ with:
61
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/queueserver
62
+ tags: |
63
+ type=raw,value=latest
64
+ type=ref,event=branch
65
+ type=ref,event=pr
66
+ type=semver,pattern={{version}}
67
+ type=semver,pattern={{major}}.{{minor}}
68
+ type=sha
69
+
70
+ - name: Build and push queueserver image
71
+ uses: docker/build-push-action@v5
72
+ with:
73
+ context: .
74
+ file: ./images/queueserver/Containerfile
75
+ push: true
76
+ tags: ${{ steps.meta-queueserver.outputs.tags }}
77
+ labels: ${{ steps.meta-queueserver.outputs.labels }}
78
+ build-args: |
79
+ BASE_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/bluesky:latest
80
+ cache-from: type=gha
81
+ cache-to: type=gha,mode=max
82
+
83
+ - name: Docker meta for gui
84
+ id: meta-gui
85
+ uses: docker/metadata-action@v5
86
+ with:
87
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/gui
88
+ tags: |
89
+ type=raw,value=latest
90
+ type=ref,event=branch
91
+ type=ref,event=pr
92
+ type=semver,pattern={{version}}
93
+ type=semver,pattern={{major}}.{{minor}}
94
+ type=sha
95
+
96
+ - name: Build and push gui image
97
+ uses: docker/build-push-action@v5
98
+ with:
99
+ context: .
100
+ file: ./images/gui/Containerfile
101
+ push: true
102
+ tags: ${{ steps.meta-gui.outputs.tags }}
103
+ labels: ${{ steps.meta-gui.outputs.labels }}
104
+ build-args: |
105
+ BASE_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/bluesky:latest
106
+ cache-from: type=gha
107
+ cache-to: type=gha,mode=max
108
+
109
+ - name: Docker meta for viewer
110
+ id: meta-viewer
111
+ uses: docker/metadata-action@v5
112
+ with:
113
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/viewer
114
+ tags: |
115
+ type=raw,value=latest
116
+ type=ref,event=branch
117
+ type=ref,event=pr
118
+ type=semver,pattern={{version}}
119
+ type=semver,pattern={{major}}.{{minor}}
120
+ type=sha
121
+
122
+ - name: Build and push viewer image
123
+ uses: docker/build-push-action@v5
124
+ with:
125
+ context: .
126
+ file: ./images/viewer/Containerfile
127
+ push: true
128
+ tags: ${{ steps.meta-viewer.outputs.tags }}
129
+ labels: ${{ steps.meta-viewer.outputs.labels }}
130
+ build-args: |
131
+ BASE_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/bluesky:latest
132
+ cache-from: type=gha
133
+ cache-to: type=gha,mode=max
134
+
135
+ - name: Docker meta for sim
136
+ id: meta-sim
137
+ uses: docker/metadata-action@v5
138
+ with:
139
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/sim
140
+ tags: |
141
+ type=raw,value=latest
142
+ type=ref,event=branch
143
+ type=ref,event=pr
144
+ type=semver,pattern={{version}}
145
+ type=semver,pattern={{major}}.{{minor}}
146
+ type=sha
147
+
148
+ - name: Build and push sim image
149
+ uses: docker/build-push-action@v5
150
+ with:
151
+ context: .
152
+ file: ./images/sim/Containerfile
153
+ push: true
154
+ tags: ${{ steps.meta-sim.outputs.tags }}
155
+ labels: ${{ steps.meta-sim.outputs.labels }}
156
+ build-args: |
157
+ BASE_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/bluesky:latest
158
+ cache-from: type=gha
159
+ cache-to: type=gha,mode=max
@@ -0,0 +1,70 @@
1
+ # This workflow will upload a Python Package to PyPI when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ release-build:
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - uses: actions/checkout@v6
24
+
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.x"
28
+
29
+ - name: Build release distributions
30
+ run: |
31
+ # NOTE: put your own distribution build steps here.
32
+ python -m pip install build
33
+ python -m build
34
+
35
+ - name: Upload distributions
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: release-dists
39
+ path: dist/
40
+
41
+ pypi-publish:
42
+ runs-on: ubuntu-latest
43
+ needs:
44
+ - release-build
45
+ permissions:
46
+ # IMPORTANT: this permission is mandatory for trusted publishing
47
+ id-token: write
48
+
49
+ # Dedicated environments with protections for publishing are strongly recommended.
50
+ # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
51
+ environment:
52
+ name: pypi
53
+ # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54
+ url: https://pypi.org/p/nbs-pods
55
+ #
56
+ # ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57
+ # ALTERNATIVE: exactly, uncomment the following line instead:
58
+ # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
59
+
60
+ steps:
61
+ - name: Retrieve release distributions
62
+ uses: actions/download-artifact@v4
63
+ with:
64
+ name: release-dists
65
+ path: dist/
66
+
67
+ - name: Publish release distributions to PyPI
68
+ uses: pypa/gh-action-pypi-publish@release/v1
69
+ with:
70
+ packages-dir: dist/
@@ -0,0 +1,33 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ *.egg-info/
8
+
9
+ # Editor temporary/backup files
10
+ *~
11
+ \#*\#
12
+ .\#*
13
+
14
+
15
+ # Environment
16
+ .env
17
+ .venv/
18
+ env/
19
+ venv/
20
+
21
+ # IDE
22
+ .idea/
23
+ .vscode/
24
+ *.swp
25
+ *.swo
26
+
27
+ # OS
28
+ .DS_Store
29
+ Thumbs.db
30
+
31
+ # QueueServer
32
+ config/ipython/profile_default/history.sqlite
33
+ config/ipython/profile_default/startup/existing_plans_and_devices.yaml
@@ -0,0 +1,165 @@
1
+ Metadata-Version: 2.4
2
+ Name: nbs-pods
3
+ Version: 0.2.2
4
+ Summary: Containerized NBS (NIST Beamline Software) services for beamline simulation
5
+ Project-URL: homepage, https://github.com/xraygui/nbs-pods
6
+ Author-email: Charles Titus <ctitus@bnl.gov>
7
+ Keywords: beamline,bluesky,containers,nsls-ii,podman
8
+ Classifier: Intended Audience :: Science/Research
9
+ Classifier: License :: Public Domain
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: >=3.8
13
+ Description-Content-Type: text/markdown
14
+
15
+ # NBS Pods
16
+
17
+ Containerized NBS (NIST Beamline Software) services for beamline simulation.
18
+
19
+ ## Container Images
20
+
21
+ This repository provides containerized NBS services that can be run in two modes:
22
+
23
+ ### Demo Mode (Pre-built Images)
24
+ Uses pre-built images from GitHub Container Registry (GHCR):
25
+ ```bash
26
+ # Images are automatically built and pushed to:
27
+ # ghcr.io/xraygui/nbs-pods/bluesky:latest
28
+ # ghcr.io/xraygui/nbs-pods/nbs:latest
29
+ # ghcr.io/xraygui/nbs-pods/nbs-gui:latest
30
+ ```
31
+
32
+ ### Development Mode (Local Builds)
33
+ Build images locally for development:
34
+ ```bash
35
+ # Build all images
36
+ podman-compose -f docker-compose.build.yml build
37
+
38
+ # Build specific image
39
+ podman-compose -f docker-compose.build.yml build nbs
40
+
41
+ # Rebuild with no caching
42
+ podman-compose -f docker-compose.build.yml build --no-cache nbs_gui
43
+ ```
44
+
45
+ ## Image Dependencies
46
+
47
+ ```
48
+ fedora → bluesky → nbs → nbs-gui
49
+ ```
50
+
51
+ ## Usage
52
+
53
+ ### Demo Mode (Default)
54
+ ```bash
55
+ # Start all services with pre-built images
56
+ ./scripts/deploy.sh start
57
+
58
+ # Start specific services
59
+ ./scripts/deploy.sh start gui queueserver
60
+
61
+ # Start demo services (bluesky-services, gui, queueserver, sim, viewer)
62
+ ./scripts/deploy.sh demo
63
+ ```
64
+
65
+ ### Development Mode
66
+ ```bash
67
+ # Build images locally first
68
+ podman-compose -f docker-compose.build.yml build
69
+
70
+ # Start specific services in development mode
71
+ ./scripts/deploy.sh start --dev gui
72
+
73
+ # Mix normal and development mode
74
+ ./scripts/deploy.sh start queueserver --dev gui
75
+ ```
76
+
77
+ ### Stopping Services
78
+ ```bash
79
+ # Stop all services
80
+ ./scripts/deploy.sh stop
81
+
82
+ # Stop specific services
83
+ ./scripts/deploy.sh stop gui queueserver
84
+ ```
85
+
86
+ ## Available Services
87
+
88
+ - **bluesky-services**: Core infrastructure (Redis, MongoDB, Kafka, ZMQ proxies)
89
+ - **queueserver**: RE Manager for experiment orchestration
90
+ - **gui**: NBS GUI with display protocol detection (Wayland/X11)
91
+ - **sim**: NBS simulation services
92
+ - **viewer**: Additional viewing services (if configured)
93
+
94
+ ## Development Workflow
95
+
96
+ ### Docker Compose Override System
97
+
98
+ The deployment system uses Docker Compose's override mechanism to enable flexible configuration:
99
+
100
+ 1. **Base Configuration**: Each service has a main `docker-compose.yml` file with default settings
101
+ 2. **Override Files**: `docker-compose.override.yml` files (if present) are automatically composed with the main file
102
+ 3. **Development Files**: `docker-compose.development.yml` files are applied when using the `--dev` flag
103
+
104
+ ### Override Files (`docker-compose.override.yml`)
105
+
106
+ Override files allow local customization without modifying the base configuration:
107
+ - **Testing**: Override environment variables, ports, or volumes for testing
108
+ - **Bug Fixes**: Temporarily modify service parameters to work around issues
109
+ - **GUI Configuration**: Especially useful for display protocol issues (Wayland/X11)
110
+ - **Local Paths**: Mount local directories for configuration or data
111
+
112
+ Example override file:
113
+ ```yaml
114
+ services:
115
+ qs-gui:
116
+ volumes:
117
+ - ${HOME}/local-config:/etc/bluesky
118
+ environment:
119
+ - DEBUG=true
120
+ ```
121
+
122
+ ### Development Files (`docker-compose.development.yml`)
123
+
124
+ Development files are applied when using the `--dev` flag and typically:
125
+ - **Switch to Local Images**: Use locally built images instead of GHCR images
126
+ - **Config Mounts**: Mount configuration directories to test config changes
127
+ - **Code Mounts**: Mount local source code directories for live development
128
+ - **Local Installs**: Install packages from local paths with `pip install -e`
129
+ - **Debug Settings**: Enable debugging, logging, or development-specific configurations
130
+
131
+ Example development file which only mounts local config directories
132
+ ```yaml
133
+ services:
134
+ qs-gui:
135
+ volumes:
136
+ - ${NBS_PODS_DIR}/config/bluesky:/etc/bluesky
137
+ - ${BEAMLINE_PODS_DIR}/config/ipython:/usr/local/share/ipython
138
+ - ${NBS_PODS_DIR}/config/tiled:/etc/tiled
139
+ ```
140
+
141
+ Example development file which installs local code
142
+ ```yaml
143
+ services:
144
+ nbs-sim:
145
+ volumes:
146
+ - ${NBSDIR}:/usr/local/src/xraygui
147
+ - ${BEAMLINE_PODS_DIR}/config/ipython:/usr/local/share/ipython
148
+ command: >
149
+ bash -c "
150
+ pip3 install --no-deps --no-build-isolation -e /usr/local/src/xraygui/nbs-sim/src &&
151
+ nbs-sim --startup-dir /usr/local/share/ipython/profile_default/startup --list-pvs
152
+ "
153
+ ```
154
+ ### File Resolution Order
155
+
156
+ The system resolves compose files in this order:
157
+ 1. Base service file (e.g., `docker-compose.yml`)
158
+ 2. Override file (`docker-compose.override.yml`) - if present
159
+ 3. Development file (`docker-compose.development.yml`) - if `--dev` flag used
160
+
161
+ Later files override earlier ones, allowing for flexible configuration management.
162
+
163
+ ## Configuration
164
+
165
+ Images include default configurations in `/etc/bluesky` and `/etc/tiled/profiles` which can be overridden with volume mounts in development mode.
@@ -0,0 +1,151 @@
1
+ # NBS Pods
2
+
3
+ Containerized NBS (NIST Beamline Software) services for beamline simulation.
4
+
5
+ ## Container Images
6
+
7
+ This repository provides containerized NBS services that can be run in two modes:
8
+
9
+ ### Demo Mode (Pre-built Images)
10
+ Uses pre-built images from GitHub Container Registry (GHCR):
11
+ ```bash
12
+ # Images are automatically built and pushed to:
13
+ # ghcr.io/xraygui/nbs-pods/bluesky:latest
14
+ # ghcr.io/xraygui/nbs-pods/nbs:latest
15
+ # ghcr.io/xraygui/nbs-pods/nbs-gui:latest
16
+ ```
17
+
18
+ ### Development Mode (Local Builds)
19
+ Build images locally for development:
20
+ ```bash
21
+ # Build all images
22
+ podman-compose -f docker-compose.build.yml build
23
+
24
+ # Build specific image
25
+ podman-compose -f docker-compose.build.yml build nbs
26
+
27
+ # Rebuild with no caching
28
+ podman-compose -f docker-compose.build.yml build --no-cache nbs_gui
29
+ ```
30
+
31
+ ## Image Dependencies
32
+
33
+ ```
34
+ fedora → bluesky → nbs → nbs-gui
35
+ ```
36
+
37
+ ## Usage
38
+
39
+ ### Demo Mode (Default)
40
+ ```bash
41
+ # Start all services with pre-built images
42
+ ./scripts/deploy.sh start
43
+
44
+ # Start specific services
45
+ ./scripts/deploy.sh start gui queueserver
46
+
47
+ # Start demo services (bluesky-services, gui, queueserver, sim, viewer)
48
+ ./scripts/deploy.sh demo
49
+ ```
50
+
51
+ ### Development Mode
52
+ ```bash
53
+ # Build images locally first
54
+ podman-compose -f docker-compose.build.yml build
55
+
56
+ # Start specific services in development mode
57
+ ./scripts/deploy.sh start --dev gui
58
+
59
+ # Mix normal and development mode
60
+ ./scripts/deploy.sh start queueserver --dev gui
61
+ ```
62
+
63
+ ### Stopping Services
64
+ ```bash
65
+ # Stop all services
66
+ ./scripts/deploy.sh stop
67
+
68
+ # Stop specific services
69
+ ./scripts/deploy.sh stop gui queueserver
70
+ ```
71
+
72
+ ## Available Services
73
+
74
+ - **bluesky-services**: Core infrastructure (Redis, MongoDB, Kafka, ZMQ proxies)
75
+ - **queueserver**: RE Manager for experiment orchestration
76
+ - **gui**: NBS GUI with display protocol detection (Wayland/X11)
77
+ - **sim**: NBS simulation services
78
+ - **viewer**: Additional viewing services (if configured)
79
+
80
+ ## Development Workflow
81
+
82
+ ### Docker Compose Override System
83
+
84
+ The deployment system uses Docker Compose's override mechanism to enable flexible configuration:
85
+
86
+ 1. **Base Configuration**: Each service has a main `docker-compose.yml` file with default settings
87
+ 2. **Override Files**: `docker-compose.override.yml` files (if present) are automatically composed with the main file
88
+ 3. **Development Files**: `docker-compose.development.yml` files are applied when using the `--dev` flag
89
+
90
+ ### Override Files (`docker-compose.override.yml`)
91
+
92
+ Override files allow local customization without modifying the base configuration:
93
+ - **Testing**: Override environment variables, ports, or volumes for testing
94
+ - **Bug Fixes**: Temporarily modify service parameters to work around issues
95
+ - **GUI Configuration**: Especially useful for display protocol issues (Wayland/X11)
96
+ - **Local Paths**: Mount local directories for configuration or data
97
+
98
+ Example override file:
99
+ ```yaml
100
+ services:
101
+ qs-gui:
102
+ volumes:
103
+ - ${HOME}/local-config:/etc/bluesky
104
+ environment:
105
+ - DEBUG=true
106
+ ```
107
+
108
+ ### Development Files (`docker-compose.development.yml`)
109
+
110
+ Development files are applied when using the `--dev` flag and typically:
111
+ - **Switch to Local Images**: Use locally built images instead of GHCR images
112
+ - **Config Mounts**: Mount configuration directories to test config changes
113
+ - **Code Mounts**: Mount local source code directories for live development
114
+ - **Local Installs**: Install packages from local paths with `pip install -e`
115
+ - **Debug Settings**: Enable debugging, logging, or development-specific configurations
116
+
117
+ Example development file which only mounts local config directories
118
+ ```yaml
119
+ services:
120
+ qs-gui:
121
+ volumes:
122
+ - ${NBS_PODS_DIR}/config/bluesky:/etc/bluesky
123
+ - ${BEAMLINE_PODS_DIR}/config/ipython:/usr/local/share/ipython
124
+ - ${NBS_PODS_DIR}/config/tiled:/etc/tiled
125
+ ```
126
+
127
+ Example development file which installs local code
128
+ ```yaml
129
+ services:
130
+ nbs-sim:
131
+ volumes:
132
+ - ${NBSDIR}:/usr/local/src/xraygui
133
+ - ${BEAMLINE_PODS_DIR}/config/ipython:/usr/local/share/ipython
134
+ command: >
135
+ bash -c "
136
+ pip3 install --no-deps --no-build-isolation -e /usr/local/src/xraygui/nbs-sim/src &&
137
+ nbs-sim --startup-dir /usr/local/share/ipython/profile_default/startup --list-pvs
138
+ "
139
+ ```
140
+ ### File Resolution Order
141
+
142
+ The system resolves compose files in this order:
143
+ 1. Base service file (e.g., `docker-compose.yml`)
144
+ 2. Override file (`docker-compose.override.yml`) - if present
145
+ 3. Development file (`docker-compose.development.yml`) - if `--dev` flag used
146
+
147
+ Later files override earlier ones, allowing for flexible configuration management.
148
+
149
+ ## Configuration
150
+
151
+ Images include default configurations in `/etc/bluesky` and `/etc/tiled/profiles` which can be overridden with volume mounts in development mode.
@@ -0,0 +1,48 @@
1
+ version: '3'
2
+
3
+ services:
4
+ bluesky:
5
+ build:
6
+ context: .
7
+ dockerfile: images/bluesky/Containerfile
8
+ image: bluesky:latest
9
+
10
+ queueserver:
11
+ build:
12
+ context: .
13
+ dockerfile: images/queueserver/Containerfile
14
+ args:
15
+ BASE_IMAGE: bluesky:latest
16
+ image: queueserver:latest
17
+ depends_on:
18
+ - bluesky
19
+
20
+ gui:
21
+ build:
22
+ context: .
23
+ dockerfile: images/gui/Containerfile
24
+ args:
25
+ BASE_IMAGE: bluesky:latest
26
+ image: gui:latest
27
+ depends_on:
28
+ - bluesky
29
+
30
+ viewer:
31
+ build:
32
+ context: .
33
+ dockerfile: images/viewer/Containerfile
34
+ args:
35
+ BASE_IMAGE: bluesky:latest
36
+ image: viewer:latest
37
+ depends_on:
38
+ - bluesky
39
+
40
+ sim:
41
+ build:
42
+ context: .
43
+ dockerfile: images/sim/Containerfile
44
+ args:
45
+ BASE_IMAGE: bluesky:latest
46
+ image: sim:latest
47
+ depends_on:
48
+ - bluesky
@@ -0,0 +1,16 @@
1
+ FROM ghcr.io/prefix-dev/pixi:latest
2
+
3
+ RUN apt-get update && apt-get install -y git
4
+
5
+ RUN mkdir -p /etc/tiled/profiles
6
+ RUN mkdir -p /etc/bluesky
7
+ RUN mkdir -p /etc/pixi
8
+ RUN mkdir -p /opt/pixi/envs
9
+
10
+ # Copy default configurations
11
+ COPY src/nbs_pods/config/tiled/profiles/ /etc/tiled/profiles/
12
+ COPY src/nbs_pods/config/bluesky/ /etc/bluesky/
13
+ COPY src/nbs_pods/config/ipython/ /usr/local/share/ipython/
14
+ COPY src/nbs_pods/config/pixi/ /etc/pixi/
15
+
16
+ WORKDIR /usr/local/share/ipython/profile_default
@@ -0,0 +1,6 @@
1
+ ARG BASE_IMAGE=bluesky
2
+ FROM ${BASE_IMAGE}
3
+
4
+ RUN pixi install -e gui && rm -rf ~/.cache/rattler
5
+
6
+ CMD ["pixi", "run", "gui"]
@@ -0,0 +1,4 @@
1
+ ARG BASE_IMAGE=bluesky
2
+ FROM ${BASE_IMAGE}
3
+
4
+ RUN pixi install -e terminal && rm -rf ~/.cache/rattler
@@ -0,0 +1,6 @@
1
+ ARG BASE_IMAGE=bluesky
2
+ FROM ${BASE_IMAGE}
3
+
4
+ RUN pixi install -e qs && rm -rf ~/.cache/rattler
5
+
6
+ CMD ["pixi", "run", "qs"]
@@ -0,0 +1,6 @@
1
+ ARG BASE_IMAGE=bluesky
2
+ FROM ${BASE_IMAGE}
3
+
4
+ RUN pixi install -e sim && rm -rf ~/.cache/rattler
5
+
6
+ CMD ["pixi", "run", "sim"]
@@ -0,0 +1,6 @@
1
+ ARG BASE_IMAGE=bluesky
2
+ FROM ${BASE_IMAGE}
3
+
4
+ RUN pixi install -e viewer && rm -rf ~/.cache/rattler
5
+
6
+ CMD ["pixi", "run", "viewer"]