WEBVTT

00:00:01.680 --> 00:00:03.540
[Autogenerated] in this first demo we're going to

00:00:03.540 --> 00:00:07.900
install openCV using Docker compose first.

00:00:07.900 --> 00:00:10.020
We're going to clone the repository.

00:00:10.640 --> 00:00:14.260
Then we're going to configure the open C V platform.

00:00:14.290 --> 00:00:18.110
Then we're going to run the platform and verify the

00:00:18.120 --> 00:00:21.530
installation as shown in the previous clip.

00:00:21.630 --> 00:00:25.470
The source code can be found on GitHub The source code for

00:00:25.470 --> 00:00:30.690
Docker Compose can also be found on GitHub under opencV slash

00:00:30.700 --> 00:00:34.780
Docker Compose and there you find a link also to the

00:00:34.790 --> 00:00:38.640
installation documentation On the space.

00:00:38.640 --> 00:00:42.340
You can also find the requirements such as docker compose.

00:00:42.470 --> 00:00:45.630
Docker and at least 5GB of RAM.

00:00:46.390 --> 00:00:52.900
Now in my experience that 5GB of RAM is on the low end of the skill seven or 8

00:00:52.900 --> 00:00:58.210
is definitely recommended and the steps that are documented here are the steps

00:00:58.210 --> 00:01:02.240
that we're going to follow in our console locally.

00:01:02.250 --> 00:01:05.030
I'm running a deviant distribution on the Windows

00:01:05.030 --> 00:01:07.100
using the Windows subsystem for Linux,

00:01:08.200 --> 00:01:12.540
let's check whether dr is properly installed using the Docker Version Command.

00:01:13.730 --> 00:01:14.540
Then let's use it.

00:01:14.540 --> 00:01:17.040
Docker Compose command with version to see whether

00:01:17.040 --> 00:01:19.100
Docker Compose is installed as well.

00:01:19.540 --> 00:01:24.360
Newer versions of Docker will actually have Docker Compose built in Great.

00:01:24.580 --> 00:01:27.480
Both Docker as well as Docker Compose are installed.

00:01:28.070 --> 00:01:34.040
Let's clear the screen and let's now clone the Git repository on open C v slash.

00:01:34.050 --> 00:01:34.970
OpencV.

00:01:35.130 --> 00:01:40.700
Docker Now let's change that directory using the cd command.

00:01:41.880 --> 00:01:46.130
Let's clear the screen again and now we're going to copy the

00:01:46.130 --> 00:01:50.440
configuration file that is part of the repository and rename it to

00:01:50.440 --> 00:01:53.860
the real configuration file using the Cp command.

00:01:53.870 --> 00:01:56.950
This is an example configuration file which we need to

00:01:56.950 --> 00:01:59.150
edit in order to make it work for us.

00:02:00.020 --> 00:02:03.740
Let's open up the file using our favorite editor in this instance.

00:02:03.740 --> 00:02:04.700
This will be imax.

00:02:04.700 --> 00:02:07.150
But of course you can use any editor that you'd like.

00:02:07.180 --> 00:02:13.830
Although I can recommend using imax this is the default configuration of open C.

00:02:13.830 --> 00:02:14.350
V.

00:02:14.690 --> 00:02:19.700
And we only need to configure a few parameters and we're up and running first.

00:02:19.700 --> 00:02:23.110
Let's change the server name and you don't need to use an I.

00:02:23.110 --> 00:02:28.360
P address here, which you can use a hostname in my local host file.

00:02:28.370 --> 00:02:33.730
I've mapped open Cv to local host or 127 dot oh dot oh 127.0.0.1.

00:02:33.740 --> 00:02:35.730
Hence I'm going to use the name.

00:02:35.740 --> 00:02:36.340
Open C.

00:02:36.340 --> 00:02:36.910
V.

00:02:37.010 --> 00:02:39.090
You can also use local host here.

00:02:39.090 --> 00:02:39.740
Of course.

00:02:40.480 --> 00:02:44.470
Then we're going to add two random secrets to the configuration file.

00:02:44.850 --> 00:02:48.610
The first is the secret key that's being used in the background for flask.

00:02:48.620 --> 00:02:54.110
I'm going to paste here just a random big string as data store.

00:02:54.120 --> 00:02:54.670
Open C.

00:02:54.670 --> 00:02:59.070
V uses post rescue L to improve the security of post rescue.

00:02:59.070 --> 00:03:03.980
L let's remove the default password and replace it by another random string.

00:03:05.050 --> 00:03:09.200
Note that we will need a string in order to put it in the environment file.

00:03:09.730 --> 00:03:15.510
But first let's finish up configuring the open CSV file Let's scroll all the

00:03:15.510 --> 00:03:20.020
way to the bottom where we configure the SMtP server why?

