|
1 | | -# Podman deployment |
| 1 | +# InstructLab UI stack deployment in Podman |
2 | 2 |
|
3 | | -To help support knowledge and skill additions as well as the capabilities to chat with a deployed model, the following Podman files have been included to be used with `podman kube play`. UI stack supports two mode of deployments: |
| 3 | +InstructLab UI provides a simple and intuitive web interface that users can use to create knowledge and skill contribution. InstructLab UI supports two mode of deployments: |
4 | 4 |
|
5 | | -- Github mode: This mode is used to deploy the UI stack with Github integration. Users can create skill and knowledge and push it to the taxonomy repository present in instructlab org or their own personal clone of the taxonomy repository. |
6 | | -- Native mode: This mode is used to deploy the UI stack without Github integration. User created skill and knowledge contributions are local to the machine where UI stack is deployed. Users can publish their contribution to any taxonomy repository present on the machine for data generation or training of the model. |
| 5 | +## Github mode |
7 | 6 |
|
8 | | -## Secret |
| 7 | +Github mode is used to deploy the UI stack with Github integration. Users can create skill and knowledge contributions and push it to the taxonomy repository present in instructlab org or their own personal clone of the taxonomy repository present under the user's own organization. To deploy InstructLab UI stack in the Github mode on Podman, please follow the detailed instructions present [here](./github/README.md). |
9 | 8 |
|
10 | | -A secret is required to personalize the Instructlab UI for both the above mentioned modes. |
| 9 | +## Native mode |
11 | 10 |
|
12 | | -Two options exist to generate the secret, either using `kubectl` or filling in values in the `secret.yaml` provided. |
13 | | - |
14 | | -> [!NOTE] |
15 | | -> It is not required to fill in every field. Double quotes `""` can be used for values that are not used. |
16 | | -
|
17 | | -### Kubectl secret creation |
18 | | - |
19 | | -Using `kubectl`, we will use the `--dry-run -o yaml` flags to generate the secret for us. |
20 | | - |
21 | | -#### For Github mode |
22 | | - |
23 | | -```bash |
24 | | -cd ./github |
25 | | - |
26 | | -kubectl create secret generic ui-env \ |
27 | | - --from-literal=IL_UI_DEPLOYMENT=github \ |
28 | | - --from-literal=OAUTH_GITHUB_ID="" \ |
29 | | - --from-literal=OAUTH_GITHUB_SECRET="" \ |
30 | | - --from-literal=GITHUB_TOKEN="" \ |
31 | | - --from-literal=NEXTAUTH_SECRET=your_super_secretdom_string \ |
32 | | - --from-literal=NEXTAUTH_URL=http://localhost:3000 \ |
33 | | - --from-literal=NEXT_PUBLIC_AUTHENTICATION_ORG="" \ |
34 | | - --from-literal=NEXT_PUBLIC_TAXONOMY_REPO_OWNER="" \ |
35 | | - --from-literal=NEXT_PUBLIC_TAXONOMY_REPO="" \ |
36 | | - --from-literal=NEXT_PUBLIC_TAXONOMY_DOCUMENTS_REPO=github.com/instructlab-public/taxonomy-knowledge-docs \ |
37 | | - --from-literal=NEXT_PUBLIC_EXPERIMENTAL_FEATURES="false" \ |
38 | | - --from-literal=IL_GRANITE_API="" \ |
39 | | - --from-literal=IL_GRANITE_MODEL_NAME="" \ |
40 | | - --from-literal=IL_MERLINITE_API="" \ |
41 | | - --from-literal=IL_MERLINITE_MODEL_NAME="" \ |
42 | | - --from-literal=IL_ENABLE_DEV_MODE=false \ |
43 | | - --dry-run=client -o yaml > secret.yaml |
44 | | -``` |
45 | | - |
46 | | -#### For Native mode |
47 | | - |
48 | | -```bash |
49 | | -cd ./native |
50 | | - |
51 | | -kubectl create secret generic ui-env \ |
52 | | - --from-literal=IL_UI_DEPLOYMENT=native \ |
53 | | - --from-literal=IL_UI_ADMIN_USERNAME="" \ |
54 | | - --from-literal=IL_UI_ADMIN_PASSWORD="" \ |
55 | | - --from-literal=NEXTAUTH_SECRET=your_super_secretdom_string \ |
56 | | - --from-literal=NEXTAUTH_URL=http://localhost:3000 \ |
57 | | - --from-literal=NEXT_PUBLIC_TAXONOMY_ROOT_DIR="" \ |
58 | | - --from-literal=NEXT_PUBLIC_EXPERIMENTAL_FEATURES="false" \ |
59 | | - --from-literal=IL_ENABLE_DEV_MODE=false \ |
60 | | - --dry-run=client -o yaml > secret.yaml |
61 | | -``` |
62 | | - |
63 | | -### Manual providing values |
64 | | - |
65 | | -A file named `secret.yaml.example` exists for both the modes. Please rename the file to `secret.yaml`. The user can use this file to input their values in place.These values must be `base64` encoded. |
66 | | - |
67 | | -Here is an example on how to `base64` encode a value. |
68 | | - |
69 | | -```bash |
70 | | -echo "password" | base64 |
71 | | -``` |
72 | | - |
73 | | -Using the above fill in the values as it relates to the environment. |
74 | | - |
75 | | -## Deploy the secret |
76 | | - |
77 | | -Now that the `secret.yaml` has been generated, use `podman kube play` to load the secret. |
78 | | - |
79 | | -```bash |
80 | | -podman kube play secret.yaml |
81 | | -``` |
82 | | - |
83 | | -## Launching the UI |
84 | | - |
85 | | -Now with the secret in place, use `podman kube play` to launch the containers. If you are deploying the Native mode, please replace the `<TAXONOMY_REPO_ROOT_DIR>` variable in `native/instructlab-ui.yaml` with the absolute path of the directory where the taxonomy repository is present. UI will look for the taxonomy repo in this directory to submit the skill and knowledge contributions. |
86 | | - |
87 | | -```bash |
88 | | -podman kube play instructlab-ui.yaml |
89 | | -``` |
90 | | - |
91 | | -> [!NOTE] |
92 | | -> If you are deploying the UI stack (Native mode) on a rootless Podman and SELinux enabled system, please make sure of the following two issues |
93 | | -> |
94 | | -> 1. Uncomment the `securityContext` in the `instructlab-ui.yaml` file and set the value of `runAsGroup` to the value of the host user's group id. |
95 | | -> `id` command should give you the `gid` of the host user. |
96 | | -> |
97 | | -> 2. Make sure cpu and cpusets cgroup controllers are enabled for the user. To check if the cgroup controllers are enabled, run the following command: |
98 | | -> ```cat "/sys/fs/cgroup/user.slice/user-$(id -u).slice/user@$(id -u).service/cgroup.controllers"``` |
99 | | -> |
100 | | -> If the output of the above command does not contain `cpu` and `cpuset`, then you need to enable these cgroup controllers for the user. To enable these cgroup controllers, create the following file `/etc/systemd/system/[email protected]/delegate.conf` with the following content: |
101 | | -> |
102 | | ->```[Service] |
103 | | -> Delegate=memory pids cpu cpuset``` |
104 | | -> Save the file and run `sudo systemctl daemon-reload` followed by `sudo systemctl restart user@$(id -u).service` to apply the changes. |
105 | | -
|
106 | | -## Accessing the UI |
107 | | -
|
108 | | -The Instructlab UI should now be accessible from `http://localhost:3000` or `http://<host-ip>:3000` depending on where the UI stack is deployed. |
109 | | -
|
110 | | -## Cleaning up |
111 | | -
|
112 | | -To clean up the deployment, use `podman kube down` to delete the deployment. |
113 | | -
|
114 | | -```bash |
115 | | -podman kube down instructlab-ui.yaml |
116 | | -podman kube down secret.yaml |
117 | | -``` |
| 11 | +Native mode is used to deploy the InstructLab UI stack without Github integration. User created skill and knowledge contributions are local to the machine where UI stack is deployed. Users can publish their contribution to any taxonomy repository present on the machine for synthetic data generation or training of the model using the [InstructLab tools](https://github.com/instructlab/instructlab). To deploy the InstructLab UI stack in Native mode, please follow the detailed instructions present [here](./native/README.md). |
0 commit comments