@@ -16,8 +16,8 @@ container definition is in https://github.com/epics-containers/.devcontainer.
16
16
Configure Visual Studio Code
17
17
----------------------------
18
18
19
- For podman users, you must first tell vscode to use podman instead of docker.
20
- Open a vscode window and hit "ctrl ," (control-comma) to open the user
19
+ For podman users, you must first tell VSCode to use podman instead of docker.
20
+ Open a VSCode window and hit "ctrl ," (control-comma) to open the user
21
21
settings editor and search for
22
22
"dev.containers.dockerPath", change its value from "docker" to "podman".
23
23
@@ -49,10 +49,10 @@ to reopen the folder in a container. Click on the ``Reopen in Container`` button
49
49
50
50
reopen in container dialogue
51
51
52
- Now all of your vscode terminals and file explorer will be running inside of
52
+ Now all of your VSCode terminals and file explorer will be running inside of
53
53
the devcontainer and have access to all the tools installed there.
54
54
55
- To verify things are working as expected, open a terminal in vscode from
55
+ To verify things are working as expected, open a terminal in VSCode from
56
56
the menus ``Terminal > New Terminal ``. You should see a prompt like this:
57
57
58
58
.. code-block :: bash
@@ -77,7 +77,8 @@ Things to note:
77
77
to ``/root ``.
78
78
79
79
- Podman users are running as root inside the container but files will be
80
- written with your user id and group id.
80
+ written with your user id and group id when writing to the mounted
81
+ workspace folder (or your home directory).
81
82
82
83
.. _devcontainer-configure :
83
84
@@ -90,79 +91,56 @@ Configuring the Devcontainer
90
91
configured for interacting with the test beamline bl01t on the test
91
92
cluster Pollux. HOWEVER: for this exercise we will use your personal
92
93
GitHub account to avoid clashes with other users of this tutorial.
93
- Therefore follow the instructions below and for the KUBECONFIG setting
94
- use the following:
94
+ Therefore follow the instructions below and set KUBECONFIG as follows:
95
95
96
96
.. code-block :: bash
97
97
98
98
# point at your cluster configuration file
99
99
export KUBECONFIG=/home/${USER} /.kube/config_pollux
100
100
101
101
To enable access to the pollux cluster, execute the following commands
102
- from outside of the dev container:
102
+ from OUTSIDE of the dev container:
103
103
104
104
.. code-block :: bash
105
105
106
106
module load pollux
107
+ klogout
107
108
.devcontainer/dls-copy-k8s-crt.sh # a script in the .devcontainer repo
108
109
kubectl get nodes
109
110
110
- The last command will ask for your fed-id and password and then show A
111
- list of nodes in the pollux cluster.
111
+ The last command will ask for your fed-id and password and then show a
112
+ list of nodes in the pollux cluster. Your credentials are cached for a
113
+ week after which you will see authentication errors. To fix this
114
+ repeat the above steps.
112
115
113
116
You devcontainer environment is configured by a file called
114
117
``.bashrc_dev `` file. The terminals in the devcontainer will source this
115
118
file when they start.
116
119
117
- You can take a copy of ``.devcontainer/.bashrc_dev `` and place it in your
118
- home folder to customize it.
119
- i.e.:
120
-
121
-
122
- # IMPORTANT: use /home/$USER not $HOME
123
- cp .devcontainer/.bashrc_dev /home/${USER}/.bashrc_dev
124
- code /home/${USER}/.bashrc_dev
125
-
126
- Alternatively you can take a fork of the .devcontainer repo and make your
127
- own version of the .bashrc_dev file in place.
128
-
129
- Much of this file is setting up convenience features like prompt and bash
120
+ Much of this file is setting up convenience features like the prompt and bash
130
121
history. You can change these to suit your own preferences.
131
122
132
123
The primary configuration options are the environment variables exported by
133
124
this script. These are listed below with some recommended values for running
134
125
these tutorials. Paste the following into the ``.bashrc_dev `` file and
135
- change GITHUB_ORG to your GitHub organization or user.
126
+ add your GitHub organization or user to K8S_HELM_REGISTRY .
136
127
137
128
.. code-block :: bash
138
129
139
130
# ########### REPLACE all environment below with your details ###################
140
131
141
- # Github organization or user name
142
- export GITHUB_ORG=< YOUR GITHUB ORGANIZATION OR USER GOES HERE>
143
-
144
- # point at your cluster configuration file
132
+ # point at your cluster config file
145
133
export KUBECONFIG=/home/${USER} /.kube/config
146
134
147
- # the default beamline or domain for ec commands
148
- export BEAMLINE=t01 # equivalent to K8S_DOMAIN=bl01t
135
+ # the default domain for ec commands (REMOVE if this is supplied by the host)
136
+ export K8S_DOMAIN=bl01t
149
137
150
138
# where to get HELM charts for ec commands
151
- export K8S_HELM_REGISTRY=ghcr.io/${GITHUB_ORG}
139
+ export K8S_HELM_REGISTRY=ghcr.io/< YOUR GITHUB USER OR ORGANIZATION >
152
140
153
- # where to get container IMAGES for ec commands
154
- export K8S_IMAGE_REGISTRY=ghcr.io/${GITHUB_ORG}
141
+ # ###############################################################################
155
142
156
- # the URL for the facility logging system
157
- export K8S_LOG_URL=' none'
158
-
159
- # set this to True to suppress output of commands in 'ec' CLI
160
- unset K8S_QUIET
161
-
162
- # extra arguments to supply to containerized CLI commands
163
- export K8S_CLI_ARGS=' '
164
-
165
- After editing ``/home/$USER/.bashrc_dev `` you will need to close any open terminals and
143
+ After editing ``.bashrc_dev `` you will need to close any open terminals and
166
144
restart them to pick up the changes.
167
145
168
146
@@ -177,6 +155,9 @@ restart them to pick up the changes.
177
155
In addition, you can alter the system packages installed in the container or make
178
156
any other changes to the Dockerfile and regenerate your own container image.
179
157
158
+ To pick up such changes to ``.devcontainer `` run the ``Rebuild Container ``
159
+ command from VSCode command pallette (accessed via ctrl-shift-P).
160
+
180
161
If you wish to persist these changes
181
162
then it is suggested that you make your own github repo of .devcontainer and
182
163
push the changes there.
0 commit comments