00:03:20.030 --> 00:03:25.460
Well, currently the only alerting mechanism supported by OpencV is email.

00:03:25.490 --> 00:03:30.380
So we need to tell OpenCV how it can send emails first.

00:03:30.380 --> 00:03:32.600
Let's configure our smtP server,

00:03:32.680 --> 00:03:37.980
the SmtP ports and then fill in a valid user name and password.

00:03:38.550 --> 00:03:41.610
This email account is used to send emails from.

00:03:41.620 --> 00:03:43.630
So you need an SMTP account.

00:03:45.140 --> 00:03:48.520
Usually these accounts are supplied by a system administrator.

00:03:50.770 --> 00:03:53.240
Then we can save the configuration file.

00:03:54.130 --> 00:03:57.490
Let's go back to the console and now added the environment file.

00:03:57.620 --> 00:03:58.310
Why?

00:03:58.320 --> 00:04:01.480
Because we change the password of the post rescue L user.

00:04:01.720 --> 00:04:01.870
Now,

00:04:01.870 --> 00:04:05.370
we also need to change the password in the environment file which

00:04:05.370 --> 00:04:08.170
is being used when building the Docker image.

00:04:09.710 --> 00:04:13.480
And we need to define a new variable here called postgres

00:04:13.490 --> 00:04:17.329
underscore password and assign it the value that we just

00:04:17.329 --> 00:04:19.190
use in the configuration file.

00:04:19.200 --> 00:04:21.709
So I'm going to paste the secret string here.

00:04:22.720 --> 00:04:25.510
Now let's save this file and go back to the console.

00:04:26.210 --> 00:04:28.920
That was all there is to it to configuring open C.

00:04:28.920 --> 00:04:36.710
V by using the Docker compose up command with the dash dash detached flag.

00:04:36.720 --> 00:04:39.310
We bring up the majority of the services,

00:04:39.320 --> 00:04:42.010
the services we need to bring up our post grass,

00:04:42.020 --> 00:04:43.840
our database back end,

00:04:43.850 --> 00:04:49.880
read this web server and salary underscore worker These

00:04:49.880 --> 00:04:54.280
services are all defined in the Docker compose file and

00:04:54.280 --> 00:04:56.470
Docker Compose starts doing its thing.

00:04:57.200 --> 00:05:00.350
It's pulling all the missing images and after having

00:05:00.350 --> 00:05:03.960
pulled all the missing images, it will start building our open C.

00:05:03.960 --> 00:05:05.360
V image.

00:05:05.590 --> 00:05:08.340
This might take a while depending on your bandwidth

00:05:08.350 --> 00:05:10.630
as well as processor capabilities.

00:05:11.720 --> 00:05:12.430
However,

00:05:12.430 --> 00:05:17.690
this is a one time cost as in it will now cache all downloaded images

00:05:17.820 --> 00:05:20.800
as well as cash the image that it will build for us.

00:05:20.810 --> 00:05:21.910
Open C v.

00:05:22.520 --> 00:05:25.230
The next time you will run the Docker compose up command,

00:05:25.240 --> 00:05:29.680
it will instantly start all services as they already are downloaded

00:05:29.680 --> 00:05:34.640
and built for us as a reminder of these steps that we are

00:05:34.640 --> 00:05:40.340
demonstrating right now and doing can be found on dot opencv dot io

00:05:40.450 --> 00:05:44.460
slash installation slash docker once.

00:05:44.460 --> 00:05:47.770
Docker Compose is ready with pulling all images and starting the

00:05:47.770 --> 00:05:51.410
services now we need to initialize the database.

00:05:51.540 --> 00:05:56.790
This is also a one time command by executing the command.

00:05:56.800 --> 00:06:02.090
Docker, dash i T web server, open c v.

00:06:02.100 --> 00:06:07.920
And then the upgrade dash dB command we tell OPENCV to initialize the postgres.

00:06:07.920 --> 00:06:09.680
SQL database for us.

00:06:10.710 --> 00:06:14.480
Don't get confused by the term upgrade DB as were

00:06:14.480 --> 00:06:16.780
actually initializing the database.

00:06:16.780 --> 00:06:17.510
Post rescue.

00:06:17.510 --> 00:06:23.540
L The next step will be importing all those CV entries from the internet.

00:06:23.560 --> 00:06:26.360
If we can do that by executing the command Docker,

00:06:28.270 --> 00:06:30.520
then the name of the service web server,

00:06:30.530 --> 00:06:31.720
open c v E.

00:06:31.720 --> 00:06:37.330
And then the command import data when selecting yes

00:06:37.340 --> 00:06:39.620
because we want to import initial data.

00:06:39.630 --> 00:06:44.540
The process starts now this can take a long time because it needs to

00:06:44.540 --> 00:06:48.670
download all those CvN entries from all over the years.

