diff --git a/deploy/compose/ui-compose.yml b/deploy/compose/ui-compose.yml deleted file mode 100644 index 29b584a8..00000000 --- a/deploy/compose/ui-compose.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: '5.1' - -services: - pathservice: - image: ghcr.io/instructlab/ui/pathservice:main - pull_policy: always - deploy: - replicas: 1 - restart_policy: - condition: always - resources: - limits: - cpus: '0.1' - memory: 200M - reservations: - cpus: '0.1' - memory: 200M - ports: - - "4000:4000" - - ui: - image: ghcr.io/instructlab/ui/ui:main - pull_policy: always - env_file: - - .env - deploy: - replicas: 1 - restart_policy: - condition: always - resources: - limits: - cpus: '0.1' - memory: 200M - reservations: - cpus: '0.1' - memory: 200M - ports: - - "3000:3000" diff --git a/deploy/podman/README.md b/deploy/podman/README.md new file mode 100644 index 00000000..3f85d4ff --- /dev/null +++ b/deploy/podman/README.md @@ -0,0 +1,71 @@ +# Podman deployment + +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`. + +## Secret + +A secret is required to personalize the Instructlab UI. + +Two options exist to generate the secret, either using `kubectl` or filling in values in the `secret.yaml` provided. + +**NOTE:** It is not required to fill in every field. Double quotes `""` can be used for values that are not used. + +### Kubectl secret creation + +Using `kubectl`, we will use the `--dry-run -o yaml` flags to generate the secret for us. + +```bash +kubectl create secret generic ui-env \ + --from-literal=IL_UI_ADMIN_USERNAME=admin \ + --from-literal=IL_UI_ADMIN_PASSWORD=password \ + --from-literal=OAUTH_GITHUB_ID="" \ + --from-literal=OAUTH_GITHUB_SECRET="" \ + --from-literal=NEXTAUTH_SECRET=your_super_secretdom_string \ + --from-literal=NEXTAUTH_URL=http://localhost:3000 \ + --from-literal=IL_GRANITE_API="" \ + --from-literal=IL_GRANITE_MODEL_NAME="" \ + --from-literal=IL_MERLINITE_API="" \ + --from-literal=IL_MERLINITE_MODEL_NAME="" \ + --from-literal=IL_UI_DEPLOYMENT=dev \ + --from-literal=GITHUB_TOKEN="" \ + --from-literal=TAXONOMY_DOCUMENTS_REPO=github.com/instructlab-public/taxonomy-knowledge-docs \ + --from-literal=NEXT_PUBLIC_AUTHENTICATION_ORG="" \ + --from-literal=NEXT_PUBLIC_TAXONOMY_REPO_OWNER="" \ + --from-literal=NEXT_PUBLIC_TAXONOMY_REPO="" \ + --from-literal=NEXT_PUBLIC_EXPERIMENTAL_FEATURES="false" \ + --from-literal=NEXT_PUBLIC_BASE_CLONE_DIRECTORY="" \ + --from-literal=NEXT_PUBLIC_LOCAL_REPO_PATH="" \ + --dry-run=client -o yaml > secret.yaml +``` + +### Manual providing values + +A file named `secret.yaml` exists to allow for the user to input their values in place. These values must be `base64` encoded. + +Here is an example on how to `base64` encode a value. + +```bash +echo "password" | base64 +``` + +Using the above fill in the values as it relates to the environment. + +## Deploy the secret + +Now that the `secret.yaml` has been generated use `podman kube play` to load the secret. + +```bash +podman kube play secret.yaml +``` + +## Launching the UI + +Now with the secret in place use `podman kube play` to launch the containers. + +```bash +podman kube play instructlab-ui.yaml +``` + +## Accessing the UI + +The Instructlab UI should now be accessible from `http://localhost:3000` diff --git a/deploy/podman/instructlab-ui.yaml b/deploy/podman/instructlab-ui.yaml new file mode 100644 index 00000000..a6c0cb0b --- /dev/null +++ b/deploy/podman/instructlab-ui.yaml @@ -0,0 +1,143 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: pathservice +spec: + replicas: 1 + selector: + matchLabels: + app: pathservice + template: + metadata: + labels: + app: pathservice + spec: + containers: + - name: pathservice + image: ghcr.io/instructlab/ui/pathservice:main + resources: + limits: + cpu: "100m" + memory: "200Mi" + requests: + cpu: "100m" + memory: "200Mi" + ports: + - containerPort: 4000 + hostPort: 4000 + imagePullPolicy: Always +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ui +spec: + replicas: 1 + selector: + matchLabels: + app: ui + template: + metadata: + labels: + app: ui + spec: + containers: + - name: ui + image: ghcr.io/instructlab/ui/ui:main + resources: + limits: + cpu: "100m" + memory: "200Mi" + requests: + cpu: "100m" + memory: "200Mi" + env: + - name: NEXTAUTH_SECRET + valueFrom: + secretKeyRef: + name: ui-env + key: NEXTAUTH_SECRET + - name: NEXTAUTH_URL + valueFrom: + secretKeyRef: + name: ui-env + key: NEXTAUTH_URL + - name: IL_UI_ADMIN_PASSWORD + valueFrom: + secretKeyRef: + name: ui-env + key: IL_UI_ADMIN_PASSWORD + - name: IL_UI_DEPLOYMENT + valueFrom: + secretKeyRef: + name: ui-env + key: IL_UI_DEPLOYMENT + - name: IL_UI_ADMIN_USERNAME + valueFrom: + secretKeyRef: + name: ui-env + key: IL_UI_ADMIN_USERNAME + - name: OAUTH_GITHUB_ID + valueFrom: + secretKeyRef: + name: ui-env + key: OAUTH_GITHUB_ID + - name: OAUTH_GITHUB_SECRET + valueFrom: + secretKeyRef: + name: ui-env + key: OAUTH_GITHUB_SECRET + - name: IL_GRANITE_API + valueFrom: + secretKeyRef: + name: ui-env + key: IL_GRANITE_API + - name: IL_GRANITE_MODEL_NAME + valueFrom: + secretKeyRef: + name: ui-env + key: IL_GRANITE_MODEL_NAME + - name: IL_MERLINITE_API + valueFrom: + secretKeyRef: + name: ui-env + key: IL_MERLINITE_API + - name: IL_MERLINITE_MODEL_NAME + valueFrom: + secretKeyRef: + name: ui-env + key: IL_MERLINITE_MODEL_NAME + - name: GITHUB_TOKEN + valueFrom: + secretKeyRef: + name: ui-env + key: GITHUB_TOKEN + - name: TAXONOMY_DOCUMENTS_REPO + valueFrom: + secretKeyRef: + name: ui-env + key: TAXONOMY_DOCUMENTS_REPO + - name: NEXT_PUBLIC_AUTHENTICATION_ORG + valueFrom: + secretKeyRef: + name: ui-env + key: NEXT_PUBLIC_AUTHENTICATION_ORG + - name: NEXT_PUBLIC_TAXONOMY_REPO_OWNER + valueFrom: + secretKeyRef: + name: ui-env + key: NEXT_PUBLIC_TAXONOMY_REPO_OWNER + - name: NEXT_PUBLIC_TAXONOMY_REPO + valueFrom: + secretKeyRef: + name: ui-env + key: NEXT_PUBLIC_TAXONOMY_REPO + - name: NEXT_PUBLIC_EXPERIMENTAL_FEATURES + valueFrom: + secretKeyRef: + name: ui-env + key: NEXT_PUBLIC_EXPERIMENTAL_FEATURES + ports: + - containerPort: 3000 + hostPort: 3000 + imagePullPolicy: Always diff --git a/deploy/podman/secret.yaml b/deploy/podman/secret.yaml new file mode 100644 index 00000000..fd0c555a --- /dev/null +++ b/deploy/podman/secret.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +data: + GITHUB_TOKEN: "" + IL_GRANITE_API: "" + IL_GRANITE_MODEL_NAME: "" + IL_MERLINITE_API: "" + IL_MERLINITE_MODEL_NAME: "" + IL_UI_ADMIN_PASSWORD: "" + IL_UI_ADMIN_USERNAME: "" + IL_UI_DEPLOYMENT: "" + NEXT_PUBLIC_AUTHENTICATION_ORG: "" + NEXT_PUBLIC_BASE_CLONE_DIRECTORY: "" + NEXT_PUBLIC_EXPERIMENTAL_FEATURES: "" + NEXT_PUBLIC_LOCAL_REPO_PATH: "" + NEXT_PUBLIC_TAXONOMY_REPO: "" + NEXT_PUBLIC_TAXONOMY_REPO_OWNER: "" + NEXTAUTH_SECRET: "" + NEXTAUTH_URL: "" + OAUTH_GITHUB_ID: "" + OAUTH_GITHUB_SECRET: "" + TAXONOMY_DOCUMENTS_REPO: "" +kind: Secret +metadata: + creationTimestamp: null + name: ui-env