Skip to content

Commit 593c1f0

Browse files
authored
CI: add dev container (#29)
1 parent 4436c6d commit 593c1f0

File tree

4 files changed

+48
-7
lines changed

4 files changed

+48
-7
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"name": "NSDF INTERSECT",
33
"image": "mcr.microsoft.com/devcontainers/python:3.10",
44
"features": {
5-
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
6-
"ghcr.io/devcontainers/features/make:1": {}
5+
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
76
},
87
"forwardPorts": [10042, 10043, 15672, 1883, 5672],
98
"customizations": {
@@ -13,5 +12,6 @@
1312
"terminal.integrated.defaultProfile.linux": "bash"
1413
}
1514
}
16-
}
15+
},
16+
"postCreateCommand": "pip install pyyaml numpy intersect-sdk[amqp]"
1717
}

README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ This repository hosts the dashboard, dashboard service, storage service, and tes
3030
- [Transition client](#transition_clientpy)
3131
- [Running all services](#-running-all-services)
3232
- [Running with pre-built images](#running-with-pre-built-images)
33+
- [Running with codespaces](#running-with-codespaces)
3334
- [Authors](#authors)
3435
- [Acknowledgements](#acknowledgements)
3536

@@ -44,7 +45,7 @@ The dashboard is the visualization component for monitoring the experiment in re
4445
To build the Docker image for the dashboard, run the following:
4546

4647
```bash
47-
docker build --platform linux/amd64 -t intersect-dashboard -f Dockerfile.dashboard .
48+
docker build -t intersect-dashboard -f Dockerfile.dashboard .
4849
```
4950

5051
#### Running the dashboard container
@@ -200,6 +201,46 @@ To stop and clean up the services.
200201
docker compose down
201202
```
202203

204+
## Running with codespaces
205+
206+
Click the next button to open in GitHub Codespaces
207+
208+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/nsdf-fabric/NSDF-INTERSECT)
209+
210+
Verify that you are using the `main` branch, the repository name `nsdf-fabric/NSDF-INTERSECT` and the dev container configuration `NSDF INTERSECT`. Then click on `Create Codespace`
211+
212+
### 📦 Building the services
213+
214+
Once the environment is created, we can build the services with the following:
215+
216+
```bash
217+
make dashboard
218+
```
219+
220+
```bash
221+
make service
222+
```
223+
224+
```bash
225+
make storage
226+
```
227+
228+
### 🌐 Setting up the network
229+
230+
Next, we can build the networking for the system with compose as follows:
231+
232+
```bash
233+
make up
234+
```
235+
236+
### 🧪 Running experiment campaigns
237+
238+
Finally, we can run a test client as follows:
239+
240+
```bash
241+
make transition
242+
```
243+
203244
## Authors
204245

205246
This project was created by the [NSDF team](https://nationalsciencedatafabric.org/contributors.html), and the [INTERSECT team](https://www.ornl.gov/intersect).

assets/team_logo.png

319 KB
Loading

clients/single_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def prepare_bragg_messages(n: int = 1):
8686
def prepare_transition_message():
8787
return IntersectDirectMessageParams(
8888
destination="nsdf.cloud.diffraction.dashboard.dashboard-service",
89-
operation="NSDFDashboard.get_transition_data",
89+
operation="NSDFDashboard.get_transition_data_single",
9090
payload=TransitionData(
9191
id=str(uuid4()), temp=transition_data[0][0], ylist=transition_data[0][1:]
9292
),
@@ -119,7 +119,7 @@ def main():
119119
"--bragg", action="store_true", default=False, help="send bragg file"
120120
)
121121
parser.add_argument(
122-
"--tpoint", action="store_true", default=False, help="send transition data"
122+
"--transition", action="store_true", default=False, help="send transition data"
123123
)
124124
parser.add_argument(
125125
"--next-temp",
@@ -135,7 +135,7 @@ def main():
135135
if args.bragg:
136136
for msg in prepare_bragg_messages(args.n):
137137
initial_messages.append(msg)
138-
if args.tpoint:
138+
if args.transition:
139139
initial_messages.append(prepare_transition_message())
140140
if args.next_temp:
141141
initial_messages.append(prepare_next_temperature_message(args.val))

0 commit comments

Comments
 (0)