You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FastScore can use Github repo as a storage backend.
4
-
In this case all assets are stored as plain files in single repo with a mandated directory structure.
5
-
Every change to asset (via CLI or API) immediately pushed to Github repo.
6
-
And vice versa - external changes to repo (via git client or Github web interface) are propagated to Model Manage.
3
+
FastScore can use a Github repository as a storage backend for all the model assets.
4
+
5
+
All assets are stored as plain text files in a single repository with a mandated directory structure detailed below.
6
+
Every change to an asset (via CLI or API) is immediately pushed to Github repository. The integration is bi-directional with external changes to the repository (via git client or Github web interface) propagated to Model Manage.
7
7
8
8
### Configuration
9
9
10
-
To use repo as a storage your `db` section in `config.yaml`should look like this:
10
+
Setup the configuration to the repository in the `db` section of the `config.yaml`as shown below:
11
11
```yaml
12
12
db:
13
13
type: git
14
14
url: https://github.com/org/repo.git
15
15
branch: master
16
-
username: joe
17
-
password: secret
16
+
username: secret://git_user
17
+
password: secret://git_pass
18
18
```
19
19
20
-
* `type: git` tells FastScore to use Github as storage backend.
21
-
* `url` should point to your existing Github repo.
20
+
* `type: git` tells FastScore to use Github as the storage backend.
21
+
* `url` points to the existing Github repository.
22
22
* `branch` tells which git branch to use.
23
-
* `username` is the name of your Github user with read/write access to repo.
24
-
* `password` Github user password in a plain text.
23
+
* `username` is the Docker Secret storing the user name of a Github user with read/write access to repository.
24
+
* `password` is the Docker Secret storing the user password.
25
+
26
+
27
+
### Docker Secrets for Credentials
28
+
29
+
It is best practice to obscure passwords using Docker Secrets. These secrets are defined by adding the following section to end of the docker-compose.yml file:
30
+
31
+
```
32
+
secrets:
33
+
git_user:
34
+
external: true
35
+
git_pass:
36
+
external: true
37
+
```
38
+
39
+
In addition, the secret must be injected by running the ['docker secret create'](https://docs.docker.com/engine/reference/commandline/secret_create/) command. This can be automated or handled within UCP.
40
+
41
+
For example:
42
+
43
+
```
44
+
echo joe | docker secret create git_user -
45
+
echo password | docker secret create git_pass -
46
+
```
25
47
26
-
Only HTTPS URLs to repos are supported for now. With Vault integration SSH URLs will be supported and plaintext passwords in config will be gone.
48
+
Note: Only HTTPS URLs to respositories are currently supported.
27
49
28
-
### Repo directories structure
50
+
### Repository directories structure
29
51
30
-
All kinds of FastScore assets are stored in the following directories:
52
+
All FastScore assets must be stored in the directory structure shown below:
31
53
```
32
54
attachments
33
55
models
@@ -36,10 +58,11 @@ sensors
36
58
streams
37
59
```
38
60
39
-
* Each asset stored as a separate file.
40
-
* File name is an asset name and file extension is an asset type.
41
-
* No assets of same kind could share the same name.
42
-
* Attachments are grouped into subdirs named after model they are belong.
61
+
The integration between the system follows these rules:
62
+
* Each asset must be stored as a separate file.
63
+
* File name is the asset name and file extension is an asset type.
64
+
* No assets of same kind can share the same name.
65
+
* Attachments are grouped into subdirectories named after model they belong to.
43
66
44
67
Example:
45
68
```
@@ -55,11 +78,11 @@ streams\
55
78
out.json
56
79
```
57
80
58
-
Here, attachments in `attachments/model1` dir are belong to model `model1.py`.
81
+
Here, attachments in `attachments/model1` directory belong to model `model1.py`.
59
82
60
83
### Github webhooks
61
-
To make FastScore aware of external changes to repo you can use Github webhooks.
62
-
To set up a webhook on GitHub, head over to the **Settings** page of your repo, and click on **Webhooks & services**. After that, click on **Add webhook**. Paste publicly accessible URL of your FastScore proxy instance into Payload URL:
84
+
To make FastScore aware of external changes to the repository you will need to set up a Github webhook.
85
+
To set up a webhook on GitHub, head over to the **Settings** page of your repository, and click on **Webhooks & Services**. After that, click on **Add Webhook**. Paste the publicly accessible URL of your FastScore proxy instance into Payload URL:
0 commit comments