Skip to content

Commit 05e2012

Browse files
authored
Merge pull request #175 from epics-containers/post-first-workshop
remove reference to .profile
2 parents 5b1a2f4 + 0793fb4 commit 05e2012

12 files changed

+52
-54
lines changed

docs/reference/docker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ We do fully support `docker`, please report any issues you find.
1313

1414
There are a few things to know if you are using `docker` in your developer containers:
1515

16-
1. add `export EC_REMOTE_USER=$USER` into your `$HOME/.profile`. The epics-containers devcontainer.json files will use this to set the account that your user will use inside devcontainers.
16+
1. add `export EC_REMOTE_USER=$USER` into your `$HOME/.bashrc` (or `$HOME/.zshrc` for zsh users). The epics-containers devcontainer.json files will use this to set the account that your user will use inside devcontainers.
1717
1. you may need to tell git that you are ok with the repository permissions. `vscode` may ask you about this or you may need to do the command:
1818
```bash
1919
git config --global --add safe.directory <Git folder>

docs/reference/environment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Perhaps the simplest way to achieve this is to install `ec` into your user space
9292
pip install --user ec-cli
9393
```
9494

95-
Then add the following to your `$HOME/.profile` file:
95+
Then add the following to your `$HOME/.bashrc` (or `$HOME/.zshrc` for zsh users):
9696

9797
```bash
9898
PATH=$PATH:$HOME/.local/bin

docs/tutorials/create_ioc.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ The config folder can contain a variety of different files [as listed here](http
126126

127127
Each `entity` listed in the *IOC yaml* file will create an instance of the support module `entity_model` that it refers to. It will pass a number of arguments to the `entity_model` that will be used to generate the startup script entries and EPICS Database entries for that entity. The `entity_model` is responsible for declaring the parameters it expects and how they are used in the script and DB entries it generates. It supplies types and descriptions for each of these parameters, plus may supply default values.
128128

129-
We will be creating a simulation detector from the `ioc-adsimdetector` Generic IOC. The following *Support yaml* for the simulation detector is baked into the container. Once you have your container up and running you can use `dc exec bl01t-ea-cam-01 bash` to get a shell inside and see this file at **/epics/ibek_defs/ADSimDetector.ibek.support.yaml**.
129+
We will be creating a simulation detector from the `ioc-adsimdetector` Generic IOC. The following *Support yaml* for the simulation detector is baked into the container. Once you have your container up and running you can use `docker compose exec bl01t-ea-cam-01 bash` to get a shell inside and see this file at **/epics/ibek_defs/ADSimDetector.ibek.support.yaml**.
130130

131131
```yaml
132132
# yaml-language-server: $schema=https://github.com/epics-containers/ibek/releases/download/3.0.1/ibek.support.schema.json
@@ -299,7 +299,7 @@ We can launch all the services in the beamline as we did in the earlier tutorial
299299
```bash
300300
cd t01-services
301301
source ./environment.sh
302-
dc up -d
302+
docker compose up -d
303303
```
304304

305305
The new screen will allow you to hit 'Acquire' on the CAMERA pane, and 'Enable' on the Standard Array pane. You should see the moving image from the simulation detector in the right hand image pane.
@@ -384,7 +384,7 @@ Fill out the rest of your NDProcess entity as follows:
384384
Now restart your simulation detector IOC:
385385

386386
```bash
387-
dc restart bl01t-ea-cam-01
387+
docker compose restart bl01t-ea-cam-01
388388
```
389389

390390
Once it is back up you can click on the bl01t-ea-cam-01 button in the 'Autogenerated Engineering Screens' pane and you will see a new 'NDProcess' entity. If you know about wiring up AreaDetector you can now wire this plugin into your pipeline and make modifications to the image data as it passes through.
@@ -400,7 +400,7 @@ folder. Or alternatively you could override behaviour completely by placing
400400
To see what ibek generated you can go and look inside the IOC container:
401401