00:06:48.860 --> 00:06:55.740
This is also the process that uses so much memory and is a tip check what the

00:06:55.750 --> 00:07:01.950
exit code of this command is sometimes the process errors out because of memory

00:07:01.950 --> 00:07:04.770
management issues and then you will get a result.

00:07:04.770 --> 00:07:07.030
code unequal to zero.

00:07:08.270 --> 00:07:11.570
Later on we shall see how you can check whether the database

00:07:11.570 --> 00:07:15.530
import field or not but this is something to be aware of that

00:07:15.540 --> 00:07:18.130
sometimes due to memory management issues.

00:07:18.210 --> 00:07:23.670
This step might feel fortunately this is only a one time step as it needs to

00:07:23.670 --> 00:07:28.620
download all these sources but dealt us the process which we shall do

00:07:28.630 --> 00:07:32.780
approximately every 15 minutes is a very short step.

00:07:33.690 --> 00:07:36.850
The previously mentioned memory requirement of five

00:07:36.850 --> 00:07:40.600
gigabytes or actually eight gigabytes is specifically for

00:07:40.600 --> 00:07:43.590
this one time step importing of all C.

00:07:43.590 --> 00:07:44.660
V entries.

00:07:46.200 --> 00:07:50.820
I didn't see any error message So I assume that the import went successful.

00:07:51.090 --> 00:07:53.120
I'm going to clear the screen once again.

00:07:53.660 --> 00:07:56.250
And now let's add an administrative user.

00:07:56.700 --> 00:08:00.510
You do that by again performing the darker exact dash I T

00:08:00.510 --> 00:08:02.750
command with the name of the server.

00:08:02.760 --> 00:08:05.050
Web server open C V.

00:08:05.060 --> 00:08:09.790
And then the command creates dash user then let's specify the

00:08:09.790 --> 00:08:15.510
username better in this instance than an email address and

00:08:15.510 --> 00:08:17.660
then the dash dash admin flag.

00:08:18.480 --> 00:08:22.460
This will add an initial user called peter in this instance

00:08:22.730 --> 00:08:25.240
which will be administrator of the open C.

00:08:25.240 --> 00:08:26.360
V instance.

00:08:27.470 --> 00:08:32.440
Let's add and repeat a strong password and our administrative user has been

00:08:32.440 --> 00:08:38.789
created per usual clear to screen and now we're actually ready.

00:08:39.679 --> 00:08:43.179
We started almost all services defined in the Docker Compose

00:08:43.179 --> 00:08:48.940
file but not all of them by specifying the Docker Compose up

00:08:48.950 --> 00:08:50.800
and then dash dash detached flag.

00:08:50.810 --> 00:08:55.000
We start the leftover service which is the salary beat service.

00:08:55.870 --> 00:08:59.200
This service takes care of every 15 minutes downloading

00:08:59.200 --> 00:09:02.370
new or deltas of the change CV entries.

00:09:04.540 --> 00:09:07.710
Now let's fire up our browser and let's go to the address that we

00:09:07.710 --> 00:09:11.030
previously specified in the conflict file in my case,

00:09:11.040 --> 00:09:14.150
open C V and then the port number 8000,

00:09:14.160 --> 00:09:17.820
which is the full report number that the openCV web service

00:09:17.830 --> 00:09:20.830
listens to do mine doted on my machine,

00:09:20.910 --> 00:09:25.420
openCV is mapped to local host or 127 dot oh dot oh 127.0.0.1.

00:09:25.870 --> 00:09:30.180
Use the same name here as you specified in the configuration file and

00:09:30.190 --> 00:09:36.020
make sure that the name resolves to the correct IP address lo and behold

00:09:36.030 --> 00:09:40.010
open C v e is up and running ye successfully.

00:09:40.610 --> 00:09:45.330
What we see right now is that the full page and this is an overview of all most

00:09:45.330 --> 00:09:50.980
recent CV entries to end the first demo as a sanity check,

00:09:50.990 --> 00:09:54.790
browse at the left hand side to the little tag symbol which

00:09:54.800 --> 00:09:58.840
stands for vendors and products and check the number of vendors

00:09:58.840 --> 00:10:00.580
and products that has been imported.

00:10:01.160 --> 00:10:05.680
This should look more or less the same at your local instance and let's do the

00:10:05.680 --> 00:10:10.730
same for the bottom left icon categories and this also should match more or

00:10:10.730 --> 00:10:14.110
less the same as you see now on the screen again.

00:10:14.270 --> 00:10:17.400
This is making sure that the import process went successfully.

00:10:17.960 --> 00:10:24.060
If not delete the volume and repeat the import process again in the next demo,

00:10:24.070 --> 00:10:26.960
let's configure some notifications and start using

00:10:26.960 --> 00:10:28.670
the alerting platform function.
