Skip to content

Commit d6f70af

Browse files
authored
Marcell patch 2 (#143)
* Typo * Break long sentance * Rewrite * Remove redundant/duplicate row * Update IOC filesystem layout, use devcontainer naming terminology * Remove implied relative effects of ibek * Rewrite * Consistant service naming * Add PAT notes
1 parent 9c0d223 commit d6f70af

File tree

3 files changed

+26
-17
lines changed

3 files changed

+26
-17
lines changed

docs/tutorials/create_ioc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ Note that the process for taking a *Support yaml* entity_model with values from
207207

208208
To learn more about Jinja templating see here: <https://jinja.palletsprojects.com/en/3.0.x/templates/>.
209209

210-
Therefore, we can update our *IOC yaml* file by adding an ADSimDetector entity to the entities list. In vscode, open **services/t01-ea-cam-01/config/ioc.yaml** and edit the boilerplate template so that it looks like the following:
210+
Therefore, we can update our *IOC yaml* file by adding an ADSimDetector entity to the entities list. In vscode, open **services/bl01t-ea-cam-01/config/ioc.yaml** and edit the boilerplate template so that it looks like the following:
211211

212212

213213
```yaml

docs/tutorials/dev_container.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Also, epics-containers provides a mechanism for creating a separate workspace fo
7070

7171
The earlier tutorials were firmly in the realm of [](changes_1) above. It was adequate for us to install a container platform, IDE and python and that is all we needed.
7272

73-
Once you get to level of [](changes_2) you need to have compilers and build tools installed. You might also require system level dependencies. AreaDetector, that we used earlier has a long list of system dependencies that need to be installed in order to compile it. Traditionally we have installed all of these onto developer workstations or separately compiled the dependencies as part of the build.
73+
Once you get to the level of [](changes_2) you need to have compilers and build tools installed. You might also require system level dependencies. AreaDetector, that we used earlier has a long list of system dependencies that need to be installed in order to compile it. Traditionally we have installed all of these onto developer workstations or separately compiled the dependencies as part of the build.
7474

7575
These tools and dependencies will likely differ from one Generic IOC to the next.
7676

@@ -161,7 +161,7 @@ If you do not do this, your devcontainer will run as root. Although it will stil
161161

162162
### First Time Preparation
163163

164-
The devcontainer uses a docker network that it can share with a ca-gateway in order that your PVs are accessible from your host machine. We arrange to create this network once and as long as you don't delete it or reset docker it will be available for all your devcontainers going forward.
164+
The devcontainer uses a docker network that it can share with a ca-gateway so that your PVs are accessible from your host machine. We arrange to create this network once, and as long as you don't delete it or reset docker, it will be available for all your devcontainers going forward.
165165

166166
To create the network run the following commands:
167167

@@ -172,7 +172,7 @@ source ./compose/environment.sh
172172

173173
### Launching the Developer Container
174174

175-
In this section we are going to use vscode to launch a developer container. This means that all vscode terminals and editors will be running inside our container and browsing for files with vscode uses the container filesystem. This is a very convenient way to work because it makes it possible to archive away the development environment alongside the source code. It also means that you can easily share the development environment with other developers, and your development environment is portable between machines.
175+
In this section we are going to use vscode to launch a developer container. This means that all vscode terminals and editors will be running inside our container and browsing for files with the container filesystem. This is a very convenient way to work because it makes it possible to archive away the development environment alongside the source code. It also means that you can easily share the development environment with other developers, and your development environment is portable between machines.
176176

177177
For epics-containers the generic IOC *is* the developer container. When
178178
you build the developer target of the container in CI it will contain all the
@@ -267,7 +267,7 @@ In VSCode click the `File` menu and select `Add Folder to Workspace`. Navigate t
267267

268268
Also take this opportunity to add the folder `/epics` to the workspace. This is the root folder in which all of the EPICS source and built files are located.
269269

270-
You can now easily browse around the `/epics` folder and see all the support modules and epics-base. This will give you a feel for the layout of files in the container. Here is a summary (where WS is your workspace on your host. i.e. the root folder under which your two projects are cloned):
270+
You can now easily browse around the `/epics` folder and see all the support modules and epics-base. This will give you a feel for the layout of files in the container. Here is a summary relative to `${localWorkspaceFolder}` which is at the root of the Generic IOC source repo (the directory containing `.devcontainer/devcontainer.json`):
271271

272272
(container-layout)=
273273
## Generic IOC Container Filesystem Layout
@@ -290,11 +290,11 @@ You can now easily browse around the `/epics` folder and see all the support mod
290290
- compiled epics-base
291291
292292
* - /epics/ioc
293-
- WS/ioc-adsimdetector/ioc
293+
- ${localWorkspaceFolder}/ioc
294294
- soft link to IOC source tree
295295
296296
* - /epics/opi
297-
- WS/ioc-adsimdetector/opi
297+
- ${localWorkspaceFolder}/opi/ioc
298298
- auto generated OPI files for the IOC
299299
300300
* - /epics/runtime
@@ -309,20 +309,16 @@ You can now easily browse around the `/epics` folder and see all the support mod
309309
- N/A
310310
- all PVI definitions from support modules
311311
312-
* - /epics/opi
313-
- N/A
314-
- all OPI files (generated or copied from support)
315-
316312
* - /workspaces
317-
- WS
313+
- ${localWorkspaceFolder}/../
318314
- all peers to Generic IOC source repo
319315
320316
* - /workspaces/ioc-adsimdetector
321-
- WS/ioc-adsimdetector
317+
- ${localWorkspaceFolder}
322318
- Generic IOC source repo (in this example)
323319
324320
* - /epics/generic-source
325-
- WS/ioc-adsimdetector
321+
- ${localWorkspaceFolder}
326322
- A second - fixed location mount of the Generic IOC source repo to allow `ibek` to find it easily.
327323
```
328324

@@ -342,17 +338,17 @@ Now that we have the beamline repo visible in our container we can easily supply
342338
Try the following:
343339

344340
```
345-
cd /epics/ioc
346341
ibek dev instance /workspaces/t01-services/services/bl01t-ea-cam-01
347342
348343
# check the it worked - should see a symlink to the config folder
344+
cd /epics/ioc
349345
ls -l config
350346
# now start the IOC by running the standard entry point script
351347
./start.sh
352348
# you should now see the IOC instance startup and show the ioc shell prompt
353349
```
354350

355-
This removed any existing config folder and replaced it with the config from the IOC instance bl01t-ea-cam-01 by symlinking to that IOC Instance's config folder. Note that we used a soft link, this means we can edit the config, restart the IOC to test it and the changes will already be in place in the beamline repository.
351+
This removed any existing config folder and replaced it with the config from the IOC instance bl01t-ea-cam-01 by symlinking to its config folder. Note that we used a soft link, this means we can edit the config, restart the IOC to test it and the changes will already be in place in the beamline repository.
356352

357353

358354
## Wrapping Up

docs/tutorials/setup_workstation.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,25 @@ The tools you need to install are:
77
- Visual Studio Code
88
- a container platform, either docker or podman
99
- Python 3.11 or later + a Python virtual environment
10-
- git client for version control
10+
- git client for version control (Configured for the current user, with read-write access for Repository Contents as well as Workflows. Note: If you use Personal Access Tokens then replace `[email protected]:` with `https://github.com/` throughout this tutorial)
1111

1212
Visual Studio Code is recommended because it has excellent integration with
1313
devcontainers. It also has useful extensions for working with Kubernetes,
1414
EPICS, Yaml files and more.
1515

16+
:::{note}
17+
**Using a Personal Access Token (PAT):** If following the tutorials on an untrusted machine, using a PAT for authentication is encouraged as it can be scoped and time bound. For Github users a new token can be created via Settings -> Developer Settings -> Personal access tokens -> Fine-grained tokens.
18+
19+
```
20+
# Remember credentials for 5 hours duration
21+
git config --global credential.helper 'cache --timeout 18000'
22+
# When asked to login
23+
Username for `https://github.com': <ENTER YOUR USERNAME>
24+
Password for `https://<YOUR USERNAME>@github.com': <ENTER YOUR PAT>
25+
```
26+
:::
27+
28+
1629
## Options
1730

1831
You are not required to use VSCode to develop with epics-containers.

0 commit comments

Comments
 (0)