402402
```bash
403-
dc exec bl01t-ea-test-02
403+
docker compose exec bl01t-ea-test-02
404404
cd /epics/runtime/
405405
cat ioc.subst
406406
cat st.cmd
@@ -431,7 +431,7 @@ Your IOC Instance will now be using the raw startup script and database. But sho
431431

432432
Restart the IOC to see it operating as before (except that engineering screen generation will no longer happen):
433433
```bash
434-
dc restart bl01t-ea-cam-01
434+
docker compose restart bl01t-ea-cam-01
435435
```
436436

437437
:::{note}

docs/tutorials/deploy_example.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,23 +80,21 @@ You can see the status of the services by running the following command:
8080
docker compose ps
8181
```
8282

83-
In environment.sh we created an alias for `docker compose` named `dc` from now on we'll shorten the commands to use `dc` instead of `docker compose`.
84-
8583
## Managing the Example IOC Instance
8684

8785
### Starting and Stopping IOCs
8886

89-
To stop / start the example IOC try the following commands. Note that `dc ps -a` shows you all IOCs including stopped ones.
87+
To stop / start the example IOC try the following commands. Note that `docker compose ps -a` shows you all IOCs including stopped ones.
9088

9189
Also note that tab completion should allow you to complete the names of your commands and services. e.g.
92-
`dc star <tab> ex <tab>`, should complete to `dc start example-test-01`.
90+
`docker compose star <tab> ex <tab>`, should complete to `docker compose start example-test-01`.
9391

9492
```bash
95-
dc ps -a
96-
dc stop example-test-01
97-
dc ps -a
98-
dc start example-test-01
99-
dc ps
93+
docker compose ps -a
94+
docker compose stop example-test-01
95+
docker compose ps -a
96+
docker compose start example-test-01
97+
docker compose ps
10098
```
10199

102100
:::{Note}
@@ -112,7 +110,7 @@ This is a Generic IOC image and all IOC Instances must be based upon one of thes
112110
To run a bash shell inside the IOC container:
113111

114112
```bash
115-
dc exec example-test-01 bash
113+
docker compose exec example-test-01 bash
116114
caget EXAMPLE:SUM
117115
```
118116

@@ -138,13 +136,13 @@ In the Virtual Machine supplied for testing epics-containers we do not install E
138136
To get the current logs for the example IOC:
139137

140138
```bash
141-
dc logs example-test-01
139+
docker compose logs example-test-01
142140
```
143141

144142
Or follow the IOC log until you hit ctrl-C:
145143

146144
```bash
147-
dc logs example-test-01 -f
145+
docker compose logs example-test-01 -f
148146
```
149147

150148
You should see the log of ibek loading and generating the IOC startup assets and then the ioc shell startup script log. Ibek is the tool that runs inside of the IOC container and generates the ioc shell script and database file by interpreting the /epics/ioc/config/ioc.yaml at launch time.
@@ -154,7 +152,7 @@ You should see the log of ibek loading and generating the IOC startup assets and
154152
You can stop all the services with the following command.
155153

156154
```bash
157-
dc stop
155+
docker compose stop
158156
```
159157

160158
This will stop all the currently running containers described in the `compose.yml` file.
@@ -166,7 +164,7 @@ However this will leave the resources themselves in place:
166164
To take down the services and remove all of their resources use the following command:
167165

168166
```bash
169-
dc down
167+
docker compose down
170168
```
171169

172170
### Monitoring and interacting with an IOC shell
@@ -177,7 +175,7 @@ shell. In the next tutorial we will use this command to interact with
177175
iocShell.
178176

179177
```bash
180-
dc attach example-test-01
178+
docker compose attach example-test-01
181179
dbl
182180
# ctrl-p ctrl-q to detach
183181
```

