Skip to content

Commit 5e12c14

Browse files
authored
Merge pull request #341 from cooktheryan/podman-kube-play
podman kube play commands to launch the environment
2 parents 51da9a0 + 6be1a25 commit 5e12c14

File tree

4 files changed

+239
-38
lines changed

4 files changed

+239
-38
lines changed

deploy/compose/ui-compose.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

deploy/podman/README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Podman deployment
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`.
4+
5+
## Secret
6+
7+
A secret is required to personalize the Instructlab UI.
8+
9+
Two options exist to generate the secret, either using `kubectl` or filling in values in the `secret.yaml` provided.
10+
11+
**NOTE:** It is not required to fill in every field. Double quotes `""` can be used for values that are not used.
12+
13+
### Kubectl secret creation
14+
15+
Using `kubectl`, we will use the `--dry-run -o yaml` flags to generate the secret for us.
16+
17+
```bash
18+
kubectl create secret generic ui-env \
19+
--from-literal=IL_UI_ADMIN_USERNAME=admin \
20+
--from-literal=IL_UI_ADMIN_PASSWORD=password \
21+
--from-literal=OAUTH_GITHUB_ID="" \
22+
--from-literal=OAUTH_GITHUB_SECRET="" \
23+
--from-literal=NEXTAUTH_SECRET=your_super_secretdom_string \
24+
--from-literal=NEXTAUTH_URL=http://localhost:3000 \
25+
--from-literal=IL_GRANITE_API="" \
26+
--from-literal=IL_GRANITE_MODEL_NAME="" \
27+
--from-literal=IL_MERLINITE_API="" \
28+
--from-literal=IL_MERLINITE_MODEL_NAME="" \
29+
--from-literal=IL_UI_DEPLOYMENT=dev \
30+
--from-literal=GITHUB_TOKEN="" \
31+
--from-literal=TAXONOMY_DOCUMENTS_REPO=github.com/instructlab-public/taxonomy-knowledge-docs \
32+
--from-literal=NEXT_PUBLIC_AUTHENTICATION_ORG="" \
33+
--from-literal=NEXT_PUBLIC_TAXONOMY_REPO_OWNER="" \
34+
--from-literal=NEXT_PUBLIC_TAXONOMY_REPO="" \
35+
--from-literal=NEXT_PUBLIC_EXPERIMENTAL_FEATURES="false" \
36+
--from-literal=NEXT_PUBLIC_BASE_CLONE_DIRECTORY="" \
37+
--from-literal=NEXT_PUBLIC_LOCAL_REPO_PATH="" \
38+
--dry-run=client -o yaml > secret.yaml
39+
```
40+
41+
### Manual providing values
42+
43+
A file named `secret.yaml` exists to allow for the user to input their values in place. These values must be `base64` encoded.
44+
45+
Here is an example on how to `base64` encode a value.
46+
47+
```bash
48+
echo "password" | base64
49+
```
50+
51+
Using the above fill in the values as it relates to the environment.
52+
53+
## Deploy the secret
54+
55+
Now that the `secret.yaml` has been generated use `podman kube play` to load the secret.
56+
57+
```bash
58+
podman kube play secret.yaml
59+
```
60+
61+
## Launching the UI
62+
63+
Now with the secret in place use `podman kube play` to launch the containers.
64+
65+
```bash
66+
podman kube play instructlab-ui.yaml
67+
```
68+
69+
## Accessing the UI
70+
71+
The Instructlab UI should now be accessible from `http://localhost:3000`

