Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.native.example → .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
IL_UI_DEPLOYMENT=native
IL_UI_ADMIN_USERNAME=admin
IL_UI_ADMIN_PASSWORD=password

Expand Down
31 changes: 0 additions & 31 deletions .env.github.example

This file was deleted.

34 changes: 4 additions & 30 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@ This is a [NextJS](https://nextjs.org) framework with [Patternfly](https://www.p

Podman is a requirement for using the Makefile. Install and init instructions [here](https://podman.io/docs/installation).

Set the .env in the ui directory by copying the example env files in the root directory. The`IL_ENABLE_DEV_MODE` flag enables assistive features that help you automate the time consuming and repetitive tasks, such as filling skill and knowledge forms for testing. Once .env file is setup, run the following:
Set the .env in the ui directory by copying the `example.env` file in the root directory. The`IL_ENABLE_DEV_MODE` flag enables assistive features that help you automate the time consuming and repetitive tasks, such as filling skill and knowledge forms for testing. Once .env file is setup, run the following:

```bash
# Github mode development .env
cp .env.github.example .env
# or native mode .env
cp .env.native.example .env

make start-dev-local
```

Expand Down Expand Up @@ -49,10 +44,7 @@ Choose the .env file to use and start the Next.js service with the following:

```bash
cd ui/
# Github mode development .env
cp .env.github.example .env
# or native mode .env
cp .env.native.example .env
cp .env.xample .env
# start a development instance with hot module replacement on port 3000
npm install
npm run dev
Expand Down Expand Up @@ -83,27 +75,9 @@ npm run pretty
npm run type-check
```

UI stack supports two mode of deployments:

- github - This is the default mode and it allows users to push their knowledge and skill contribution to the github taxonomy repository.
- native - This mode allow users to keep the skill and knowledge contribution in their local machine.

## Running the UI in Native Deployment Mode

To enable the native mode, set the `IL_UI_DEPLOYMENT=native` in the .env file. Once the flag is set, the UI will not push the knowledge and skill contribution to the github repository. Instead, it will keep the contribution in the local machine. In the `native` mode, the UI login page will show username and password input box to authenticate the user. You can setup the username and password in the .env file through the `IL_UI_ADMIN_USERNAME` and `IL_UI_ADMIN_PASSWORD` flags.

## Running the UI in Github Deployment Mode

To enable the github mode, set the `IL_UI_DEPLOYMENT=github` in the .env file. Once the flag is set, the UI will push the knowledge and skill contribution to the github taxonomy repository. In the `github` mode, the UI login page will show the github login button to authenticate the user.

### OAuth Configuration for Github Deployment Mode

You can either set up the Oauth app in your
[GitHub](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app)
account or use the user/pass defined in `.env`. To change those defaults, create
the `/ui/.env` file and fill in the account user/pass with the following.
## Running the UI

Example [.env](../.env.example) file.
Contributions will be kept on the local machine. The UI login page will show username and password input box to authenticate the user. You can setup the username and password in the .env file through the `IL_UI_ADMIN_USERNAME` and `IL_UI_ADMIN_PASSWORD` flags.

## Local Dev Chat Environment

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// src/pages/api/native/clone-repo.ts
// src/pages/api/clone-repo.ts
import { NextResponse } from 'next/server';
import * as git from 'isomorphic-git';
import http from 'isomorphic-git/http/node';
Expand All @@ -15,8 +15,8 @@ export async function POST() {
if (fs.existsSync(taxonomyDirectoryPath)) {
const files = fs.readdirSync(taxonomyDirectoryPath);
if (files.length > 0) {
console.log(`Using existing native Taxonomy repository at ${taxonomyDirectoryPath}.`);
return NextResponse.json({ message: `Using existing native Taxonomy repository at ${taxonomyDirectoryPath}.` }, { status: 200 });
console.log(`Using existing Taxonomy repository at ${taxonomyDirectoryPath}.`);
return NextResponse.json({ message: `Using existing Taxonomy repository at ${taxonomyDirectoryPath}.` }, { status: 200 });
}
fs.rmdirSync(taxonomyDirectoryPath, { recursive: true });
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// src/app/api/native/download/route.ts
// src/app/api/download/route.ts
'use server';
import { NextRequest, NextResponse } from 'next/server';
import { spawn } from 'child_process';
Expand Down
1 change: 0 additions & 1 deletion src/app/api/envConfig/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export async function GET() {
MERLINITE_MODEL_NAME: process.env.IL_MERLINITE_MODEL_NAME || '',
UPSTREAM_REPO_OWNER: process.env.NEXT_PUBLIC_TAXONOMY_REPO_OWNER || '',
UPSTREAM_REPO_NAME: process.env.NEXT_PUBLIC_TAXONOMY_REPO || '',
DEPLOYMENT_TYPE: process.env.IL_UI_DEPLOYMENT || '',
ENABLE_DEV_MODE: process.env.IL_ENABLE_DEV_MODE || 'false',
ENABLE_DOC_CONVERSION: process.env.IL_ENABLE_DOC_CONVERSION || 'false',
ENABLE_SKILLS_FEATURES: process.env.IL_ENABLE_SKILLS_FEATURES || '',
Expand Down
4 changes: 2 additions & 2 deletions src/app/api/fine-tune/git/branches/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// src/app/api/native/fine-tune/git/branches/route.ts
// src/app/api/fine-tune/git/branches/route.ts
import { NextResponse } from 'next/server';
import * as git from 'isomorphic-git';
import fs from 'fs';
Expand Down Expand Up @@ -56,7 +56,7 @@ export async function GET() {
// Sort by creation date, newest first
branchDetails.sort((a, b) => b.creationDate - a.creationDate);

console.log('Total branches present in native taxonomy (fine-tune):', branchDetails.length);
console.log('Total branches present in taxonomy (fine-tune):', branchDetails.length);

return NextResponse.json({ branches: branchDetails }, { status: 200 });
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// src/app/api/native/git/branches/route.ts
// src/app/api/git/branches/route.ts
import { NextRequest, NextResponse } from 'next/server';
import * as git from 'isomorphic-git';
import fs from 'fs';
import path from 'path';
import { findTaxonomyRepoPath } from '@/app/api/native/utils';
import { findTaxonomyRepoPath } from '@/app/api/utils';

// Get the repository path from the environment variable
const LOCAL_TAXONOMY_ROOT_DIR = process.env.NEXT_PUBLIC_LOCAL_TAXONOMY_ROOT_DIR || `${process.env.HOME}/.instructlab-ui`;
Expand Down Expand Up @@ -52,7 +52,7 @@ export async function GET() {
}

branchDetails.sort((a, b) => b.creationDate - a.creationDate); // Sort by creation date, newest first
console.log('Total branches present in native taxonomy:', branchDetails.length);
console.log('Total branches present in taxonomy:', branchDetails.length);

return NextResponse.json({ branches: branchDetails }, { status: 200 });
} catch (error) {
Expand Down
54 changes: 0 additions & 54 deletions src/app/api/github/download/route.ts

This file was deleted.

Loading