docs/tutorials/dev_container.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This means making changes to the IOC instance folders which appear in the `servi
2323
To make a change like this requires:
2424

2525
- change the IOC instance ioc.yaml or other configuration files in the services repository
26-
- re-launch the IOC with `dc restart <ioc-name>`
26+
- re-launch the IOC with `docker compose restart <ioc-name>`
2727
- that's it. No compilation required because we are only changing instance configuration here, not the IOC binary or dbd.
2828

2929
(changes_2)=
@@ -43,7 +43,7 @@ To make a change like this requires:
4343
- make changes to the Generic IOC Dockerfile (which holds the build instructions for a Generic IOC - we will discuss this in {any}`generic_ioc`)
4444
- push the changes and tag the repo - this will build and publish a new container image using CI
4545
- change the IOC instance in the services repo to point at the new container image
46-
- redeploy the IOC with `dc restart <ioc-name>`
46+
- redeploy the IOC with `docker compose restart <ioc-name>`
4747

4848

4949
(changes_3)=
@@ -130,7 +130,7 @@ Before continuing this tutorial make sure you have not left any IOCs running fro
130130
```bash
131131
cd t01-services
132132
. ./environment.sh
133-
dc down
133+
docker compose down
134134
```
135135
:::
136136

@@ -154,7 +154,7 @@ Users of docker need to instruct the devcontainer to use their own user id insid
154154
export EC_REMOTE_USER=$USER
155155
```
156156

157-
It is recommended that you place this command in `$HOME/.profile` to make it permanent.
157+
It is recommended that you place this command in `$HOME/.bashrc` (or `$HOME/.zshrc` for zsh users) to make it permanent.
158158

159159
If you do not do this, your devcontainer will run as root. Although it will still work, it is not recommended. Also, forgetting to set EC_REMOTE_USER before launching a pre-existing devcontainer will cause errors. (my apologies to docker users - I wanted to make the devcontainer compatible with both docker and podman and this is the least invasive method I could come up with).
160160
:::

docs/tutorials/dev_container2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ IMPORTANT: the commands we are about to run must be executed on the host, not in
5151
```bash
5252
cd /workspaces/ioc-adsimdetector/compose
5353
. ./environment.sh
54-
dc up -d
54+
docker compose up -d
5555
```
5656

5757
Phoebus will be launched and attempt to load the bob file called **opi/ioc/index.bob**. The **opi** folder is a place where the author of this generic IOC could place some screens. The subfolder **ioc** is not committed to git and is where the IOC instance will place its autogenerated engineering screens. The autogenerated screens always include and index.bob which is the entry point to all other autogenerated screens.

docs/tutorials/generic_ioc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,6 @@ https://github.com/orgs/YOUR_GITHUB_ACCOUNT/packages?repo_name=ioc-lakeshore340
708708
709709
## EXERCISE
710710
711-
Now you have a published Generic IOC container image for ioc-lakeshore340. See if you can add an IOC instance that uses this into your `bl01t` beamline. You should then be able to run up your IOC instance with `dc deploy-local`. You could also run a local version of the simulator and see if you can get the IOC to talk to it.
711+
Now you have a published Generic IOC container image for ioc-lakeshore340. See if you can add an IOC instance that uses this into your `bl01t` beamline. You should then be able to run up your IOC instance with `docker compose deploy-local`. You could also run a local version of the simulator and see if you can get the IOC to talk to it.
712712
713713

docs/tutorials/ioc_changes1.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Make sure the ca-gateway from the previous tutorial is stopped before launching
7676
# IMPORTANT: do this in a terminal outside of the devcontainer
7777
cd ioc-adsimdetector/compose
7878
. ./environment.sh
79-
dc down
79+
docker compose down
8080
```
8181

8282
Now you can launch your test beamline and it will have picked up the new extras.db. Note that we run caget inside the IOC container because not all users will have caget on their host. Those that have it on the host can just type: `caget BL01T-EA-CAM-01:TEST`.
@@ -85,11 +85,11 @@ Now you can launch your test beamline and it will have picked up the new extras.
8585
# IMPORTANT: do this in a terminal outside of the devcontainer
8686
cd t01-services
8787
. ./environment.sh
88-
dc up -d
89-
dc exec example-test-01 caget BL01T-EA-CAM-01:TEST
88+
docker compose up -d
89+
docker compose exec example-test-01 caget BL01T-EA-CAM-01:TEST
9090

9191
# Now shut down the beamline again so we can continue with further developer container tutorials
92-
dc down
92+
docker compose down
9393
```
9494

