Skip to content

Commit 0aa8d87

Browse files
committed
update setup workstation and related pages
1 parent 76c2567 commit 0aa8d87

File tree

6 files changed

+50
-55
lines changed

6 files changed

+50
-55
lines changed

docs/how-to/own_tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ epics-containers has been tested with
1717
- vscode
1818
- Github Codespaces
1919

20-
If you prefer console based editors like vim or emacs, then you will get the best results by launching the development containers defined in the epics-containers using the devcontainer CLI as described here <https://containers.dev/supporting#devcontainer-cli>.
20+
If you prefer console based editors like neovim or emacs, then you will get the best results by launching the development containers defined in the epics-containers using the devcontainer CLI as described here <https://containers.dev/supporting#devcontainer-cli>.
2121

2222
In addition you could install your editor inside the developer container by adding an apt-install command into the `epics-containers` user personalization file. See [details here](https://github.com/epics-containers/epics-containers.github.io/blob/3a87e808e1c7983430a30c5a4dcd0d0661895d60/.devcontainer/postCreateCommand#L23-L27)

docs/reference/cli.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
# Command Line Interface for IOC Management
44

5-
The python project {any}`edge-containers-cli` is installed as part of the Python section of the initial tutorial {any}`../tutorials/setup_workstation`. It provides a command line function `ec` with support for:
5+
The python project {any}`edge-containers-cli` is installed as part of the Python section of the initial tutorial {any}`../tutorials/setup_workstation`. It provides a command line function `ec` with support for managing and monitoring IOC instances.
66

7-
- deploying, managing and monitoring IOC and service instances
7+
This tool is only required if you are deploying to Kubernetes. Docker compose provides a very similar set of commands for local deployment. Also note that `ec` supports both ArgoCD and pure Helm deployments. The tutorials will use ArgoCD, for information on Helm based deployments see {any}`helm` .
88

99
The CLI is just a thin wrapper around the underlying tools that do the real work:
1010

1111
```{eval-rst}
1212
1313
:kubectl: the command line interface to the Kubernetes APIs
1414
:helm: the command line interface to the Kubernetes Helm package manager
15-
:podman/docker: CLIs for container engines
1615
:git: the git version control system client
16+
:argocd: the ArgoCD command line interface
1717
```
1818

1919
`ec` is useful because it saves typing and provides a consistent interface when working on multiple {any}`services-repo` s. This is because it uses the environment setup by the beamline repo's `environment.sh` script. See {any}`environment`.

docs/reference/docker.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ Working with Docker
33

44
DLS is a `podman` shop and therefore more testing is done with `podman` than `docker` as the container CLI used with developer containers. `podman` works extremely well with developer containers, but `docker` needs a little more work sometimes.
55

6+
The primary difference is that `podman` does not require root access and `docker` does. When inside a podman container you appear to be root but you are running as your own host user id. When you write to any host mounted files you will be doing so with your host user permissions. In a docker container any host files written will be owned by the user id that the container is running as.
7+
8+
Therefore:
9+
- It is better not to run docker containers as root.
10+
- It is easiest to run podman containers as root for simplicity.
11+
612
We do fully support `docker`, please report any issues you find.
713

814
There are a few things to know if you are using `docker` in your developer containers:
@@ -12,7 +18,7 @@ There are a few things to know if you are using `docker` in your developer conta
1218
```bash
1319
git config --global --add safe.directory <Git folder>
1420
```
15-
1. you can use `sudo` if you are having permissions issues. In particular the following will reset permissions on a folder:
21+
1. you can use `sudo` if you are having permissions issues. In particular the following will reset permissions on all of the epics files inside the container filesystem:
1622
```bash
17-
sudo chown -r vscode <folder>
23+
sudo chown -r vscode /epics
1824
```

docs/reference/glossary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ epics-containers supports two kinds of services repositories:
1616

1717
A Python command line tool for the developer that runs *outside* of containers. It provides simple features for and monitoring and managing and IOC instances within a [](services-repo).
1818

19-
So named 'edge' containers because these services all run close to the hardware. Uses the command line entry point `ec`.
19+
So named 'edge' containers because these services all run close to the hardware. Uses the command line entry point `ec`. See {any}`cli` for more details.
2020

2121
(ibek)=
2222
## ibek

docs/reference/helm.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(helm)=
2+
# Pure Helm Deployments
3+
4+
At DLS we use helm charts in our services repos to describe our IOC instances. However we use ArgoCD continuous deployment to deploy them. ArgoCD is a Kubernetes native tool that knows how to keep a set of Helm charts in a git repository in sync with a set of Kubernetes resources.
5+
6+
You are not required to use ArgoCD, you can use Helm directly if you prefer. This page discusses how to use the command line tool `ec` to deploy and manage IOC instances using Helm directly. `ec` adds some useful version management features to the workflow that to some extent replicates ArgoCD's ability to track versions.
7+
8+
### TODO this is WIP
9+
10+
If you set the `EC_CLI_BACKEND` environment variable to `K8S` then `ec` will use Helm directly to deploy and manage IOC instances. You can get a feel for the commands available with `ec --help`.
11+
12+
```bash
13+
export EC_CLI_BACKEND=K8S
14+
ec --help
15+
```

docs/tutorials/setup_workstation.md

Lines changed: 22 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,18 @@ See these how-to pages for more information:
2424

2525
## Platform Support
2626

27-
epics-containers can use Linux, Windows or MacOS as the host operating system for
28-
the developer workstation.
27+
The containers used in the tutorials are x86_64 Linux. The best way to experience the tutorials is to use an Intel Linux workstation or laptop. arm64 container images have been tested but are not yet widely used in the available images.
2928

30-
If you are using Windows then you must first
31-
install WSL2 and then work within the Linux subsystem. see
32-
[WSL2 installation instructions].
33-
Ubuntu is recommended as the Linux distribution for WSL2.
29+
If you are using a Mac or Windows then the simplest approach is to use the Linux Virtual Machine with pre-installed software that we provide. First install [VirtualBox](https://www.virtualbox.org/wiki/Downloads) and then download the [Virtual Machine](https://drive.google.com/file/d/1ejJjiVDcODkiJsTShkCclQyod02f4Tex/view?usp=drive_link) TODO: currently hosted on giles Google Drive - find a better hosting solution. The downloaded file is an OVA file which can be imported into VirtualBox using ``File->Import Appliance ...``. During the import process you will be able to modify the resources that the VM uses, the defaults are recommended, but you may decrease them if your host machine has limited resources.
30+
31+
If you are using Windows you could instead install WSL2 and then work within the Linux subsystem. see [WSL2 installation instructions]. Ubuntu is recommended as the Linux distribution for WSL2. This has not been tested with the tutorials recently so the VM above is the preferred option.
3432

3533
## Installation Steps
3634

35+
If you are using the Virtual Machine, then you can skip to "Setup virtual environment", because the first three requirements are already installed.
36+
37+
If you are using your own Linux machine then follow all the steps below to install the required software.
38+
3739
### Setup VSCode
3840

3941
:::{Note}
@@ -61,7 +63,7 @@ devcontainer in the next tutorial.
6163
### Setup Docker or Podman
6264

6365
:::{Note}
64-
**DLS Users**: RHEL 8 Workstations at DLS have podman 4.6.1 installed by default.
66+
**DLS Users**: RHEL 8 Workstations at DLS have podman 4.9.4 installed by default.
6567
RHEL 7 Workstations are not supported.
6668
:::
6769

@@ -70,21 +72,15 @@ has been tested with podman 4.4.1 and higher on RedHat 8, and Docker 24.0.5 and
7072

7173
If you are using docker, simply replace `podman` with `docker` in the commands listed in these tutorials. `docker` users should also take a look at this page: [](../reference/docker.md)
7274

73-
The podman version required is 4.0 or later. Any version of docker since 20.10
74-
will also work. Pick the tool that has the most recent version for your platform.
75-
RedHat 8 and above have recent podman versions. Debian platforms don't yet
76-
have recent podman versions available. If you have a choice then podman is
77-
preferred because it does not require root access and it is the tool with
78-
which epics-containers has had the most testing.
75+
The podman version required is 4.0 or later. Any version of docker since 20.10 will also work. Pick the tool that has the most recent version for your platform. RedHat 8 and above have recent podman versions. Older Debian platforms don't yet
76+
have recent podman versions available. If you have a choice then podman is slightly preferred because it does not require root access and it is the tool with which epics-containers has had the most testing. However, docker is the most widely used container platform and is also well supported.
7977

8078
The links below have details of how to install your choice of container platform:
8179

8280
- [Install docker]
8381
- [Install podman]
8482

85-
The docker install page encourages you to install Docker Desktop. This is a paid
86-
for product and is not required for this tutorial. You can install the free linux
87-
CLI tools by clicking on the appropriate linux distribution link.
83+
The docker install page encourages you to install Docker Desktop. This is a paid for product and is not required for this tutorial. You can install the free linux CLI tools by clicking on the appropriate linux distribution link.
8884

8985
(python-setup)=
9086

@@ -94,16 +90,15 @@ CLI tools by clicking on the appropriate linux distribution link.
9490
**DLS Users**: for this step just use `module load python/3.11`
9591
:::
9692

97-
Go ahead and install Python 3.10 or later. 3.11 is recommended as this is the
98-
highest version that epics-containers has been tested with.
93+
Go ahead and install Python 3.11 or later.
9994

10095
There are instructions for installing Python on all platforms here:
10196
<https://docs.python-guide.org/starting/installation/>
10297

10398
### Setup virtual environment
10499

105100

106-
Once you have python set up a virtual environment for your epics-containers
101+
Once you have python, set up a virtual environment for your epics-containers
107102
work. In the examples we will use `$HOME/ec-venv` as the virtual environment
108103
but you can choose any folder.
109104

@@ -117,34 +112,28 @@ source $HOME/ec-venv/bin/activate
117112
python -m pip install --upgrade pip
118113
```
119114

120-
Note that each time you open a new shell you will need to activate the virtual
121-
environment again. (Or place its bin folder in your path permanently).
115+
Note that each time you open a new shell you will need to activate the virtual environment again. (Or place its bin folder in your path by adding it in your .bashrc).
122116

123117
(ec)=
124118

125119
### edge-containers-cli
126120

127-
Above we set up a python virtual environment. Now we will install
128-
the {any}`edge-containers-cli` python tool into that environment.
121+
Above we set up a python virtual environment. Now we will install the {any}`edge-containers-cli` python tool into that environment. This tool is used to manage the IOC instances in Kubernetes and is only required for the later tutorials.
129122

130123
```bash
131124
pip install edge-containers-cli
132125
```
133126

134-
This is the developer's 'outside of the container' helper tool. The command
135-
line entry point is `ec`. We will be using many `ec` command line
136-
functions in the next tutorial.
137-
138127
See {any}`CLI` for more details.
139128

140129
:::{note}
141-
DLS Users: `ec` is already installed for you on `dls_sw` just do the
142-
following to make sure it is always available:
130+
DLS Users: `ec` is already installed for you on `dls_sw` just do the following to make sure it is always available:
143131

144132
```bash
145-
# use the ec version from dls_sw/work/python3
133+
# use the ec version from /dls_sw/work/python3
146134
mkdir -p $HOME/.local/bin
147135
ln -fs /dls_sw/work/python3/ec-venv/bin/ec $HOME/.local/bin/ec
136+
# log out and back in again to make sure the new path is available
148137
```
149138
:::
150139

@@ -161,24 +150,9 @@ You don't need Kubernetes yet.
161150
The following tutorials will take you through creating, deploying and
162151
debugging IOC instances, generic IOCs and support modules.
163152

164-
For simplicity we don't encourage using Kubernetes at this stage. Instead we
165-
will deploy containers to the local workstation's docker or podman instance.
166-
167-
However, everything in these tutorials would also work with Kubernetes. If you
168-
are particularly interested in Kubernetes then you can jump to
169-
{any}`setup-kubernetes` and follow the instructions there. Then come back to this
170-
point and continue with the tutorials. If you do this just be aware that
171-
we use the beamline name `bl01t` for local deployment examples and
172-
`bl46p` for Kubernetes examples so you will need to substitute the
173-
appropriate beamline name for your environment. All the local deployment
174-
examples should also deploy to a Kubernetes cluster.
175-
176-
If you are planning not to use Kubernetes at all then now might be
177-
a good time to install an alternative container management platform such
178-
as [Portainer](https://www.portainer.io/). Such tools will help you
179-
visualise and manage your local containers. They are not required and you
180-
could just manage everything from epics-containers command line interface
181-
if you prefer.
153+
For simplicity we don't encourage using Kubernetes at this stage. Instead we will deploy containers to the local workstation's docker or podman instance.
154+
155+
If you are planning not to use Kubernetes at all then now might be a good time to install an alternative container management platform such as [Portainer](https://www.portainer.io/). Such tools will help you visualise and manage your containers across a number of servers. These are not required and you could just manage everything from the docker compose command line if you prefer.
182156

183157
[download visual studio code]: https://code.visualstudio.com/download
184158
[how to use wsl2 and visual studio code]: https://code.visualstudio.com/blogs/2019/09/03/wsl2

0 commit comments

Comments
 (0)