Skip to content

Commit 59a6f05

Browse files
committed
Update Blog “open-sourcing-workshops-on-demand-part2-deploying-the-backend”
1 parent 45f6970 commit 59a6f05

File tree

1 file changed

+16
-63
lines changed

1 file changed

+16
-63
lines changed

content/blog/open-sourcing-workshops-on-demand-part2-deploying-the-backend.md

Lines changed: 16 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ It provides:
6060
* A fail2ban service
6161
* An Admin user to manage everything
6262
* A set of scripts to handle different tasks such as:
63+
6364
* Notebooks deployment
6465
* Jupyterhub compliancy
6566
* Users compliancy
@@ -74,10 +75,10 @@ Before cloning the backend repository, you will need to prepare the server th
7475
1. In order to setup the backend server, you will need:
7576

7677
* A fresh OS install on physical / virtualized server running Ubuntu 20.04 or Centos 7.9 leveraging any deployment mechanism of your choice.(e.g. iLO, vagrant, etc.). You may even use this [vagrant file](https://github.com/Workshops-on-Demand/wod-backend/blob/main/install/Vagrantfile) to automatically generate a complete setup leveraging vagrant, libvirt and QEMU/KVM.
77-
7878
* A Linux account with sudo priviledges on your Linux distro. Name it `install`
7979

8080
**Note:** In order to support 100 concurrent users, you need:
81+
8182
* 2 cpus or more machine
8283
* 128 GB of RAM
8384
* 500 GB of storage
@@ -169,7 +170,7 @@ SCRIPTPRIVDIR: "{{ WODPRIVDIR }}/scripts"
169170
ANSIBLEPRIVDIR: "{{ WODPRIVDIR }}/ansible"
170171
```
171172

172-
* `wod-backend` file
173+
* `wod-backend` file
173174

174175
```shellsession
175176
vi wod-backend
@@ -226,7 +227,7 @@ DATAVISUPORT1-WKSHP-DataVisu101: 22101
226227
DATAVISUPORT2-WKSHP-DataVisu101: 22131
227228
```
228229

229-
* `wod-system` file
230+
* `wod-system` file
230231

231232
```shellsession
232233
vi wod-system
@@ -259,74 +260,39 @@ WODFEAPIURL: https://{{ WODAPIDBFQDN }}/api
259260
WODFEAPIUSER: moderator
260261
WODFEAPIPWD: MotDePasseCompliquéAussi125!!!##
261262
```
262-
````
263263

264-
#### Backend installation process:
264+
See the example below for a backend server.
265+
266+
### Backend installation process:
265267

266268
[](https://github.com/Workshops-on-Demand/wod-backend/blob/main/INSTALL.md#for-private-based-workshops-on-demand-private-backend--private-workshops-or-if-you-need-to-modify-defaults)Once you are done with the files, you can can proceed with the installation itself. The installation is based on a common install script [install.sh ](https://github.com/Workshops-on-Demand/wod-backend/blob/main/install/install.sh)that allows the deployment of the different parts of the solution. It can be called as follows:
267269

268270
`install.sh [-h][-t type][-g groupname][-b backend][-f frontend][-a api-db][-e external][-u user][-s sender]`
269271

270272
`-h` provides the help
271273

272-
```shellsession
273-
./install.sh -h
274-
install.sh called with -h
275-
install.sh [-h][-t type][-g groupname][-b backend][-f frontend][-a api-db][-e external][-u user][-s sender]
276-
277-
where:
278-
type is the installation type
279-
example: backend, frontend or api-db
280-
if empty using 'backend'
281-
groupname is the ansible group_vars name to be used
282-
example: production, staging, test, ...
283-
if empty using 'production'
284-
backend is the FQDN of the backend JupyterHub server
285-
example: be.internal.example.org
286-
if empty using the local name for the backend
287-
frontend is the FQDN of the frontend Web server
288-
example: fe.example.org
289-
if empty using the external name for the backend
290-
api-db is the FQDN of the API/DB server
291-
example: api.internal.example.org
292-
if empty using the name for the frontend
293-
external is the external FQDN of the backend JupyterHub server, reachable from the Internet
294-
example: jphub.example.org
295-
if empty using the internal name of the backend
296-
user is the name of the admin user for the WoD project
297-
example: mywodamin
298-
if empty using wodadmin
299-
sender is the e-mail address used in the WoD frontend to send API procmail mails to the WoD backend
300-
301-
if empty using wodadmin@localhost
302-
```
303-
304-
See the example below for a backend server.
305-
306-
```shellsession
307-
install$ sudo ./install.sh -t backend -g staging -b jup.example.net -f notebooks.example.io -a api.example.io -e notebooks.example.io -s [email protected]
308-
```
309-
310274
`install.sh` performs the following tasks:
311275

312276
* Calls the `install-system-<< distribution name >>.sh` script
313277
* Installs minimal required (`ansible, git, jq, openssh server, npm`)
314278
* Creates an admin user as defined upper (default is `wodadmin`) with sudo rights
315279
* Calls the `install-system-common.sh` script that performs the following tasks:
280+
316281
* Cleanup
317282
* Github repos cloning (leveraging install.repo file) : public Backend and public Private repos
318283
* Create ssh keys for wodadmin
319284
* Creates GROUPNAME variables
320285
* Creates Ansible inventory files
321-
322286
* Calls the `install_system.sh` script with the type (backend, frontend, etc..) that performs the following tasks:
287+
323288
* Install the necessary stack based on selected type
324289
* Create a `wod.sh` script in `wod-backend` directory to be used by all other scripts
325290
* Source the `wod.sh` file
326291
* Setup Ansible-galaxies (`community.general` and `posix`)
327292
* Setup Ansible and call the playbook `install_<type>.yml` followed by the `ansible\_check\_<type>.yml`
328293

329294
At the end of the installation process:
295+
330296
* you will have a JupyterHub server running on port 8000
331297
* You will get a new `wodadmin` user (Default admin)
332298
* You will get a set of 20 students (Default value)
@@ -343,45 +309,32 @@ If you need to develop private content that cannot be shared with the wider Open
343309

344310
### **How to handle private-content based Workshops-on-Demand**
345311

346-
##### *(private backend + private workshops on top of default public backend and notebooks)*
312+
#### *(private backend + private workshops on top of default public backend and notebooks)*
347313

348314
The principle remains similar, with a few differences explained below.
349315

350316
* You will start by forking the following public private [repo](https://github.com/Workshops-on-Demand/wod-private.git) on Github under your own Github account (we will refer to it as `Account`).
351317
* Next, clone the forked repo.
352-
353-
```shellsession
354-
install$ git clone https://github.com/Account/wod-private.git wod-private
355-
install$ cd $HOME/wod-private/ansible/group_vars
356-
```
357-
358318
* Edit the `all.yml` and `<groupname>` files to customize your setup. This variable `<groupname>` defines possible backend server in your environement. By default, the project comes with a sample working file named `production` in `ansible/group-vars`. But you could have multiple. In our case, we have defined `sandbox`, `test`, `staging` and several `production` files, all defining a different backend environment. These files will be used to override the default values specified by the public version delivered as part of the default public installation.
359319
* Commit and push changes to your repo.
360320
* Create an `install.priv` file located in `install` directory when using a private repo (consider looking at [install.repo](https://github.com/Workshops-on-Demand/wod-backend/blob/main/install/install.repo) file for a better understanding of the variables).
361321

322+
* Define the WODPRIVREPO and WODPRIVBRANCH variables as follows:
362323

363-
* Define the WODPRIVREPO and WODPRIVBRANCH variables as follows:
364-
365-
* WODPRIVBRANCH="main"
366-
* WODPRIVREPO="[email protected]:Account/Private-Repo.git wod-private"
324+
* WODPRIVBRANCH="main"
325+
* WODPRIVREPO="[email protected]:Account/Private-Repo.git wod-private"
367326

368327
**Note:** When using a token
369328

370329
Please refer to the following [url](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) to generate a `token` file in `install` directory of WoD-backend:
371330

372331
* Edit the `install.priv` file located in `install` directory of WoD-backend:
373332

374-
* Create line before variable declaration: ``token=`cat $EXEPATH/token` ``
375-
376-
* Use the token in the url WODPRIVREPO="git clone https://user:[email protected]/Account/wod-private.git wod-private"
333+
* Create line before variable declaration: ``token=`cat $EXEPATH/token` ``
334+
* Use the token in the url WODPRIVREPO="git clone https://user:[email protected]/Account/wod-private.git wod-private"
377335

378336
You are now ready to perform the installation again to support a private repository.
379337

380-
```shellsession
381-
cd $HOME/wod-backend/install
382-
sudo ./install.sh -t backend -g staging -b jup.example.net -f notebooks.example.io -a api.example.io -e notebooks.example.io -s [email protected]
383-
```
384-
385338
Please note that this setup phase can be conccurent with the public setup phase. Indeed, the install script should detect the presence of the private repository owing to the presence of the install.priv file. It will automatically adjust the different scripts and variables to add the relevant content. It will actually overload some of the variables with private ones.
386339

387340
You now have a working Workshops-on-Demand backend server in place. Congratulations! The next article in the series will help you better understand the lifecycle of the backend server. How does a workshop registration work from the backend server 's side? How do you manage this server on a daily basis? How and when do you need to update it ? All these questions will be answered in the next article. And from there, we will move to the frontend side of things and finally to a workshop's creation process.

0 commit comments

Comments
 (0)