9595
## Raw Startup Assets

docs/tutorials/ioc_changes2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ From *outside of the developer container* start up phoebus and the ca-gateway as
7373
```bash
7474
cd ioc-adsimdetector/compose
7575
. ./environment.sh
76-
dc up -d
76+
docker compose up -d
7777
```
7878

7979
Phoebus should now be up and running and showing the auto generated **index.bob**, In phoebus do the following steps:

docs/tutorials/launch_example.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ git clone https://github.com/epics-containers/example-services
3030
cd example-services
3131
# setup some environment variables
3232
source ./environment.sh
33-
# launch the docker compose configuration (with dc alias for docker compose)
34-
dc up -d
33+
docker compose up -d
3534
```
3635

3736
If all is well you should see phoebus lauch with an overview of the beamline like the following:
@@ -49,28 +48,28 @@ caget BL01T-DI-CAM-01:DET:Acquire_RBV
4948

5049
# OR if you don't have caget/put locally then use one of the containers instead:
5150
# execute caget from inside one of the example IOCs
52-
dc exec bl01t-ea-test-01 caget BL01T-DI-CAM-01:DET:Acquire_RBV
51+
docker compose exec bl01t-ea-test-01 caget BL01T-DI-CAM-01:DET:Acquire_RBV
5352
# or get a shell inside an example IOC and use caget
54-
dc exec bl01t-ea-test-01 bash
53+
docker compose exec bl01t-ea-test-01 bash
5554
caget BL01T-DI-CAM-01:DET:Acquire_RBV
5655

5756
# attach to logs of a service (-f follows the logs, use ctrl-c to exit)
58-
dc logs bl01t-di-cam-01 -f
57+
docker compose logs bl01t-di-cam-01 -f
5958
# stop a service
60-
dc stop bl01t-di-cam-01
59+
docker compose stop bl01t-di-cam-01
6160
# restart a service
62-
dc start bl01t-di-cam-01
61+
docker compose start bl01t-di-cam-01
6362
# attach to a service stdio
64-
dc attach bl01t-di-cam-01
63+
docker compose attach bl01t-di-cam-01
6564
# exec a process in a service
66-
dc exec bl01t-di-cam-01 bash
65+
docker compose exec bl01t-di-cam-01 bash
6766
# delete a service (deletes the container)
68-
dc down bl01t-di-cam-01
67+
docker compose down bl01t-di-cam-01
6968
# create and launch a single service (plus its dependencies)
70-
dc up bl01t-di-cam-01 -d
69+
docker compose up bl01t-di-cam-01 -d
7170
# close down and delete all the containers
7271
# volumes are not deleted to preserve the data
73-
dc down
72+
docker compose down
7473
```
7574

7675
This tutorial is a simple introduction to validate that the setup is working. In the following tutorials you will get to create your own beamline and start adding IOCs to it.
@@ -79,9 +78,9 @@ This tutorial is a simple introduction to validate that the setup is working. In
7978
Before moving on to the next tutorial always make sure to stop and delete the containers from your current example as follows:
8079

8180
```bash
82-
dc down
81+
docker compose down
8382
```
8483

85-
If you do not do this you will get name clashes when trying the next example. If this happens - return to the previous project directory and use `dc down`.
84+
If you do not do this you will get name clashes when trying the next example. If this happens - return to the previous project directory and use `docker compose down`.
8685

8786
This is a deliberate choice as we can only run a single ca-gateway on a given host port at a time. For more complex setups you could share one ca-gateway between multiple compose configurations, but we have chosen to keep things simple for these tutorials.

0 commit comments

Comments
 (0)