Skip to content

Commit 11f4fa6

Browse files
authored
Deprecate XP helm charts (#72)
* Deprecate XP helm charts * Add helm installation instructions to README
1 parent 8222a91 commit 11f4fa6

30 files changed

+18
-1375
lines changed

.github/workflows/helm-chart.yml

-35
This file was deleted.

.pre-commit-config.yaml

-15
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
11
repos:
2-
- repo: https://github.com/norwoodj/helm-docs
3-
rev: v1.11.0
4-
hooks:
5-
- id: helm-docs-built
6-
name: 'Helm Docs for XP Management Service Chart'
7-
files: '^infra/charts/management-service/'
8-
args:
9-
- --chart-search-root=infra/charts/management-service
10-
- --template-files=./README.md.gotmpl
11-
- id: helm-docs-built
12-
name: 'Helm Docs for XP Treatment Service Chart'
13-
files: '^infra/charts/treatment-service/'
14-
args:
15-
- --chart-search-root=infra/charts/treatment-service
16-
- --template-files=./README.md.gotmpl
172
- repo: local
183
hooks:
194
- id: format

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Setup [`pre-commit`](https://pre-commit.com/) to automatically lint and format t
6363
make setup
6464
```
6565

66-
3. On push, the pre-commit hook will run. This runs `make format`, `make lint`, `UI linting` and `generation of helm docs`.
66+
3. On push, the pre-commit hook will run. This runs `make format`, `make lint` and `UI linting`.
6767

6868
## XP Management/Treatment Service using Go
6969

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ To test authorization for Management Service locally, make the following changes
6464

6565
To use the XP Go modules as API dependencies, simply import the XP Go modules directly i.e. `import "github.com/caraml-dev/xp/..."`
6666

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+
6771
## Contributing
6872

6973
XP is still under active development. Please have a look at our contributing and development guides if you want to contribute to the project:

docs/infra/treatment-service.md

+13-72
Original file line numberDiff line numberDiff line change
@@ -63,49 +63,7 @@ In short, the service account configured would minimally need these roles/permis
6363

6464
#### As a Helm Release
6565

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*
10967

11068
##### 2.1 Configure the Standalone Treatment Service to use a Google Cloud Provider (GCP) Service Account (Optional)
11169

@@ -182,36 +140,26 @@ is configured as a plugin for.
182140

183141
#### Configuration
184142

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
187-
the experiment engines section, within the
188-
[Helm chart values](https://github.com/caraml-dev/turing/blob/477ac2392c590d3dd6453a5834657dc773fe0e56/infra/charts/turing/values.yaml#L104)
143+
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
144+
[Helm chart values](https://github.com/caraml-dev/helm-charts/blob/ce4026287443c9d5f2c3fb69d2dd33f3d90f89e3/charts/turing/values.yaml#L118)
189145
of a Turing API server deployment.
190146

191-
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
194148
an example of the configuration values that need to be specified.
195149

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.
199151

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.
202153

203154
![treatment_service_plugin_configuration.png](treatment_service_plugin_configuration.png)
204155

205156
#### Google Cloud Provider (GCP) Service Account
206157

207-
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
209159
[Google Cloud Pub/Sub](https://cloud.google.com/pubsub/docs/overview) subscription and for logging
210160
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
213-
- [roles/bigquery.dataEditor](https://cloud.google.com/bigquery/docs/access-control#bigquery.dataEditor), minimally,
214-
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)
215163

216164
### Deploying the Treatment Service Plugin
217165

@@ -261,14 +209,13 @@ turing:
261209
262210
As mentioned [earlier](#configuration), the Treatment Service Plugin configuration values must also be provided.
263211
Place those values within the `turing.experimentEngines.*.options.treatment_service_config` field of the Turing API's
264-
[Helm chart values file](https://github.com/caraml-dev/turing/blob/477ac2392c590d3dd6453a5834657dc773fe0e56/infra/charts/turing/values.yaml#L104).
212+
[Helm chart values file](https://github.com/caraml-dev/helm-charts/blob/ce4026287443c9d5f2c3fb69d2dd33f3d90f89e3/charts/turing/values.yaml#L118).
265213

266214
#### 1.1 Configure the Treatment Service Plugin to use a Google Cloud Provider (GCP) Service Account (Optional)
267215
The service account token file has to be made accessible to the Turing API server such that it is
268216
available for it to be mounted within a Turing Router. The Turing API server looks for this service account token
269217
file via the filepath stored in the `turing.expermentEngines.*.serviceAccountKeyFilePath` field of the Turing API
270-
server
271-
[Helm chart values file](https://github.com/caraml-dev/turing/blob/477ac2392c590d3dd6453a5834657dc773fe0e56/infra/charts/turing/values.yaml#L104):
218+
server [Helm chart values file](https://github.com/caraml-dev/helm-charts/blob/ce4026287443c9d5f2c3fb69d2dd33f3d90f89e3/charts/turing/values.yaml#L118):
272219

273220
```yaml
274221
turing:
@@ -284,11 +231,7 @@ How this service account token file has to be made accessible to the Turing API
284231
deploying the Turing API server and is out of scope of this guide.
285232

286233
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
291-
[Helm chart values file](https://github.com/caraml-dev/turing/blob/477ac2392c590d3dd6453a5834657dc773fe0e56/infra/charts/turing/values.yaml#L104):
234+
[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):
292235

293236
```yaml
294237
turing:
@@ -316,9 +259,7 @@ to access the mounted service account token.
316259

317260
Last but not least, specify the
318261
`turing.experimentEngines.*.options.treatment_service_config.deployment_config.google_application_credentials_env_var`
319-
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):
322263

323264
```yaml
324265
turing:

infra/charts/management-service/Chart.yaml

-5
This file was deleted.

0 commit comments

Comments
 (0)