deploy/podman/instructlab-ui.yaml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: pathservice
5+
spec:
6+
replicas: 1
7+
selector:
8+
matchLabels:
9+
app: pathservice
10+
template:
11+
metadata:
12+
labels:
13+
app: pathservice
14+
spec:
15+
containers:
16+
- name: pathservice
17+
image: ghcr.io/instructlab/ui/pathservice:main
18+
resources:
19+
limits:
20+
cpu: "100m"
21+
memory: "200Mi"
22+
requests:
23+
cpu: "100m"
24+
memory: "200Mi"
25+
ports:
26+
- containerPort: 4000
27+
hostPort: 4000
28+
imagePullPolicy: Always
29+
---
30+
apiVersion: apps/v1
31+
kind: Deployment
32+
metadata:
33+
name: ui
34+
spec:
35+
replicas: 1
36+
selector:
37+
matchLabels:
38+
app: ui
39+
template:
40+
metadata:
41+
labels:
42+
app: ui
43+
spec:
44+
containers:
45+
- name: ui
46+
image: ghcr.io/instructlab/ui/ui:main
47+
resources:
48+
limits:
49+
cpu: "100m"
50+
memory: "200Mi"
51+
requests:
52+
cpu: "100m"
53+
memory: "200Mi"
54+
env:
55+
- name: NEXTAUTH_SECRET
56+
valueFrom:
57+
secretKeyRef:
58+
name: ui-env
59+
key: NEXTAUTH_SECRET
60+
- name: NEXTAUTH_URL
61+
valueFrom:
62+
secretKeyRef:
63+
name: ui-env
64+
key: NEXTAUTH_URL
65+
- name: IL_UI_ADMIN_PASSWORD
66+
valueFrom:
67+
secretKeyRef:
68+
name: ui-env
69+
key: IL_UI_ADMIN_PASSWORD
70+
- name: IL_UI_DEPLOYMENT
71+
valueFrom:
72+
secretKeyRef:
73+
name: ui-env
74+
key: IL_UI_DEPLOYMENT
75+
- name: IL_UI_ADMIN_USERNAME
76+
valueFrom:
77+
secretKeyRef:
78+
name: ui-env
79+
key: IL_UI_ADMIN_USERNAME
80+
- name: OAUTH_GITHUB_ID
81+
valueFrom:
82+
secretKeyRef:
83+
name: ui-env
84+
key: OAUTH_GITHUB_ID
85+
- name: OAUTH_GITHUB_SECRET
86+
valueFrom:
87+
secretKeyRef:
88+
name: ui-env
89+
key: OAUTH_GITHUB_SECRET
90+
- name: IL_GRANITE_API
91+
valueFrom:
92+
secretKeyRef:
93+
name: ui-env
94+
key: IL_GRANITE_API
95+
- name: IL_GRANITE_MODEL_NAME
96+
valueFrom:
97+
secretKeyRef:
98+
name: ui-env
99+
key: IL_GRANITE_MODEL_NAME
100+
- name: IL_MERLINITE_API
101+
valueFrom:
102+
secretKeyRef:
103+
name: ui-env
104+
key: IL_MERLINITE_API
105+
- name: IL_MERLINITE_MODEL_NAME
106+
valueFrom:
107+
secretKeyRef:
108+
name: ui-env
109+
key: IL_MERLINITE_MODEL_NAME
110+
- name: GITHUB_TOKEN
111+
valueFrom:
112+
secretKeyRef:
113+
name: ui-env
114+
key: GITHUB_TOKEN
115+
- name: TAXONOMY_DOCUMENTS_REPO
116+
valueFrom:
117+
secretKeyRef:
118+
name: ui-env
119+
key: TAXONOMY_DOCUMENTS_REPO
120+
- name: NEXT_PUBLIC_AUTHENTICATION_ORG
121+
valueFrom:
122+
secretKeyRef:
123+
name: ui-env
124+
key: NEXT_PUBLIC_AUTHENTICATION_ORG
125+
- name: NEXT_PUBLIC_TAXONOMY_REPO_OWNER
126+
valueFrom:
127+
secretKeyRef:
128+
name: ui-env
129+
key: NEXT_PUBLIC_TAXONOMY_REPO_OWNER
130+
- name: NEXT_PUBLIC_TAXONOMY_REPO
131+
valueFrom:
132+
secretKeyRef:
133+
name: ui-env
134+
key: NEXT_PUBLIC_TAXONOMY_REPO
135+
- name: NEXT_PUBLIC_EXPERIMENTAL_FEATURES
136+
valueFrom:
137+
secretKeyRef:
138+
name: ui-env
139+
key: NEXT_PUBLIC_EXPERIMENTAL_FEATURES
140+
ports:
141+
- containerPort: 3000
142+
hostPort: 3000
143+
imagePullPolicy: Always

deploy/podman/secret.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: v1
2+
data:
3+
GITHUB_TOKEN: ""
4+
IL_GRANITE_API: ""
5+
IL_GRANITE_MODEL_NAME: ""
6+
IL_MERLINITE_API: ""
7+
IL_MERLINITE_MODEL_NAME: ""
8+
IL_UI_ADMIN_PASSWORD: ""
9+
IL_UI_ADMIN_USERNAME: ""
10+
IL_UI_DEPLOYMENT: ""
11+
NEXT_PUBLIC_AUTHENTICATION_ORG: ""
12+
NEXT_PUBLIC_BASE_CLONE_DIRECTORY: ""
13+
NEXT_PUBLIC_EXPERIMENTAL_FEATURES: ""
14+
NEXT_PUBLIC_LOCAL_REPO_PATH: ""
15+
NEXT_PUBLIC_TAXONOMY_REPO: ""
16+
NEXT_PUBLIC_TAXONOMY_REPO_OWNER: ""
17+
NEXTAUTH_SECRET: ""
18+
NEXTAUTH_URL: ""
19+
OAUTH_GITHUB_ID: ""
20+
OAUTH_GITHUB_SECRET: ""
21+
TAXONOMY_DOCUMENTS_REPO: ""
22+
kind: Secret
23+
metadata:
24+
creationTimestamp: null
25+
name: ui-env

0 commit comments

Comments
 (0)