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
Copy file name to clipboardexpand all lines: README.md
+4
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,10 @@ To test authorization for Management Service locally, make the following changes
64
64
65
65
To use the XP Go modules as API dependencies, simply import the XP Go modules directly i.e. `import "github.com/caraml-dev/xp/..."`
66
66
67
+
#### d. XP Helm installation
68
+
69
+
For running a helm installation of XP, you may refer to the [xp-management](https://github.com/caraml-dev/helm-charts/tree/main/charts/xp-management) and [xp-treatment](https://github.com/caraml-dev/helm-charts/tree/main/charts/xp-treatment) charts.
70
+
67
71
## Contributing
68
72
69
73
XP is still under active development. Please have a look at our contributing and development guides if you want to contribute to the project:
Copy file name to clipboardexpand all lines: docs/infra/treatment-service.md
+13-72
Original file line number
Diff line number
Diff line change
@@ -63,49 +63,7 @@ In short, the service account configured would minimally need these roles/permis
63
63
64
64
#### As a Helm Release
65
65
66
-
*Some of these steps have been adapted from https://github.com/caraml-dev/xp/tree/main/infra/charts/treatment-service*
67
-
68
-
##### 1. Add the Helm Repository
69
-
70
-
```shell
71
-
$ helm repo add xp https://turing-ml.github.io/charts
72
-
```
73
-
74
-
##### 2. Install the Helm Chart
75
-
76
-
This command will install XP Treatment Service release named `xp-treatment` in the `default` namespace.
77
-
Default chart values will be used for the installation:
78
-
```shell
79
-
$ helm install xp-treatment xp/xp-treatment
80
-
```
81
-
82
-
You can (and most likely, should) override the default configuration with Helm chart values suitable for your
83
-
installation. Refer to [Configuration](https://github.com/caraml-dev/xp/tree/main/infra/charts/treatment-service#configuration) section for the detailed description of available configuration keys.
84
-
85
-
You can also refer to [values.yaml](https://github.com/caraml-dev/xp/tree/main/infra/charts/treatment-service/values.yaml)
86
-
for a minimal configuration that needs to be provided for XP Treatment Service installation.
87
-
88
-
```shell
89
-
$ helm install xp-treatment xp/xp-treatment \
90
-
--values=path/to/helm/chart/values/file.yaml
91
-
```
92
-
93
-
Notice that you can specify the *Treatment Service configuration*[values](#configuration) under the `xpTreatment`
94
-
field in the Helm chart values file like below:
95
-
96
-
```yaml
97
-
xpTreatment:
98
-
config:
99
-
Port: 8080
100
-
ManagementService:
101
-
URL: https://caraml-dev.io/api/xp/v1
102
-
AuthorizationEnabled: true
103
-
# ...
104
-
```
105
-
106
-
These configuration values would be saved in a `.yaml` file within a
107
-
[secret](https://kubernetes.io/docs/concepts/configuration/secret/) that gets mounted automatically onto the
108
-
Treatment Service pod, where it will be read by the Treatment Service.
66
+
*Follow the installation steps from https://github.com/caraml-dev/helm-charts/tree/main/charts/xp-treatment*
109
67
110
68
##### 2.1 Configure the Standalone Treatment Service to use a Google Cloud Provider (GCP) Service Account (Optional)
111
69
@@ -182,36 +140,26 @@ is configured as a plugin for.
182
140
183
141
#### Configuration
184
142
185
-
Unlike for the standalone Treatment Service whereby the configuration values are placed in a file solely dedicated
186
-
for Treatment Service configurations, the Treatment Service Plugin configuration values need to be placed under
Unlike for the standalone Treatment Service whereby the configuration values are placed in a file solely dedicated for Treatment Service configurations, the Treatment Service Plugin configuration values need to be placed under the experiment engines section, within the
Note that not all the configuration values used in a standalone Treatment Service need to be specified for the
192
-
Treatment Service Plugin, since some of those values will be retrieved directly via the Management Service (e.g. Pub/Sub
193
-
configuration or segmenter configuration). See [below](#1-prepare-the-turing-api-server-helm-chart-values-file) for
147
+
Note that not all the configuration values used in a standalone Treatment Service need to be specified for the Treatment Service Plugin, since some of those values will be retrieved directly via the Management Service (e.g. Pub/Sub configuration or segmenter configuration). See [below](#1-prepare-the-turing-api-server-helm-chart-values-file) for
194
148
an example of the configuration values that need to be specified.
195
149
196
-
When the Turing API server deploys a router, the plugin manager will automatically retrieve the aforementioned
197
-
configurations from the Management Service, as well as the experiment engine configuration
198
-
(shown in the code block above) from the Turing API server.
150
+
When the Turing API server deploys a router, the plugin manager will automatically retrieve the aforementioned configurations from the Management Service, as well as the experiment engine configuration (shown in the code block above) from the Turing API server.
199
151
200
-
The plugin manager then creates a new plugin configuration object that will subsequently be passed to the API and then
201
-
to the Treatment Service plugin runner, which will be configured with those values passed to it.
152
+
The plugin manager then creates a new plugin configuration object that will subsequently be passed to the API and then to the Treatment Service plugin runner, which will be configured with those values passed to it.
Just as in the standalone Treatment Service, a GCP Service Account with the following roles is needed for the
208
-
Treatment Service Plugin to communicate with the Management Service via a
158
+
Just as in the standalone Treatment Service, a GCP Service Account with the following roles is needed for the Treatment Service Plugin to communicate with the Management Service via a
209
159
[Google Cloud Pub/Sub](https://cloud.google.com/pubsub/docs/overview) subscription and for logging
210
160
treatment responses to a table in [Google BigQuery](https://cloud.google.com/bigquery):
211
-
-[roles/pubsub.subscriber](https://cloud.google.com/pubsub/docs/access-control#roles), minimally, for the topic
212
-
that the Management Service will publish updates to
for the table that will contain the logs (if logging to BigQuery is configured)
161
+
-[roles/pubsub.subscriber](https://cloud.google.com/pubsub/docs/access-control#roles), minimally, for the topic that the Management Service will publish updates to
162
+
-[roles/bigquery.dataEditor](https://cloud.google.com/bigquery/docs/access-control#bigquery.dataEditor), minimally, for the table that will contain the logs (if logging to BigQuery is configured)
215
163
216
164
### Deploying the Treatment Service Plugin
217
165
@@ -261,14 +209,13 @@ turing:
261
209
262
210
As mentioned [earlier](#configuration), the Treatment Service Plugin configuration values must also be provided.
263
211
Place those values within the `turing.experimentEngines.*.options.treatment_service_config` field of the Turing API's
server [Helm chart values file](https://github.com/caraml-dev/helm-charts/blob/ce4026287443c9d5f2c3fb69d2dd33f3d90f89e3/charts/turing/values.yaml#L118):
272
219
273
220
```yaml
274
221
turing:
@@ -284,11 +231,7 @@ How this service account token file has to be made accessible to the Turing API
284
231
deploying the Turing API server and is out of scope of this guide.
285
232
286
233
However, one recommended way to do so is to use the
287
-
[Helm chart installation of Turing](https://github.com/caraml-dev/turing/tree/477ac2392c590d3dd6453a5834657dc773fe0e56/infra/charts/turing),
288
-
which allows the service account token file (assumed to already exist within the same cluster as the Turing API
289
-
server deployment as a [secret](https://kubernetes.io/docs/concepts/configuration/secret/)) to be mounted as a volume into the
290
-
Turing API server container, through the use of `extraVolumes` and `extraVolumeMounts` in the Turing API's
[Helm chart installation of Turing](https://github.com/caraml-dev/helm-charts/blob/ce4026287443c9d5f2c3fb69d2dd33f3d90f89e3/charts/turing), which allows the service account token file (assumed to already exist within the same cluster as the Turing API server deployment as a [secret](https://kubernetes.io/docs/concepts/configuration/secret/)) to be mounted as a volume into the Turing API server container, through the use of `extraVolumes` and `extraVolumeMounts` in the Turing API's [Helm chart values file](https://github.com/caraml-dev/helm-charts/blob/ce4026287443c9d5f2c3fb69d2dd33f3d90f89e3/charts/turing/values.yaml#L118):
292
235
293
236
```yaml
294
237
turing:
@@ -316,9 +259,7 @@ to access the mounted service account token.
field as follows to allow the Treatment Service Plugin to retrieve the filepath of the GCP service account secret
320
-
token from the Turing Router container correctly (the Turing API automatically injects the filepath of the mounted
321
-
service account token as the `GOOGLE_APPLICATION_CREDENTIALS_EXPERIMENT_ENGINE` env var within the Turing Router):
262
+
field as follows to allow the Treatment Service Plugin to retrieve the filepath of the GCP service account secret token from the Turing Router container correctly (the Turing API automatically injects the filepath of the mounted service account token as the `GOOGLE_APPLICATION_CREDENTIALS_EXPERIMENT_ENGINE` env var within the Turing Router):
0 commit comments